Skip to content

Empty fix sqls are still written to disk with chunk meta when export-fix-sql is false #870

@mengxian-li

Description

@mengxian-li

Bug Report

With export-fix-sql = false, we still see files under the fixDir path.
The file only contains the chunk meta:

-- table: database.test_table
-- range in sequence: (1234) < (key) <= (5678)

The issue is that this line is not guarded with export-fix-sql, so empty sql is added to dml.sqls:

		dml.sqls = append(dml.sqls, sql)

Then later in writeSQLs, for each empty sql, the chunk meta data is written to disk

// write chunk meta
chunkRange := dml.node.ChunkRange
fixSQLFile.WriteString(fmt.Sprintf("-- table: %s.%s\n-- %s\n", tableDiff.Schema, tableDiff.Table, chunkRange.ToMeta()))

We just need to guard this line with export-fix-sql.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions