summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormonty@mysql.com <>2006-06-30 19:15:18 +0300
committermonty@mysql.com <>2006-06-30 19:15:18 +0300
commit2f86009c9e8d7a59385981f311286e616a4b41aa (patch)
tree15c1c844006e3cdc77167f5ef3986b9d40c16104 /tests
parenta5f362cb9417697ffbd41adaad2a840a97e9d27a (diff)
parent445dfdc3a7bd1fa69cda8eeffce588cad8213fde (diff)
downloadmariadb-git-2f86009c9e8d7a59385981f311286e616a4b41aa.tar.gz
Merge mysql.com:/home/my/mysql-4.1
into mysql.com:/home/my/mysql-5.0
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c71
1 files changed, 65 insertions, 6 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 3876de58b0e..0b3928e400b 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -14882,11 +14882,13 @@ static void test_bug17667()
printf("success. All queries found intact in the log.\n");
- } else {
+ }
+ else
+ {
fprintf(stderr, "Could not find the log file, var/log/master.log, so "
- "test_bug17667 is \ninconclusive. Run test from the "
- "mysql-test/mysql-test-run* program \nto set up the correct "
- "environment for this test.\n\n");
+ "test_bug17667 is \ninconclusive. Run test from the "
+ "mysql-test/mysql-test-run* program \nto set up the correct "
+ "environment for this test.\n\n");
}
if (log_file != NULL)
@@ -14896,7 +14898,8 @@ static void test_bug17667()
/*
- Bug#14169: type of group_concat() result changed to blob if tmp_table was used
+ Bug#14169: type of group_concat() result changed to blob if tmp_table was
+ used
*/
static void test_bug14169()
{
@@ -14929,7 +14932,62 @@ static void test_bug14169()
rc= mysql_query(mysql, "drop table t1");
myquery(rc);
-}/*
+}
+
+
+/*
+ Bug#20152: mysql_stmt_execute() writes to MYSQL_TYPE_DATE buffer
+*/
+
+static void test_bug20152()
+{
+ MYSQL_BIND bind[1];
+ MYSQL_STMT *stmt;
+ MYSQL_TIME tm;
+ int rc;
+ const char *query= "INSERT INTO t1 (f1) VALUES (?)";
+
+ myheader("test_bug20152");
+
+ memset(bind, 0, sizeof(bind));
+ bind[0].buffer_type= MYSQL_TYPE_DATE;
+ bind[0].buffer= (void*)&tm;
+
+ tm.year = 2006;
+ tm.month = 6;
+ tm.day = 18;
+ tm.hour = 14;
+ tm.minute = 9;
+ tm.second = 42;
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+ rc= mysql_query(mysql, "CREATE TABLE t1 (f1 DATE)");
+ myquery(rc);
+
+ stmt= mysql_stmt_init(mysql);
+ rc= mysql_stmt_prepare(stmt, query, strlen(query));
+ check_execute(stmt, rc);
+ rc= mysql_stmt_bind_param(stmt, bind);
+ check_execute(stmt, rc);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+ rc= mysql_stmt_close(stmt);
+ check_execute(stmt, rc);
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+
+ if (tm.hour == 14 && tm.minute == 9 && tm.second == 42) {
+ if (!opt_silent)
+ printf("OK!");
+ } else {
+ printf("[14:09:42] != [%02d:%02d:%02d]\n", tm.hour, tm.minute, tm.second);
+ DIE_UNLESS(0==1);
+ }
+}
+
+
+/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -15193,6 +15251,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug12744", test_bug12744 },
{ "test_bug16143", test_bug16143 },
{ "test_bug15613", test_bug15613 },
+ { "test_bug20152", test_bug20152 },
{ "test_bug14169", test_bug14169 },
{ "test_bug17667", test_bug17667 },
{ 0, 0 }