Commit 50f9e2f5 authored by unknown's avatar unknown

client_test.c:

  fix typos noticed while poking around in test program.


tests/client_test.c:
  fix typos noticed while poking around in test program.
parent b1c77d97
...@@ -223,7 +223,7 @@ static void client_disconnect() ...@@ -223,7 +223,7 @@ static void client_disconnect()
if (mysql) if (mysql)
{ {
fprintf(stdout, "\n droping the test database '%s' ...", current_db); fprintf(stdout, "\n dropping the test database '%s' ...", current_db);
strxmov(query, "DROP DATABASE IF EXISTS ", current_db, NullS); strxmov(query, "DROP DATABASE IF EXISTS ", current_db, NullS);
mysql_query(mysql, query); mysql_query(mysql, query);
...@@ -797,21 +797,21 @@ static void test_tran_bdb() ...@@ -797,21 +797,21 @@ static void test_tran_bdb()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* now insert the second row, and rollback the transaction */ /* now insert the second row, and roll back the transaction */
rc= mysql_query(mysql, "INSERT INTO my_demo_transaction VALUES(20, 'mysql')"); rc= mysql_query(mysql, "INSERT INTO my_demo_transaction VALUES(20, 'mysql')");
myquery(rc); myquery(rc);
rc= mysql_rollback(mysql); rc= mysql_rollback(mysql);
myquery(rc); myquery(rc);
/* delete first row, and rollback it */ /* delete first row, and roll it back */
rc= mysql_query(mysql, "DELETE FROM my_demo_transaction WHERE col1= 10"); rc= mysql_query(mysql, "DELETE FROM my_demo_transaction WHERE col1= 10");
myquery(rc); myquery(rc);
rc= mysql_rollback(mysql); rc= mysql_rollback(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction"); rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction");
myquery(rc); myquery(rc);
...@@ -822,7 +822,7 @@ static void test_tran_bdb() ...@@ -822,7 +822,7 @@ static void test_tran_bdb()
my_process_result_set(result); my_process_result_set(result);
mysql_free_result(result); mysql_free_result(result);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction"); rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction");
myquery(rc); myquery(rc);
...@@ -870,21 +870,21 @@ static void test_tran_innodb() ...@@ -870,21 +870,21 @@ static void test_tran_innodb()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* now insert the second row, and rollback the transaction */ /* now insert the second row, and roll back the transaction */
rc= mysql_query(mysql, "INSERT INTO my_demo_transaction VALUES(20, 'mysql')"); rc= mysql_query(mysql, "INSERT INTO my_demo_transaction VALUES(20, 'mysql')");
myquery(rc); myquery(rc);
rc= mysql_rollback(mysql); rc= mysql_rollback(mysql);
myquery(rc); myquery(rc);
/* delete first row, and rollback it */ /* delete first row, and roll it back */
rc= mysql_query(mysql, "DELETE FROM my_demo_transaction WHERE col1= 10"); rc= mysql_query(mysql, "DELETE FROM my_demo_transaction WHERE col1= 10");
myquery(rc); myquery(rc);
rc= mysql_rollback(mysql); rc= mysql_rollback(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction"); rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction");
myquery(rc); myquery(rc);
...@@ -895,7 +895,7 @@ static void test_tran_innodb() ...@@ -895,7 +895,7 @@ static void test_tran_innodb()
my_process_result_set(result); my_process_result_set(result);
mysql_free_result(result); mysql_free_result(result);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction"); rc= mysql_query(mysql, "SELECT * FROM my_demo_transaction");
myquery(rc); myquery(rc);
...@@ -1158,7 +1158,7 @@ static void test_prepare() ...@@ -1158,7 +1158,7 @@ static void test_prepare()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
assert(tiny_data == (char) my_stmt_result("SELECT * FROM my_prepare")); assert(tiny_data == (char) my_stmt_result("SELECT * FROM my_prepare"));
stmt= mysql_simple_prepare(mysql, "SELECT * FROM my_prepare"); stmt= mysql_simple_prepare(mysql, "SELECT * FROM my_prepare");
...@@ -1304,7 +1304,7 @@ static void test_double_compare() ...@@ -1304,7 +1304,7 @@ static void test_double_compare()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM test_double_compare"); rc= mysql_query(mysql, "SELECT * FROM test_double_compare");
myquery(rc); myquery(rc);
...@@ -1740,7 +1740,7 @@ static void test_select() ...@@ -1740,7 +1740,7 @@ static void test_select()
rc= mysql_query(mysql, "INSERT INTO test_select VALUES(10, 'venu')"); rc= mysql_query(mysql, "INSERT INTO test_select VALUES(10, 'venu')");
myquery(rc); myquery(rc);
/* now insert the second row, and rollback the transaction */ /* now insert the second row, and roll back the transaction */
rc= mysql_query(mysql, "INSERT INTO test_select VALUES(20, 'mysql')"); rc= mysql_query(mysql, "INSERT INTO test_select VALUES(20, 'mysql')");
myquery(rc); myquery(rc);
...@@ -2259,7 +2259,7 @@ static void test_simple_update() ...@@ -2259,7 +2259,7 @@ static void test_simple_update()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM test_update"); rc= mysql_query(mysql, "SELECT * FROM test_update");
myquery(rc); myquery(rc);
...@@ -2738,7 +2738,7 @@ static void test_simple_delete() ...@@ -2738,7 +2738,7 @@ static void test_simple_delete()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM test_simple_delete"); rc= mysql_query(mysql, "SELECT * FROM test_simple_delete");
myquery(rc); myquery(rc);
...@@ -2837,7 +2837,7 @@ static void test_update() ...@@ -2837,7 +2837,7 @@ static void test_update()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM test_update"); rc= mysql_query(mysql, "SELECT * FROM test_update");
myquery(rc); myquery(rc);
...@@ -2883,7 +2883,7 @@ static void test_prepare_noparam() ...@@ -2883,7 +2883,7 @@ static void test_prepare_noparam()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM my_prepare"); rc= mysql_query(mysql, "SELECT * FROM my_prepare");
myquery(rc); myquery(rc);
...@@ -3953,7 +3953,7 @@ static void test_insert() ...@@ -3953,7 +3953,7 @@ static void test_insert()
rc= mysql_commit(mysql); rc= mysql_commit(mysql);
myquery(rc); myquery(rc);
/* test the results now, only one row should exists */ /* test the results now, only one row should exist */
rc= mysql_query(mysql, "SELECT * FROM test_prep_insert"); rc= mysql_query(mysql, "SELECT * FROM test_prep_insert");
myquery(rc); myquery(rc);
...@@ -4906,7 +4906,7 @@ DROP TABLE IF EXISTS test_multi_tab"; ...@@ -4906,7 +4906,7 @@ DROP TABLE IF EXISTS test_multi_tab";
/* /*
First test that we get an error for multi statements First test that we get an error for multi statements
(Becasue default connection is not opened with CLIENT_MULTI_STATEMENTS) (Because default connection is not opened with CLIENT_MULTI_STATEMENTS)
*/ */
rc= mysql_query(mysql, query); /* syntax error */ rc= mysql_query(mysql, query); /* syntax error */
myquery_r(rc); myquery_r(rc);
...@@ -4920,7 +4920,7 @@ DROP TABLE IF EXISTS test_multi_tab"; ...@@ -4920,7 +4920,7 @@ DROP TABLE IF EXISTS test_multi_tab";
exit(1); exit(1);
} }
/* Create connection that supprot multi statements */ /* Create connection that supports multi statements */
if (!(mysql_real_connect(mysql_local, opt_host, opt_user, if (!(mysql_real_connect(mysql_local, opt_host, opt_user,
opt_password, current_db, opt_port, opt_password, current_db, opt_port,
opt_unix_socket, CLIENT_MULTI_STATEMENTS))) opt_unix_socket, CLIENT_MULTI_STATEMENTS)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment