You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.
Some drivers (notably Python's mysql-connector) set some variables by using ON and OFF rather than using 1 and 0.
Since these are currently not supported the behavior when these are set (which happens while the connection is being established) varies:
SET @@session.autocommit=OFF causes an error indicating that OFF is not a known column.
SET @@session.autocommit=ON fails to parse since ON is also a reserved keyword.
I did some hacky changes to prove this could be fixed by making ON and OFF non reserved keywords and I was then able to connect from a Jupyter Notebook.
I consider this change quite urgent, since it is blocking usage of gitbase from many different SQL drivers.
The text was updated successfully, but these errors were encountered:
As a motivating example, once this is fixed we will be able to run programs like these:
frommatplotlibimportpyplotaspltfrommysqlimportconnectorassqlprint('querying data... (can take up to a minute)')
conn=sql.connect(user='root', passwd=None, db='mysql')
cursor=conn.cursor()
cursor.execute(""" SELECT year, month, count(*) as n FROM ( SELECT commit_author_when, YEAR(commit_author_when) as year, MONTH(commit_author_when) as month FROM commits ) as t GROUP BY year, month ORDER BY year, month;""")
dates= []
counts= []
for (year, month, count) incursor:
dates.append('%04d%02d'%(year,month))
counts.append(count)
plt.figure(figsize=(20,5))
plt.scatter(dates, counts)
plt.xticks(rotation=60)
plt.show()
Some drivers (notably Python's mysql-connector) set some variables by using
ON
andOFF
rather than using1
and0
.Since these are currently not supported the behavior when these are set (which happens while the connection is being established) varies:
SET @@session.autocommit=OFF
causes an error indicating thatOFF
is not a known column.SET @@session.autocommit=ON
fails to parse sinceON
is also a reserved keyword.I did some hacky changes to prove this could be fixed by making
ON
andOFF
non reserved keywords and I was then able to connect from a Jupyter Notebook.I consider this change quite urgent, since it is blocking usage of
gitbase
from many different SQL drivers.The text was updated successfully, but these errors were encountered: