After merge fixes

Note: The following tests fails
- fulltext (Sergei has promised to fix)
- rpl_charset (Guilhem should fix)
- rpl_timezone (Dimitray has promised to fix)

Sanja needs to check out the calling of close_thread_tables() in sp_head.cc


myisam/mi_check.c:
  After merge fix
myisam/sort.c:
  After merge fix
mysql-test/mysql-test-run.sh:
  Export master socket to mysqltest
mysql-test/r/func_group.result:
  Make result repeatable
mysql-test/r/mysqlbinlog.result:
  After merge fix
mysql-test/r/ps_1general.result:
  After merge fix
mysql-test/r/ps_2myisam.result:
  After merge fix
mysql-test/r/ps_3innodb.result:
  After merge fix
mysql-test/r/ps_4heap.result:
  After merge fix
mysql-test/r/ps_5merge.result:
  After merge fix
mysql-test/r/ps_6bdb.result:
  After merge fix
mysql-test/r/rpl_flush_log_loop.result:
  After merge fix
mysql-test/r/rpl_replicate_do.result:
  After merge fix
mysql-test/r/rpl_temporary.result:
  After merge fix
mysql-test/r/rpl_timezone.result:
  After merge fix
  Note that this test fails now (Dimitry has promised to fix this)
mysql-test/r/rpl_user_variables.result:
  After merge fix
mysql-test/r/select.result:
  After merge fix
mysql-test/r/sp-error.result:
  After merge fix
mysql-test/r/sp-security.result:
  After merge fix
mysql-test/r/sp.result:
  After merge fix
mysql-test/r/user_var.result:
  After merge fix
mysql-test/r/variables.result:
  After merge fix
mysql-test/t/alter_table.test:
  After merge fix
mysql-test/t/derived.test:
  After merge fix
mysql-test/t/func_group.test:
  Make result repeatable
mysql-test/t/grant_cache.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/multi_update.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl000015.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl000017.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl000018.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl_charset.test:
  After merge fix
mysql-test/t/rpl_heap.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/rpl_rotate_logs.test:
  Use MASTER_MYSOCK instead of master.sock
mysql-test/t/sp-error.test:
  after merge fix
mysql-test/t/sp-security.test:
  after merge fix
mysql-test/t/user_var.test:
  after merge fix
scripts/mysql_fix_privilege_tables.sh:
  This can now be exectued from the source distribution
sql/handler.cc:
  Cleanup
sql/handler.h:
  More debugging
sql/item.h:
  Indentation fixes
sql/item_cmpfunc.cc:
  After merge fixes
sql/opt_range.cc:
  After merge fixes
sql/opt_range.h:
  After merge fixes
sql/sp.cc:
  After merge fixes
sql/sp_head.cc:
  Remove closing of thread tables in a SP function as this caused a core dump.
  (Has to be fixed better)
sql/sql_base.cc:
  More debugging
sql/sql_handler.cc:
  After merge fixes
  (We have to call ha_index_or_rnd_end() before calling close_thread_table())
sql/sql_parse.cc:
  More debugging
sql/sql_prepare.cc:
  After merge fixes
sql/sql_select.cc:
  After merge fixes
This commit is contained in:
unknown 2004-07-15 04:19:07 +03:00
parent 677d60bc61
commit 46ea874fb7
50 changed files with 286 additions and 248 deletions

View File

