From 97c3182312568d856e040f8d788f1ee0291717c1 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 23 Jul 2010 17:09:27 -0300 Subject: WL#5498: Remove dead and unused source code Remove code that has been disabled for a long time. --- tests/mysql_client_test.c | 209 ---------------------------------------------- 1 file changed, 209 deletions(-) (limited to 'tests') diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index a3640077889..61f9d4881cb 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -5775,215 +5775,6 @@ static void test_set_variable() mysql_stmt_close(stmt1); } -#if NOT_USED - -/* Insert meta info .. */ - -static void test_insert_meta() -{ - MYSQL_STMT *stmt; - int rc; - MYSQL_RES *result; - MYSQL_FIELD *field; - - myheader("test_insert_meta"); - - rc= mysql_autocommit(mysql, TRUE); - myquery(rc); - - rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_insert"); - myquery(rc); - - rc= mysql_query(mysql, "CREATE TABLE test_prep_insert(col1 tinyint, \ - col2 varchar(50), col3 varchar(30))"); - myquery(rc); - - strmov(query, "INSERT INTO test_prep_insert VALUES(10, 'venu1', 'test')"); - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - verify_param_count(stmt, 0); - - result= mysql_param_result(stmt); - mytest_r(result); - - mysql_stmt_close(stmt); - - strmov(query, "INSERT INTO test_prep_insert VALUES(?, 'venu', ?)"); - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - verify_param_count(stmt, 2); - - result= mysql_param_result(stmt); - mytest(result); - - my_print_result_metadata(result); - - mysql_field_seek(result, 0); - field= mysql_fetch_field(result); - mytest(field); - if (!opt_silent) - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1"); - DIE_UNLESS(strcmp(field->name, "col1") == 0); - - field= mysql_fetch_field(result); - mytest(field); - if (!opt_silent) - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3"); - DIE_UNLESS(strcmp(field->name, "col3") == 0); - - field= mysql_fetch_field(result); - mytest_r(field); - - mysql_free_result(result); - mysql_stmt_close(stmt); -} - - -/* Update meta info .. */ - -static void test_update_meta() -{ - MYSQL_STMT *stmt; - int rc; - MYSQL_RES *result; - MYSQL_FIELD *field; - - myheader("test_update_meta"); - - rc= mysql_autocommit(mysql, TRUE); - myquery(rc); - - rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_update"); - myquery(rc); - - rc= mysql_query(mysql, "CREATE TABLE test_prep_update(col1 tinyint, \ - col2 varchar(50), col3 varchar(30))"); - myquery(rc); - - strmov(query, "UPDATE test_prep_update SET col1=10, col2='venu1' WHERE col3='test'"); - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - verify_param_count(stmt, 0); - - result= mysql_param_result(stmt); - mytest_r(result); - - mysql_stmt_close(stmt); - - strmov(query, "UPDATE test_prep_update SET col1=?, col2='venu' WHERE col3=?"); - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - verify_param_count(stmt, 2); - - result= mysql_param_result(stmt); - mytest(result); - - my_print_result_metadata(result); - - mysql_field_seek(result, 0); - field= mysql_fetch_field(result); - mytest(field); - if (!opt_silent) - { - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); - } - DIE_UNLESS(strcmp(field->name, "col1") == 0); - DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0); - - field= mysql_fetch_field(result); - mytest(field); - if (!opt_silent) - { - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); - } - DIE_UNLESS(strcmp(field->name, "col3") == 0); - DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0); - - field= mysql_fetch_field(result); - mytest_r(field); - - mysql_free_result(result); - mysql_stmt_close(stmt); -} - - -/* Select meta info .. */ - -static void test_select_meta() -{ - MYSQL_STMT *stmt; - int rc; - MYSQL_RES *result; - MYSQL_FIELD *field; - - myheader("test_select_meta"); - - rc= mysql_autocommit(mysql, TRUE); - myquery(rc); - - rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_select"); - myquery(rc); - - rc= mysql_query(mysql, "CREATE TABLE test_prep_select(col1 tinyint, \ - col2 varchar(50), col3 varchar(30))"); - myquery(rc); - - strmov(query, "SELECT * FROM test_prep_select WHERE col1=10"); - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - verify_param_count(stmt, 0); - - result= mysql_param_result(stmt); - mytest_r(result); - - strmov(query, "SELECT col1, col3 from test_prep_select WHERE col1=? AND col3='test' AND col2= ?"); - stmt= mysql_simple_prepare(mysql, query); - check_stmt(stmt); - - verify_param_count(stmt, 2); - - result= mysql_param_result(stmt); - mytest(result); - - my_print_result_metadata(result); - - mysql_field_seek(result, 0); - field= mysql_fetch_field(result); - mytest(field); - if (!opt_silent) - { - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); - } - DIE_UNLESS(strcmp(field->name, "col1") == 0); - DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0); - - field= mysql_fetch_field(result); - mytest(field); - if (!opt_silent) - { - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); - } - DIE_UNLESS(strcmp(field->name, "col2") == 0); - DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0); - - field= mysql_fetch_field(result); - mytest_r(field); - - mysql_free_result(result); - mysql_stmt_close(stmt); -} -#endif - - /* Test FUNCTION field info / DATE_FORMAT() table_name . */ static void test_func_fields() -- cgit v1.2.1 From 7f80eb46e9b9d2c164737cadb9d7ce10e502054b Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Sat, 24 Jul 2010 09:24:44 -0300 Subject: Bug#42733: Type-punning warnings when compiling MySQL Post-merge fix: remove remaining casts which are now unnecessary and are actually causing warnings. --- tests/thread_test.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/thread_test.c b/tests/thread_test.c index 1a3dd60c1fd..c243a3a7321 100644 --- a/tests/thread_test.c +++ b/tests/thread_test.c @@ -88,36 +88,36 @@ static struct my_option my_long_options[] = { {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"database", 'D', "Database to use", (uchar**) &database, (uchar**) &database, + {"database", 'D', "Database to use", &database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host", (uchar**) &host, (uchar**) &host, 0, GET_STR, + {"host", 'h', "Connect to host", &host, &host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"user", 'u', "User for login if not current user", (uchar**) &user, - (uchar**) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"user", 'u', "User for login if not current user", &user, + &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"version", 'V', "Output version information and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"verbose", 'v', "Write some progress indicators", (uchar**) &verbose, - (uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"query", 'Q', "Query to execute in each threads", (uchar**) &query, - (uchar**) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"verbose", 'v', "Write some progress indicators", &verbose, + &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"query", 'Q', "Query to execute in each threads", &query, + &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " #if MYSQL_PORT_DEFAULT == 0 "/etc/services, " #endif "built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").", - (uchar**) &tcp_port, - (uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, - {"socket", 'S', "Socket file to use for connection", (uchar**) &unix_socket, - (uchar**) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + &tcp_port, + &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0}, + {"socket", 'S', "Socket file to use for connection", &unix_socket, + &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"test-count", 'c', "Run test count times (default %d)", - (uchar**) &number_of_tests, (uchar**) &number_of_tests, 0, GET_UINT, + &number_of_tests, &number_of_tests, 0, GET_UINT, REQUIRED_ARG, 1000, 0, 0, 0, 0, 0}, {"thread-count", 't', "Number of threads to start", - (uchar**) &number_of_threads, (uchar**) &number_of_threads, 0, GET_UINT, + &number_of_threads, &number_of_threads, 0, GET_UINT, REQUIRED_ARG, 2, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -- cgit v1.2.1