maria-developers team mailing list archive
Mailing list archive
Re: CREATE SEQUENCE is coming
Daniel Black <daniel.black@xxxxxxxxxxx>
Tue, 28 Mar 2017 11:50:25 +1100
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?
>> How will this value be exposed to getGeneratedKeys in
> 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)
uses sequence.CURRVAL, sequence.NEXTVAL
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.