diff --git a/pymysqlreplication/binlogstream.py b/pymysqlreplication/binlogstream.py index 4f8213d5..7b8f4e4b 100644 --- a/pymysqlreplication/binlogstream.py +++ b/pymysqlreplication/binlogstream.py @@ -651,9 +651,8 @@ def __get_table_information(self, schema, table): information_schema.columns WHERE table_schema = %s AND table_name = %s - ORDER BY ORDINAL_POSITION """, (schema, table)) - result = cur.fetchall() + result = sorted(cur.fetchall(), key=lambda x: x['ORDINAL_POSITION']) cur.close() return result