julien-duponchelle / julien-duponchelle/python-mysql-replication

Fail when the ecoding is ucs2

Open
#159 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.4k
Forks
690
PR merge metrics
No merged PRs in 30d

Description

Hello,

I had a field in the table with charset ucs2

```
test_field varchar(100) CHARACTER SET ucs2 DEFAULT NULL COMMENT
```

and the is failing with this error:

```
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "lazarus.py", line 85, in run
for row in binlogevent.rows:
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 397, in rows
self._fetch_rows()
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 392, in _fetch_rows
self.__rows.append(self._fetch_one_row())
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 445, in _fetch_one_row
row["values"] = self._read_column_data(self.columns_present_bitmap)
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 118, in _read_column_data
values[name] = self.__read_string(1, column)
File "/usr/local/lib/python2.7/dist-packages/pymysqlreplication/row_event.py", line 197, in __read_string
string = string.decode(column.character_set_name)
LookupError: unknown encoding: ucs2
```

It's possible to support this encoding?

Thaks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.