MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / test_issue_95

Method test_issue_95

pymysql/tests/test_issues.py:328–348  ·  view source on GitHub ↗

Leftover trailing OK packet for "CALL my_sp" queries

(self)

Source from the content-addressed store, hash-verified

326 c.execute("drop table b")
327
328 def test_issue_95(self):
329 """Leftover trailing OK packet for "CALL my_sp" queries"""
330 conn = self.connect()
331 cur = conn.cursor()
332 with warnings.catch_warnings():
333 warnings.filterwarnings("ignore")
334 cur.execute("DROP PROCEDURE IF EXISTS `foo`")
335 cur.execute(
336 """CREATE PROCEDURE `foo` ()
337 BEGIN
338 SELECT 1;
339 END"""
340 )
341 try:
342 cur.execute("""CALL foo()""")
343 cur.execute("""SELECT 1""")
344 self.assertEqual(cur.fetchone()[0], 1)
345 finally:
346 with warnings.catch_warnings():
347 warnings.filterwarnings("ignore")
348 cur.execute("DROP PROCEDURE IF EXISTS `foo`")
349
350 def test_issue_114(self):
351 """autocommit is not set after reconnecting with ping()"""

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected