Commit a74811e7 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

64-bit portability fixes in network I/O

use $MAX_TABLES mysqltest variable to make join test portable
make test now works with the manager on IA64 Linux
parent 2d3f96b4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2158,12 +2158,15 @@ static void var_from_env(const char* name, const char* def_val)

static void init_var_hash()
{
  VAR* v;
  if (hash_init(&var_hash, 1024, 0, 0, get_var_key, var_free, MYF(0)))
    die("Variable hash initialization failed");
  var_from_env("MASTER_MYPORT", "9306");
  var_from_env("SLAVE_MYPORT", "9307");
  var_from_env("MYSQL_TEST_DIR", "/tmp");
  var_from_env("BIG_TEST", opt_big_test ? "1" : "0");
  v=var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "63",0);
  hash_insert(&var_hash, (byte*)v);
}


+5 −4
Original line number Diff line number Diff line
@@ -905,7 +905,8 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
static MYSQL_DATA *read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
			     uint fields)
{
  uint	field,pkt_len;
  uint	field;
  ulong pkt_len;
  ulong len;
  uchar *cp;
  char	*to;
@@ -991,7 +992,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
  ulong pkt_len,len;
  uchar *pos,*prev_pos;

  if ((pkt_len=(uint) net_safe_read(mysql)) == packet_error)
  if ((pkt_len=net_safe_read(mysql)) == packet_error)
    return -1;
  if (pkt_len == 1 && mysql->net.read_pos[0] == 254)
    return 1;				/* End of data */
@@ -1453,7 +1454,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
  my_socket	sock;
  uint32	ip_addr;
  struct	sockaddr_in sock_addr;
  uint		pkt_length;
  ulong		pkt_length;
  NET		*net= &mysql->net;
#ifdef __WIN__
  HANDLE	hPipe=INVALID_HANDLE_VALUE;
@@ -2135,7 +2136,7 @@ int STDCALL mysql_read_query_result(MYSQL *mysql)
  uchar *pos;
  ulong field_count;
  MYSQL_DATA *fields;
  uint length;
  ulong length;
  DBUG_ENTER("mysql_read_query_result");

  /* read from the connection which we actually used, which
+2 −2
Original line number Diff line number Diff line
@@ -674,8 +674,8 @@ start_master()
    elif [ x$DO_GDB = x1 ]
    then
      $ECHO "set args $master_args" > $GDB_MASTER_INIT
      manager_launch master $XTERM -display :0 -title "Master" -e gdb -x \
       $GDB_MASTER_INIT $MYSQLD 
      manager_launch master $XTERM -display $DISPLAY \
      -title "Master" -e gdb -x $GDB_MASTER_INIT $MYSQLD 
    else	    
      manager_launch master $MYSQLD $master_args  
    fi  
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ a
1
2
select t1.a from t1 as t1 left join t1 as t2 using (a) left join t1 as t3 using (a) left join t1 as t4 using (a) left join t1 as t5 using (a) left join t1 as t6 using (a) left join t1 as t7 using (a) left join t1 as t8 using (a) left join t1 as t9 using (a) left join t1 as t10 using (a) left join t1 as t11 using (a) left join t1 as t12 using (a) left join t1 as t13 using (a) left join t1 as t14 using (a) left join t1 as t15 using (a) left join t1 as t16 using (a) left join t1 as t17 using (a) left join t1 as t18 using (a) left join t1 as t19 using (a) left join t1 as t20 using (a) left join t1 as t21 using (a) left join t1 as t22 using (a) left join t1 as t23 using (a) left join t1 as t24 using (a) left join t1 as t25 using (a) left join t1 as t26 using (a) left join t1 as t27 using (a) left join t1 as t28 using (a) left join t1 as t29 using (a) left join t1 as t30 using (a) left join t1 as t31 using (a) left join t1 as t32 using (a) left join t1 as t33 using (a) left join t1 as t34 using (a) left join t1 as t35 using (a) left join t1 as t36 using (a) left join t1 as t37 using (a) left join t1 as t38 using (a) left join t1 as t39 using (a) left join t1 as t40 using (a) left join t1 as t41 using (a) left join t1 as t42 using (a) left join t1 as t43 using (a) left join t1 as t44 using (a) left join t1 as t45 using (a) left join t1 as t46 using (a) left join t1 as t47 using (a) left join t1 as t48 using (a) left join t1 as t49 using (a) left join t1 as t50 using (a) left join t1 as t51 using (a) left join t1 as t52 using (a) left join t1 as t53 using (a) left join t1 as t54 using (a) left join t1 as t55 using (a) left join t1 as t56 using (a) left join t1 as t57 using (a) left join t1 as t58 using (a) left join t1 as t59 using (a) left join t1 as t60 using (a) left join t1 as t61 using (a) left join t1 as t62 using (a) left join t1 as t63 using (a) left join t1 as t64 using (a) left join t1 as t65 using (a);
Too many tables. MySQL can only use 31 tables in a join
Too many tables. MySQL can only use $MAX_TABLES tables in a join
drop table t1;
CREATE TABLE t1 (
a int(11) NOT NULL,
+1 −1
Original line number Diff line number Diff line
#
# This failed for lia Perminov
#

eval_result; # because MAX_TABLES is different on 64-bit system
drop table if exists t1,t2;
create table t1 (id int primary key);
create table t2 (id int);
Loading