Status: Closed (View Workflow)
Resolution: Won't Do
We have a ColumnStore table with an autoincrement column (defined as a comment in the table, as documented here).
We noticed that none of the usual methods of retrieving the current autoincrement value for the table work:
• SELECT LAST_INSERT_ID()
o Doesn't work, that is, it is not affected by inserts or updates into ColumnStore tables. Works fine for InnoDB.
• SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '<SCHEMA>' AND TABLE_NAME = '<TABLE>'
o Always returns NULL;
• mysql_insert_id() (from libmysql)
o Always returns 0.
• JDBC driver calls
o Always return 0.
This is breaking our code, as the ORMs we use (for instance, Rails' Active Record or Scala's SORM) depend on this value being returned and/or available somehow.
Is this a bug? If not, is there any other way to retrieve the current autoincrement value?