Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when the ecoding is ucs2 #159

Open
guerremdq opened this issue May 30, 2016 · 2 comments
Open

Fail when the ecoding is ucs2 #159

guerremdq opened this issue May 30, 2016 · 2 comments

Comments

@guerremdq
Copy link

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

@baloo
Copy link
Collaborator

baloo commented May 31, 2016

I'd say it's related to #146. I would solve both problems by not trying to parse content and just return a byte array to user. And let user parse it's data.

This is a breaking change, but it's the safest we can try here.

Any thoughts?

@julien-duponchelle
Copy link
Owner

Sadly I agree with you. We will need to provide a sample for user to get the character_set_name if people want to do it like today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants