(self)
| 40 | self.check_data_integrity(("col1 TINYINT",), generator) |
| 41 | |
| 42 | def test_stored_procedures(self): |
| 43 | db = self.connection |
| 44 | c = self.cursor |
| 45 | self.create_table(("pos INT", "tree CHAR(20)")) |
| 46 | c.executemany( |
| 47 | "INSERT INTO %s (pos,tree) VALUES (%%s,%%s)" % self.table, |
| 48 | list(enumerate("ash birch cedar Lärche pine".split())), |
| 49 | ) |
| 50 | db.commit() |
| 51 | |
| 52 | c.execute( |
| 53 | """ |
| 54 | CREATE PROCEDURE test_sp(IN t VARCHAR(255)) |
| 55 | BEGIN |
| 56 | SELECT pos FROM %s WHERE tree = t; |
| 57 | END |
| 58 | """ |
| 59 | % self.table |
| 60 | ) |
| 61 | db.commit() |
| 62 | |
| 63 | c.callproc("test_sp", ("Lärche",)) |
| 64 | rows = c.fetchall() |
| 65 | self.assertEqual(len(rows), 1) |
| 66 | self.assertEqual(rows[0][0], 3) |
| 67 | c.nextset() |
| 68 | |
| 69 | c.execute("DROP PROCEDURE test_sp") |
| 70 | c.execute("drop table %s" % (self.table)) |
| 71 | |
| 72 | def test_small_CHAR(self): |
| 73 | # Character data |
nothing calls this directly
no test coverage detected