TDBC

Artifact Content
Login
Bounty program for improvements to Tcl and certain Tcl packages.

Artifact aaea568e1cb26758b15077de9535aadf911ae0bf:

Attachment "patch-tests_tdbcmysql_test" to ticket [491a0e30c4] added by stu 2017-05-26 05:02:57.
Index: tests/tdbcmysql.test
--- tests/tdbcmysql.test.orig
+++ tests/tdbcmysql.test
@@ -3286,6 +3286,37 @@ test tdbc::mysql-30.1 {Multiple result sets - but in r
 
 #-------------------------------------------------------------------------------
 
+set stmt [::db prepare {
+    CREATE TABLE mytable(
+	a_id INTEGER
+    ) ENGINE=InnoDB
+}]
+set rs [$stmt execute]
+rename $rs {}
+rename $stmt {}
+
+set stmt [db prepare {
+    INSERT INTO mytable(a_id) VALUES(:a_id)
+}]
+$stmt paramtype a_id integer
+for {set a_id 100} {$a_id < 1000} {incr a_id} {
+    set rs [$stmt execute]
+    rename $rs {}
+}
+rename $stmt {}
+
+test tdbc::mysql-50.0 {} -body {
+	db columns mytable
+} -result [dict create a_id [list name a_id type integer precision 11 scale 0 nullable 1]]
+
+test tdbc::mysql-50.1 {} -body {
+	db allrows {SELECT a_id FROM mytable WHERE a_id=241}
+} -result [list [list a_id 241]]
+
+::db allrows {DROP TABLE mytable}
+
+#-------------------------------------------------------------------------------
+
 # Test cleanup. Drop tables and get rid of the test database.