Skip to content

Commit a927fda

Browse files
committed
fix: fix ambiguous order by query issue
1 parent 2d04dd7 commit a927fda

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

schema-engine/sql-schema-describer/src/mysql.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ impl<'a> SqlSchemaDescriber<'a> {
281281
AND column_info.table_schema IN ({namespaces_filter})
282282
-- Exclude views.
283283
AND table_info.table_type = 'BASE TABLE'
284-
ORDER BY BINARY namespace, BINARY table_name"#
284+
ORDER BY BINARY namespace, BINARY table_info.table_name"#
285285
);
286286

287287
let rows = self.conn.query_raw(&sql, &[]).await?;

schema-engine/sql-schema-describer/src/mysql/constraints_query.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ LEFT JOIN INFORMATION_SCHEMA.CHECK_CONSTRAINTS cc
99
ON cc.constraint_schema = tc.table_schema
1010
AND cc.constraint_name = tc.constraint_name
1111
WHERE constraint_type = 'CHECK'
12-
ORDER BY BINARY namespace, BINARY table_name, constraint_type, constraint_name;
12+
ORDER BY BINARY namespace, BINARY tc.table_name, constraint_type, tc.constraint_name;

0 commit comments

Comments
 (0)