diff options
author | davi@buzz.(none) <> | 2008-02-20 23:18:40 -0200 |
---|---|---|
committer | davi@buzz.(none) <> | 2008-02-20 23:18:40 -0200 |
commit | bf9142825dc921888a47c6443844ec3249e3d70f (patch) | |
tree | e232df570c6c78881714ae7d48ce10cebeb5e6d2 /tests | |
parent | 2aed47c98b7e0269a4ccd87999198eb213464493 (diff) | |
parent | 4b821c0cbd7bf87b1ac6de6a84207e9fd0383e62 (diff) | |
download | mariadb-git-bf9142825dc921888a47c6443844ec3249e3d70f.tar.gz |
Merge buzz.(none):/home/davi/mysql-5.0-runtime
into buzz.(none):/home/davi/mysql-5.1-runtime
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 3776be79399..82a9b964fcc 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16110,6 +16110,87 @@ static void test_bug24179() /* + +/** + Bug#32265 Server returns different metadata if prepared statement is used +*/ + +static void test_bug32265() +{ + int rc; + MYSQL_STMT *stmt; + MYSQL_FIELD *field; + + DBUG_ENTER("test_bug32265"); + myheader("test_bug32265"); + + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + myquery(rc); + rc= mysql_query(mysql, "CREATE TABLE t1 (a INTEGER)"); + myquery(rc); + rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)"); + myquery(rc); + rc= mysql_query(mysql, "CREATE VIEW v1 AS SELECT * FROM t1"); + myquery(rc); + + stmt= open_cursor("SELECT * FROM t1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + field= stmt->mysql->fields; + DIE_UNLESS(strcmp(field->table, "t1") == 0); + DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); + mysql_stmt_close(stmt); + + stmt= open_cursor("SELECT a '' FROM t1 ``"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + field= stmt->mysql->fields; + DIE_UNLESS(strcmp(field->table, "") == 0); + DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); + mysql_stmt_close(stmt); + + stmt= open_cursor("SELECT a '' FROM t1 ``"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + field= stmt->mysql->fields; + DIE_UNLESS(strcmp(field->table, "") == 0); + DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); + mysql_stmt_close(stmt); + + stmt= open_cursor("SELECT * FROM v1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + field= stmt->mysql->fields; + DIE_UNLESS(strcmp(field->table, "v1") == 0); + DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); + mysql_stmt_close(stmt); + + stmt= open_cursor("SELECT * FROM v1 /* SIC */ GROUP BY 1"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + field= stmt->mysql->fields; + DIE_UNLESS(strcmp(field->table, "v1") == 0); + DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); + mysql_stmt_close(stmt); + + rc= mysql_query(mysql, "DROP VIEW v1"); + myquery(rc); + rc= mysql_query(mysql, "DROP TABLE t1"); + myquery(rc); + + DBUG_VOID_RETURN; +} + Bug#28075 "COM_DEBUG crashes mysqld" */ @@ -17517,6 +17598,7 @@ static struct my_tests_st my_tests[]= { { "test_bug21726", test_bug21726 }, { "test_bug15518", test_bug15518 }, { "test_bug23383", test_bug23383 }, + { "test_bug32265", test_bug32265 }, { "test_bug21635", test_bug21635 }, { "test_status", test_status }, { "test_bug24179", test_bug24179 }, |