diff options
author | bell@sanja.is.com.ua <> | 2005-06-15 01:57:25 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2005-06-15 01:57:25 +0300 |
commit | 303dafc538ced22fd90dd1c99fb50f0e79fc06fa (patch) | |
tree | f4a159aa998d239c457b1b991ac225b8f025ecf5 /tests | |
parent | 50def61bef7757f25b6372430c59090c1deac9bd (diff) | |
download | mariadb-git-303dafc538ced22fd90dd1c99fb50f0e79fc06fa.tar.gz |
fix of BUG#11111 fix
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index fb18c83b30e..7a683659df6 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -13156,14 +13156,24 @@ static void test_bug11111() char buf[2][20]; long len[2]; int i; + int rc; const char * query = "SELECT DISTINCT f1,ff2 FROM v1"; + myheader("test_bug11111"); - mysql_query(mysql, "drop table if exists t1, t2, v1"); - mysql_query(mysql, "create table t1 (f1 int, f2 int)"); - mysql_query(mysql, "create table t2 (ff1 int, ff2 int)"); - mysql_query(mysql, "create view v1 as select * from t1, t2 where f1=ff1"); - mysql_query(mysql, "insert into t1 values (1,1), (2,2), (3,3)"); - mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)"); + rc= mysql_query(mysql, "drop table if exists t1, t2, v1"); + myquery(rc); + rc= mysql_query(mysql, "drop view if exists t1, t2, v1"); + myquery(rc); + rc= mysql_query(mysql, "create table t1 (f1 int, f2 int)"); + myquery(rc); + rc= mysql_query(mysql, "create table t2 (ff1 int, ff2 int)"); + myquery(rc); + rc= mysql_query(mysql, "create view v1 as select * from t1, t2 where f1=ff1"); + myquery(rc); + rc= mysql_query(mysql, "insert into t1 values (1,1), (2,2), (3,3)"); + myquery(rc); + rc= mysql_query(mysql, "insert into t2 values (1,1), (2,2), (3,3)"); + myquery(rc); stmt = mysql_stmt_init(mysql); @@ -13176,15 +13186,19 @@ static void test_bug11111() bind[i].buffer= (gptr *)&buf[i]; bind[i].buffer_length= 20; bind[i].length= &len[i]; - } + } if (mysql_stmt_bind_result(stmt, bind)) printf("Error: %s\n", mysql_stmt_error(stmt)); mysql_stmt_fetch(stmt); - DIE_UNLESS(!strcmp(buf[1],"1")); + printf("return: %s", buf[1]); + DIE_UNLESS(!strcmp(buf[1],"1")); mysql_stmt_close(stmt); - mysql_query(mysql, "drop table t1, t2, v1"); + rc= mysql_query(mysql, "drop view v1"); + myquery(rc); + rc= mysql_query(mysql, "drop table t1, t2"); + myquery(rc); } /* |