Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: sort temp view columns order (#8965)

zll60070b282265193
diff --git a/backend/plugin/parser/mysql/differ.go b/backend/plugin/parser/mysql/differ.go
index c9799fb65a..506e3ff137 100644
--- a/backend/plugin/parser/mysql/differ.go
+++ b/backend/plugin/parser/mysql/differ.go
@@ -2098,6 +2098,12 @@ func (t *mysqlTransformer) ExitCreateView(ctx *mysql.CreateViewContext) {
for _, field := range fields {
result = append(result, field.Name)
}
+ // the column order of createView is decided by createView statement.
+ // we get columns here only for create temp view.
+ // only for test-case.
+ sort.Slice(result, func(i, j int) bool {
+ return result[i] < result[j]
+ })
view.columns = result
}