【 TiDB 使用环境】测试
【 TiDB 版本】v6.5.0
dumpling导出schema后用lightning导入时发生Error 1064: You have an error in your SQL syntax,但ddl本身无错误
nohup tiup dumpling -u ?-p ? -P 4000 -h 127.0.0.1 -d -o $dump_dir --filter ‘dcdb.*’ > $dump_dir/dumpling-out.log &
[mydumper.csv]
separator = ‘~@’
delimiter = ‘"’
header = true
not-null = false
null = ‘\N’
backslash-escape = true
nohup tiup tidb-lightning -config tidb-lightning.toml -d ? 2>&1 &
lightning 提示:
[2024/02/22 14:03:06.672 +08:00] [WARN] [restore.go:537] [“failed to rewrite statement, will use raw input instead”][“run create schema job failed with no retry”]
[2024/02/22 14:03:07.067 +08:00] [ERROR] [restore.go:785] [“restore all schema failed”] [takeTime=437.05098ms] [error="[Lightning:Restore:ErrCreateSchema]create schema failed, table: dcdb_1
.MR_TZ_FUNDACCTLINK
, stmt: restore table schema: run create schema job failed: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 33 near ""MR_TZ_FUNDACCTLINK" (\n"PROJECTID" int(11) NOT NULL DEFAULT ‘0’,\n"FUNDACCTTYPE" char(1) NOT NULL DEFAULT ’ ',\n"FUNDACCT" varchar(32) NOT NULL,\n"DEFAULTFLAG" char(1) NOT NULL DEFAULT ’ ',\nPRIMARY KEY ("PROJECTID","FUNDACCT") /*T![clustered_index] CLUSTERED */,\nUNIQUE KEY "FUNDACCTLINK_UNIQUE_INDEX" ("PROJECTID","FUNDACCTTYPE")\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;" "]