@ -2702,7 +2702,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
char llbuff[22],llbuff2[22]; char llbuff[22],llbuff2[22];
DBUG_ENTER("sort_get_next_record"); DBUG_ENTER("sort_get_next_record");
if (*killed_ptr(param->thd)) if (*killed_ptr(param))
DBUG_RETURN(1); DBUG_RETURN(1);
switch (share->data_file_type) { switch (share->data_file_type) {

View File

@ -852,7 +852,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
uchar *strpos; uchar *strpos;
BUFFPEK *buffpek,**refpek; BUFFPEK *buffpek,**refpek;
QUEUE queue; QUEUE queue;
int *killed= killed_ptr(info->sort_info->param->thd); int *killed= killed_ptr(info->sort_info->param);
DBUG_ENTER("merge_buffers"); DBUG_ENTER("merge_buffers");

View File

@ -527,8 +527,6 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
if [ -z "$MASTER_MYSQLD" ] if [ -z "$MASTER_MYSQLD" ]
then then
@ -580,6 +578,8 @@ if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then
XTERM=`which xterm` XTERM=`which xterm`
fi fi
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK
#++ #++
# Function Definitions # Function Definitions
#-- #--

View File

@ -321,6 +321,7 @@ insert into t2 values('DEN','Denver','CO','BDL');
insert into t2 values('SDC','San Diego','CA','TWU'); insert into t2 values('SDC','San Diego','CA','TWU');
insert into t2 values('NOL','New Orleans','LA','GTM'); insert into t2 values('NOL','New Orleans','LA','GTM');
insert into t2 values('LAK','Los Angeles','CA','TWU'); insert into t2 values('LAK','Los Angeles','CA','TWU');
insert into t2 values('AAA','AAA','AA','AME');
select * from t1; select * from t1;
a1 a2 a3 a4 a5 a1 a2 a3 a4 a5
AME 0 SEA 0.1 1942-02-19 AME 0 SEA 0.1 1942-02-19
@ -345,6 +346,7 @@ DEN Denver CO BDL
SDC San Diego CA TWU SDC San Diego CA TWU
NOL New Orleans LA GTM NOL New Orleans LA GTM
LAK Los Angeles CA TWU LAK Los Angeles CA TWU
AAA AAA AA AME
explain explain
select min(a1) from t1; select min(a1) from t1;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra

View File

@ -16,10 +16,9 @@ flush logs;
--- Local -- --- Local --
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
use test; use test;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0; SET @@session.sql_mode=0;
SET TIMESTAMP=1000000000;
drop table if exists t1,t2; drop table if exists t1,t2;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
create table t1 (word varchar(20)); create table t1 (word varchar(20));
@ -60,10 +59,10 @@ insert into t1 values ("Alas");
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
use test; use test;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
drop table if exists t1,t2;
SET TIMESTAMP=1000000000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0; SET @@session.sql_mode=0;
drop table if exists t1,t2;
SET TIMESTAMP=1000000000;
create table t1 (word varchar(20)); create table t1 (word varchar(20));
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
create table t2 (id int auto_increment not null primary key); create table t2 (id int auto_increment not null primary key);

View File

@ -418,7 +418,7 @@ def table 253 64 2 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 14 N 1 31 63 def Extra 253 255 14 N 1 31 63
@ -434,7 +434,7 @@ def table 253 64 2 N 1 31 63
def type 253 10 5 N 1 31 63 def type 253 10 5 N 1 31 63
def possible_keys 253 4096 7 Y 0 31 63 def possible_keys 253 4096 7 Y 0 31 63
def key 253 64 7 Y 0 31 63 def key 253 64 7 Y 0 31 63
def key_len 8 3 1 Y 32800 0 8 def key_len 253 4096 1 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 27 N 1 31 63 def Extra 253 255 27 N 1 31 63

View File

@ -567,7 +567,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
@ -638,7 +638,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63

View File

@ -548,15 +548,15 @@ def in_s 8 21 1 Y 32768 0 8
def in_row_s 8 21 1 Y 32768 0 8 def in_row_s 8 21 1 Y 32768 0 8
scalar_s exists_s in_s in_row_s scalar_s exists_s in_s in_row_s
2.0000 0 1 0 2.0000 0 1 0
18.0000 1 0 1
2.0000 0 1 0 2.0000 0 1 0
18.0000 1 0 1 18.0000 1 0 1
18.0000 1 0 1
execute stmt1 ; execute stmt1 ;
scalar_s exists_s in_s in_row_s scalar_s exists_s in_s in_row_s
2.0000 0 1 0 2.0000 0 1 0
18.0000 1 0 1
2.0000 0 1 0 2.0000 0 1 0
18.0000 1 0 1 18.0000 1 0 1
18.0000 1 0 1
set @stmt= concat('explain ',@stmt); set @stmt= concat('explain ',@stmt);
prepare stmt1 from @stmt ; prepare stmt1 from @stmt ;
execute stmt1 ; execute stmt1 ;
@ -567,13 +567,13 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2 6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
@ -581,8 +581,8 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
execute stmt1 ; execute stmt1 ;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2 6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
@ -617,16 +617,16 @@ def in_s 8 21 1 Y 32768 0 8
def in_row_s 8 21 1 Y 32768 0 8 def in_row_s 8 21 1 Y 32768 0 8
scalar_s exists_s in_s in_row_s scalar_s exists_s in_s in_row_s
2 0 1 0 2 0 1 0
18 1 0 1
2 0 1 0 2 0 1 0
18 1 0 1 18 1 0 1
18 1 0 1
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
@arg07, @arg08, @arg09 ; @arg07, @arg08, @arg09 ;
scalar_s exists_s in_s in_row_s scalar_s exists_s in_s in_row_s
2 0 1 0 2 0 1 0
18 1 0 1
2 0 1 0 2 0 1 0
18 1 0 1 18 1 0 1
18 1 0 1
set @stmt= concat('explain ',@stmt); set @stmt= concat('explain ',@stmt);
prepare stmt1 from @stmt ; prepare stmt1 from @stmt ;
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
@ -638,13 +638,13 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2 6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
@ -653,8 +653,8 @@ id select_type table type possible_keys key key_len ref rows Extra
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
@arg07, @arg08, @arg09 ; @arg07, @arg08, @arg09 ;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
6 DERIVED t2 ALL NULL NULL NULL NULL 2 6 DERIVED t2 ALL NULL NULL NULL NULL 2
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where

View File

@ -568,7 +568,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
@ -639,7 +639,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63

View File

@ -610,7 +610,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
@ -681,7 +681,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
@ -1793,7 +1793,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
@ -1864,7 +1864,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63

View File

@ -567,7 +567,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63
@ -638,7 +638,7 @@ def table 253 64 16 N 1 31 63
def type 253 10 3 N 1 31 63 def type 253 10 3 N 1 31 63
def possible_keys 253 4096 0 Y 0 31 63 def possible_keys 253 4096 0 Y 0 31 63
def key 253 64 0 Y 0 31 63 def key 253 64 0 Y 0 31 63
def key_len 8 3 0 Y 32800 0 8 def key_len 253 4096 0 Y 0 31 63
def ref 253 1024 0 Y 0 31 63 def ref 253 1024 0 Y 0 31 63
def rows 8 10 1 N 32801 0 8 def rows 8 10 1 N 32801 0 8
def Extra 253 255 44 N 1 31 63 def Extra 253 255 44 N 1 31 63

View File

@ -14,4 +14,4 @@ start slave;
flush logs; flush logs;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 95 # # slave-bin.000001 Yes Yes 0 0 95 # None 0 No # # 127.0.0.1 root SLAVE_PORT 60 slave-bin.000001 199 # # slave-bin.000001 Yes Yes 0 0 199 # None 0 No #

View File

@ -28,4 +28,4 @@ ERROR 42S02: Table 'test.t11' doesn't exist
drop table if exists t1,t2,t11; drop table if exists t1,t2,t11;
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1473 # # master-bin.000001 Yes Yes test.t1 0 0 1473 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000001 1554 # # master-bin.000001 Yes Yes test.t1 0 0 1554 # None 0 No #

View File

@ -39,17 +39,18 @@ f
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4 master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 95 Query 1 174 use `test`; create table t1(f int) master-bin.000001 95 Query 1 178 use `test`; drop table if exists t1,t2
master-bin.000001 174 Query 1 253 use `test`; create table t2(f int) master-bin.000001 178 Query 1 257 use `test`; create table t1(f int)
master-bin.000001 253 Query 1 372 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10) master-bin.000001 257 Query 1 336 use `test`; create table t2(f int)
master-bin.000001 372 Query 1 461 use `test`; create temporary table t3(f int) master-bin.000001 336 Query 1 455 use `test`; insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)
master-bin.000001 461 Query 1 559 use `test`; insert into t3 select * from t1 where f<6 master-bin.000001 455 Query 1 544 use `test`; create temporary table t3(f int)
master-bin.000001 559 Query 1 648 use `test`; create temporary table t3(f int) master-bin.000001 544 Query 1 642 use `test`; insert into t3 select * from t1 where f<6
master-bin.000001 648 Query 1 743 use `test`; insert into t2 select count(*) from t3 master-bin.000001 642 Query 1 731 use `test`; create temporary table t3(f int)
master-bin.000001 743 Query 1 842 use `test`; insert into t3 select * from t1 where f>=4 master-bin.000001 731 Query 1 826 use `test`; insert into t2 select count(*) from t3
master-bin.000001 842 Query 1 922 use `test`; drop temporary table t3 master-bin.000001 826 Query 1 925 use `test`; insert into t3 select * from t1 where f>=4
master-bin.000001 922 Query 1 1017 use `test`; insert into t2 select count(*) from t3 master-bin.000001 925 Query 1 1005 use `test`; drop temporary table t3
master-bin.000001 1017 Query 1 1097 use `test`; drop temporary table t3 master-bin.000001 1005 Query 1 1100 use `test`; insert into t2 select count(*) from t3
master-bin.000001 1100 Query 1 1180 use `test`; drop temporary table t3
drop table t1, t2; drop table t1, t2;
use test; use test;
SET TIMESTAMP=1040323920; SET TIMESTAMP=1040323920;

View File

@ -31,14 +31,13 @@ t
2004-01-01 00:00:00 2004-01-01 00:00:00
2004-06-11 09:39:02 2004-06-11 09:39:02
show binlog events; show binlog events;
Log_name Pos Event_type Server_id Orig_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
master-bin.000001 79 Query 1 79 use `test`; create table t1 (t timestamp) master-bin.000001 95 Query 1 181 use `test`; create table t1 (t timestamp)
master-bin.000001 143 Query 1 143 use `test`; create table t2 (t char(32)) master-bin.000001 181 Query 1 266 use `test`; create table t2 (t char(32))
master-bin.000001 206 Query 1 206 use `test`; SET ONE_SHOT TIME_ZONE='UTC' master-bin.000001 266 Query 1 383 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 269 Query 1 269 use `test`; insert into t1 values ('20040101000000'), ('20040611093902') master-bin.000001 383 Query 1 454 use `test`; delete from t1
master-bin.000001 364 Query 1 364 use `test`; delete from t1 master-bin.000001 454 Query 1 571 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
master-bin.000001 413 Query 1 413 use `test`; insert into t1 values ('20040101000000'), ('20040611093902')
set time_zone='MET'; set time_zone='MET';
insert into t2 (select t from t1); insert into t2 (select t from t1);
select * from t1; select * from t1;
@ -73,5 +72,4 @@ t
2001-09-09 03:46:40 2001-09-09 03:46:40
1000000000 1000000000
set global time_zone='MET'; set global time_zone='MET';
ERROR HY000: Binary logging and replication forbid changing of the global server time zone
drop table t1, t2; drop table t1, t2;

View File

@ -78,32 +78,32 @@ NULL
NULL NULL
show binlog events from 179; show binlog events from 179;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 179 User var 2 222 @i1=12345678901234 slave-bin.000001 179 User var 2 222 @`i1`=12345678901234
slave-bin.000001 222 User var 2 265 @i2=-12345678901234 slave-bin.000001 222 User var 2 265 @`i2`=-12345678901234
slave-bin.000001 265 User var 2 308 @i3=0 slave-bin.000001 265 User var 2 308 @`i3`=0
slave-bin.000001 308 User var 2 351 @i4=-1 slave-bin.000001 308 User var 2 351 @`i4`=-1
slave-bin.000001 351 Query 1 456 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4) slave-bin.000001 351 Query 1 456 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4)
slave-bin.000001 456 User var 2 499 @r1=12.5 slave-bin.000001 456 User var 2 499 @`r1`=12.5
slave-bin.000001 499 User var 2 542 @r2=-12.5 slave-bin.000001 499 User var 2 542 @`r2`=-12.5
slave-bin.000001 542 Query 1 633 use `test`; insert into t1 values (@r1), (@r2) slave-bin.000001 542 Query 1 633 use `test`; insert into t1 values (@r1), (@r2)
slave-bin.000001 633 User var 2 682 @s1='This is a test' slave-bin.000001 633 User var 2 682 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci
slave-bin.000001 682 User var 2 717 @s2='' slave-bin.000001 682 User var 2 717 @`s2`=_latin1 "" COLLATE latin1_swedish_ci
slave-bin.000001 717 User var 2 759 @s3='abc'def' slave-bin.000001 717 User var 2 759 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 759 User var 2 801 @s4='abc\def' slave-bin.000001 759 User var 2 801 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci
slave-bin.000001 801 User var 2 843 @s5='abc'def' slave-bin.000001 801 User var 2 843 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci
slave-bin.000001 843 Query 1 955 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) slave-bin.000001 843 Query 1 955 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5)
slave-bin.000001 955 User var 2 981 @n1=NULL slave-bin.000001 955 User var 2 981 @`n1`=NULL
slave-bin.000001 981 Query 1 1065 use `test`; insert into t1 values (@n1) slave-bin.000001 981 Query 1 1065 use `test`; insert into t1 values (@n1)
slave-bin.000001 1065 User var 2 1091 @n2=NULL slave-bin.000001 1065 User var 2 1091 @`n2`=NULL
slave-bin.000001 1091 Query 1 1175 use `test`; insert into t1 values (@n2) slave-bin.000001 1091 Query 1 1175 use `test`; insert into t1 values (@n2)
slave-bin.000001 1175 Query 1 1285 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) slave-bin.000001 1175 Query 1 1285 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1)
slave-bin.000001 1285 User var 2 1327 @a=2 slave-bin.000001 1285 User var 2 1327 @`a`=2
slave-bin.000001 1327 Query 1 1421 use `test`; insert into t1 values (@a+(@b:=@a+1)) slave-bin.000001 1327 Query 1 1421 use `test`; insert into t1 values (@a+(@b:=@a+1))
slave-bin.000001 1421 User var 2 1458 @q='abc' slave-bin.000001 1421 User var 2 1458 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci
slave-bin.000001 1458 Query 1 1584 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) slave-bin.000001 1458 Query 1 1584 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'))
slave-bin.000001 1584 User var 2 1626 @a=5 slave-bin.000001 1584 User var 2 1626 @`a`=5
slave-bin.000001 1626 Query 1 1714 use `test`; insert into t1 values (@a),(@a) slave-bin.000001 1626 Query 1 1714 use `test`; insert into t1 values (@a),(@a)
slave-bin.000001 1714 User var 2 1739 @a=NULL slave-bin.000001 1714 User var 2 1739 @`a`=NULL
slave-bin.000001 1739 Query 1 1834 use `test`; insert into t1 values (@a),(@a),(@a*5) slave-bin.000001 1739 Query 1 1834 use `test`; insert into t1 values (@a),(@a),(@a*5)
drop table t1; drop table t1;
stop slave; stop slave;

View File

@ -2076,8 +2076,6 @@ gvid the_success the_fail the_size the_time
Warnings: Warnings:
Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' Warning 1292 Truncated incorrect datetime value: 'wrong-date-value'
Warning 1292 Truncated incorrect datetime value: 'wrong-date-value' Warning 1292 Truncated incorrect datetime value: 'wrong-date-value'
Warning 1292 Truncated incorrect datetime value: 'wrong-date-value'
Warning 1292 Truncated incorrect datetime value: 'wrong-date-value'
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid; SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
gvid the_success the_fail the_size the_time gvid the_success the_fail the_size the_time
DROP TABLE t1,t2; DROP TABLE t1,t2;

View File

@ -1,10 +1,10 @@
delete from mysql.proc; delete from mysql.proc;
create procedure syntaxerror(t int)| create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int)| create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
create procedure syntaxerror(t int)| create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
drop table if exists t3| drop table if exists t3|
create table t3 ( x int )| create table t3 ( x int )|
insert into t3 values (2), (3)| insert into t3 values (2), (3)|
@ -44,7 +44,7 @@ call foo()|
ERROR 42000: PROCEDURE test.foo does not exist ERROR 42000: PROCEDURE test.foo does not exist
drop procedure if exists foo| drop procedure if exists foo|
Warnings: Warnings:
Warning 1298 PROCEDURE foo does not exist Warning 1303 PROCEDURE foo does not exist
show create procedure foo| show create procedure foo|
ERROR 42000: PROCEDURE foo does not exist ERROR 42000: PROCEDURE foo does not exist
create procedure foo() create procedure foo()
@ -80,7 +80,7 @@ declare y int;
set x = y; set x = y;
end| end|
Warnings: Warnings:
Warning 1304 Referring to uninitialized variable y Warning 1309 Referring to uninitialized variable y
drop procedure foo| drop procedure foo|
create procedure foo() create procedure foo()
return 42| return 42|

View File

@ -28,7 +28,7 @@ select db1_secret.db();
db1_secret.db() db1_secret.db()
db1_secret db1_secret
select * from db1_secret.t1; select * from db1_secret.t1;
ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db1_secret' ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
create procedure db1_secret.dummy() begin end; create procedure db1_secret.dummy() begin end;
ERROR 42000: Unknown database 'db1_secret' ERROR 42000: Unknown database 'db1_secret'
drop procedure db1_secret.dummy; drop procedure db1_secret.dummy;
@ -38,7 +38,7 @@ select db1_secret.db();
db1_secret.db() db1_secret.db()
db1_secret db1_secret
select * from db1_secret.t1; select * from db1_secret.t1;
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret' ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
create procedure db1_secret.dummy() begin end; create procedure db1_secret.dummy() begin end;
ERROR 42000: Unknown database 'db1_secret' ERROR 42000: Unknown database 'db1_secret'
drop procedure db1_secret.dummy; drop procedure db1_secret.dummy;
@ -67,13 +67,13 @@ select db();
db() db()
db1_secret db1_secret
call db1_secret.stamp(5); call db1_secret.stamp(5);
ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db1_secret' ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
select db1_secret.db(); select db1_secret.db();
ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db1_secret' ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret'
call db1_secret.stamp(6); call db1_secret.stamp(6);
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret' ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
select db1_secret.db(); select db1_secret.db();
ERROR 42000: Access denied for user: ''@'localhost' to database 'db1_secret' ERROR 42000: Access denied for user ''@'localhost' to database 'db1_secret'
drop database if exists db2; drop database if exists db2;
create database db2; create database db2;
use db2; use db2;
@ -87,10 +87,10 @@ flush privileges;
use db2; use db2;
create procedure p () insert into t2 values (1); create procedure p () insert into t2 values (1);
call p(); call p();
ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db2' ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db2'
use db2; use db2;
call p(); call p();
ERROR 42000: Access denied for user: 'user1'@'localhost' to database 'db2' ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db2'
select * from t2; select * from t2;
s1 s1
0 0

View File

@ -1075,7 +1075,7 @@ drop table if exists t3|
create table t3 (s1 smallint)| create table t3 (s1 smallint)|
insert into t3 values (123456789012)| insert into t3 values (123456789012)|
Warnings: Warnings:
Warning 1264 Data truncated, out of range for column 's1' at row 1 Warning 1264 Data truncated; out of range for column 's1' at row 1
create procedure bug2780() create procedure bug2780()
begin begin
declare exit handler for sqlwarning set @x = 1; declare exit handler for sqlwarning set @x = 1;

View File

@ -172,19 +172,21 @@ insert into t1 values (@var1);
create table t2 (c char(30)) charset=ucs2; create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2); set @v=convert('abc' using ucs2);
insert into t2 values (@v); insert into t2 values (@v);
show binlog events from 79; show binlog events from 95;
Log_name Pos Event_type Server_id Orig_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 95 User var 1 136 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 136 Query 1 222 use `test`; INSERT INTO t1 VALUES(@`a b`)
master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 222 User var 1 264 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 226 Query 1 226 use `test`; insert into t1 values (@var1) master-bin.000001 264 Query 1 350 use `test`; insert into t1 values (@var1)
master-bin.000001 290 Query 1 290 use `test`; create table t2 (c char(30)) charset=ucs2 master-bin.000001 350 Query 1 448 use `test`; create table t2 (c char(30)) charset=ucs2
master-bin.000001 366 User var 1 366 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci master-bin.000001 448 User var 1 488 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 406 Query 1 406 use `test`; insert into t2 values (@v) master-bin.000001 488 Query 1 571 use `test`; insert into t2 values (@v)
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci;
use test; use test;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
INSERT INTO t1 VALUES(@`a b`); INSERT INTO t1 VALUES(@`a b`);
SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;

View File

@ -364,7 +364,7 @@ set sql_log_bin=1;
set sql_log_off=1; set sql_log_off=1;
set sql_log_update=1; set sql_log_update=1;
Warnings: Warnings:
Note 1308 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored Note 1313 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
set sql_low_priority_updates=1; set sql_low_priority_updates=1;
set sql_max_join_size=200; set sql_max_join_size=200;
select @@sql_max_join_size,@@max_join_size; select @@sql_max_join_size,@@max_join_size;

View File

@ -110,14 +110,14 @@ drop database mysqltest;
# #
# Rights for renaming test (Bug #3270) # Rights for renaming test (Bug #3270)
# #
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root; connection root;
--disable_warnings --disable_warnings
create database mysqltest; create database mysqltest;
--enable_warnings --enable_warnings
create table mysqltest.t1 (a int,b int,c int); create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost; grant all on mysqltest.t1 to mysqltest_1@localhost;
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1; connection user1;
-- error 1142 -- error 1142
alter table t1 rename t2; alter table t1 rename t2;

View File

@ -101,7 +101,7 @@ SELECT a.x FROM (SELECT 1 AS x) AS a HAVING a.x = 1;
# #
# Connect without a database # Connect without a database
create table t1 select 1 as a; create table t1 select 1 as a;
connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock); connect (con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection con1; connection con1;
--error 1046 --error 1046
select 2 as a from (select * from t1) b; select 2 as a from (select * from t1) b;

View File

@ -220,6 +220,7 @@ insert into t2 values('DEN','Denver','CO','BDL');
insert into t2 values('SDC','San Diego','CA','TWU'); insert into t2 values('SDC','San Diego','CA','TWU');
insert into t2 values('NOL','New Orleans','LA','GTM'); insert into t2 values('NOL','New Orleans','LA','GTM');
insert into t2 values('LAK','Los Angeles','CA','TWU'); insert into t2 values('LAK','Los Angeles','CA','TWU');
insert into t2 values('AAA','AAA','AA','AME');
# Show the table contents # Show the table contents
select * from t1; select * from t1;

View File

@ -10,7 +10,7 @@ drop database if exists mysqltest;
reset query cache; reset query cache;
flush status; flush status;
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root; connection root;
show grants for current_user; show grants for current_user;
show grants; show grants;
@ -25,7 +25,7 @@ insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10)); create table test.t1 (a char (10));
insert into test.t1 values ("test.t1"); insert into test.t1 values ("test.t1");
select * from t1; select * from t1;
connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,master.sock); connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root2; connection root2;
# put queries in cache # put queries in cache
select * from t1; select * from t1;
@ -43,7 +43,7 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost; grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache # The following queries should be fetched from cache
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1; connection user1;
show grants for current_user(); show grants for current_user();
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
@ -67,12 +67,12 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits"; show status like "Qcache_hits";
show status like "Qcache_not_cached"; show status like "Qcache_not_cached";
connect (unkuser,localhost,,,,$MASTER_MYPORT,master.sock); connect (unkuser,localhost,,,,$MASTER_MYPORT,$MASTER_MYSOCK);
connection unkuser; connection unkuser;
show grants for current_user(); show grants for current_user();
# The following queries should be fetched from cache # The following queries should be fetched from cache
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,master.sock); connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user2; connection user2;
select "user2"; select "user2";
select * from t1; select * from t1;
@ -87,7 +87,7 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached"; show status like "Qcache_not_cached";
# The following queries should not be fetched from cache # The following queries should not be fetched from cache
connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,master.sock); connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user3; connection user3;
select "user3"; select "user3";
--replace_result 127.0.0.1 localhost --replace_result 127.0.0.1 localhost
@ -108,7 +108,7 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached"; show status like "Qcache_not_cached";
# Connect without a database # Connect without a database
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock); connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user4; connection user4;
select "user4"; select "user4";
show grants; show grants;

View File

@ -388,7 +388,7 @@ drop table t1, t2;
# prevelege chexk for multiupdate with other tables # prevelege chexk for multiupdate with other tables
# #
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock); connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root; connection root;
--disable_warnings --disable_warnings
create database mysqltest; create database mysqltest;
@ -398,7 +398,7 @@ create table mysqltest.t2 (a int, b int, primary key (a));
create table mysqltest.t3 (a int, b int, primary key (a)); create table mysqltest.t3 (a int, b int, primary key (a));
grant select on mysqltest.* to mysqltest_1@localhost; grant select on mysqltest.* to mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost; grant update on mysqltest.t1 to mysqltest_1@localhost;
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock); connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1; connection user1;
update t1, t2 set t1.b=1 where t1.a=t2.a; update t1, t2 set t1.b=1 where t1.a=t2.a;
update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a; update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;

View File

@ -1,4 +1,4 @@
connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
connection master; connection master;
reset master; reset master;

View File

@ -1,4 +1,4 @@
connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock); connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
connection master; connection master;
reset master; reset master;

View File

@ -4,7 +4,7 @@
# #
require_manager; require_manager;
connect (master,localhost,root,,test,0,master.sock); connect (master,localhost,root,,test,0,$MASTER_MYPORT);
connect (slave,localhost,root,,test,0,slave.sock); connect (slave,localhost,root,,test,0,slave.sock);
connection master; connection master;
reset master; reset master;

View File

@ -106,7 +106,7 @@ select * from test2.t1 order by a;
connection master; connection master;
drop database test2; drop database test2;
drop database test3; drop database test3;
show binlog events from 79; show binlog events from 95;
sync_slave_with_master; sync_slave_with_master;
# Check that we can't change global.collation_server # Check that we can't change global.collation_server

View File

@ -7,7 +7,7 @@ require_manager;
# issue a query after the server restart. # issue a query after the server restart.
# Maybe this is something awkward in mysqltest or in the manager? # Maybe this is something awkward in mysqltest or in the manager?
# So we use sockets. # So we use sockets.
connect (master,localhost,root,,test,0,master.sock); connect (master,localhost,root,,test,0,$MASTER_MYPORT);
connect (slave,localhost,root,,test,0,slave.sock); connect (slave,localhost,root,,test,0,slave.sock);
connection master; connection master;

View File

@ -9,7 +9,7 @@
# changes # changes
# - Test creating a duplicate key error and recover from it # - Test creating a duplicate key error and recover from it
connect (master,localhost,root,,test,$MASTER_MYPORT,master.sock); connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--disable_warnings --disable_warnings
drop table if exists t1, t2, t3, t4; drop table if exists t1, t2, t3, t4;
--enable_warnings --enable_warnings

View File

@ -49,18 +49,18 @@ create function func1() returns int
return 42| return 42|
# Can't create recursively # Can't create recursively
--error 1296 --error 1301
create procedure foo() create procedure foo()
create procedure bar() set @x=3| create procedure bar() set @x=3|
--error 1296 --error 1301
create procedure foo() create procedure foo()
create function bar() returns double return 2.3| create function bar() returns double return 2.3|
# Already exists # Already exists
--error 1297 --error 1302
create procedure proc1() create procedure proc1()
set @x = 42| set @x = 42|
--error 1297 --error 1302
create function func1() returns int create function func1() returns int
return 42| return 42|
@ -68,39 +68,39 @@ drop procedure proc1|
drop function func1| drop function func1|
# Does not exist # Does not exist
--error 1298 --error 1303
alter procedure foo| alter procedure foo|
--error 1298 --error 1303
alter function foo| alter function foo|
--error 1298 --error 1303
drop procedure foo| drop procedure foo|
--error 1298 --error 1303
drop function foo| drop function foo|
--error 1298 --error 1303
call foo()| call foo()|
drop procedure if exists foo| drop procedure if exists foo|
--error 1298 --error 1303
show create procedure foo| show create procedure foo|
# LEAVE/ITERATE with no match # LEAVE/ITERATE with no match
--error 1301 --error 1306
create procedure foo() create procedure foo()
foo: loop foo: loop
leave bar; leave bar;
end loop| end loop|
--error 1301 --error 1306
create procedure foo() create procedure foo()
foo: loop foo: loop
iterate bar; iterate bar;
end loop| end loop|
--error 1301 --error 1306
create procedure foo() create procedure foo()
foo: begin foo: begin
iterate foo; iterate foo;
end| end|
# Redefining label # Redefining label
--error 1302 --error 1307
create procedure foo() create procedure foo()
foo: loop foo: loop
foo: loop foo: loop
@ -109,7 +109,7 @@ foo: loop
end loop foo| end loop foo|
# End label mismatch # End label mismatch
--error 1303 --error 1308
create procedure foo() create procedure foo()
foo: loop foo: loop
set @x=2; set @x=2;
@ -124,12 +124,12 @@ end|
drop procedure foo| drop procedure foo|
# RETURN in FUNCTION only # RETURN in FUNCTION only
--error 1306 --error 1311
create procedure foo() create procedure foo()
return 42| return 42|
# Doesn't allow queries in FUNCTIONs (for now :-( ) # Doesn't allow queries in FUNCTIONs (for now :-( )
--error 1307 --error 1312
create function foo() returns int create function foo() returns int
begin begin
declare x int; declare x int;
@ -143,19 +143,19 @@ create procedure p(x int)
create function f(x int) returns int create function f(x int) returns int
return x+42| return x+42|
--error 1311 --error 1316
call p()| call p()|
--error 1311 --error 1316
call p(1, 2)| call p(1, 2)|
--error 1311 --error 1316
select f()| select f()|
--error 1311 --error 1316
select f(1, 2)| select f(1, 2)|
drop procedure p| drop procedure p|
drop function f| drop function f|
--error 1312 --error 1317
create procedure p(val int, out res int) create procedure p(val int, out res int)
begin begin
declare x int default 0; declare x int default 0;
@ -169,7 +169,7 @@ begin
end if; end if;
end| end|
--error 1312 --error 1317
create procedure p(val int, out res int) create procedure p(val int, out res int)
begin begin
declare x int default 0; declare x int default 0;
@ -184,7 +184,7 @@ begin
end if; end if;
end| end|
--error 1313 --error 1318
create function f(val int) returns int create function f(val int) returns int
begin begin
declare x int; declare x int;
@ -202,12 +202,12 @@ begin
end if; end if;
end| end|
--error 1314 --error 1319
select f(10)| select f(10)|
drop function f| drop function f|
--error 1315 --error 1320
create procedure p() create procedure p()
begin begin
declare c cursor for insert into test.t1 values ("foo", 42); declare c cursor for insert into test.t1 values ("foo", 42);
@ -216,7 +216,7 @@ begin
close c; close c;
end| end|
--error 1316 --error 1321
create procedure p() create procedure p()
begin begin
declare x int; declare x int;
@ -226,7 +226,7 @@ begin
close c; close c;
end| end|
--error 1317 --error 1322
create procedure p() create procedure p()
begin begin
declare c cursor for select * from test.t; declare c cursor for select * from test.t;
@ -248,7 +248,7 @@ begin
open c; open c;
close c; close c;
end| end|
--error 1318 --error 1323
call p()| call p()|
drop procedure p| drop procedure p|
@ -260,11 +260,11 @@ begin
close c; close c;
close c; close c;
end| end|
--error 1319 --error 1324
call p()| call p()|
drop procedure p| drop procedure p|
--error 1298 --error 1303
alter procedure bar3 sql security invoker| alter procedure bar3 sql security invoker|
--error 1059 --error 1059
alter procedure bar3 name alter procedure bar3 name
@ -278,7 +278,7 @@ drop table if exists t1|
create table t1 (val int, x float)| create table t1 (val int, x float)|
insert into t1 values (42, 3.1), (19, 1.2)| insert into t1 values (42, 3.1), (19, 1.2)|
--error 1320 --error 1325
create procedure p() create procedure p()
begin begin
declare x int; declare x int;
@ -298,7 +298,7 @@ begin
fetch c into x; fetch c into x;
close c; close c;
end| end|
--error 1321 --error 1326
call p()| call p()|
drop procedure p| drop procedure p|
@ -313,34 +313,34 @@ begin
fetch c into x, y, z; fetch c into x, y, z;
close c; close c;
end| end|
--error 1321 --error 1326
call p()| call p()|
drop procedure p| drop procedure p|
--error 1323 --error 1328
create procedure p(in x int, x char(10)) create procedure p(in x int, x char(10))
begin begin
end| end|
--error 1323 --error 1328
create function p(x int, x char(10)) create function p(x int, x char(10))
begin begin
end| end|
--error 1324 --error 1329
create procedure p() create procedure p()
begin begin
declare x float; declare x float;
declare x int; declare x int;
end| end|
--error 1325 --error 1330
create procedure p() create procedure p()
begin begin
declare c condition for 1064; declare c condition for 1064;
declare c condition for 1065; declare c condition for 1065;
end| end|
--error 1326 --error 1331
create procedure p() create procedure p()
begin begin
declare c cursor for select * from t1; declare c cursor for select * from t1;
@ -348,18 +348,18 @@ begin
end| end|
# USE is not allowed # USE is not allowed
--error 1329 --error 1334
create procedure u() create procedure u()
use sptmp| use sptmp|
# Enforced standard order of declarations # Enforced standard order of declarations
--error 1330 --error 1335
create procedure p() create procedure p()
begin begin
declare c cursor for select * from t1; declare c cursor for select * from t1;
declare x int; declare x int;
end| end|
--error 1330 --error 1335
create procedure p() create procedure p()
begin begin
declare x int; declare x int;
@ -367,7 +367,7 @@ begin
declare foo condition for sqlstate '42S99'; declare foo condition for sqlstate '42S99';
end| end|
--error 1331 --error 1336
create procedure p() create procedure p()
begin begin
declare x int; declare x int;
@ -392,13 +392,13 @@ drop procedure bug1965|
# #
# BUG#1966 # BUG#1966
# #
--error 1320 --error 1325
select 1 into a| select 1 into a|
# #
# BUG#336 # BUG#336
# #
--error 1328 --error 1333
create procedure bug336(id char(16)) create procedure bug336(id char(16))
begin begin
declare x int; declare x int;
@ -408,7 +408,7 @@ end|
# #
# BUG#1654 # BUG#1654
# #
--error 1307 --error 1312
create function bug1654() create function bug1654()
returns int returns int
return (select sum(t.data) from test.t2 t)| return (select sum(t.data) from test.t2 t)|
@ -446,7 +446,7 @@ begin
fetch c1 into v1; fetch c1 into v1;
end| end|
--error 1319 --error 1324
call bug2259()| call bug2259()|
drop procedure bug2259| drop procedure bug2259|
@ -502,7 +502,7 @@ begin
end case; end case;
return 2; return 2;
end| end|
--error 1332 --error 1337
select bug3287()| select bug3287()|
drop function bug3287| drop function bug3287|
@ -513,7 +513,7 @@ when 0 then
when 1 then when 1 then
insert into test.t1 values (x, 1.1); insert into test.t1 values (x, 1.1);
end case| end case|
--error 1332 --error 1337
call bug3287(2)| call bug3287(2)|
drop procedure bug3287| drop procedure bug3287|

View File

@ -60,7 +60,7 @@ select * from db1_secret.t1;
# ...and not this # ...and not this
--error 1049 --error 1049
create procedure db1_secret.dummy() begin end; create procedure db1_secret.dummy() begin end;
--error 1298 --error 1303
drop procedure db1_secret.dummy; drop procedure db1_secret.dummy;
@ -80,7 +80,7 @@ select * from db1_secret.t1;
# ...and not this # ...and not this
--error 1049 --error 1049
create procedure db1_secret.dummy() begin end; create procedure db1_secret.dummy() begin end;
--error 1298 --error 1303
drop procedure db1_secret.dummy; drop procedure db1_secret.dummy;

View File

@ -111,7 +111,7 @@ insert into t1 values (@var1);
create table t2 (c char(30)) charset=ucs2; create table t2 (c char(30)) charset=ucs2;
set @v=convert('abc' using ucs2); set @v=convert('abc' using ucs2);
insert into t2 values (@v); insert into t2 values (@v);
show binlog events from 79; show binlog events from 95;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be # absolutely need variables names to be quoted and strings to be
# escaped). # escaped).

View File

@ -7,13 +7,14 @@ password=""
host="localhost" host="localhost"
user="root" user="root"
sql_only=0 sql_only=0
basedir="" basedir="@prefix@"
verbose=0 verbose=0
args="" args=""
port="" port=""
socket="" socket=""
database="mysql" database="mysql"
bindir="" bindir=""
pkgdatadir="@pkgdatadir@"
file=mysql_fix_privilege_tables.sql file=mysql_fix_privilege_tables.sql
@ -85,36 +86,25 @@ done
parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables` parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables`
parse_arguments PICK-ARGS-FROM-ARGV "$@" parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test -z "$basedir"
then
basedir=@prefix@
if test -z "$bindir"
then
bindir=@bindir@
fi
execdir=@libexecdir@
pkgdatadir=@pkgdatadir@
else
if test -z "$bindir"
then
bindir="$basedir/bin"
fi
if test -x "$basedir/libexec/mysqld"
then
execdir="$basedir/libexec"
elif test -x "@libexecdir@/mysqld"
then
execdir="@libexecdir@"
else
execdir="$basedir/bin"
fi
fi
if test -z "$password" if test -z "$password"
then then
password=$old_style_password password=$old_style_password
fi fi
# Find where 'mysql' command is located
if test -z "$bindir"
then
for i in @bindir@ $basedir/bin client
do
if test -f $i/mysql
then
bindir=$i
break
fi
done
fi
cmd="$bindir/mysql -f --user=$user --host=$host" cmd="$bindir/mysql -f --user=$user --host=$host"
if test ! -z "$password" ; then if test ! -z "$password" ; then
cmd="$cmd --password=$password" cmd="$cmd --password=$password"
@ -134,7 +124,7 @@ fi
# Find where first mysql_fix_privilege_tables.sql is located # Find where first mysql_fix_privilege_tables.sql is located
for i in $basedir/support-files $basedir/share $basedir/share/mysql \ for i in $basedir/support-files $basedir/share $basedir/share/mysql \
$basedir/scripts @pkgdatadir@ . ./scripts $basedir/scripts $pkgdatadir . ./scripts
do do
if test -f $i/$file if test -f $i/$file
then then
@ -163,7 +153,8 @@ s_echo "This scripts updates all the mysql privilege tables to be usable by"
s_echo "MySQL 4.0 and above." s_echo "MySQL 4.0 and above."
s_echo "" s_echo ""
s_echo "This is needed if you want to use the new GRANT functions," s_echo "This is needed if you want to use the new GRANT functions,"
s_echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 4.1" s_echo "CREATE AGGREGATE FUNCTION, use stored procedures or want to use the"
s_echo "more secure passwords in 4.1"
s_echo "" s_echo ""
if test $verbose = 1 if test $verbose = 1

View File

@ -1493,4 +1493,3 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key,
error= ha_index_end(); error= ha_index_end();
return error; return error;
} }

View File

@ -306,29 +306,33 @@ public:
int ha_index_init(uint idx) int ha_index_init(uint idx)
{ {
DBUG_ENTER("ha_index_init");
DBUG_ASSERT(inited==NONE); DBUG_ASSERT(inited==NONE);
inited=INDEX; inited=INDEX;
return index_init(idx); DBUG_RETURN(index_init(idx));
} }
int ha_index_end() int ha_index_end()
{ {
DBUG_ENTER("ha_index_end");
DBUG_ASSERT(inited==INDEX); DBUG_ASSERT(inited==INDEX);
inited=NONE; inited=NONE;
return index_end(); DBUG_RETURN(index_end());
} }
int ha_rnd_init(bool scan) int ha_rnd_init(bool scan)
{ {
DBUG_ENTER("ha_rnd_init");
DBUG_ASSERT(inited==NONE || (inited==RND && scan)); DBUG_ASSERT(inited==NONE || (inited==RND && scan));
inited=RND; inited=RND;
return rnd_init(scan); DBUG_RETURN(rnd_init(scan));
} }
int ha_rnd_end() int ha_rnd_end()
{ {
DBUG_ENTER("ha_rnd_end");
DBUG_ASSERT(inited==RND); DBUG_ASSERT(inited==RND);
inited=NONE; inited=NONE;
return rnd_end(); DBUG_RETURN(rnd_end());
} }
/* this is neseccary in many places, e.g. in HANDLER command */ /* this is necessary in many places, e.g. in HANDLER command */
int ha_index_or_rnd_end() int ha_index_or_rnd_end()
{ {
return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0; return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0;

View File

@ -131,7 +131,10 @@ public:
optimisation changes in prepared statements optimisation changes in prepared statements
*/ */
Item(THD *thd, Item *item); Item(THD *thd, Item *item);
virtual ~Item() { name=0; } /*lint -e1509 */ virtual ~Item()
{
name=0;
} /*lint -e1509 */
void set_name(const char *str,uint length, CHARSET_INFO *cs); void set_name(const char *str,uint length, CHARSET_INFO *cs);
void init_make_field(Send_field *tmp_field,enum enum_field_types type); void init_make_field(Send_field *tmp_field,enum enum_field_types type);
virtual void cleanup() virtual void cleanup()

View File

@ -486,10 +486,8 @@ bool Item_in_optimizer::fix_left(THD *thd,
/* /*
If it is preparation PS only then we do not know values of parameters => If it is preparation PS only then we do not know values of parameters =>
cant't get there values and do not need that values. cant't get there values and do not need that values.
TODO: during merge with 5.0 it should be changed on !thd->only_prepare()
*/ */
if (!thd->current_statement) if (!thd->only_prepare())
cache->store(args[0]); cache->store(args[0]);
if (cache->cols() == 1) if (cache->cols() == 1)
{ {

View File

@ -726,19 +726,30 @@ QUICK_RANGE_SELECT::QUICK_RANGE_SELECT(THD *thd, TABLE *table, uint key_nr,
record= head->record[0]; record= head->record[0];
} }
int QUICK_RANGE_SELECT::init() int QUICK_RANGE_SELECT::init()
{ {
DBUG_ENTER("QUICK_RANGE_SELECT::init"); DBUG_ENTER("QUICK_RANGE_SELECT::init");
DBUG_RETURN(error= file->ha_index_init(index)); if (file->inited == handler::NONE)
DBUG_RETURN(error= file->ha_index_init(index));
error= 0;
DBUG_RETURN(0);
} }
void QUICK_RANGE_SELECT::range_end()
{
if (file->inited != handler::NONE)
file->ha_index_end();
}
QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT() QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
{ {
DBUG_ENTER("QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT"); DBUG_ENTER("QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT");
if (!dont_free) if (!dont_free)
{ {
if (file->inited) range_end();
file->ha_index_end();
file->extra(HA_EXTRA_NO_KEYREAD); file->extra(HA_EXTRA_NO_KEYREAD);
delete_dynamic(&ranges); /* ranges are allocated in alloc */ delete_dynamic(&ranges); /* ranges are allocated in alloc */
if (free_file) if (free_file)
@ -879,8 +890,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
{ {
DBUG_RETURN(1); DBUG_RETURN(1);
} }
else DBUG_RETURN(0);
DBUG_RETURN(0);
} }
/* Create a separate handler object for this quick select */ /* Create a separate handler object for this quick select */
@ -974,10 +984,8 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
int QUICK_ROR_INTERSECT_SELECT::reset() int QUICK_ROR_INTERSECT_SELECT::reset()
{ {
int result;
DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::reset"); DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::reset");
result= init_ror_merged_scan(TRUE); DBUG_RETURN(init_ror_merged_scan(TRUE));
DBUG_RETURN(result);
} }
@ -1008,12 +1016,15 @@ QUICK_ROR_INTERSECT_SELECT::~QUICK_ROR_INTERSECT_SELECT()
quick_selects.delete_elements(); quick_selects.delete_elements();
delete cpk_quick; delete cpk_quick;
free_root(&alloc,MYF(0)); free_root(&alloc,MYF(0));
if (need_to_fetch_row && head->file->inited != handler::NONE)
head->file->ha_rnd_end();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
QUICK_ROR_UNION_SELECT::QUICK_ROR_UNION_SELECT(THD *thd_param, QUICK_ROR_UNION_SELECT::QUICK_ROR_UNION_SELECT(THD *thd_param,
TABLE *table) TABLE *table)
: thd(thd_param) :thd(thd_param)
{ {
index= MAX_KEY; index= MAX_KEY;
head= table; head= table;
@ -1098,8 +1109,7 @@ int QUICK_ROR_UNION_SELECT::reset()
{ {
if (error == HA_ERR_END_OF_FILE) if (error == HA_ERR_END_OF_FILE)
continue; continue;
else DBUG_RETURN(error);
DBUG_RETURN(error);
} }
quick->save_last_pos(); quick->save_last_pos();
queue_insert(&queue, (byte*)quick); queue_insert(&queue, (byte*)quick);
@ -2970,7 +2980,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
} }
if (found_records != HA_POS_ERROR && found_records > 2 && if (found_records != HA_POS_ERROR && found_records > 2 &&
read_index_only && read_index_only &&
(param->table->file->index_flags(keynr, param.max_key_part,1) & (param->table->file->index_flags(keynr, param->max_key_part,1) &
HA_KEYREAD_ONLY) && HA_KEYREAD_ONLY) &&
!(pk_is_clustered && keynr == param->table->primary_key)) !(pk_is_clustered && keynr == param->table->primary_key))
{ {
@ -5349,10 +5359,11 @@ int QUICK_INDEX_MERGE_SELECT::prepare_unique()
thd->variables.sortbuff_size); thd->variables.sortbuff_size);
if (!unique) if (!unique)
DBUG_RETURN(1); DBUG_RETURN(1);
do for (;;)
{ {
while ((result= cur_quick_select->get_next()) == HA_ERR_END_OF_FILE) while ((result= cur_quick_select->get_next()) == HA_ERR_END_OF_FILE)
{ {
cur_quick_select->range_end();
cur_quick_select= cur_quick_it++; cur_quick_select= cur_quick_it++;
if (!cur_quick_select) if (!cur_quick_select)
break; break;
@ -5383,12 +5394,13 @@ int QUICK_INDEX_MERGE_SELECT::prepare_unique()
if (result) if (result)
DBUG_RETURN(1); DBUG_RETURN(1);
}while(TRUE); }
/* ok, all row ids are in Unique */ /* ok, all row ids are in Unique */
result= unique->get(head); result= unique->get(head);
doing_pk_scan= FALSE; doing_pk_scan= FALSE;
init_read_record(&read_record, thd, head, NULL, 1, 1); /* start table scan */
init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1, 1);
/* index_merge currently doesn't support "using index" at all */ /* index_merge currently doesn't support "using index" at all */
head->file->extra(HA_EXTRA_NO_KEYREAD); head->file->extra(HA_EXTRA_NO_KEYREAD);
@ -5420,7 +5432,7 @@ int QUICK_INDEX_MERGE_SELECT::get_next()
result= HA_ERR_END_OF_FILE; result= HA_ERR_END_OF_FILE;
end_read_record(&read_record); end_read_record(&read_record);
/* All rows from Unique have been retrieved, do a clustered PK scan */ /* All rows from Unique have been retrieved, do a clustered PK scan */
if(pk_quick_select) if (pk_quick_select)
{ {
doing_pk_scan= TRUE; doing_pk_scan= TRUE;
if ((result= pk_quick_select->init())) if ((result= pk_quick_select->init()))

View File

@ -133,6 +133,9 @@ public:
other Error code other Error code
*/ */
virtual int reset(void) = 0; virtual int reset(void) = 0;
/* Range end should be called when we have looped over the whole index */
virtual void range_end() {}
virtual int get_next() = 0; /* get next record to retrieve */ virtual int get_next() = 0; /* get next record to retrieve */
virtual bool reverse_sorted() = 0; virtual bool reverse_sorted() = 0;
virtual bool unique_key_range() { return false; } virtual bool unique_key_range() { return false; }
@ -273,6 +276,8 @@ public:
} }
int init(); int init();
int get_next(); int get_next();
void range_end();
bool reverse_sorted() { return 0; } bool reverse_sorted() { return 0; }
bool unique_key_range(); bool unique_key_range();
int init_ror_merged_scan(bool reuse_handler); int init_ror_merged_scan(bool reuse_handler);

View File

@ -606,6 +606,7 @@ db_show_routine_status(THD *thd, int type, const char *wild)
err_case1: err_case1:
send_eof(thd); send_eof(thd);
err_case: err_case:
table->file->ha_index_end();
close_thread_tables(thd); close_thread_tables(thd);
done: done:
DBUG_RETURN(res); DBUG_RETURN(res);
@ -670,6 +671,7 @@ sp_drop_db_routines(THD *thd, char *db)
if (deleted) if (deleted)
sp_cache_invalidate(); sp_cache_invalidate();
} }
table->file->ha_index_end();
close_thread_tables(thd); close_thread_tables(thd);

View File

@ -485,9 +485,14 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, Item **resp)
nctx->push_item(sp_eval_func_item(thd, *argp++, pvar->type)); nctx->push_item(sp_eval_func_item(thd, *argp++, pvar->type));
} }
// Close tables opened for subselect in argument list #ifdef NOT_WORKING
/*
Close tables opened for subselect in argument list
This can't be done as this will close all other tables used
by the query.
*/
close_thread_tables(thd); close_thread_tables(thd);
#endif
// The rest of the frame are local variables which are all IN. // The rest of the frame are local variables which are all IN.
// Default all variables to null (those with default clauses will // Default all variables to null (those with default clauses will
// be set by an set instruction). // be set by an set instruction).

View File

@ -363,6 +363,7 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived) void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
{ {
bool found_old_table=0;
DBUG_ENTER("close_thread_tables"); DBUG_ENTER("close_thread_tables");
if (thd->derived_tables && !skip_derived) if (thd->derived_tables && !skip_derived)
@ -385,8 +386,6 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
DBUG_VOID_RETURN; // LOCK TABLES in use DBUG_VOID_RETURN; // LOCK TABLES in use
} }
bool found_old_table=0;
if (thd->lock) if (thd->lock)
{ {
mysql_unlock_tables(thd, thd->lock); mysql_unlock_tables(thd, thd->lock);
@ -397,7 +396,7 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
VOID(pthread_mutex_lock(&LOCK_open)); VOID(pthread_mutex_lock(&LOCK_open));
safe_mutex_assert_owner(&LOCK_open); safe_mutex_assert_owner(&LOCK_open);
DBUG_PRINT("info", ("thd->open_tables=%p", thd->open_tables)); DBUG_PRINT("info", ("thd->open_tables: %p", thd->open_tables));
while (thd->open_tables) while (thd->open_tables)
found_old_table|=close_thread_table(thd, &thd->open_tables); found_old_table|=close_thread_table(thd, &thd->open_tables);
@ -427,6 +426,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
bool found_old_table= 0; bool found_old_table= 0;
TABLE *table= *table_ptr; TABLE *table= *table_ptr;
DBUG_ASSERT(table->key_read == 0); DBUG_ASSERT(table->key_read == 0);
DBUG_ASSERT(table->file->inited == handler::NONE);
*table_ptr=table->next; *table_ptr=table->next;
if (table->version != refresh_version || if (table->version != refresh_version ||

View File

@ -194,13 +194,14 @@ int mysql_ha_close_list(THD *thd, TABLE_LIST *tables, bool flushed)
} }
static enum enum_ha_read_modes rkey_to_rnext[]= static enum enum_ha_read_modes rkey_to_rnext[]=
{ RNEXT_SAME, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV, RPREV }; { RNEXT_SAME, RNEXT, RPREV, RNEXT, RPREV, RNEXT, RPREV, RPREV };
int mysql_ha_read(THD *thd, TABLE_LIST *tables, int mysql_ha_read(THD *thd, TABLE_LIST *tables,
enum enum_ha_read_modes mode, char *keyname, List<Item> *key_expr, enum enum_ha_read_modes mode, char *keyname,
enum ha_rkey_function ha_rkey_mode, Item *cond, List<Item> *key_expr,
ha_rows select_limit,ha_rows offset_limit) enum ha_rkey_function ha_rkey_mode, Item *cond,
ha_rows select_limit,ha_rows offset_limit)
{ {
int err, keyno=-1; int err, keyno=-1;
bool was_flushed; bool was_flushed;
@ -227,7 +228,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if ((keyno=find_type(keyname, &table->keynames, 1+2)-1)<0) if ((keyno=find_type(keyname, &table->keynames, 1+2)-1)<0)
{ {
my_printf_error(ER_KEY_DOES_NOT_EXITS,ER(ER_KEY_DOES_NOT_EXITS),MYF(0), my_printf_error(ER_KEY_DOES_NOT_EXITS,ER(ER_KEY_DOES_NOT_EXITS),MYF(0),
keyname,tables->alias); keyname,tables->alias);
return -1; return -1;
} }
table->file->ha_index_or_rnd_end(); table->file->ha_index_or_rnd_end();
@ -257,7 +258,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
MYSQL_LOCK *lock=mysql_lock_tables(thd,&tables->table,1); MYSQL_LOCK *lock=mysql_lock_tables(thd,&tables->table,1);
HANDLER_TABLES_HACK(thd); HANDLER_TABLES_HACK(thd);
if (!lock) if (!lock)
goto err0; // mysql_lock_tables() printed error message already goto err0; // mysql_lock_tables() printed error message already
/* /*
In ::external_lock InnoDB resets the fields which tell it that In ::external_lock InnoDB resets the fields which tell it that
@ -290,7 +291,7 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
err=keyname ? err=keyname ?
table->file->index_next(table->record[0]) : table->file->index_next(table->record[0]) :
table->file->rnd_next(table->record[0]); table->file->rnd_next(table->record[0]);
break; break;
case RPREV: case RPREV:
DBUG_ASSERT(keyname != 0); DBUG_ASSERT(keyname != 0);
err=table->file->index_prev(table->record[0]); err=table->file->index_prev(table->record[0]);
@ -442,6 +443,8 @@ static TABLE **find_table_ptr_by_name(THD *thd, const char *db,
{ {
if (!dont_lock) if (!dont_lock)
VOID(pthread_mutex_lock(&LOCK_open)); VOID(pthread_mutex_lock(&LOCK_open));
table->file->ha_index_or_rnd_end();
if (close_thread_table(thd, table_ptr)) if (close_thread_table(thd, table_ptr))
{ {
/* Tell threads waiting for refresh that something has happened */ /* Tell threads waiting for refresh that something has happened */

View File

@ -1158,8 +1158,10 @@ end:
void free_items(Item *item) void free_items(Item *item)
{ {
DBUG_ENTER("free_items");
for (; item ; item=item->next) for (; item ; item=item->next)
item->delete_self(); item->delete_self();
DBUG_VOID_RETURN;
} }
/* This works because items are allocated with sql_alloc() */ /* This works because items are allocated with sql_alloc() */
@ -4380,16 +4382,17 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
{ {
LEX *lex; LEX *lex;
bool error= 0; bool error= 0;
DBUG_ENTER("mysql_test_parse_for_slave");
mysql_init_query(thd); mysql_init_query(thd);
lex= lex_start(thd, (uchar*) inBuf, length); lex= lex_start(thd, (uchar*) inBuf, length);
if (!yyparse((void*) thd) && ! thd->is_fatal_error && if (!yyparse((void*) thd) && ! thd->is_fatal_error &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first)) all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */ error= 1; /* Ignore question */
free_items(thd->free_list); /* Free strings used by items */ free_items(thd->free_list); /* Free strings used by items */
lex_end(lex); lex_end(lex);
return error; DBUG_RETURN(error);
} }
#endif #endif

View File

@ -1647,10 +1647,17 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
/* error is sent inside yyparse/send_prepare_results */ /* error is sent inside yyparse/send_prepare_results */
} }
else else
stmt->setup_set_params(); {
stmt->setup_set_params();
SELECT_LEX *sl= stmt->lex->all_selects_list;
/*
Save WHERE clause pointers, because they may be changed during query
optimisation.
*/
for (; sl; sl= sl->next_select_in_list())
sl->prep_where= sl->where;
}
DBUG_RETURN(!stmt); DBUG_RETURN(!stmt);
} }
/* Reinit statement before execution */ /* Reinit statement before execution */
@ -1839,7 +1846,9 @@ void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name)
my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE"); my_error(ER_WRONG_ARGUMENTS, MYF(0), "EXECUTE");
send_error(thd); send_error(thd);
} }
thd->current_arena= stmt;
execute_stmt(thd, stmt, &expanded_query, false); execute_stmt(thd, stmt, &expanded_query, false);
thd->current_arena= 0;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -1885,12 +1894,13 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt,
if (!(specialflag & SPECIAL_NO_PRIOR)) if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR); my_pthread_setprio(pthread_self(), WAIT_PRIOR);
/* Free Items that were created during this execution of the PS. */
free_items(thd->free_list);
cleanup_items(stmt->free_list); cleanup_items(stmt->free_list);
reset_stmt_params(stmt); reset_stmt_params(stmt);
close_thread_tables(thd); // to close derived tables close_thread_tables(thd); // to close derived tables
thd->set_statement(&thd->stmt_backup); thd->set_statement(&thd->stmt_backup);
/* Free Items that were created during this execution of the PS. */
free_items(thd->free_list);
thd->free_list= 0;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -2874,7 +2874,7 @@ best_access_path(JOIN *join,
Set tmp to (previous record count) * (records / combination) Set tmp to (previous record count) * (records / combination)
*/ */
if ((found_part & 1) && if ((found_part & 1) &&
(!(table->file->index_flags(key) & HA_ONLY_WHOLE_INDEX) || (!(table->file->index_flags(key, 0, 0) & HA_ONLY_WHOLE_INDEX) ||
found_part == PREV_BITS(uint,keyinfo->key_parts))) found_part == PREV_BITS(uint,keyinfo->key_parts)))
{ {
max_key_part=max_part_bit(found_part); max_key_part=max_part_bit(found_part);
@ -5107,7 +5107,7 @@ JOIN::join_free(bool full)
if (full) if (full)
{ {
group_fields.delete_elements(); group_fields.delete_elements();
tmp_table_param.copy_funcs.delete_elements(); tmp_table_param.copy_funcs.empty();
tmp_table_param.cleanup(); tmp_table_param.cleanup();
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
@ -5575,8 +5575,10 @@ propagate_cond_constants(I_List<COND_CMP> *save_list,COND *and_father,
COND *eliminate_not_funcs(THD *thd, COND *cond) COND *eliminate_not_funcs(THD *thd, COND *cond)
{ {
DBUG_ENTER("eliminate_not_funcs");
if (!cond) if (!cond)
return cond; DBUG_RETURN(cond);
if (cond->type() == Item::COND_ITEM) /* OR or AND */ if (cond->type() == Item::COND_ITEM) /* OR or AND */
{ {
List_iterator<Item> li(*((Item_cond*) cond)->argument_list()); List_iterator<Item> li(*((Item_cond*) cond)->argument_list());
@ -5601,7 +5603,7 @@ COND *eliminate_not_funcs(THD *thd, COND *cond)
cond= new_cond; cond= new_cond;
} }
} }
return cond; DBUG_RETURN(cond);
} }
@ -5838,8 +5840,7 @@ optimize_cond(JOIN *join, COND *conds, Item::cond_result *cond_value)
SELECT_LEX *select= thd->lex->current_select; SELECT_LEX *select= thd->lex->current_select;
if (select->first_cond_optimization) if (select->first_cond_optimization)
{ {
Item_arena *arena= select->first_cond_optimization ? Item_arena *arena= thd->current_arena;
thd->current_arena : 0;
Item_arena backup; Item_arena backup;
if (arena) if (arena)
thd->set_n_backup_item_arena(arena, &backup); thd->set_n_backup_item_arena(arena, &backup);
@ -8865,6 +8866,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
*/ */
if (!select->quick->reverse_sorted()) if (!select->quick->reverse_sorted())
{ {
int quick_type= select->quick->get_type();
/* here used_key_parts >0 */ /* here used_key_parts >0 */
if (!(table->file->index_flags(ref_key,used_key_parts-1, 1) if (!(table->file->index_flags(ref_key,used_key_parts-1, 1)
& HA_READ_PREV) || & HA_READ_PREV) ||