Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: write to table option buffer instead of result buffer (#8883)
rebelicea8d4a19a9b8c
diff --git a/backend/api/v1/schema_design_transformer.go b/backend/api/v1/schema_design_transformer.goindex f0ac66ef5f..713a48136f 100644--- a/backend/api/v1/schema_design_transformer.go+++ b/backend/api/v1/schema_design_transformer.go@@ -929,6 +929,7 @@ func (g *mysqlDesignSchemaGenerator) EnterCreateTable(ctx *mysql.CreateTableContg.firstElementInTable = trueg.columnDefine.Reset()g.tableConstraints.Reset()+ g.tableOptions.Reset()delete(schema.tables, tableName)if _, err := g.result.WriteString(ctx.GetParser().GetTokenStream().GetTextFromInterval(antlr.Interval{@@ -1076,7 +1077,7 @@ func (g *mysqlDesignSchemaGenerator) ExitCreateTableOptions(ctx *mysql.CreateTabreturn}- if _, err := g.result.WriteString(ctx.GetParser().GetTokenStream().GetTextFromInterval(antlr.Interval{+ if _, err := g.tableOptions.WriteString(ctx.GetParser().GetTokenStream().GetTextFromInterval(antlr.Interval{Start: g.tableOptionTokenIndex,Stop: ctx.GetStop().GetTokenIndex(),})); err != nil {diff --git a/backend/api/v1/testdata/design.yaml b/backend/api/v1/testdata/design.yamlindex 386666f64b..fe236702b3 100644--- a/backend/api/v1/testdata/design.yaml+++ b/backend/api/v1/testdata/design.yaml@@ -4,7 +4,7 @@`a` int,PRIMARY KEY (`a`),CONSTRAINT fk1 FOREIGN KEY (`a`) REFERENCES `t2` (`b`)- );+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;CREATE TABLE `t3` (`a` int);@@ -125,7 +125,7 @@result: |+CREATE TABLE `t` (`a` int NOT NULL- );+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;CREATE TABLE `t4` (`a` varchar(10) NOT NULL DEFAULT 'default value' COMMENT 'this is comment, aha',`c` int NOT NULL,@@ -146,7 +146,7 @@baseline: |-CREATE TABLE `t` (`a` int- );+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;target: |-{"schemas": [@@ -169,4 +169,4 @@result: |CREATE TABLE `t` (`a` int NOT NULL- ) COMMENT 'this is comment' ;+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT 'this is comment';