Commit c1b5a5b0 authored by monty@donna.mysql.com's avatar monty@donna.mysql.com
Browse files

Removed not used variable 'last_ref'

Fixed problem with negative DECIMAL() keys
Fixed some bugs with NULL keys in BDB
More mysql-test tests
parent 3857c6a3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -40383,6 +40383,8 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.31
@itemize @bullet
@item
Fixed problem when using @code{DECIMAL()} keys on negative numbers.
@item
@code{HOUR()} on a @code{CHAR} column always returned @code{NULL}.
@item
Fixed security bug in something (please upgrade if you are using a earlier
+34 −22
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@
#define INIT_Q_LINES	  1024
#define MIN_VAR_ALLOC	  32
#define BLOCK_STACK_DEPTH  32
#define MAX_EXPECTED_ERRORS 10

static int record = 0, verbose = 0, silent = 0, opt_sleep=0;
static char *db = 0, *pass=0;
@@ -88,7 +89,7 @@ static char TMPDIR[FN_REFLEN];

static int block_stack[BLOCK_STACK_DEPTH];
static int *cur_block, *block_stack_end;
static uint global_expected_errno=0;
static uint global_expected_errno[MAX_EXPECTED_ERRORS];

DYNAMIC_ARRAY q_lines;

@@ -132,7 +133,7 @@ struct st_query
  char *query, *first_argument;
  int first_word_len;
  my_bool abort_on_error, require_file;
  uint expected_errno;
  uint expected_errno[MAX_EXPECTED_ERRORS];
  char record_file[FN_REFLEN];
  /* Add new commands before Q_UNKNOWN */
  enum { Q_CONNECTION=1, Q_QUERY, Q_CONNECT,
@@ -542,17 +543,24 @@ static void get_file_name(char *filename, struct st_query* q)
}


static int get_int(struct st_query* q)
static void get_ints(uint *to,struct st_query* q)
{
  char* p=q->first_argument;
  int res;
  DBUG_ENTER("get_int");
  long val;
  DBUG_ENTER("get_ints");

  while (*p && isspace(*p)) p++;
  if (!*p)
    die("Missing argument in %s\n", q->query);
  res=atoi(p);
  DBUG_PRINT("result",("res: %d",res));
  DBUG_RETURN(res);

  for (; (p=str2int(p,10,(long) INT_MIN, (long) INT_MAX, &val)) ; p++)
  {
    *to++= (uint) val;
    if (*p != ',')
      break;
  }
  *to++=0;					/* End of data */
  DBUG_VOID_RETURN;
}


@@ -918,9 +926,10 @@ int read_query(struct st_query** q_ptr)
  q->record_file[0] = 0;
  q->require_file=0;
  q->first_word_len = 0;
  q->expected_errno = global_expected_errno;
  q->abort_on_error = global_expected_errno == 0;
  global_expected_errno=0;
  memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
	 sizeof(global_expected_errno));
  q->abort_on_error = global_expected_errno[0] == 0;
  bzero((gptr) global_expected_errno,sizeof(global_expected_errno));
  q->type = Q_UNKNOWN;
  q->query=0;
  if (read_line(read_query_buf, sizeof(read_query_buf)))
@@ -947,7 +956,8 @@ int read_query(struct st_query** q_ptr)
	p++;
	for (;isdigit(*p);p++)
	  expected_errno = expected_errno * 10 + *p - '0';
	q->expected_errno = expected_errno;
	q->expected_errno[0] = expected_errno;
	q->expected_errno[1] = 0;
      }
    }

