[Libreoffice-bugs] [Bug 119962] FireBird: Auto-Increase after copy table: Error inserting new data item.

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Wed Sep 19 14:21:54 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=119962

--- Comment #3 from Julien Nabet <serval2412 at yahoo.fr> ---
Function isAutoIncrement returns a sal_bool value (sal_True or sal_False), see
https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/ResultSetMetaData.cxx#186

According to
https://github.com/FirebirdSQL/firebird/blob/master/doc/sql.extensions/README.identity_columns.txt,
each identity column is associated with a generator (RDB$GENERATOR_NAME). This
generator provide s a number and stores it.
But it seems no mechanism exists in copy process to retrieve its state (or
missed it).


Still with this same doc, notice too that the test lines 206/207 is wrong
206              if(iType == 1) // IDENTITY
207                  return true;
it should be:
206              if(iType == 0 || iType == 1) // IDENTITY
207                  return true;
Since 0 is for GENERATED ALWAYS (you can't override the identiy column in
Insert statements - insert/update/...) and 1 for GENERATED BY DEFAULT
Now perhaps it's because construct method
https://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/firebird/Column.cxx#28
uses "GENERATED BY DEFAULT AS IDENTITY" but it's another story.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180919/eee9613a/attachment.html>


More information about the Libreoffice-bugs mailing list