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

mysqltests test_emoticons on Linux fails for Python3 but not Python2 #536

Closed
gordthompson opened this issue Mar 2, 2019 · 2 comments
Closed

Comments

@gordthompson
Copy link
Collaborator

Xubuntu 18.04
unixODBC 2.3.7

Notes:

  1. test_emoticons passes for both Python2 and Python3 on Windows.
  2. Tests on Linux and Windows were against the same MySQL server (5.6.13 on Windows).

Connection string:

[mysqltests]
connection-string=DRIVER=MySQL;charset=utf8mb4;SERVER=192.168.0.179;PORT=3307;DATABASE=myDb;UID=root;PWD=abcd

Python2

gord@xubuntu64-nbk1:~/git/pyodbc$ python2 tests2/mysqltests.py -t test_emoticons
/home/gord/git/pyodbc/tests2 --> /home/gord/git/pyodbc
python:  2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0]
pyodbc:  4.0.27b1 /home/gord/git/pyodbc/build/lib.linux-x86_64-2.7/pyodbc.so
odbc:    03.52
driver:  libmyodbc8w.so 08.00.0015
         supports ODBC version 03.80
os:      Linux
unicode: Py_Unicode=4 SQLWCHAR=2
Max VARCHAR = 255
Max WVARCHAR = (not supported)
Max BINARY = 255
----------------------------------------------------------------------
Ran 1 test in 0.134s

OK

MySQL server General Log shows

10 Execute	insert into t1 values ('x \\U0001F31C z')

python2_okay.odbc.log

Python3

gord@xubuntu64-nbk1:~/git/pyodbc$ python3 tests3/mysqltests.py -t test_emoticons
/home/gord/git/pyodbc/tests3 --> /home/gord/git/pyodbc
python:  3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0]
pyodbc:  4.0.27b1 /home/gord/git/pyodbc/build/lib.linux-x86_64-3.6/pyodbc.cpython-36m-x86_64-linux-gnu.so
odbc:    03.52
driver:  libmyodbc8w.so 08.00.0015
         supports ODBC version 03.80
os:      Linux
unicode: Py_Unicode=4 SQLWCHAR=2
Max VARCHAR = 255
Max WVARCHAR = (not supported)
Max BINARY = 255
======================================================================
FAIL: test_emoticons (__main__.MySqlTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests3/mysqltests.py", line 730, in test_emoticons
    self.assertEqual(result, v)
AssertionError: 'x ' != 'x 🌜 z'
- x 
+ x 🌜 z


----------------------------------------------------------------------
Ran 1 test in 0.085s

FAILED (failures=1)

MySQL server General Log shows

14 Execute	insert into t1 values ('x 🌜 z')

python3_fail.odbc.log

@gordthompson
Copy link
Collaborator Author

Python3 on Windows

C:\Users\Gord\git\pyodbc>python3 tests3\mysqltests.py -t test_emoticons
C:\Users\Gord\git\pyodbc\tests3 --> C:\Users\Gord\git\pyodbc
python:  3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
pyodbc:  4.0.0-unsupported C:\Users\Gord\git\pyodbc\build\lib.win-amd64-3.7\pyodbc.cp37-win_amd64.pyd
odbc:    03.80.0000
driver:  myodbc8w.dll 08.00.0012
         supports ODBC version 03.80
os:      Windows
unicode: Py_Unicode=2 SQLWCHAR=2
Max VARCHAR = 255
Max WVARCHAR = (not supported)
Max BINARY = 255
         7 6.1.7601 SP1 Multiprocessor Free
----------------------------------------------------------------------
Ran 1 test in 0.338s

OK

python3_win_okay.odbc.log

gordthompson added a commit to gordthompson/pyodbc that referenced this issue Mar 3, 2019
@gordthompson
Copy link
Collaborator Author

PR #532 now includes a fix for this.

mkleehammer pushed a commit that referenced this issue Jul 31, 2019
* update usage information in mysqltests.py

* explicit charset for test_emoticons create table (#536)
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

1 participant