diff --git a/DEPS.bzl b/DEPS.bzl index 63af2c942e108..ac0a348ad55fe 100644 --- a/DEPS.bzl +++ b/DEPS.bzl @@ -4425,8 +4425,8 @@ def go_deps(): name = "org_golang_x_net", build_file_proto_mode = "disable_global", importpath = "golang.org/x/net", - sum = "h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=", - version = "v0.2.0", + sum = "h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU=", + version = "v0.4.0", ) go_repository( name = "org_golang_x_oauth2", @@ -4453,15 +4453,15 @@ def go_deps(): name = "org_golang_x_term", build_file_proto_mode = "disable_global", importpath = "golang.org/x/term", - sum = "h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=", - version = "v0.2.0", + sum = "h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=", + version = "v0.3.0", ) go_repository( name = "org_golang_x_text", build_file_proto_mode = "disable_global", importpath = "golang.org/x/text", - sum = "h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=", - version = "v0.4.0", + sum = "h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=", + version = "v0.5.0", ) go_repository( name = "org_golang_x_time", diff --git a/dumpling/export/dump.go b/dumpling/export/dump.go index d9c363eda39dc..b8e46f595c4e9 100644 --- a/dumpling/export/dump.go +++ b/dumpling/export/dump.go @@ -1219,9 +1219,7 @@ func dumpTableMeta(tctx *tcontext.Context, conf *Config, conn *BaseConn, db stri selectedField: selectField, selectedLen: selectLen, hasImplicitRowID: hasImplicitRowID, - specCmts: []string{ - "/*!40101 SET NAMES binary*/;", - }, + specCmts: getSpecialComments(conf.ServerInfo.ServerType), } if conf.NoSchemas { diff --git a/dumpling/export/ir.go b/dumpling/export/ir.go index 4b98019605e9c..aa1b2070591ab 100644 --- a/dumpling/export/ir.go +++ b/dumpling/export/ir.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/pingcap/errors" + "github.com/pingcap/tidb/br/pkg/version" tcontext "github.com/pingcap/tidb/dumpling/context" ) @@ -85,7 +86,7 @@ type MetaIR interface { MetaSQL() string } -func setTableMetaFromRows(rows *sql.Rows) (TableMeta, error) { +func setTableMetaFromRows(serverType version.ServerType, rows *sql.Rows) (TableMeta, error) { tps, err := rows.ColumnTypes() if err != nil { return nil, errors.Trace(err) @@ -101,6 +102,6 @@ func setTableMetaFromRows(rows *sql.Rows) (TableMeta, error) { colTypes: tps, selectedField: strings.Join(nms, ","), selectedLen: len(nms), - specCmts: []string{"/*!40101 SET NAMES binary*/;"}, + specCmts: getSpecialComments(serverType), }, nil } diff --git a/dumpling/export/ir_impl.go b/dumpling/export/ir_impl.go index bca821f612623..d1efa75db3365 100644 --- a/dumpling/export/ir_impl.go +++ b/dumpling/export/ir_impl.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/pingcap/errors" + "github.com/pingcap/tidb/br/pkg/version" tcontext "github.com/pingcap/tidb/dumpling/context" "go.uber.org/zap" ) @@ -370,3 +371,22 @@ func (td *multiQueriesChunk) Close() error { func (*multiQueriesChunk) RawRows() *sql.Rows { return nil } + +var serverSpecialComments = map[version.ServerType][]string{ + version.ServerTypeMySQL: { + "/*!40014 SET FOREIGN_KEY_CHECKS=0*/;", + "/*!40101 SET NAMES binary*/;", + }, + version.ServerTypeTiDB: { + "/*!40014 SET FOREIGN_KEY_CHECKS=0*/;", + "/*!40101 SET NAMES binary*/;", + }, + version.ServerTypeMariaDB: { + "/*!40101 SET NAMES binary*/;", + "SET FOREIGN_KEY_CHECKS=0;", + }, +} + +func getSpecialComments(serverType version.ServerType) []string { + return serverSpecialComments[serverType] +} diff --git a/dumpling/export/writer.go b/dumpling/export/writer.go index e64c067c807b7..ae037041596ae 100644 --- a/dumpling/export/writer.go +++ b/dumpling/export/writer.go @@ -133,7 +133,7 @@ func (w *Writer) WritePolicyMeta(policy, createSQL string) error { if err != nil { return err } - return writeMetaToFile(tctx, "placement-policy", createSQL, w.extStorage, fileName+".sql", conf.CompressType) + return w.writeMetaToFile(tctx, "placement-policy", createSQL, fileName+".sql") } // WriteDatabaseMeta writes database meta to a file @@ -143,7 +143,7 @@ func (w *Writer) WriteDatabaseMeta(db, createSQL string) error { if err != nil { return err } - return writeMetaToFile(tctx, db, createSQL, w.extStorage, fileName+".sql", conf.CompressType) + return w.writeMetaToFile(tctx, db, createSQL, fileName+".sql") } // WriteTableMeta writes table meta to a file @@ -153,7 +153,7 @@ func (w *Writer) WriteTableMeta(db, table, createSQL string) error { if err != nil { return err } - return writeMetaToFile(tctx, db, createSQL, w.extStorage, fileName+".sql", conf.CompressType) + return w.writeMetaToFile(tctx, db, createSQL, fileName+".sql") } // WriteViewMeta writes view meta to a file @@ -167,11 +167,11 @@ func (w *Writer) WriteViewMeta(db, view, createTableSQL, createViewSQL string) e if err != nil { return err } - err = writeMetaToFile(tctx, db, createTableSQL, w.extStorage, fileNameTable+".sql", conf.CompressType) + err = w.writeMetaToFile(tctx, db, createTableSQL, fileNameTable+".sql") if err != nil { return err } - return writeMetaToFile(tctx, db, createViewSQL, w.extStorage, fileNameView+".sql", conf.CompressType) + return w.writeMetaToFile(tctx, db, createViewSQL, fileNameView+".sql") } // WriteSequenceMeta writes sequence meta to a file @@ -181,7 +181,7 @@ func (w *Writer) WriteSequenceMeta(db, sequence, createSQL string) error { if err != nil { return err } - return writeMetaToFile(tctx, db, createSQL, w.extStorage, fileName+".sql", conf.CompressType) + return w.writeMetaToFile(tctx, db, createSQL, fileName+".sql") } // WriteTableData writes table data to a file with retry @@ -213,10 +213,14 @@ func (w *Writer) WriteTableData(meta TableMeta, ir TableDataIR, currentChunk int return } if conf.SQL != "" { - meta, err = setTableMetaFromRows(ir.RawRows()) + rows := ir.RawRows() + meta, err = setTableMetaFromRows(w.conf.ServerInfo.ServerType, rows) if err != nil { return err } + if err = rows.Err(); err != nil { + return errors.Trace(err) + } } defer func() { _ = ir.Close() @@ -270,19 +274,17 @@ func (w *Writer) tryToWriteTableData(tctx *tcontext.Context, meta TableMeta, ir return nil } -func writeMetaToFile(tctx *tcontext.Context, target, metaSQL string, s storage.ExternalStorage, path string, compressType storage.CompressType) error { - fileWriter, tearDown, err := buildFileWriter(tctx, s, path, compressType) +func (w *Writer) writeMetaToFile(tctx *tcontext.Context, target, metaSQL string, path string) error { + fileWriter, tearDown, err := buildFileWriter(tctx, w.extStorage, path, w.conf.CompressType) if err != nil { return errors.Trace(err) } defer tearDown(tctx) return WriteMeta(tctx, &metaData{ - target: target, - metaSQL: metaSQL, - specCmts: []string{ - "/*!40101 SET NAMES binary*/;", - }, + target: target, + metaSQL: metaSQL, + specCmts: getSpecialComments(w.conf.ServerInfo.ServerType), }, fileWriter) } diff --git a/dumpling/export/writer_test.go b/dumpling/export/writer_test.go index 09e43c469e5bf..4f07d25b7b224 100644 --- a/dumpling/export/writer_test.go +++ b/dumpling/export/writer_test.go @@ -11,6 +11,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/pingcap/tidb/br/pkg/version" tcontext "github.com/pingcap/tidb/dumpling/context" "github.com/pingcap/tidb/util/promutil" "github.com/stretchr/testify/require" @@ -32,7 +33,7 @@ func TestWriteDatabaseMeta(t *testing.T) { bytes, err := os.ReadFile(p) require.NoError(t, err) - require.Equal(t, "/*!40101 SET NAMES binary*/;\nCREATE DATABASE `test`;\n", string(bytes)) + require.Equal(t, "/*!40014 SET FOREIGN_KEY_CHECKS=0*/;\n/*!40101 SET NAMES binary*/;\nCREATE DATABASE `test`;\n", string(bytes)) } func TestWritePolicyMeta(t *testing.T) { @@ -51,7 +52,7 @@ func TestWritePolicyMeta(t *testing.T) { bytes, err := os.ReadFile(p) require.NoError(t, err) - require.Equal(t, "/*!40101 SET NAMES binary*/;\ncreate placement policy `y` followers=2;\n", string(bytes)) + require.Equal(t, "/*!40014 SET FOREIGN_KEY_CHECKS=0*/;\n/*!40101 SET NAMES binary*/;\ncreate placement policy `y` followers=2;\n", string(bytes)) } func TestWriteTableMeta(t *testing.T) { @@ -69,7 +70,7 @@ func TestWriteTableMeta(t *testing.T) { require.NoError(t, err) bytes, err := os.ReadFile(p) require.NoError(t, err) - require.Equal(t, "/*!40101 SET NAMES binary*/;\nCREATE TABLE t (a INT);\n", string(bytes)) + require.Equal(t, "/*!40014 SET FOREIGN_KEY_CHECKS=0*/;\n/*!40101 SET NAMES binary*/;\nCREATE TABLE t (a INT);\n", string(bytes)) } func TestWriteViewMeta(t *testing.T) { @@ -79,7 +80,7 @@ func TestWriteViewMeta(t *testing.T) { writer := createTestWriter(config, t) - specCmt := "/*!40101 SET NAMES binary*/;\n" + specCmt := "/*!40014 SET FOREIGN_KEY_CHECKS=0*/;\n/*!40101 SET NAMES binary*/;\n" createTableSQL := "CREATE TABLE `v`(\n`a` int\n)ENGINE=MyISAM;\n" createViewSQL := "DROP TABLE IF EXISTS `v`;\nDROP VIEW IF EXISTS `v`;\nSET @PREV_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;\nSET @PREV_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;\nSET @PREV_COLLATION_CONNECTION=@@COLLATION_CONNECTION;\nSET character_set_client = utf8;\nSET character_set_results = utf8;\nSET collation_connection = utf8_general_ci;\nCREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` (`a`) AS SELECT `t`.`a` AS `a` FROM `test`.`t`;\nSET character_set_client = @PREV_CHARACTER_SET_CLIENT;\nSET character_set_results = @PREV_CHARACTER_SET_RESULTS;\nSET collation_connection = @PREV_COLLATION_CONNECTION;\n" err := writer.WriteViewMeta("test", "v", createTableSQL, createViewSQL) @@ -331,6 +332,7 @@ var mu sync.Mutex func createTestWriter(conf *Config, t *testing.T) *Writer { t.Helper() + conf.ServerInfo.ServerType = version.ServerTypeMySQL mu.Lock() extStore, err := conf.createExternalStorage(context.Background()) diff --git a/dumpling/tests/file_size/run.sh b/dumpling/tests/file_size/run.sh index 6b0577dc2e514..174b1e0def008 100644 --- a/dumpling/tests/file_size/run.sh +++ b/dumpling/tests/file_size/run.sh @@ -14,8 +14,8 @@ chars_20="1111_0000_1111_0000_" # insert 100 records, each occupies 20 bytes run_sql "insert into t values $(seq -s, 100 | sed 's/,*$//g' | sed "s/[0-9]*/('$chars_20')/g");" -# dumping with file size = 311 bytes, actually 10 rows -run_dumpling -F 311B +# dumping with file size = 348 bytes, actually 10 rows +run_dumpling -F 348B # the dumping result is expected to be: # 10 files for insertion(each conatins 10 records / 200 bytes) diff --git a/dumpling/tests/naughty_strings/data/naughty_strings.escape.sql b/dumpling/tests/naughty_strings/data/naughty_strings.escape.sql index 1fa1d0d223013..d73ee94aee1a7 100644 --- a/dumpling/tests/naughty_strings/data/naughty_strings.escape.sql +++ b/dumpling/tests/naughty_strings/data/naughty_strings.escape.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `escape` VALUES ('''', '"'), diff --git a/dumpling/tests/naughty_strings/data/naughty_strings.t.sql b/dumpling/tests/naughty_strings/data/naughty_strings.t.sql index fa5d74f15f934..88128d75dfd4c 100644 --- a/dumpling/tests/naughty_strings/data/naughty_strings.t.sql +++ b/dumpling/tests/naughty_strings/data/naughty_strings.t.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `t` VALUES (''), diff --git a/dumpling/tests/naughty_strings/expect/naughty_strings.escape.sql b/dumpling/tests/naughty_strings/expect/naughty_strings.escape.sql index bc578c659f4c4..607aa53e0acef 100644 --- a/dumpling/tests/naughty_strings/expect/naughty_strings.escape.sql +++ b/dumpling/tests/naughty_strings/expect/naughty_strings.escape.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `escape` VALUES ('\'','\"'), diff --git a/dumpling/tests/naughty_strings/expect/naughty_strings.t.sql b/dumpling/tests/naughty_strings/expect/naughty_strings.t.sql index 1dd0c5ae209a3..5f3468aeb108c 100644 --- a/dumpling/tests/naughty_strings/expect/naughty_strings.t.sql +++ b/dumpling/tests/naughty_strings/expect/naughty_strings.t.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `t` VALUES (''), diff --git a/dumpling/tests/placement_policy/result/x-placement-policy-create.sql b/dumpling/tests/placement_policy/result/x-placement-policy-create.sql index 8a41e6c2a3522..9a7dac22244b0 100644 --- a/dumpling/tests/placement_policy/result/x-placement-policy-create.sql +++ b/dumpling/tests/placement_policy/result/x-placement-policy-create.sql @@ -1,2 +1,3 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; /*T![placement] CREATE PLACEMENT POLICY `x` PRIMARY_REGION="cn-east-1" REGIONS="cn-east-1,cn-east" */; diff --git a/dumpling/tests/placement_policy/result/x1-placement-policy-create.sql b/dumpling/tests/placement_policy/result/x1-placement-policy-create.sql index d5e7f8ad8dda5..ebed679154ef5 100644 --- a/dumpling/tests/placement_policy/result/x1-placement-policy-create.sql +++ b/dumpling/tests/placement_policy/result/x1-placement-policy-create.sql @@ -1,2 +1,3 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; /*T![placement] CREATE PLACEMENT POLICY `x1` FOLLOWERS=4 */; diff --git a/dumpling/tests/primary_key/result/pk_case_0.sql b/dumpling/tests/primary_key/result/pk_case_0.sql index 6c8c7fb9e6538..0168395142ef6 100644 --- a/dumpling/tests/primary_key/result/pk_case_0.sql +++ b/dumpling/tests/primary_key/result/pk_case_0.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `pk_case_0` VALUES (0,10), diff --git a/dumpling/tests/primary_key/result/pk_case_1.sql b/dumpling/tests/primary_key/result/pk_case_1.sql index 4a671cc64f247..741c36cd64e4a 100644 --- a/dumpling/tests/primary_key/result/pk_case_1.sql +++ b/dumpling/tests/primary_key/result/pk_case_1.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `pk_case_1` VALUES (0,10), diff --git a/dumpling/tests/primary_key/result/pk_case_2.sql b/dumpling/tests/primary_key/result/pk_case_2.sql index af9494d00645d..0605e11e5572c 100644 --- a/dumpling/tests/primary_key/result/pk_case_2.sql +++ b/dumpling/tests/primary_key/result/pk_case_2.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `pk_case_2` VALUES (0,10), diff --git a/dumpling/tests/primary_key/result/pk_case_3.sql b/dumpling/tests/primary_key/result/pk_case_3.sql index a29e568dd1340..2da84a1a1b91c 100644 --- a/dumpling/tests/primary_key/result/pk_case_3.sql +++ b/dumpling/tests/primary_key/result/pk_case_3.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `pk_case_3` VALUES (6,4,x'000000000101000000000000000000f03f000000000000f03f'), diff --git a/dumpling/tests/quote/data/quote-database-schema-create-mysql57.sql b/dumpling/tests/quote/data/quote-database-schema-create-mysql57.sql index a5df1c26b6c8b..8cc30bc18ca25 100755 --- a/dumpling/tests/quote/data/quote-database-schema-create-mysql57.sql +++ b/dumpling/tests/quote/data/quote-database-schema-create-mysql57.sql @@ -1,2 +1,3 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE DATABASE `quo``te/database` /*!40100 DEFAULT CHARACTER SET latin1 */; diff --git a/dumpling/tests/quote/data/quote-database-schema-create.sql b/dumpling/tests/quote/data/quote-database-schema-create.sql index d895b4678b912..4a5bfe7c297fc 100755 --- a/dumpling/tests/quote/data/quote-database-schema-create.sql +++ b/dumpling/tests/quote/data/quote-database-schema-create.sql @@ -1,2 +1,3 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE DATABASE `quo``te/database` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */; diff --git a/dumpling/tests/quote/data/quote-database.quote-table-schema-mysql57.sql b/dumpling/tests/quote/data/quote-database.quote-table-schema-mysql57.sql index b3c55dee26330..4b0c6e85c30eb 100755 --- a/dumpling/tests/quote/data/quote-database.quote-table-schema-mysql57.sql +++ b/dumpling/tests/quote/data/quote-database.quote-table-schema-mysql57.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE TABLE `quo``te/table` ( `quo``te/col` int(11) NOT NULL, diff --git a/dumpling/tests/quote/data/quote-database.quote-table-schema.sql b/dumpling/tests/quote/data/quote-database.quote-table-schema.sql index 61bfcc50d113f..cf357c7603836 100755 --- a/dumpling/tests/quote/data/quote-database.quote-table-schema.sql +++ b/dumpling/tests/quote/data/quote-database.quote-table-schema.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE TABLE `quo``te/table` ( `quo``te/col` int NOT NULL, diff --git a/dumpling/tests/quote/data/quote-database.quote-table.000000000-mysql57.sql b/dumpling/tests/quote/data/quote-database.quote-table.000000000-mysql57.sql index 5cee6b7b4a67d..3f36d8fc8a099 100755 --- a/dumpling/tests/quote/data/quote-database.quote-table.000000000-mysql57.sql +++ b/dumpling/tests/quote/data/quote-database.quote-table.000000000-mysql57.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `quo``te/table` (`quo``te/col`,`a`) VALUES (0,10), diff --git a/dumpling/tests/quote/data/quote-database.quote-table.000000000.sql b/dumpling/tests/quote/data/quote-database.quote-table.000000000.sql index 5cee6b7b4a67d..3f36d8fc8a099 100755 --- a/dumpling/tests/quote/data/quote-database.quote-table.000000000.sql +++ b/dumpling/tests/quote/data/quote-database.quote-table.000000000.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; INSERT INTO `quo``te/table` (`quo``te/col`,`a`) VALUES (0,10), diff --git a/dumpling/tests/rows/run.sh b/dumpling/tests/rows/run.sh index 84175b025b9b2..41124fd267a0d 100644 --- a/dumpling/tests/rows/run.sh +++ b/dumpling/tests/rows/run.sh @@ -46,7 +46,7 @@ check_sync_diff $cur/conf/diff_config.toml # test dumpling with both rows and filesize rm -rf "$DUMPLING_OUTPUT_DIR" -run_dumpling --rows 10 --filesize 100B --loglevel debug +run_dumpling --rows 10 --filesize 140B --loglevel debug # the dumping result is expected to be: # 50 files for insertion file_num=$(find "$DUMPLING_OUTPUT_DIR" -maxdepth 1 -iname "$DB_NAME.$TABLE_NAME.*.sql" | wc -l) diff --git a/dumpling/tests/sequences/data/sequences.s-schema-sequence-expect.sql b/dumpling/tests/sequences/data/sequences.s-schema-sequence-expect.sql index 0fb6daa6fc5ad..0f33902517ff1 100644 --- a/dumpling/tests/sequences/data/sequences.s-schema-sequence-expect.sql +++ b/dumpling/tests/sequences/data/sequences.s-schema-sequence-expect.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB; SELECT SETVAL(`s`,1001); diff --git a/dumpling/tests/views/data/views-schema-create.sql b/dumpling/tests/views/data/views-schema-create.sql index af5ca6d166d0e..88ce12d5c3ccd 100644 --- a/dumpling/tests/views/data/views-schema-create.sql +++ b/dumpling/tests/views/data/views-schema-create.sql @@ -1,2 +1,3 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE DATABASE `views` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin */ /*!80016 DEFAULT ENCRYPTION='N' */; diff --git a/dumpling/tests/views/data/views.v-schema-view.sql b/dumpling/tests/views/data/views.v-schema-view.sql index 06d73e73fe664..3063ec02815cd 100644 --- a/dumpling/tests/views/data/views.v-schema-view.sql +++ b/dumpling/tests/views/data/views.v-schema-view.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; DROP TABLE IF EXISTS `v`; DROP VIEW IF EXISTS `v`; diff --git a/dumpling/tests/views/data/views.v-schema.sql b/dumpling/tests/views/data/views.v-schema.sql index 8e6bf5d441640..0d2bddbdffc13 100644 --- a/dumpling/tests/views/data/views.v-schema.sql +++ b/dumpling/tests/views/data/views.v-schema.sql @@ -1,3 +1,4 @@ +/*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40101 SET NAMES binary*/; CREATE TABLE `v`( `a` int, diff --git a/go.mod b/go.mod index eebe7e139ec85..df18ccec64b18 100644 --- a/go.mod +++ b/go.mod @@ -110,12 +110,12 @@ require ( go.uber.org/multierr v1.8.0 go.uber.org/zap v1.23.0 golang.org/x/exp v0.0.0-20221023144134-a1e5550cf13e - golang.org/x/net v0.2.0 + golang.org/x/net v0.4.0 golang.org/x/oauth2 v0.2.0 golang.org/x/sync v0.1.0 golang.org/x/sys v0.3.0 - golang.org/x/term v0.2.0 - golang.org/x/text v0.4.0 + golang.org/x/term v0.3.0 + golang.org/x/text v0.5.0 golang.org/x/time v0.2.0 golang.org/x/tools v0.2.0 google.golang.org/api v0.74.0 diff --git a/go.sum b/go.sum index 0bbbbf7dfe099..b7de00223b8a3 100644 --- a/go.sum +++ b/go.sum @@ -1190,8 +1190,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1320,8 +1320,8 @@ golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1331,8 +1331,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=