It is not your use of Long.MIN_VALUE that is a problem. It seems any negative number causes the same problem. For instance, this fails with a syntax exception:
CREATE TABLE connection (id BIGINT AUTO_INCREMENT(-1, 1) PRIMARY KEY); On Saturday, 30 August 2014 08:21:54 UTC+2, Gili wrote: > > Noel, > > Both the H2 documentation and java.lang.Long.MIN_VALUE indicate that > -9223372036854775808 is a legal value, yet H2 rejects it. Isn't this a bug? > > Gili > > On Saturday, August 30, 2014 1:36:15 AM UTC-4, Noel Grandin wrote: >> >> Our internal implementation of sequences uses longs for everything, so >> you will need to use values for start/stop/cycle/increment that fit >> into a long value. >> >> On Fri, Aug 29, 2014 at 11:04 PM, Gili <[email protected]> wrote: >> > Two clarifications: >> > >> > I am using version 1.3.176. >> > This behavior contradicts the documentation: >> > http://www.h2database.com/html/datatypes.html#bigint_type >> > >> > Please also take this opportunity to clarify the difference between >> IDENTITY >> > and BIGINT in the documentation. As far as I understand it, IDENTITY is >> > equivalent to "BIGINT AUTO_INCREMENT PRIMARY KEY" but it's not clear if >> > there are any other differences. For example, the documentation reads >> "Used >> > values are never re-used, even when the transaction is rolled back" for >> > IDENTITY but not for BIGINT AUTO_INCREMENT so it's not clear if there >> is >> > some magic under the hood. >> > >> > Gili >> > >> > On Friday, August 29, 2014 4:53:16 PM UTC-4, Gili wrote: >> >> >> >> Hi, >> >> >> >> If I run: >> >> >> >> CREATE TABLE connection (id BIGINT >> AUTO_INCREMENT(-9223372036854775808, >> >> 1) PRIMARY KEY); >> >> >> >> I get: >> >> >> >> Syntax error in SQL statement "CREATE TABLE CONNECTION (ID BIGINT >> >> AUTO_INCREMENT(-9223372036854775808[*], 1) PRIMARY KEY)"; expected >> "long" >> >> >> >> I've successfully initialized all other types at their minimum values. >> >> BIGINT seems to be the only type that has a problem with this. >> >> >> >> Gili >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "H2 Database" group. >> > To unsubscribe from this group and stop receiving emails from it, send >> an >> > email to [email protected]. >> > To post to this group, send email to [email protected]. >> > Visit this group at http://groups.google.com/group/h2-database. >> > For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
