add surrogate escape for callproc and test case for that (#104)

This commit is contained in:
Woo-Jing, Seok
2016-07-28 18:49:52 +09:00
committed by INADA Naoki
parent fb842fbdd5
commit c7d2168939
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import capabilities
from datetime import timedelta
import unittest
@ -43,7 +44,7 @@ class test_MySQLdb(capabilities.DatabaseTest):
c = self.cursor
self.create_table(('pos INT', 'tree CHAR(20)'))
c.executemany("INSERT INTO %s (pos,tree) VALUES (%%s,%%s)" % self.table,
list(enumerate('ash birch cedar larch pine'.split())))
list(enumerate('ash birch cedar rche pine'.split())))
db.commit()
c.execute("""
@ -54,7 +55,7 @@ class test_MySQLdb(capabilities.DatabaseTest):
""" % self.table)
db.commit()
c.callproc('test_sp', ('larch',))
c.callproc('test_sp', ('rche',))
rows = c.fetchall()
self.assertEqual(len(rows), 1)
self.assertEqual(rows[0][0], 3)