Public bug reported:

I am on Ubuntu 18, using oursql 0.9.3.2, and /usr/lib/x86_64-linux-
gnu/libmysqlclient.so.20

I am using oursql to connect to 2 different servers: MariaDB 10.1.38 and
MariaDB 10.3.15:

Expected behavior (MariaDB 10.1.38):

conn = oursql.connect(host='maridb-10.1.38', ...)
curs = conn.cursor()
curs.execute("SET SESSION max_statement_time=1")
curs.execute("SHOW variables like 'max_statement_%'")
curs.fetchall()
>> [(u'max_statement_time', u'1.000000')]
curs.execute(long_query)
curs.fetchall()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "oursqlx/cursor.pyx", line 122, in oursql.Cursor.execute 
(oursqlx/oursql.c:20330)
  File "oursqlx/statement.pyx", line 402, in oursql._Statement.execute 
(oursqlx/oursql.c:13119)
  File "oursqlx/statement.pyx", line 127, in oursql._Statement._raise_error 
(oursqlx/oursql.c:9947)
oursql.UnknownError: (1969, 'Query execution was interrupted 
(max_statement_time exceeded)', None)

Unexpected behavior (MariaDB 10.3.15):

conn = oursql.connect(host='maridb-10.3.15', ...)
curs = conn.cursor()
curs.execute("SET SESSION max_statement_time=1")
curs.execute("SHOW variables like 'max_statement_%'")
curs.fetchall()
>> [(u'max_statement_time', u'1.000000')]
curs.execute(long_query)
curs.fetchall()
... Gets stuck

I have 2 interesting observations:
- looking at 'processlist' on the server side confirms that the query was 
actually canceled (connection is in sleep mode)
- running the same sequence using the 'mysql' CLI of MariaDB 10.1.38 against 
the MariaDB 10.3.15 server  works fine (query is interrupted).

Any hints as to how to debug this will be highly appreciated.

** Affects: oursql
     Importance: Undecided
         Status: New

** Description changed:

  I am on Ubuntu 18, using oursql 0.9.3.2, and /usr/lib/x86_64-linux-
  gnu/libmysqlclient.so.20
  
  I am using oursql to connect to 2 different servers: MariaDB 10.1.38 and
  MariaDB 10.3.15:
  
  Expected behavior (MariaDB 10.1.38):
  
  conn = oursql.connect(host='maridb-10.1.38', ...)
  curs = conn.cursor()
  curs.execute("SET SESSION max_statement_time=1")
  curs.execute("SHOW variables like 'max_statement_%'")
  curs.fetchall()
  >> [(u'max_statement_time', u'1.000000')]
  curs.execute(long_query)
+ curs.fetchall()
  Traceback (most recent call last):
-   File "<stdin>", line 1, in <module>
-   File "oursqlx/cursor.pyx", line 122, in oursql.Cursor.execute 
(oursqlx/oursql.c:20330)
-   File "oursqlx/statement.pyx", line 402, in oursql._Statement.execute 
(oursqlx/oursql.c:13119)
-   File "oursqlx/statement.pyx", line 127, in oursql._Statement._raise_error 
(oursqlx/oursql.c:9947)
+   File "<stdin>", line 1, in <module>
+   File "oursqlx/cursor.pyx", line 122, in oursql.Cursor.execute 
(oursqlx/oursql.c:20330)
+   File "oursqlx/statement.pyx", line 402, in oursql._Statement.execute 
(oursqlx/oursql.c:13119)
+   File "oursqlx/statement.pyx", line 127, in oursql._Statement._raise_error 
(oursqlx/oursql.c:9947)
  oursql.UnknownError: (1969, 'Query execution was interrupted 
(max_statement_time exceeded)', None)
- 
  
  Unexpected behavior (MariaDB 10.3.15):
  
  conn = oursql.connect(host='maridb-10.3.15', ...)
  curs = conn.cursor()
  curs.execute("SET SESSION max_statement_time=1")
  curs.execute("SHOW variables like 'max_statement_%'")
  curs.fetchall()
  >> [(u'max_statement_time', u'1.000000')]
  curs.execute(long_query)
+ curs.fetchall()
  ... Gets stuck
  
  I have 2 interesting observations:
  - looking at 'processlist' on the server side confirms that the query was 
actually canceled (connection is in sleep mode)
  - running the same sequence using the 'mysql' CLI of MariaDB 10.1.38 against 
the MariaDB 10.3.15 server  works fine (query is interrupted).
  
  Any hints as to how to debug this will be highly appreciated.

-- 
You received this bug notification because you are a member of Agesys
Team, which is subscribed to oursql.
https://bugs.launchpad.net/bugs/1831872

Title:
  Long query gets stuck despite max_statement_time being set

Status in oursql:
  New

Bug description:
  I am on Ubuntu 18, using oursql 0.9.3.2, and /usr/lib/x86_64-linux-
  gnu/libmysqlclient.so.20

  I am using oursql to connect to 2 different servers: MariaDB 10.1.38
  and MariaDB 10.3.15:

  Expected behavior (MariaDB 10.1.38):

  conn = oursql.connect(host='maridb-10.1.38', ...)
  curs = conn.cursor()
  curs.execute("SET SESSION max_statement_time=1")
  curs.execute("SHOW variables like 'max_statement_%'")
  curs.fetchall()
  >> [(u'max_statement_time', u'1.000000')]
  curs.execute(long_query)
  curs.fetchall()
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "oursqlx/cursor.pyx", line 122, in oursql.Cursor.execute 
(oursqlx/oursql.c:20330)
    File "oursqlx/statement.pyx", line 402, in oursql._Statement.execute 
(oursqlx/oursql.c:13119)
    File "oursqlx/statement.pyx", line 127, in oursql._Statement._raise_error 
(oursqlx/oursql.c:9947)
  oursql.UnknownError: (1969, 'Query execution was interrupted 
(max_statement_time exceeded)', None)

  Unexpected behavior (MariaDB 10.3.15):

  conn = oursql.connect(host='maridb-10.3.15', ...)
  curs = conn.cursor()
  curs.execute("SET SESSION max_statement_time=1")
  curs.execute("SHOW variables like 'max_statement_%'")
  curs.fetchall()
  >> [(u'max_statement_time', u'1.000000')]
  curs.execute(long_query)
  curs.fetchall()
  ... Gets stuck

  I have 2 interesting observations:
  - looking at 'processlist' on the server side confirms that the query was 
actually canceled (connection is in sleep mode)
  - running the same sequence using the 'mysql' CLI of MariaDB 10.1.38 against 
the MariaDB 10.3.15 server  works fine (query is interrupted).

  Any hints as to how to debug this will be highly appreciated.

To manage notifications about this bug go to:
https://bugs.launchpad.net/oursql/+bug/1831872/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~agesys-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~agesys-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to