spanner-migration-tool
spanner-migration-tool copied to clipboard
Fix : mysqldump parser not able to parse ordering of the index key
Expected Behavior
We should be able to get the ordering (i.e, ascending/descending) of the key columns involved in the index.
Actual Behavior
The mysqldump parser has no attribute in *ast.IndexPartSpecification which can be mapped to the ordering of the key column.
Find alternative way to get the ordering of the key column in the index. currently default ordering is kept to ascending. The fix is needed in mysql/mysqldump.go in toSchemaKeys function.
func toSchemaKeys(columns []*ast.IndexPartSpecification) (keys []schema.Key) {
for _, colname := range columns {
keys = append(keys, schema.Key{Column: colname.Column.Name.String()})
}
return keys
}