diff options
author | unknown <evgen@moonbone.local> | 2007-09-28 23:27:23 +0000 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-09-28 23:27:23 +0000 |
commit | 084cbc7ed8eb5dac7448e4867c3c7b92c78b5b91 (patch) | |
tree | eb6cc71abd40b9945aa746fa74a351cd2ec22a60 /tests | |
parent | 4c14efa696bd35cd5150551465fa31596e73d5d1 (diff) | |
parent | 6a8bd84a825094c99919f4391c22fd70f47c08ac (diff) | |
download | mariadb-git-084cbc7ed8eb5dac7448e4867c3c7b92c78b5b91.tar.gz |
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/work/27990-bug-5.0-opt-mysql
sql/field.cc:
Auto merged
sql/sql_select.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index c335b0128f7..b9f39021114 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -15490,7 +15490,7 @@ static void test_bug21635() char *query_end; MYSQL_RES *result; MYSQL_FIELD *field; - unsigned int field_count, i; + unsigned int field_count, i, j; int rc; DBUG_ENTER("test_bug21635"); @@ -15506,28 +15506,35 @@ static void test_bug21635() myquery(rc); rc= mysql_query(mysql, "CREATE TABLE t1 (i INT)"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)"); - myquery(rc); + /* + We need this loop to ensure correct behavior with both constant and + non-constant tables. + */ + for (j= 0; j < 2 ; j++) + { + rc= mysql_query(mysql, "INSERT INTO t1 VALUES (1)"); + myquery(rc); - rc= mysql_real_query(mysql, query, query_end - query); - myquery(rc); + rc= mysql_real_query(mysql, query, query_end - query); + myquery(rc); - result= mysql_use_result(mysql); - DIE_UNLESS(result); + result= mysql_use_result(mysql); + DIE_UNLESS(result); - field_count= mysql_field_count(mysql); - for (i= 0; i < field_count; ++i) - { - field= mysql_fetch_field_direct(result, i); - printf("%s -> %s ... ", expr[i * 2], field->name); - fflush(stdout); - DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 && - field->table[0] == 0 && field->org_name[0] == 0); - DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0); - puts("OK"); - } + field_count= mysql_field_count(mysql); + for (i= 0; i < field_count; ++i) + { + field= mysql_fetch_field_direct(result, i); + printf("%s -> %s ... ", expr[i * 2], field->name); + fflush(stdout); + DIE_UNLESS(field->db[0] == 0 && field->org_table[0] == 0 && + field->table[0] == 0 && field->org_name[0] == 0); + DIE_UNLESS(strcmp(field->name, expr[i * 2 + 1]) == 0); + puts("OK"); + } - mysql_free_result(result); + mysql_free_result(result); + } rc= mysql_query(mysql, "DROP TABLE t1"); myquery(rc); |