summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorunknown <gluh@eagle.(none)>2007-10-23 18:51:43 +0500
committerunknown <gluh@eagle.(none)>2007-10-23 18:51:43 +0500
commit8479eb1db7d1c8ccfbaa62077c54b7f5af714324 (patch)
treed36465f86e78c442a44942849b7280eab8d10bf8 /tests
parentfb9a562b1cc2b9048eff094bb7004fb3db0e7fd0 (diff)
parentc448d2ed5d2a7efd1f77b956f46d8f1e48b17350 (diff)
downloadmariadb-git-8479eb1db7d1c8ccfbaa62077c54b7f5af714324.tar.gz
Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt client/mysqldump.c: Auto merged include/config-win.h: Auto merged libmysql/libmysql.c: Auto merged myisam/sort.c: Auto merged mysql-test/r/func_sapdb.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/variables.test: Auto merged sql/field.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/item_func.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.h: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged tests/mysql_client_test.c: Auto merged mysql-test/r/type_datetime.result: manual merge mysql-test/r/type_decimal.result: manual merge mysql-test/t/type_datetime.test: manual merge mysql-test/t/type_decimal.test: manual merge sql/item.cc: manual merge
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 9962a108e45..4fcdca76c6f 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);