-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.component/lightningThis issue is related to Lightning of TiDB.This issue is related to Lightning of TiDB.severity/majortype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
The source schema files may contain some unsupported feature, like unsupported chatset. When lightning failed to rewrite the statement, it directly uses the source file content. However, USE <database>
is missing
tidb/br/pkg/lightning/importer/import.go
Lines 625 to 638 in c1e3dae
func (worker *restoreSchemaWorker) addJob(sqlStr string, job *schemaJob) error { | |
stmts, err := createIfNotExistsStmt(worker.parser, sqlStr, job.dbName, job.tblName) | |
if err != nil { | |
worker.logger.Warn("failed to rewrite statement, will use raw input instead", | |
zap.String("db", job.dbName), | |
zap.String("table", job.tblName), | |
zap.String("statement", sqlStr), | |
zap.Error(err)) | |
job.stmts = []string{sqlStr} | |
} else { | |
job.stmts = stmts | |
} | |
return worker.appendJob(job) | |
} |
Metadata
Metadata
Assignees
Labels
affects-5.4This bug affects the 5.4.x(LTS) versions.This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.component/lightningThis issue is related to Lightning of TiDB.This issue is related to Lightning of TiDB.severity/majortype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.