Commit 7cb4b7c1 authored by gkodinov/kgeorge@macbook.gmz's avatar gkodinov/kgeorge@macbook.gmz
Browse files

fixed warnings and compile errors from the fix for bug 26243

parent d0b1e944
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1763,15 +1763,18 @@ AC_ARG_WITH(debug,
if test "$with_debug" = "yes"
then
  # Medium debug.
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
  CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS"
  CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS"
elif test "$with_debug" = "full"
then
  # Full debug. Very slow in some cases
  AC_DEFINE([DBUG_ON], [1], [Use libdbug])
  CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS"
  CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS"
else
  # Optimized version. No debug
  AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug])
  CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS"
  CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS"
fi
+0 −2
Original line number Diff line number Diff line
@@ -617,7 +617,6 @@ int main(int argc, char *argv[])
static int get_options(int argc,char *argv[])
{
  char *pos,*progname;
  DEBUGGER_OFF;

  progname= argv[0];

@@ -646,7 +645,6 @@ static int get_options(int argc,char *argv[])
      printf("Usage: %s [-?ABIKLsWv] [-m#] [-t#]\n",progname);
      exit(0);
    case '#':
      DEBUGGER_ON;
      DBUG_PUSH (++pos);
      break;
    }
+1 −1
Original line number Diff line number Diff line
@@ -2444,7 +2444,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
  my_bool res;

  DBUG_ENTER("execute");
  DBUG_DUMP("packet", packet, length);
  DBUG_DUMP("packet", (uchar*)packet, length);

  mysql->last_used_con= mysql;
  int4store(buff, stmt->stmt_id);		/* Send stmt id to server */
+10 −10
Original line number Diff line number Diff line
@@ -741,7 +741,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
  char llbuff[22];
  uint diff_pos[2];
  DBUG_ENTER("chk_index");
  DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
  DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff));

  /* TODO: implement appropriate check for RTree keys */
  if (keyinfo->flag & HA_SPATIAL)
@@ -799,9 +799,9 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
	(flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length,
			 comp_flag, diff_pos)) >=0)
    {
      DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length);
      DBUG_DUMP("new",(byte*) key, key_length);
      DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
      DBUG_DUMP("old",(uchar*) info->lastkey, info->lastkey_length);
      DBUG_DUMP("new",(uchar*) key, key_length);
      DBUG_DUMP("new_in_page",(uchar*) old_keypos,(uint) (keypos-old_keypos));

      if (comp_flag & SEARCH_FIND && flag == 0)
	mi_check_print_error(param,"Found duplicated key at page %s",llstr(page,llbuff));
@@ -870,8 +870,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
      DBUG_PRINT("test",("page: %s  record: %s  filelength: %s",
			 llstr(page,llbuff),llstr(record,llbuff2),
			 llstr(info->state->data_file_length,llbuff3)));
      DBUG_DUMP("key",(byte*) key,key_length);
      DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
      DBUG_DUMP("key",(uchar*) key,key_length);
      DBUG_DUMP("new_in_page",(uchar*) old_keypos,(uint) (keypos-old_keypos));
      goto err;
    }
    param->record_checksum+=(ha_checksum) record;
@@ -1631,7 +1631,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
    {
      if (my_errno != HA_ERR_FOUND_DUPP_KEY)
	goto err;
      DBUG_DUMP("record",(byte*) sort_param.record,share->base.pack_reclength);
      DBUG_DUMP("record",(uchar*) sort_param.record,share->base.pack_reclength);
      mi_check_print_info(param,"Duplicate key %2d for record at %10s against new record at %10s",
			  info->errkey+1,
			  llstr(sort_param.start_recpos,llbuff),
@@ -2062,7 +2062,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
		     ("From page: %ld, keyoffset: %lu  used_length: %d",
		      (ulong) pagepos, (ulong) (keypos - buff),
		      (int) used_length));
	  DBUG_DUMP("buff",(byte*) buff,used_length);
	  DBUG_DUMP("buff",(uchar*) buff,used_length);
	  goto err;
	}
      }
@@ -4024,7 +4024,7 @@ static int sort_insert_key(MI_SORT_PARAM *sort_param,
  else if (my_pwrite(info->s->kfile,(byte*) anc_buff,
		     (uint) keyinfo->block_length,filepos, param->myf_rw))
    DBUG_RETURN(1);
  DBUG_DUMP("buff",(byte*) anc_buff,mi_getint(anc_buff));
  DBUG_DUMP("buff",(uchar*) anc_buff,mi_getint(anc_buff));

	/* Write separator-key to block in next level */
  if (sort_insert_key(sort_param,key_block+1,key_block->lastkey,filepos))
@@ -4129,7 +4129,7 @@ int flush_pending_blocks(MI_SORT_PARAM *sort_param)
    else if (my_pwrite(info->s->kfile,(byte*) key_block->buff,
		       (uint) keyinfo->block_length,filepos, myf_rw))
      DBUG_RETURN(1);
    DBUG_DUMP("buff",(byte*) key_block->buff,length);
    DBUG_DUMP("buff",(uchar*) key_block->buff,length);
    nod_flag=1;
  }
  info->s->state.key_root[sort_param->key]=filepos; /* Last is root for tree */