@@ -1178,15 +1188,17 @@ int run_query(MYSQL* mysql, struct st_query* q)
	  mysql_errno(mysql), mysql_error(mysql));
    else
    {
      if (q->expected_errno)
      for (i=0 ; q->expected_errno[i] ; i++)
      {
	if ((q->expected_errno[i] == mysql_errno(mysql)))
	  goto end;				/* Ok */
      }
      if (i)
      {
	error = (q->expected_errno != mysql_errno(mysql));
	if (error)
	verbose_msg("query '%s' failed with wrong errno\
 %d instead of %d", q->query, mysql_errno(mysql), q->expected_errno);
 %d instead of %d...", q->query, mysql_errno(mysql), q->expected_errno[0]);
	goto end;
      }

      verbose_msg("query '%s' failed: %d: %s", q->query, mysql_errno(mysql),
		  mysql_error(mysql));
      /* if we do not abort on error, failure to run the query does
@@ -1196,11 +1208,11 @@ int run_query(MYSQL* mysql, struct st_query* q)
    }
  }

  if (q->expected_errno)
  if (q->expected_errno[0])
  {
    error = 1;
    verbose_msg("query '%s' succeeded - should have failed with errno %d",
		q->query, q->expected_errno);
    verbose_msg("query '%s' succeeded - should have failed with errno %d...",
		q->query, q->expected_errno[0]);
    goto end;
  }

@@ -1373,7 +1385,7 @@ int main(int argc, char** argv)
	require_file=0;
	break;
      case Q_ERROR:
	global_expected_errno=get_int(q);
	get_ints(global_expected_errno,q);
	break;
      case Q_REQUIRE:
	get_file_name(save_file,q);
+2 −1
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ ulong heap_position_old(HP_INFO *info)
/* Note that heap_info does NOT return information about the
   current position anymore;  Use heap_position instead */

int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x,int flag)
int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x,
	      int flag __attribute__((unused)))
{
  DBUG_ENTER("heap_info");
  x->records	 = info->s->records;
+28 −3
Original line number Diff line number Diff line
@@ -29,11 +29,36 @@ extern "C" {
struct st_thr_lock;

enum thr_lock_type { TL_IGNORE=-1,
		     TL_UNLOCK, TL_READ,  TL_READ_HIGH_PRIORITY,
		     TL_UNLOCK,			/* UNLOCK ANY LOCK */
		     TL_READ,			/* Read lock */
		     /* High prior. than TL_WRITE. Allow concurrent insert */
		     TL_READ_HIGH_PRIORITY,
		     /* READ, Don't allow concurrent insert */
		     TL_READ_NO_INSERT,
		     TL_WRITE_ALLOW_WRITE, TL_WRITE_ALLOW_READ,
		     /* 
			Write lock, but allow other threads to read / write.
			Used by BDB tables in MySQL to mark that someone is
			reading/writing to the table.
		      */
		     TL_WRITE_ALLOW_WRITE,
		     /*
			Write lock, but allow other threads to read / write.
			Used by ALTER TABLE in MySQL to mark to allow readers
			to use the table until ALTER TABLE is finished.
		     */
		     TL_WRITE_ALLOW_READ,
		     /*
		       WRITE lock used by concurrent insert. Will allow
		       READ, if one could use concurrent insert on table.
		     */
		     TL_WRITE_CONCURRENT_INSERT,
		     TL_WRITE_DELAYED, TL_WRITE_LOW_PRIORITY, TL_WRITE,
		     /* Write used by INSERT DELAYED.  Allows READ locks */
		     TL_WRITE_DELAYED,
		     /* WRITE lock that has lower priority than TL_READ */
		     TL_WRITE_LOW_PRIORITY,
		     /* Normal WRITE lock */
		     TL_WRITE,
		     /* Abort new lock request with an error */
		     TL_WRITE_ONLY};

extern ulong max_write_lock_count;
+7 −6
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ static int compress(MRG_INFO *mrg,char *result_table)
  if (verbose && mrg->records)
    printf("Min record length: %6d   Max length: %6d   Mean total length: %6lu\n",
	   mrg->min_pack_length,mrg->max_pack_length,
	   (ulong) new_length/mrg->records);
	   (ulong) (new_length/mrg->records));

  if (!test_only)
  {
@@ -763,11 +763,11 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
	{
	  global_count=count;
	  if (!(element=tree_insert(&count->int_tree,pos,0)) ||
	      (element->count == 1 &&
	      ((element->count == 1 &&
	       count->tree_buff + tree_buff_length <
	       count->tree_pos + count->field_length ||
	       count->field_length == 1 &&
	       count->int_tree.elements_in_tree > 1))
	       count->tree_pos + count->field_length) ||
	       (count->field_length == 1 &&
		count->int_tree.elements_in_tree > 1)))
	  {
	    delete_tree(&count->int_tree);
	    my_free(count->tree_buff,MYF(0));
@@ -862,7 +862,8 @@ static int get_statistic(MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
  DBUG_RETURN(0);
}

static int compare_huff_elements(void *not_used, byte *a, byte *b)
static int compare_huff_elements(void *not_used __attribute__((unused)),
				 byte *a, byte *b)
{
  return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
    (*((my_off_t*) a) == *((my_off_t*) b)  ? 0 : 1);
Loading