maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #10576
Re: CREATE SEQUENCE is coming
-
To:
maria-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Daniel Black <daniel.black@xxxxxxxxxxx>
-
Date:
Tue, 28 Mar 2017 11:50:25 +1100
-
In-reply-to:
<20170327203534.8F46F7804D@b03ledav004.gho.boulder.ibm.com>
-
Organization:
IBM
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 28/03/17 07:31, Vladislav Vaintroub wrote:
>
>
> On 3/27/2017 6:15 AM, Daniel Black wrote:
>> On 26/03/17 22:11, Michael Widenius wrote:
>>> There is still a lot of work to fix edge cases, but in the current
>>> implementation most major things seams to work...
>>>
>>> Comments, suggestions or questions?
>> NICE!
>>
>> How will this value be exposed to getGeneratedKeys in
>> mariadb-connector-j?
> I do not think it needs to. Statement.getGeneratedKeys returns generated
> auto-increment values on insert, the same ulonglong that is in OK
> packet, the same thing that LAST_INSERT_ID() is returning.
> no sequences involved
Ah, ok. I was miss understanding how Postgres does its sequences. I
found this quick summary from 2011 (date in http response header)
http://www.neilconway.org/docs/sequences/
Oracle ref:
http://docs.oracle.com/cd/B28359_01/server.111/b28286/pseudocolumns002.htm#SQLRF51138
uses sequence.CURRVAL, sequence.NEXTVAL
https://www.postgresql.org/docs/9.6/static/functions-sequence.html
As a note itseams PREVIOUS VALUE FOR seems to be a DB2 construct.
Postgres uses CURRVAL(sequence) which to me sounds more sound. I guess
MDEV-10422 INSERT RETURNING is the alternative.
All options work. Thanks for writing this.
So it seems they show up as full table where querying them is pretty
harmless? I suspect if things like pt-table-sync start trying to modify
them ugly things could happen.
References