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
fix: Return Correct Column Order in get_multi_foreign_keys
Ensure both referred and constrained columns reported by
`get_multi_foreign_keys` are in the same order matching the constraint
declaration. Uses information for the unique constraint corresponding
to the foreign key constraint in order to ensure its columns are
ordered correctly.
Previously, the `CONSTRAINT_COLUMN` view in the information schema was
used to retrieve the referred columns, and that view offers no
information about column order. Instead, we use the KEY_COLUMN_USAGE
view for the corresponding unique constraint, which is ordered.
This requires consulting the `REFERENTIAL_CONSTRAINTS` view in order
to find the unique constraint associated with the foreign
key. Unfortunately, this view has a [bug in the
emulator](GoogleCloudPlatform/cloud-spanner-emulator#279)
related to cross-schema foreign keys. I had to skip a test for
cross-schema foreign keys due to the emulator issue. I've confirmed a
real spanner does not have this issue.
fixes: #779
0 commit comments