You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FBDatabaseMetaData.Clause builds this : "CAST(" + columnName + " AS VARCHAR(" + (OBJECT_NAME_LENGTH + 10) + ")) = ? and ";
Because of the CAST() Firebird does not use index in this case, it reads tables NATURAL.
What is the reason to this strange condition? Index using SQL should be build : columnName + " = ? and ". If you want support special cases, please detect it and use a dedicated SQL for that.
Parameters in Firebird are restricted in length by the column or expression they are compared against, this trick is done to allow wider values by a margin of 10 so people don't get a string right truncation error when using a slightly longer name than supported by Firebird. Older versions of Firebird do not allow casting the parameter, so we cast the column expression instead. Given all supported versions do support casting parameters, I'll consider changing this to cast the parameter instead.
Submitted by: Attila Molnár (e_pluribus_unum)
Is related to JDBC467
Hi Mark!
FBDatabaseMetaData.Clause builds this : "CAST(" + columnName + " AS VARCHAR(" + (OBJECT_NAME_LENGTH + 10) + ")) = ? and ";
Because of the CAST() Firebird does not use index in this case, it reads tables NATURAL.
What is the reason to this strange condition? Index using SQL should be build : columnName + " = ? and ". If you want support special cases, please detect it and use a dedicated SQL for that.
Thank You!
Commits: 326c788
The text was updated successfully, but these errors were encountered: