spanner-migration-tool icon indicating copy to clipboard operation
spanner-migration-tool copied to clipboard

Fix : mysqldump parser not able to parse ordering of the index key

Open Pradip97 opened this issue 4 years ago • 0 comments

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
}

Pradip97 avatar Dec 18 '20 12:12 Pradip97