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

pymysql.err.ProgrammingError in version 0.8.0, but not 0.7.10 #637

Closed
GavinHuttley opened this issue Jan 23, 2018 · 1 comment
Closed

pymysql.err.ProgrammingError in version 0.8.0, but not 0.7.10 #637

GavinHuttley opened this issue Jan 23, 2018 · 1 comment

Comments

@GavinHuttley
Copy link

Using Python 3.6, Rocks 6.2 (CentOS 6.6), MySQL Server version: 5.7.11. Using the attached script applied to the attached sql file, version 0.8.0 returns:

Traceback (most recent call last):
  File "pymysql_bug.py", line 24, in <module>
    r = cursor.execute(sql)
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/cursors.py", line 165, in execute
    result = self._query(query)
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/cursors.py", line 321, in _query
    conn.query(q)
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/connections.py", line 860, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/connections.py", line 1061, in _read_query_result
    result.read()
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/connections.py", line 1349, in read
    first_packet = self.connection._read_packet()
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/connections.py", line 1018, in _read_packet
    packet.check_error()
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/gavin/miniconda3/envs/py36/lib/python3.6/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE `alt_allele_attrib` (\n  `alt_allele_id` int(10) unsigned DEFAULT NU' at line 10")
(py36) [gavin@gduserv ENSEMBLDB_TEST]$ 

If I then:

$ pip install PyMYSQL==0.7.10

I get no failures...

(py36) [gavin@gduserv ENSEMBLDB_TEST]$ python pymysql_bug.py 
0
72
(py36) [gavin@gduserv ENSEMBLDB_TEST]$ 
@methane
Copy link
Member

methane commented Jan 23, 2018

Have you read release note before filing issue?

PyMySQL/CHANGELOG

Lines 12 to 15 in c51b47e

* **BACKWARD INCOMPATIBLE** ``MULTI_STATEMENTS`` client flag is no longer
set by default, while it was on PyMySQL 0.7. You need to pass
``client_flag=CLIENT.MULTI_STATEMENTS`` when you connect to explicitly
enable multi-statement mode. (#590)

@methane methane closed this as completed Jan 23, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants