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
The DataTable returned by FbConnection.GetSchema("Indexes") has wrong values in the IS_UNIQUE column, due to a bug in the FbIndexes.ProcessResult method that sets the IS_UNIQUE column to 0 (false) for all non-primary keys.
The bug is in the following code:
if (row["PRIMARY_KEY"] == DBNull.Value ||
It mistakenly changes the IS_UNIQUE column to false when the index is not a primary key.
Please note that there is already (in the previous lines) an "if" statement that sets the IS_PRIMARY column, so I don't know what the purpose of this block of code is. Maybe the intent was to set IS_UNIQUE to true for all primary keys (but as far as I can see, rdb$indices.rdb$unique_flag is already set for primary keys)?
This block of code should either be removed entirely or else changed to:
if (row["PRIMARY_KEY"] == DBNull.Value ||
Convert.ToInt32(row["PRIMARY_KEY"], CultureInfo.InvariantCulture) != 0)
{
row["IS_UNIQUE"] = true;
}
Submitted by: Vladan Bato (vbato)
The DataTable returned by FbConnection.GetSchema("Indexes") has wrong values in the IS_UNIQUE column, due to a bug in the FbIndexes.ProcessResult method that sets the IS_UNIQUE column to 0 (false) for all non-primary keys.
The bug is in the following code:
if (row["PRIMARY_KEY"] == DBNull.Value ||
It mistakenly changes the IS_UNIQUE column to false when the index is not a primary key.
Please note that there is already (in the previous lines) an "if" statement that sets the IS_PRIMARY column, so I don't know what the purpose of this block of code is. Maybe the intent was to set IS_UNIQUE to true for all primary keys (but as far as I can see, rdb$indices.rdb$unique_flag is already set for primary keys)?
This block of code should either be removed entirely or else changed to:
if (row["PRIMARY_KEY"] == DBNull.Value ||
Convert.ToInt32(row["PRIMARY_KEY"], CultureInfo.InvariantCulture) != 0)
{
row["IS_UNIQUE"] = true;
}
Commits: 20ee033
The text was updated successfully, but these errors were encountered: