Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on description of values of IDENTITY_TYPE #168

Closed
serval2412 opened this issue Jan 2, 2022 · 2 comments
Closed

Error on description of values of IDENTITY_TYPE #168

serval2412 opened this issue Jan 2, 2022 · 2 comments

Comments

@serval2412
Copy link

Hello,
IDENTITY_TYPE is described as this on documentation (3.0 and 4.0) in Appendix D: System Tables:
NULL - not an identity column
0 - identity column, GENERATED BY
DEFAULT
1 - identity column, GENERATED ALWAYS
(not supported in Firebird 3.0, will be
introduced in Firebird 4.0)

it corresponds to https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.IDENTITY:
"Currently, RDB$IDENTITY_TYPE always stores the value 0 (GENERATED BY DEFAULT) for identity columns and NULL for non-identity columns. In the future this column will be able to store the value 1 (GENERATED ALWAYS) when that type of identity column is supported by Firebird."

But:
https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rnfb30-ddl-enhance.html indicates:
"Currently, RDB$IDENTITY_TYPE will currently always store the value 1 (by default) for identity columns and NULL for non-identity columns. In the future this column will store the value 0, too (for ALWAYS) when Firebird implements support for this type of identity column. "

and above all in source code src/jrd/constants.h, we got:
enum IdentityType {
IDENT_TYPE_ALWAYS,
IDENT_TYPE_BY_DEFAULT
};
So IDENT_TYPE_ALWAYS = 0 and IDENT_TYPE_BY_DEFAULT = 1

Also in doc/sql.extensions/README.identity_columns.txt:
29 Implementation:
30 Two columns have been inserted in RDB$RELATION_FIELDS: RDB$GENERATOR_NAME and RDB$IDENTITY_TYPE.
31 RDB$GENERATOR_NAME stores the automatically created generator for the column. In RDB$GENERATORS,
32 the value of RDB$SYSTEM_FLAG of that generator will be 6. RDB$IDENTITY_TYPE will currently
33 always store the value 1 (by default) for identity columns and NULL for non-identity columns.
34 In the future this column will store the value 0, too (for ALWAYS) when Firebird support this type
35 of identity column.

I know that Firebird comes from a fork of Interbase so either there's a typo in https://www.ibexpert.net/ibe/pmwiki.php?n=Doc.IDENTITY and only Appendix D: System Tables should be fixed to indicated that the current is 1 and corresponds to identity type by default or we got a bug.

@mrotteveel
Copy link
Member

Thanks for reporting. You're right, this is a mistake in that appendix, I will publish a fix of fblangref30 and fblangref40.

As an aside, the linked documentation of IB Expert is also about Firebird, and was copied from an older version of the Firebird 3.0 release notes (Firebird 3.0 alpha 1, which possibly contained that mistake as well). Interbase is not involved at all.

@serval2412
Copy link
Author

Thank you for the very quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants