Fix cdc_schema.py

There's no need to use Python 3 for the script and using it introduces
problems due to the poor availability of MySQL Connector/Python for
Python3.

ENUM, SET and DECIMAL values should have a length of -1 as the length is
meaningless for these types.
This commit is contained in:
Markus Mäkelä
2017-06-23 11:10:41 +03:00
parent ce8d712b46
commit bd1da82c96

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python
# Copyright (c) 2016 MariaDB Corporation Ab
#
@ -38,7 +38,7 @@ def parse_field(row):
res["real_type"] = name
if len(parts) > 1:
if len(parts) > 1 and name not in ["enum", "set", "decimal"]:
res["length"] = int(parts[1].split(')')[0])
else:
res["length"] = -1