diff options
author | unknown <monty@mysql.com> | 2005-05-16 13:34:23 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-05-16 13:34:23 +0300 |
commit | 70c4325d67256c44c47d41b7ef68ef5e7e9a3751 (patch) | |
tree | c8f6b5c11c76bb9b2298a70403114f9d6e1b3695 | |
parent | 577f140e3f0010c2a50c988f523d66b9d5d27303 (diff) | |
download | mariadb-git-70c4325d67256c44c47d41b7ef68ef5e7e9a3751.tar.gz |
Fixed failing tests for not 32 bit intel machines
Fixed bug in mysql_stmt_fetch() when retrieving rows to return
mysql-test/r/ps.result:
Fix to not get warnings if mysql_client_test.test fails
mysql-test/t/index_merge_ror.test:
Proper fix for 64 bit intel (which gives uses another, equal good index)
mysql-test/t/ps.test:
Fix to not get warnings if mysql_client_test.test fails
sql-common/client.c:
More debugging
sql/sql_prepare.cc:
Fixed bug in mysql_stmt_fetch() when retrieving rows to return
sql/sql_select.cc:
More debugging
tests/mysql_client_test.c:
More debugging
-rw-r--r-- | mysql-test/r/ps.result | 1 | ||||
-rw-r--r-- | mysql-test/t/index_merge_ror.test | 2 | ||||
-rw-r--r-- | mysql-test/t/ps.test | 3 | ||||
-rw-r--r-- | sql-common/client.c | 9 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 10 | ||||
-rw-r--r-- | sql/sql_select.cc | 4 | ||||
-rw-r--r-- | tests/mysql_client_test.c | 9 |
7 files changed, 25 insertions, 13 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index c84c62442ef..8371437d664 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -1,4 +1,5 @@ drop table if exists t1,t2; +drop database if exists client_test_db; create table t1 ( a int primary key, diff --git a/mysql-test/t/index_merge_ror.test b/mysql-test/t/index_merge_ror.test index 15c596ce149..48fe5526f11 100644 --- a/mysql-test/t/index_merge_ror.test +++ b/mysql-test/t/index_merge_ror.test @@ -185,7 +185,7 @@ explain select st_a from t1 ignore index (st_a) where st_a=1 and st_b=1; # # Different value on 32 and 64 bit ---replace sta_swt12a sta_swt21a +--replace_result sta_swt12a sta_swt21a sta_swt12a, sta_swt12a, explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1; explain select * from t1 where st_b=1 and swt1b=1 and swt2b=1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index b06d3c4caf0..f4396e41a20 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -3,6 +3,9 @@ # --disable_warnings drop table if exists t1,t2; + +# Avoid wrong warnings if mysql_client_test fails +drop database if exists client_test_db; --enable_warnings create table t1 diff --git a/sql-common/client.c b/sql-common/client.c index 4cbdb4b8e0d..0bebcb0065d 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -650,6 +650,7 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, NET *net= &mysql->net; my_bool result= 1; init_sigpipe_variables + DBUG_ENTER("cli_advanced_command"); /* Don't give sigpipe errors if the client doesn't want them */ set_sigpipe(mysql); @@ -657,13 +658,13 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, if (mysql->net.vio == 0) { /* Do reconnect if possible */ if (mysql_reconnect(mysql)) - return 1; + DBUG_RETURN(1); } if (mysql->status != MYSQL_STATUS_READY) { DBUG_PRINT("error",("state: %d", mysql->status)); set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); - return 1; + DBUG_RETURN(1); } net->last_error[0]=0; @@ -702,7 +703,8 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, 1 : 0); end: reset_sigpipe(mysql); - return result; + DBUG_PRINT("exit",("result: %d", result)); + DBUG_RETURN(result); } void free_old_query(MYSQL *mysql) @@ -2458,6 +2460,7 @@ get_info: mysql->status= MYSQL_STATUS_GET_RESULT; mysql->field_count= (uint) field_count; mysql->warning_count= 0; + DBUG_PRINT("exit",("ok")); DBUG_RETURN(0); } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index b36d835a80a..1521b206e0d 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1934,12 +1934,12 @@ void reset_stmt_for_execute(THD *thd, LEX *lex) } -/* - Clears parameters from data left from previous execution or long data +/* + Clears parameters from data left from previous execution or long data SYNOPSIS reset_stmt_params() - stmt - prepared statement for which parameters should be reset + stmt prepared statement for which parameters should be reset */ static void reset_stmt_params(Prepared_statement *stmt) @@ -1955,6 +1955,7 @@ static void reset_stmt_params(Prepared_statement *stmt) Executes previously prepared query. If there is any parameters, then replace markers with the data supplied from client, and then execute the query. + SYNOPSIS mysql_stmt_execute() thd Current thread @@ -2208,7 +2209,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) { /* assume there is always place for 8-16 bytes */ ulong stmt_id= uint4korr(packet); - ulong num_rows= uint4korr(packet+=4); + ulong num_rows= uint4korr(packet+4); Statement *stmt; DBUG_ENTER("mysql_stmt_fetch"); @@ -2266,7 +2267,6 @@ void mysql_stmt_reset(THD *thd, char *packet) /* There is always space for 4 bytes in buffer */ ulong stmt_id= uint4korr(packet); Prepared_statement *stmt; - DBUG_ENTER("mysql_stmt_reset"); if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset"))) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5ba157cb608..b0d749889bf 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1834,13 +1834,14 @@ Cursor::fetch(ulong num_rows) THD *thd= join->thd; JOIN_TAB *join_tab= join->join_tab + join->const_tables; enum_nested_loop_state error= NESTED_LOOP_OK; + DBUG_ENTER("Cursor::fetch"); + DBUG_PRINT("enter",("rows: %lu", num_rows)); /* save references to memory, allocated during fetch */ thd->set_n_backup_item_arena(this, &thd->stmt_backup); join->fetch_limit+= num_rows; - error= sub_select(join, join_tab, 0); if (error == NESTED_LOOP_OK || error == NESTED_LOOP_NO_MORE_ROWS) error= sub_select(join,join_tab,1); @@ -1873,6 +1874,7 @@ Cursor::fetch(ulong num_rows) else if (error != NESTED_LOOP_KILLED) my_message(ER_OUT_OF_RESOURCES, ER(ER_OUT_OF_RESOURCES), MYF(0)); } + DBUG_VOID_RETURN; } diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index da57fbabaf2..3cfed31c750 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -71,7 +71,7 @@ static const char *embedded_server_groups[]= { static time_t start_time, end_time; static double total_time; -const char *default_dbug_option= "d:t:o,/tmp/client_test.trace"; +const char *default_dbug_option= "d:t:o,/tmp/mysql_client_test.trace"; struct my_tests_st { @@ -12942,6 +12942,7 @@ static void test_bug9478() char a[6]; ulong a_len; int rc, i; + DBUG_ENTER("test_bug9478"); myheader("test_bug9478"); @@ -13014,6 +13015,7 @@ static void test_bug9478() for (i= 0; i < 5; i++) { + DBUG_PRINT("loop",("i: %d", i)); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); rc= mysql_stmt_fetch(stmt); @@ -13029,10 +13031,10 @@ static void test_bug9478() */ { char buff[9]; - bzero(buff, sizeof(buff)); /* Fill in the execute packet */ int4store(buff, stmt->stmt_id); - int4store(buff+5, 1); + buff[4]= 0; /* Flag */ + int4store(buff+5, 1); /* Return 1 row */ rc= ((*mysql->methods->advanced_command)(mysql, COM_EXECUTE, buff, sizeof(buff), 0,0,1) || (*mysql->methods->read_query_result)(mysql)); @@ -13072,6 +13074,7 @@ static void test_bug9478() rc= mysql_query(mysql, "drop table t1"); myquery(rc); + DBUG_VOID_RETURN; } |