Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1c72726

Browse files
committed
1 parent cffaecc commit 1c72726

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

‎src/MySqlConnector/Core/SchemaProvider.cs‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,15 +446,14 @@ private Task DoFillForeignKeysAsync(IOBehavior ioBehavior, DataTable dataTable,
446446
command.CommandText = """
447447
SELECT rc.constraint_catalog, rc.constraint_schema, rc.constraint_name,
448448
kcu.table_catalog, kcu.table_schema,
449-
rc.table_name, rc.match_option, rc.update_rule, rc.delete_rule,
450-
NULL as referenced_table_catalog, kcu.referenced_table_schema, rc.referenced_table_name
449+
rc.table_name, rc.match_option, rc.update_rule, rc.delete_rule,
450+
NULL as referenced_table_catalog, kcu.referenced_table_schema, rc.referenced_table_name
451451
FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc
452-
LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu ON
453-
(
454-
(kcu.constraint_catalog = rc.constraint_catalog OR (kcu.constraint_catalog IS NULL AND rc.constraint_catalog IS NULL)) AND
455-
(kcu.constraint_schema = rc.constraint_schema OR (kcu.constraint_schema IS NULL AND rc.constraint_schema IS NULL)) AND
456-
(kcu.constraint_name = rc.constraint_name OR (kcu.constraint_name IS NULL AND rc.constraint_name IS NULL))
457-
)
452+
LEFT JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE kcu
453+
ON kcu.constraint_catalog = rc.constraint_catalog
454+
AND kcu.constraint_schema = rc.constraint_schema
455+
AND kcu.table_name = rc.table_name
456+
AND kcu.constraint_name = rc.constraint_name
458457
WHERE kcu.ORDINAL_POSITION = 1
459458
""";
460459

@@ -481,9 +480,9 @@ private Task DoFillIndexesAsync(IOBehavior ioBehavior, DataTable dataTable, stri
481480
command.CommandText = """
482481
SELECT null AS INDEX_CATALOG, INDEX_SCHEMA,
483482
INDEX_NAME, TABLE_NAME,
484-
!NON_UNIQUE as `UNIQUE`,
483+
!NON_UNIQUE as `UNIQUE`,
485484
INDEX_NAME='PRIMARY' as `PRIMARY`,
486-
INDEX_TYPE as TYPE, COMMENT
485+
INDEX_TYPE as TYPE, COMMENT
487486
FROM INFORMATION_SCHEMA.STATISTICS
488487
WHERE SEQ_IN_INDEX=1
489488
""";

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /