Commit 70c4325d authored by unknown's avatar unknown
Browse files

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
parent 577f140e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
drop table if exists t1,t2;
drop database if exists client_test_db;
create table t1
(
a int primary key,
+1 −1
Original line number Diff line number Diff line
@@ -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;
+3 −0
Original line number Diff line number Diff line
@@ -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
+6 −3
Original line number Diff line number Diff line
@@ -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 @@ static my_bool cli_read_query_result(MYSQL *mysql)
  mysql->status= MYSQL_STATUS_GET_RESULT;
  mysql->field_count= (uint) field_count;
  mysql->warning_count= 0;
  DBUG_PRINT("exit",("ok"));
  DBUG_RETURN(0);
}

+5 −5
Original line number Diff line number Diff line
@@ -1939,7 +1939,7 @@ void reset_stmt_for_execute(THD *thd, LEX *lex)
    
  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")))
Loading