Commit b08b3a15 authored by unknown's avatar unknown
Browse files

Cleanup during review

Simple optimization for 2 argument usage to function of variable arguments
Fix stack overrun when using 1+1+1+1+1+1+1+....
Update crash-me results for 5.0
Don't call post_open if pre_open() fails (optimization)



sql-bench/limits/mysql-4.1.cfg:
  Rename: sql-bench/limits/mysql.cfg -> sql-bench/limits/mysql-4.1.cfg
libmysql/libmysql.c:
  More portable define
mysql-test/mysql-test-run.sh:
  Write also InnoDB warnings to warnings.log
mysql-test/t/type_newdecimal.test:
  Don't get errors if innodb is not defined
mysys/my_alloc.c:
  Cleanup comments
mysys/thr_lock.c:
  Cleanup comments
sql/item.h:
  Remove not needed initializer
sql/item_func.cc:
  Simple optimization for 2 argument usage to function of variable arguments
sql/mysql_priv.h:
  We use more stackspace with the introduction of int_op() etc.
  This change ensures we don't run out of stack when doing 1+1+1+1...
  (Tested on x86, 32 bit)
sql/sp_head.cc:
  Don't call post_open if pre_open() fails
sql/sp_rcontext.cc:
  More comments
  Change so that post_open() doesn't have to be called if pre_open() fails
sql/sql_parse.cc:
  Fold long lines
sql/sql_select.cc:
  Simple reorganization to reduce number of if's
  Ensure that table_map is updated for where clause (fixed warning from valgrind)
parent 906b210a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1738,7 +1738,7 @@ myodbc_remove_escape(MYSQL *mysql,char *name)

/* Default number of rows fetched per one COM_FETCH command. */

#define DEFAULT_PREFETCH_ROWS 1UL
#define DEFAULT_PREFETCH_ROWS (ulong) 1

/*
  These functions are called by function pointer MYSQL_STMT::read_row_func.
+1 −1
Original line number Diff line number Diff line
@@ -887,7 +887,7 @@ report_stats () {

    found_error=0
    # Find errors
    for i in "^Warning:" "^Error:" "^==.* at 0x"
    for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning"
    do
      if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
      then
+2 −0
Original line number Diff line number Diff line
@@ -911,7 +911,9 @@ DROP TABLE t1;
# Bug #10465
#

--disable_warnings
CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
--enable_warnings
INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
SELECT GRADE  FROM t1 WHERE GRADE > 160 AND GRADE < 300;
SELECT GRADE  FROM t1 WHERE GRADE= 151;
+6 −4
Original line number Diff line number Diff line
@@ -39,10 +39,11 @@
  DESCRIPTION
    This function prepares memory root for further use, sets initial size of
    chunk for memory allocation and pre-allocates first block if specified.
    Altough error can happen during execution of this function if pre_alloc_size
    is non-0 it won't be reported. Instead it will be reported as error in first
    alloc_root() on this memory root.
    Altough error can happen during execution of this function if
    pre_alloc_size is non-0 it won't be reported. Instead it will be
    reported as error in first alloc_root() on this memory root.
*/

void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
		     uint pre_alloc_size __attribute__((unused)))
{
@@ -71,6 +72,7 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
  DBUG_VOID_RETURN;
}


/*
  SYNOPSIS
    reset_root_defaults()
+4 −2
Original line number Diff line number Diff line
@@ -684,8 +684,10 @@ void thr_unlock(THR_LOCK_DATA *data)
    lock->read.last=data->prev;
  else if (lock_type == TL_WRITE_DELAYED && data->cond)
  {
    /* This only happens in extreme circumstances when a 
       write delayed lock that is waiting for a lock */
    /*
      This only happens in extreme circumstances when a 
      write delayed lock that is waiting for a lock
    */
    lock->write_wait.last=data->prev;		/* Put it on wait queue */
  }
  else
Loading