+11 −11
Original line number Diff line number Diff line
@@ -223,7 +223,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
  my_off_t leaf_page,next_block;
  uchar lastkey[MI_MAX_KEY_BUFF];
  DBUG_ENTER("d_search");
  DBUG_DUMP("page",(byte*) anc_buff,mi_getint(anc_buff));
  DBUG_DUMP("page",(uchar*) anc_buff,mi_getint(anc_buff));

  search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY;
  flag=(*keyinfo->bin_search)(info,keyinfo,anc_buff,key, search_key_length,
@@ -381,7 +381,7 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
    ret_value|=_mi_write_keypage(info,keyinfo,page,DFLT_INIT_HITS,anc_buff);
  else
  {
    DBUG_DUMP("page",(byte*) anc_buff,mi_getint(anc_buff));
    DBUG_DUMP("page",(uchar*) anc_buff,mi_getint(anc_buff));
  }
  my_afree((byte*) leaf_buff);
  DBUG_PRINT("exit",("Return: %d",ret_value));
@@ -411,7 +411,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
  DBUG_ENTER("del");
  DBUG_PRINT("enter",("leaf_page: %ld  keypos: 0x%lx", (long) leaf_page,
		      (ulong) keypos));
  DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
  DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff));

  endpos=leaf_buff+mi_getint(leaf_buff);
  if (!(key_start=_mi_get_last_key(info,keyinfo,leaf_buff,keybuff,endpos,
@@ -428,7 +428,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
      ret_value= -1;
    else
    {
      DBUG_DUMP("next_page",(byte*) next_buff,mi_getint(next_buff));
      DBUG_DUMP("next_page",(uchar*) next_buff,mi_getint(next_buff));
      if ((ret_value=del(info,keyinfo,key,anc_buff,next_page,next_buff,
			 keypos,next_block,ret_key)) >0)
      {
@@ -517,8 +517,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
  DBUG_ENTER("underflow");
  DBUG_PRINT("enter",("leaf_page: %ld  keypos: 0x%lx",(long) leaf_page,
		      (ulong) keypos));
  DBUG_DUMP("anc_buff",(byte*) anc_buff,mi_getint(anc_buff));
  DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
  DBUG_DUMP("anc_buff",(uchar*) anc_buff,mi_getint(anc_buff));
  DBUG_DUMP("leaf_buff",(uchar*) leaf_buff,mi_getint(leaf_buff));

  buff=info->buff;
  info->buff_used=1;
@@ -554,7 +554,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
    if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,buff,0))
      goto err;
    buff_length=mi_getint(buff);
    DBUG_DUMP("next",(byte*) buff,buff_length);
    DBUG_DUMP("next",(uchar*) buff,buff_length);

    /* find keys to make a big key-page */
    bmove((byte*) next_keypos-key_reflength,(byte*) buff+2,
@@ -659,7 +659,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
      goto err;
  buff_length=mi_getint(buff);
  endpos=buff+buff_length;
  DBUG_DUMP("prev",(byte*) buff,buff_length);
  DBUG_DUMP("prev",(uchar*) buff,buff_length);

  /* find keys to make a big key-page */
  bmove((byte*) next_keypos - key_reflength,(byte*) leaf_buff+2,
@@ -715,8 +715,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
      goto err;
    _mi_kpointer(info,leaf_key+key_length,leaf_page);
    /* Save key in anc_buff */
    DBUG_DUMP("anc_buff",(byte*) anc_buff,anc_length);
    DBUG_DUMP("key_to_anc",(byte*) leaf_key,key_length);
    DBUG_DUMP("anc_buff",(uchar*) anc_buff,anc_length);
    DBUG_DUMP("key_to_anc",(uchar*) leaf_key,key_length);

    temp_pos=anc_buff+anc_length;
    t_length=(*keyinfo->pack_key)(keyinfo,key_reflength,
@@ -737,7 +737,7 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
      bmove((byte*) leaf_buff+2,(byte*) half_pos-nod_flag,(size_t) nod_flag);
    if (!(length=(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key)))
      goto err;
    DBUG_DUMP("key_to_leaf",(byte*) leaf_key,length);
    DBUG_DUMP("key_to_leaf",(uchar*) leaf_key,length);
    t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, (uchar*) 0,
				  (uchar*) 0, (uchar*) 0, leaf_key, &s_temp);
    length=(uint) ((buff+buff_length)-half_pos);
Loading