diff options
Diffstat (limited to 'mysql-test/r')
40 files changed, 1740 insertions, 735 deletions
diff --git a/mysql-test/r/comments.result b/mysql-test/r/comments.result index 98921c561d1..d8ac68e2468 100644 --- a/mysql-test/r/comments.result +++ b/mysql-test/r/comments.result @@ -36,3 +36,18 @@ select 1/*!999992*/; select 1 + /*!00000 2 */ + 3 /*!99999 noise*/ + 4; 1 + 2 + 3 + 4 10 +drop table if exists table_28779; +create table table_28779 (a int); +prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';"; +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 '/*' AND b = 'bar'' at line 1 +prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*' AND b = 'bar';*"; +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 '/*' AND b = 'bar';*' at line 1 +prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;"; +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 +prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*! AND 2=2;*"; +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 +prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';"; +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 '/*!98765' AND b = 'bar'' at line 1 +prepare bar from "DELETE FROM table_28779 WHERE a = 7 OR 1=1/*!98765' AND b = 'bar';*"; +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 '/*!98765' AND b = 'bar';*' at line 1 +drop table table_28779; diff --git a/mysql-test/r/ctype_ascii.result b/mysql-test/r/ctype_ascii.result new file mode 100644 index 00000000000..06362486073 --- /dev/null +++ b/mysql-test/r/ctype_ascii.result @@ -0,0 +1,177 @@ +set names ascii; +select 'e'='`'; +'e'='`' +0 +select 'y'='~'; +'y'='~' +0 +create table t1 (a char(1) character set ascii); +insert into t1 (a) values (' '), ('a'), ('b'), ('c'), ('d'), ('e'), ('f'), ('g'), ('h'), ('i'), ('j'), ('k'), ('l'), ('m'), ('n'), ('o'), ('p'), ('q'), ('r'), ('s'), ('t'), ('u'), ('v'), ('w'), ('x'), ('y'), ('z'), ('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H'), ('I'), ('J'), ('K'), ('L'), ('M'), ('N'), ('O'), ('P'), ('Q'), ('R'), ('S'), ('T'), ('U'), ('V'), ('W'), ('X'), ('Y'), ('Z'), ('!'), ('@'), ('#'), ('$'), ('%'), ('^'), ('&'), ('*'), ('('), (')'), ('_'), ('+'), ('`'), ('~'), ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9'), ('0'), ('['), (']'), ('\\'), ('|'), ('}'), ('{'), ('"'), (':'), (''''), (';'), ('/'), ('.'), (','), ('?'), ('>'), ('<'), ('\n'), ('\t'), ('\a'), ('\f'), ('\v'); +select t1a.a, t1b.a from t1 as t1a, t1 as t1b where t1a.a=t1b.a order by binary t1a.a, binary t1b.a; +a a + + + + + +! ! +" " +# # +$ $ +% % +& & +' ' +( ( +) ) +* * ++ + +, , +. . +/ / +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +: : +; ; +< < +> > +? ? +@ @ +A A +A a +A a +B B +B b +C C +C c +D D +D d +E E +E e +F F +F f +F f +G G +G g +H H +H h +I I +I i +J J +J j +K K +K k +L L +L l +M M +M m +N N +N n +O O +O o +P P +P p +Q Q +Q q +R R +R r +S S +S s +T T +T t +U U +U u +V V +V v +V v +W W +W w +X X +X x +Y Y +Y y +Z Z +Z z +[ [ +\ \ +] ] +^ ^ +_ _ +` ` +a A +a A +a a +a a +a a +a a +b B +b b +c C +c c +d D +d d +e E +e e +f F +f F +f f +f f +f f +f f +g G +g g +h H +h h +i I +i i +j J +j j +k K +k k +l L +l l +m M +m m +n N +n n +o O +o o +p P +p p +q Q +q q +r R +r r +s S +s s +t T +t t +u U +u u +v V +v V +v v +v v +v v +v v +w W +w w +x X +x x +y Y +y y +z Z +z z +{ { +| | +} } +~ ~ +drop table t1; +End of 5.0 tests. diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 11717679b42..c1c8b7b060e 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -80,7 +80,7 @@ select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T'); STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T') NULL Warnings: -Error 1411 Incorrect time value: '22.30.61' for function str_to_time +Error 1411 Incorrect time value: '22.30.61' for function str_to_date create table t1 (date char(30), format char(30) not null); insert into t1 values ('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'), @@ -352,21 +352,21 @@ Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL Warnings: -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time -Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time -Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time -Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time -Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date select date,format,concat(str_to_date(date, format),'') as con from t1; date format con 2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL @@ -386,21 +386,21 @@ Tuesday 52 2001 %W %u %x NULL 7 53 1998 %w %u %Y NULL NULL %m.%d.%Y NULL Warnings: -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_time -Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_time -Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_time -Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_time -Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_time -Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_time -Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_time -Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_time +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date +Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date +Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date +Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date +Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date +Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date +Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date +Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date truncate table t1; insert into t1 values ('10:20:10AM', '%h:%i:%s'), @@ -440,7 +440,7 @@ select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')); str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA')) NULL Warnings: -Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_time +Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001"); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used diff --git a/mysql-test/r/deadlock_innodb.result b/mysql-test/r/deadlock_innodb.result index a0686d1c844..7a4874d6aab 100644 --- a/mysql-test/r/deadlock_innodb.result +++ b/mysql-test/r/deadlock_innodb.result @@ -112,3 +112,14 @@ id x commit; # Switch to connection default + disconnect con1 and con2 drop table t1, t2; +End of 4.1 tests +set storage_engine=innodb; +drop table if exists a; +drop table if exists A; +create table A (c int); +insert into A (c) values (0); +create table a as select * from A; +drop table A; +drop table if exists a; +set storage_engine=default; +End of 5.0 tests. diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 579f5907882..d1ee6d1c5a1 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -454,8 +454,11 @@ create event закачка on schedule every 10 hour do select get_lock("test_l select definer, name, db from mysql.event; definer name db root@localhost закачка events_test -"Should be only 1 process" -select /*1*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; +"Should be only 0 process" +select /*1*/ user, host, db, command, state, info +from information_schema.processlist +where (user='event_scheduler') +order by info; user host db command state info select release_lock("test_lock1"); release_lock("test_lock1") @@ -472,14 +475,15 @@ get_lock("test_lock2", 20) 1 "Create an event which tries to acquire a mutex. The event locks on the mutex" create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20); -"Let some time pass to the event starts" "Should have only 2 processes: the scheduler and the locked event" -select /*2*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; +select /*2*/ user, host, db, command, state, info +from information_schema.processlist +where (info like "select get_lock%" OR user='event_scheduler') +order by info; user host db command state info event_scheduler localhost NULL Daemon Waiting for next activation NULL root localhost events_test Connect User lock select get_lock("test_lock2", 20) "Release the mutex, the event worker should finish." -"Release the mutex, the event worker should finish." select release_lock("test_lock2"); release_lock("test_lock2") 1 @@ -489,16 +493,25 @@ select get_lock("test_lock2_1", 20); get_lock("test_lock2_1", 20) 1 create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20); -"Should have only 3 processes: the scheduler, our conn and the locked event" -select /*3*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; +"Should have only 2 processes: the scheduler and the locked event" +select /*3*/ user, host, db, command, state, info +from information_schema.processlist +where (info like "select get_lock%" OR user='event_scheduler') +order by info; user host db command state info event_scheduler localhost NULL Daemon Waiting for next activation NULL root localhost events_test Connect User lock select get_lock("test_lock2_1", 20) set global event_scheduler=off; "Should have only our process now:" -select /*4*/ user, host, db, command, state, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; +select /*4*/ user, host, db, command, state, info +from information_schema.processlist +where (info like "select get_lock%" OR user='event_scheduler') +order by info; user host db command state info root localhost events_test Connect User lock select get_lock("test_lock2_1", 20) +select release_lock("test_lock2_1"); +release_lock("test_lock2_1") +1 drop event закачка21; create table t_16 (s1 int); create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5; diff --git a/mysql-test/r/events_logs_tests.result b/mysql-test/r/events_logs_tests.result index fb658b4a83b..b7faf56f466 100644 --- a/mysql-test/r/events_logs_tests.result +++ b/mysql-test/r/events_logs_tests.result @@ -52,7 +52,8 @@ do select 'events_logs_test' as inside_event, sleep(1.5); Nothing should be logged -select user_host, db, sql_text from mysql.slow_log where sql_text not like 'create event%'; +select user_host, db, sql_text from mysql.slow_log +where sql_text like 'select \'events_logs_test\'%'; user_host db sql_text set @@global.long_query_time=1; truncate mysql.slow_log; @@ -61,7 +62,8 @@ do select 'events_logs_test' as inside_event, sleep(1.5); Event sub-statement should be logged. -select user_host, db, sql_text from mysql.slow_log where sql_text not like 'create event%'; +select user_host, db, sql_text from mysql.slow_log +where sql_text like 'select \'events_logs_test\'%'; user_host db sql_text USER_HOST events_test select 'events_logs_test' as inside_event, sleep(1.5) drop database events_test; diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 447d5620a4d..39bf1470afe 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -191,3 +191,7 @@ drop table table_26093; drop function func_26093_a; drop function func_26093_b; End of 5.0 tests +select connection_id() > 0; +connection_id() > 0 +1 +End of tests diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index 1bd50612a3f..98b8922bc5f 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -515,3 +515,23 @@ ERROR 42S02: Table 'test.t1' doesn't exist drop table if exists t1; Warnings: Note 1051 Unknown table 't1' +drop table if exists t1; +create table t1 (a int) ENGINE=MEMORY; +--> client 2 +handler t1 open; +ERROR HY000: Table storage engine for 't1' doesn't have this option +--> client 1 +drop table t1; +drop table if exists t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias read a next; +ERROR 42000: Key 'a' doesn't exist in table 't1_alias' +handler t1_alias READ a next where inexistent > 0; +ERROR 42S22: Unknown column 'inexistent' in 'field list' +handler t1_alias read a next; +ERROR 42000: Key 'a' doesn't exist in table 't1_alias' +handler t1_alias READ a next where inexistent > 0; +ERROR 42S22: Unknown column 'inexistent' in 'field list' +handler t1_alias close; +drop table t1; diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index beb1a40c318..464b775b795 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -515,3 +515,23 @@ ERROR 42S02: Table 'test.t1' doesn't exist drop table if exists t1; Warnings: Note 1051 Unknown table 't1' +drop table if exists t1; +create table t1 (a int) ENGINE=MEMORY; +--> client 2 +handler t1 open; +ERROR HY000: Table storage engine for 't1' doesn't have this option +--> client 1 +drop table t1; +drop table if exists t1; +create table t1 (a int); +handler t1 open as t1_alias; +handler t1_alias read a next; +ERROR 42000: Key 'a' doesn't exist in table 't1_alias' +handler t1_alias READ a next where inexistent > 0; +ERROR 42S22: Unknown column 'inexistent' in 'field list' +handler t1_alias read a next; +ERROR 42000: Key 'a' doesn't exist in table 't1_alias' +handler t1_alias READ a next where inexistent > 0; +ERROR 42S22: Unknown column 'inexistent' in 'field list' +handler t1_alias close; +drop table t1; diff --git a/mysql-test/r/im_cmd_line.result b/mysql-test/r/im_cmd_line.result deleted file mode 100644 index a862d465904..00000000000 --- a/mysql-test/r/im_cmd_line.result +++ /dev/null @@ -1,47 +0,0 @@ -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 XXXXX -mysqld2 offline ---> Listing users... -im_admin - -==> Adding user 'testuser'... - ---> IM password file: -testuser:*0D3CED9BEC10A777AEC23CCC353A8C08A633045E -im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295 ---> EOF - ---> Printing out line for 'testuser'... -testuser:*0D3CED9BEC10A777AEC23CCC353A8C08A633045E - ---> Listing users... -im_admin -testuser - -==> Changing the password of 'testuser'... - ---> IM password file: -im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295 -testuser:*39C549BDECFBA8AFC3CE6B948C9359A0ECE08DE2 ---> EOF - ---> Printing out line for 'testuser'... -testuser:*39C549BDECFBA8AFC3CE6B948C9359A0ECE08DE2 - ---> Listing users... -testuser -im_admin - -==> Dropping user 'testuser'... - ---> IM password file: -im_admin:*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295 ---> EOF - ---> Listing users... -im_admin - diff --git a/mysql-test/r/im_daemon_life_cycle.result b/mysql-test/r/im_daemon_life_cycle.result deleted file mode 100644 index b3afb15f207..00000000000 --- a/mysql-test/r/im_daemon_life_cycle.result +++ /dev/null @@ -1,26 +0,0 @@ -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 XXXXX -mysqld2 offline -Killing the process... -Waiting... -Success: the process was restarted. -Success: server is ready to accept connection on socket. - --------------------------------------------------------------------- --- Test for BUG#12751 --------------------------------------------------------------------- -START INSTANCE mysqld2; -Success: the process has been started. -Killing the process... -Waiting... -Success: the process was restarted. -Success: server is ready to accept connection on socket. -SHOW INSTANCE STATUS mysqld1; -instance_name state version_number version mysqld_compatible -mysqld1 STATE VERSION_NUMBER VERSION no -STOP INSTANCE mysqld2; -Success: the process has been stopped. diff --git a/mysql-test/r/im_instance_conf.result b/mysql-test/r/im_instance_conf.result deleted file mode 100644 index d04ae0270ab..00000000000 --- a/mysql-test/r/im_instance_conf.result +++ /dev/null @@ -1,225 +0,0 @@ -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 XXXXX -mysqld2 offline --------------------------------------------------------------------- -server_id = 1 -server_id = 2 --------------------------------------------------------------------- -CREATE INSTANCE mysqld3 -server_id = 3, -socket = "$MYSQL_TMP_DIR/mysqld_3.sock"; -SHOW INSTANCES; -instance_name state -mysqld3 offline -mysqld2 offline -mysqld1 online --------------------------------------------------------------------- -server_id = 1 -server_id = 2 -server_id=3 --------------------------------------------------------------------- -CREATE INSTANCE mysqld1; -ERROR HY000: Instance already exists -CREATE INSTANCE mysqld2; -ERROR HY000: Instance already exists -CREATE INSTANCE mysqld3; -ERROR HY000: Instance already exists --------------------------------------------------------------------- -nonguarded --------------------------------------------------------------------- -CREATE INSTANCE mysqld4 -nonguarded, -server_id = 4, -socket = "$MYSQL_TMP_DIR/mysqld_4.sock"; -SHOW INSTANCES; -instance_name state -mysqld3 offline -mysqld4 offline -mysqld1 online -mysqld2 offline --------------------------------------------------------------------- -nonguarded -nonguarded --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -CREATE INSTANCE mysqld5 -test-A = 000, -test-B = test, -server_id = 5, -socket = "$MYSQL_TMP_DIR/mysqld_5.sock"; -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld4 offline -mysqld5 offline -mysqld2 offline -mysqld3 offline --------------------------------------------------------------------- -test-A=000 --------------------------------------------------------------------- -test-B=test --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -CREATE INSTANCE mysqld6 -test-C1 = 10 , -test-C2 = 02 , -server_id = 6, -socket = "$MYSQL_TMP_DIR/mysqld_6.sock"; -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline --------------------------------------------------------------------- -test-C1=10 --------------------------------------------------------------------- -test-C2=02 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -CREATE INSTANCE mysqld7 test-D = test-D-value ; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -CREATE INSTANCE mysqld8 test-E 0 ; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -CREATE INSTANCE mysqld8 test-F = ; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -CREATE INSTANCE mysqld9 -test-1=" hello world ", -test-2=' ', -server_id = 9, -socket = "$MYSQL_TMP_DIR/mysqld_9.sock"; -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -mysqld9 offline -CREATE INSTANCE mysqld10 -test-3='\b\babc\sdef', -server_id = 10, -socket = "$MYSQL_TMP_DIR/mysqld_10.sock"; -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld9 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -mysqld10 offline -mysqld2 offline -CREATE INSTANCE mysqld11 -test-4='abc\tdef', -test-5='abc\ndef', -server_id = 11, -socket = "$MYSQL_TMP_DIR/mysqld_11.sock"; -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld11 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -mysqld10 offline -mysqld2 offline -mysqld9 offline -CREATE INSTANCE mysqld12 -test-6="abc\rdef", -test-7="abc\\def", -server_id = 12, -socket = "$MYSQL_TMP_DIR/mysqld_12.sock"; -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld9 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -mysqld10 offline -mysqld2 offline -mysqld12 offline -mysqld11 offline -CREATE INSTANCE mysqld13 test-bad=' \ '; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld9 offline -mysqld5 offline -mysqld6 offline -mysqld3 offline -mysqld4 offline -mysqld10 offline -mysqld2 offline -mysqld12 offline -mysqld11 offline --------------------------------------------------------------------- -test-1= hello world --------------------------------------------------------------------- -test-2= --------------------------------------------------------------------- -test-3=abc def --------------------------------------------------------------------- -test-4=abc def --------------------------------------------------------------------- -test-5=abc --------------------------------------------------------------------- -test-6=abc
def --------------------------------------------------------------------- -test-7=abc\def --------------------------------------------------------------------- --------------------------------------------------------------------- -CREATE INSTANCE qqq1; -ERROR HY000: Malformed instance name. diff --git a/mysql-test/r/im_life_cycle.result b/mysql-test/r/im_life_cycle.result deleted file mode 100644 index dcabc8cf4f3..00000000000 --- a/mysql-test/r/im_life_cycle.result +++ /dev/null @@ -1,73 +0,0 @@ -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 XXXXX -mysqld2 offline - --------------------------------------------------------------------- --- 1.1.2. --------------------------------------------------------------------- -START INSTANCE mysqld2; -Success: the process has been started. -SHOW VARIABLES LIKE 'port'; -Variable_name Value -port IM_MYSQLD2_PORT - --------------------------------------------------------------------- --- 1.1.3. --------------------------------------------------------------------- -STOP INSTANCE mysqld2; -Success: the process has been stopped. - --------------------------------------------------------------------- --- 1.1.4. --------------------------------------------------------------------- -START INSTANCE mysqld3; -ERROR HY000: Unknown instance name -START INSTANCE mysqld1; -ERROR HY000: The instance is already started - --------------------------------------------------------------------- --- 1.1.5. --------------------------------------------------------------------- -STOP INSTANCE mysqld3; -ERROR HY000: Unknown instance name - --------------------------------------------------------------------- --- 1.1.6. --------------------------------------------------------------------- -Killing the process... -Waiting... -Success: the process was restarted. -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline - --------------------------------------------------------------------- --- 1.1.7. --------------------------------------------------------------------- -START INSTANCE mysqld2; -Success: the process has been started. -Killing the process... -Waiting... -Success: the process was killed. - --------------------------------------------------------------------- --- 1.1.8. --------------------------------------------------------------------- -SHOW INSTANCE STATUS; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use - --------------------------------------------------------------------- --- BUG#12813 --------------------------------------------------------------------- -START INSTANCE mysqld1,mysqld2,mysqld3; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -STOP INSTANCE mysqld1,mysqld2,mysqld3; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -STOP INSTANCE mysqld2; -ERROR HY000: Cannot stop instance. Perhaps the instance is not started, or was started manually, so IM cannot find the pidfile. -End of 5.0 tests diff --git a/mysql-test/r/im_options.result b/mysql-test/r/im_options.result deleted file mode 100644 index 22bd5d5bdf6..00000000000 --- a/mysql-test/r/im_options.result +++ /dev/null @@ -1,151 +0,0 @@ -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 XXXXX -mysqld2 offline -UNSET mysqld1.server_id; -ERROR HY000: The instance is active. Stop the instance first -SET mysqld1.server_id = 11; -ERROR HY000: The instance is active. Stop the instance first -CREATE INSTANCE mysqld3 -datadir = '/', -server_id = 3, -socket = "$MYSQL_TMP_DIR/mysqld_3.sock"; -START INSTANCE mysqld3; -UNSET mysqld3.server_id; -ERROR HY000: The instance is active. Stop the instance first -SET mysqld3.server_id = 11; -ERROR HY000: The instance is active. Stop the instance first -STOP INSTANCE mysqld3; -SHOW INSTANCE STATUS mysqld3; -instance_name state version_number version mysqld_compatible -mysqld3 offline VERSION_NUMBER VERSION no -UNSET mysqld2.server_id; -UNSET mysqld2.server_id; -SHOW INSTANCE OPTIONS mysqld2; -option_name value -instance_name option_value -socket option_value -pid-file option_value -port option_value -datadir option_value -log option_value -log-error option_value -log-slow-queries option_value -language option_value -character-sets-dir option_value -basedir option_value -shutdown-delay option_value -skip-stack-trace option_value -loose-skip-innodb option_value -loose-skip-ndbcluster option_value -nonguarded option_value -log-output option_value -SET mysqld2.server_id = 2; -SET mysqld2.server_id = 2; -SHOW INSTANCE OPTIONS mysqld2; -option_name value -instance_name option_value -socket option_value -pid-file option_value -port option_value -datadir option_value -log option_value -log-error option_value -log-slow-queries option_value -language option_value -character-sets-dir option_value -basedir option_value -shutdown-delay option_value -skip-stack-trace option_value -loose-skip-innodb option_value -loose-skip-ndbcluster option_value -nonguarded option_value -log-output option_value -server_id option_value -UNSET mysqld2.server_id = 11; -ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use -SET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc = 0010, mysqld3.ddd = 0020; --------------------------------------------------------------------- -aaa --------------------------------------------------------------------- -bbb --------------------------------------------------------------------- -ccc=0010 --------------------------------------------------------------------- -ddd=0020 --------------------------------------------------------------------- -UNSET mysqld2.aaa, mysqld3.bbb, mysqld2.ccc, mysqld3.ddd; --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -SET mysqld2.aaa, mysqld3.bbb, mysqld.ccc = 0010; -ERROR HY000: Unknown instance name --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -SET mysqld2.aaa, mysqld3.bbb, mysqld1.ccc = 0010; -ERROR HY000: The instance is active. Stop the instance first --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc; -ERROR HY000: Unknown instance name --------------------------------------------------------------------- -server_id = 1 -server_id=2 -server_id=3 --------------------------------------------------------------------- -UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc; -ERROR HY000: The instance is active. Stop the instance first --------------------------------------------------------------------- -server_id = 1 -server_id=2 -server_id=3 --------------------------------------------------------------------- -DROP INSTANCE mysqld3; -SET mysqld2.server_id=222; -SET mysqld2.server_id = 222; -SET mysqld2.server_id = 222 ; -SET mysqld2 . server_id = 222 ; -SET mysqld2 . server_id = 222 , mysqld2 . aaa , mysqld2 . bbb ; --------------------------------------------------------------------- -server_id = 1 -server_id=222 --------------------------------------------------------------------- -aaa --------------------------------------------------------------------- -bbb --------------------------------------------------------------------- -UNSET mysqld2 . aaa , mysqld2 . bbb ; --------------------------------------------------------------------- -server_id = 1 -server_id=222 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -server_id = 1 -server_id=222 --------------------------------------------------------------------- -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 online -mysqld2 offline -FLUSH INSTANCES; -ERROR HY000: At least one instance is active. Stop all instances first -STOP INSTANCE mysqld1; -SHOW INSTANCES; -instance_name state -mysqld1 offline -mysqld2 offline -FLUSH INSTANCES; diff --git a/mysql-test/r/im_utils.result b/mysql-test/r/im_utils.result deleted file mode 100644 index 586a5ab6a8d..00000000000 --- a/mysql-test/r/im_utils.result +++ /dev/null @@ -1,96 +0,0 @@ -SHOW VARIABLES LIKE 'server_id'; -Variable_name Value -server_id 1 -SHOW INSTANCES; -instance_name state -mysqld1 XXXXX -mysqld2 offline -SHOW INSTANCE OPTIONS mysqld1; -option_name value -instance_name VALUE -socket VALUE -pid-file VALUE -port VALUE -datadir VALUE -log VALUE -log-error VALUE -log-slow-queries VALUE -language VALUE -character-sets-dir VALUE -basedir VALUE -server_id VALUE -shutdown-delay VALUE -skip-stack-trace VALUE -loose-skip-innodb VALUE -loose-skip-ndbcluster VALUE -log-output VALUE -SHOW INSTANCE OPTIONS mysqld2; -option_name value -instance_name VALUE -socket VALUE -pid-file VALUE -port VALUE -datadir VALUE -log VALUE -log-error VALUE -log-slow-queries VALUE -language VALUE -character-sets-dir VALUE -basedir VALUE -server_id VALUE -shutdown-delay VALUE -skip-stack-trace VALUE -loose-skip-innodb VALUE -loose-skip-ndbcluster VALUE -nonguarded VALUE -log-output VALUE -START INSTANCE mysqld2; -Success: the process has been started. -STOP INSTANCE mysqld2; -Success: the process has been stopped. -SHOW mysqld1 LOG FILES; -Logfile Path File size -ERROR LOG PATH FILE_SIZE -GENERAL LOG PATH FILE_SIZE -SLOW LOG PATH FILE_SIZE -SHOW mysqld2 LOG FILES; -Logfile Path File size -ERROR LOG PATH FILE_SIZE -GENERAL LOG PATH FILE_SIZE -SLOW LOG PATH FILE_SIZE -SHOW mysqld1 LOG ERROR 10; -Log -LOG_DATA -SHOW mysqld1 LOG SLOW 10; -Log -LOG_DATA -SHOW mysqld1 LOG GENERAL 10; -Log -LOG_DATA -SHOW mysqld1 LOG ERROR 10, 2; -Log -LOG_DATA -SHOW mysqld1 LOG SLOW 10, 2; -Log -LOG_DATA -SHOW mysqld1 LOG GENERAL 10, 2; -Log -LOG_DATA -SHOW mysqld2 LOG ERROR 10; -Log -LOG_DATA -SHOW mysqld2 LOG SLOW 10; -Log -LOG_DATA -SHOW mysqld2 LOG GENERAL 10; -Log -LOG_DATA -SHOW mysqld2 LOG ERROR 10, 2; -Log -LOG_DATA -SHOW mysqld2 LOG SLOW 10, 2; -Log -LOG_DATA -SHOW mysqld2 LOG GENERAL 10, 2; -Log -LOG_DATA diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index b1c41ef45e8..d0b6813cfd1 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -196,7 +196,6 @@ t1 a select show columns from mysqltest.t1; Field Type Null Key Default Extra a int(11) YES NULL -b varchar(30) YES MUL NULL select table_name, column_name, privileges from information_schema.columns where table_schema = 'mysqltest' and table_name = 'v1'; table_name column_name privileges @@ -1410,6 +1409,31 @@ alter database; 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 alter database test; 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 database mysqltest; +create table mysqltest.t1(a int, b int, c int); +create trigger mysqltest.t1_ai after insert on mysqltest.t1 +for each row set @a = new.a + new.b + new.c; +grant select(b) on mysqltest.t1 to mysqltest_1@localhost; +select trigger_name from information_schema.triggers +where event_object_table='t1'; +trigger_name +t1_ai +show triggers from mysqltest; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +t1_ai INSERT t1 set @a = new.a + new.b + new.c AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci +show columns from t1; +Field Type Null Key Default Extra +b int(11) YES NULL +select column_name from information_schema.columns where table_name='t1'; +column_name +b +show triggers; +Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation +select trigger_name from information_schema.triggers +where event_object_table='t1'; +trigger_name +drop user mysqltest_1@localhost; +drop database mysqltest; End of 5.0 tests. select * from information_schema.engines WHERE ENGINE="MyISAM"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result index e5a5a583de3..51f7694ab68 100644 --- a/mysql-test/r/information_schema_db.result +++ b/mysql-test/r/information_schema_db.result @@ -151,13 +151,11 @@ create view v2 as select f1 from testdb_1.v1; create view v4 as select f1,f2 from testdb_1.v3; show fields from testdb_1.v5; Field Type Null Key Default Extra -f1 char(4) YES NULL show create view testdb_1.v5; View Create View character_set_client collation_connection v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci show fields from testdb_1.v6; Field Type Null Key Default Extra -f1 char(4) YES NULL show create view testdb_1.v6; View Create View character_set_client collation_connection v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index dce5e1a9a35..d0b67e90afb 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -501,7 +501,7 @@ ERROR 23000: Duplicate entry 'test2' for key 'ggid' select * from t1; id ggid email passwd 1 this will work -3 test2 this will work +4 test2 this will work select * from t1 where id=1; id ggid email passwd 1 this will work @@ -1086,39 +1086,6 @@ n d 1 30 2 20 drop table t1,t2; -CREATE TABLE `t1` ( -`a` int(11) NOT NULL auto_increment, -`b` int(11) default NULL, -PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; -CREATE TABLE `t2` ( -`a` int(11) NOT NULL auto_increment, -`b` int(11) default NULL, -PRIMARY KEY (`a`) -) ENGINE=INNODB DEFAULT CHARSET=latin1 ; -insert into t1 values (1,1),(2,2); -insert into t2 values (1,1),(4,4); -reset master; -UPDATE t2,t1 SET t2.a=t1.a+2; -ERROR 23000: Duplicate entry '3' for key 'PRIMARY' -select * from t2 /* must be (3,1), (4,4) */; -a b -1 1 -4 4 -show master status /* there must no UPDATE in binlog */; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 -delete from t1; -delete from t2; -insert into t1 values (1,2),(3,4),(4,4); -insert into t2 values (1,2),(3,4),(4,4); -reset master; -UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; -ERROR 23000: Duplicate entry '4' for key 'PRIMARY' -show master status /* there must be no UPDATE query event */; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 -drop table t1, t2; create table t1 (a int, b int) engine=innodb; insert into t1 values(20,null); select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on @@ -1784,13 +1751,13 @@ Variable_name Value Innodb_page_size 16384 show status like "Innodb_rows_deleted"; Variable_name Value -Innodb_rows_deleted 72 +Innodb_rows_deleted 70 show status like "Innodb_rows_inserted"; Variable_name Value -Innodb_rows_inserted 1088 +Innodb_rows_inserted 1083 show status like "Innodb_rows_updated"; Variable_name Value -Innodb_rows_updated 888 +Innodb_rows_updated 886 show status like "Innodb_row_lock_waits"; Variable_name Value Innodb_row_lock_waits 0 diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index ae442acd1b9..32c692501ad 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1123,6 +1123,24 @@ t1 CREATE TABLE `t1` ( KEY `a` (`a`(255)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 drop table t1; +CREATE TABLE t1 ( +a INT, +b INT, +KEY (b) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1,10), (2,10), (2,20), (3,30); +START TRANSACTION; +SELECT * FROM t1 WHERE b=20 FOR UPDATE; +a b +2 20 +START TRANSACTION; +SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE; +a b +1 10 +2 10 +ROLLBACK; +ROLLBACK; +DROP TABLE t1; End of 5.0 tests CREATE TABLE `t2` ( `k` int(11) NOT NULL auto_increment, diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result index 816060b7ec9..ac69cb65972 100644 --- a/mysql-test/r/insert_notembedded.result +++ b/mysql-test/r/insert_notembedded.result @@ -105,3 +105,22 @@ DROP VIEW view_target2; DROP VIEW view_target3; DROP USER user20989@localhost; DROP DATABASE meow; +connection: default +set low_priority_updates=1; +drop table if exists t1; +create table t1 (a int, b int, unique key t1$a (a)); +lock table t1 read; +connection: update +set low_priority_updates=1; +show variables like 'low_priority_updates'; +Variable_name Value +low_priority_updates ON +insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2;; +connection: select +select * from t1; +a b +connection: default +select * from t1; +a b +drop table t1; +set low_priority_updates=default; diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result index e89fbec0aed..4a0f70a7b88 100644 --- a/mysql-test/r/lock_multi.result +++ b/mysql-test/r/lock_multi.result @@ -106,4 +106,11 @@ i ERROR 70100: Query execution was interrupted unlock tables; drop table t1; +drop table if exists t1; +create table t1 (a int) ENGINE=MEMORY; +--> client 2 +handler t1 open; +ERROR HY000: Table storage engine for 't1' doesn't have this option +--> client 1 +drop table t1; End of 5.1 tests diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index f5b369f246a..df77bc99c22 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -176,5 +176,7 @@ ERROR at line 1: DELIMITER cannot contain a backslash character ERROR at line 1: DELIMITER cannot contain a backslash character 1 1 +1 +1 End of 5.0 tests WARNING: --server-arg option not supported in this configuration. diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 30ece1b121a..31846f68b7b 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -3,7 +3,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -14,7 +16,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -29,7 +33,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -40,7 +46,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -55,7 +63,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -66,7 +76,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK @@ -83,7 +95,9 @@ mysql.columns_priv OK mysql.db OK mysql.event OK mysql.func OK -mysql.general_log OK +mysql.general_log +Error : You can't use locks with log tables. +status : OK mysql.help_category OK mysql.help_keyword OK mysql.help_relation OK @@ -94,7 +108,9 @@ mysql.plugin OK mysql.proc OK mysql.procs_priv OK mysql.servers OK -mysql.slow_log OK +mysql.slow_log +Error : You can't use locks with log tables. +status : OK mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index ef6e4ee80fd..5347787d829 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -18,7 +18,11 @@ insert into t1 values(null, "f"); /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Start: binlog v #, server v ## created {yymmdd} {HH:MM:SS} at startup ROLLBACK/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 use test/*!*/; SET TIMESTAMP=1579609942/*!*/; SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; @@ -26,21 +30,43 @@ SET @@session.sql_mode=0/*!*/; /*!\C latin1 *//*!*/; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; create table t1 (a int auto_increment not null primary key, b char(3))/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar SET INSERT_ID=1/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a")/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar SET INSERT_ID=2/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b")/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar SET INSERT_ID=3/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c")/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar SET INSERT_ID=4/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d")/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Intvar SET INSERT_ID=5/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Query thread_id={integer} exec_time={integer} error_code=0 SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e")/*!*/; +# at {pos} +#{yymmdd} {HH:MM:SS} server id 1 end_log_pos {pos} Rotate to master-bin.000002 pos: {pos} DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/r/mysqlslap.result b/mysql-test/r/mysqlslap.result index cc8bc3dac31..dfe721d10d2 100644 --- a/mysql-test/r/mysqlslap.result +++ b/mysql-test/r/mysqlslap.result @@ -129,7 +129,6 @@ INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); select * from t1; select * from t2; -select * from t1; DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; @@ -141,7 +140,6 @@ INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); select * from t1; select * from t2; -select * from t1; DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; CREATE SCHEMA `mysqlslap`; @@ -153,6 +151,7 @@ INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); SHOW TABLES; select * from t1; +select * from t2; SHOW TABLES; DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; @@ -165,6 +164,7 @@ INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2'); SHOW TABLES; select * from t1; +select * from t2; SHOW TABLES; DROP SCHEMA IF EXISTS `mysqlslap`; DROP SCHEMA IF EXISTS `mysqlslap`; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 55f78d22272..d03e21b1bb0 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -280,8 +280,20 @@ let $B = changed value of B; var2: content of variable 1 var3: content of variable 1 content of variable 1 length of var3 is longer than 0 +var1 +hi 1 hi there +var2 +2 +var2 again +2 +var3 two columns with same name +1 2 3 +var4 from query that returns NULL +var5 from query that returns no row +failing query in let +mysqltest: At line 1: Error running query 'failing query': 1064 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 'failing query' at line 1 mysqltest: At line 1: Missing required argument 'filename' to command 'source' -mysqltest: At line 1: Could not open file ./non_existingFile +mysqltest: At line 1: Could not open file './non_existingFile' mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep mysqltest: In included file "MYSQLTEST_VARDIR/tmp/error.sql": At line 1: query 'garbage ' failed: 1064: 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 'garbage' at line 1 @@ -340,6 +352,8 @@ here is the sourced script In loop here is the sourced script here is the sourced script +"hello" +"hello" mysqltest: At line 1: Missing argument to sleep mysqltest: At line 1: Missing argument to real_sleep mysqltest: At line 1: Invalid argument to sleep "abc" @@ -461,7 +475,6 @@ root@localhost -------------------------------------------------------------------------------- this will be executed this will be executed -mysqltest: Result length mismatch mysqltest: The test didn't produce any output Failing multi statement query mysqltest: At line 3: query 'create table t1 (a int primary key); @@ -473,6 +486,8 @@ mysqltest: At line 3: query 'create table t1 (a int primary key); insert into t1 values (1); select 'select-me'; insertz 'error query'' failed: 1064: 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 'insertz 'error query'' at line 1 + +More results from queries before failure can be found in MYSQLTEST_VARDIR/log/bug11731.log drop table t1; Multi statement using expected error create table t1 (a int primary key); @@ -520,17 +535,19 @@ drop table t1; mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file' mysqltest: At line 1: Missing required argument 'filename' to command 'write_file' mysqltest: At line 1: End of file encountered before 'EOF' delimiter was found +Content for test_file1 +mysqltest: At line 1: File already exist: 'MYSQLTEST_VARDIR/tmp/test_file1.tmp' Some data for cat_file command of mysqltest -mysqltest: At line 1: Failed to open file non_existing_file +mysqltest: At line 1: Failed to open file 'non_existing_file' mysqltest: At line 1: Missing required argument 'filename' to command 'file_exists' mysqltest: At line 1: Missing required argument 'from_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'to_file' to command 'copy_file' mysqltest: At line 1: Missing required argument 'mode' to command 'chmod' mysqltest: At line 1: You must write a 4 digit octal number for mode mysqltest: At line 1: You must write a 4 digit octal number for mode -mysqltest: At line 1: Missing required argument 'file' to command 'chmod' +mysqltest: At line 1: Missing required argument 'filename' to command 'chmod' mysqltest: At line 1: You must write a 4 digit octal number for mode mysqltest: At line 1: You must write a 4 digit octal number for mode hello diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index cb44a235f25..76326f65f08 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -273,6 +273,16 @@ create table VAR_SAMP(a 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 'VAR_SAMP(a int)' at line 1 create table VAR_SAMP (a 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 'VAR_SAMP (a int)' at line 1 +DROP TABLE IF EXISTS table_25930_a; +DROP TABLE IF EXISTS table_25930_b; +SET SQL_MODE = 'ANSI_QUOTES'; +CREATE TABLE table_25930_a ( "blah" INT ); +CREATE TABLE table_25930_b SELECT "blah" - 1 FROM table_25930_a; +desc table_25930_b; +Field Type Null Key Default Extra +"blah" - 1 bigint(12) YES NULL +DROP TABLE table_25930_a; +DROP TABLE table_25930_b; SET @@sql_mode=@save_sql_mode; select pi(3.14); ERROR 42000: Incorrect parameter count in the call to native function 'pi' diff --git a/mysql-test/r/parser_precedence.result b/mysql-test/r/parser_precedence.result new file mode 100644 index 00000000000..cf301ec677b --- /dev/null +++ b/mysql-test/r/parser_precedence.result @@ -0,0 +1,747 @@ +drop table if exists t1_30237_bool; +create table t1_30237_bool(A boolean, B boolean, C boolean); +insert into t1_30237_bool values +(FALSE, FALSE, FALSE), +(FALSE, FALSE, NULL), +(FALSE, FALSE, TRUE), +(FALSE, NULL, FALSE), +(FALSE, NULL, NULL), +(FALSE, NULL, TRUE), +(FALSE, TRUE, FALSE), +(FALSE, TRUE, NULL), +(FALSE, TRUE, TRUE), +(NULL, FALSE, FALSE), +(NULL, FALSE, NULL), +(NULL, FALSE, TRUE), +(NULL, NULL, FALSE), +(NULL, NULL, NULL), +(NULL, NULL, TRUE), +(NULL, TRUE, FALSE), +(NULL, TRUE, NULL), +(NULL, TRUE, TRUE), +(TRUE, FALSE, FALSE), +(TRUE, FALSE, NULL), +(TRUE, FALSE, TRUE), +(TRUE, NULL, FALSE), +(TRUE, NULL, NULL), +(TRUE, NULL, TRUE), +(TRUE, TRUE, FALSE), +(TRUE, TRUE, NULL), +(TRUE, TRUE, TRUE) ; +Testing OR, XOR, AND +select A, B, A OR B, A XOR B, A AND B +from t1_30237_bool where C is null order by A, B; +A B A OR B A XOR B A AND B +NULL NULL NULL NULL NULL +NULL 0 NULL NULL 0 +NULL 1 1 NULL NULL +0 NULL NULL NULL 0 +0 0 0 0 0 +0 1 1 1 0 +1 NULL 1 NULL NULL +1 0 1 1 0 +1 1 1 0 1 +Testing that OR is associative +select A, B, C, (A OR B) OR C, A OR (B OR C), A OR B OR C +from t1_30237_bool order by A, B, C; +A B C (A OR B) OR C A OR (B OR C) A OR B OR C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 NULL NULL NULL +NULL NULL 1 1 1 1 +NULL 0 NULL NULL NULL NULL +NULL 0 0 NULL NULL NULL +NULL 0 1 1 1 1 +NULL 1 NULL 1 1 1 +NULL 1 0 1 1 1 +NULL 1 1 1 1 1 +0 NULL NULL NULL NULL NULL +0 NULL 0 NULL NULL NULL +0 NULL 1 1 1 1 +0 0 NULL NULL NULL NULL +0 0 0 0 0 0 +0 0 1 1 1 1 +0 1 NULL 1 1 1 +0 1 0 1 1 1 +0 1 1 1 1 1 +1 NULL NULL 1 1 1 +1 NULL 0 1 1 1 +1 NULL 1 1 1 1 +1 0 NULL 1 1 1 +1 0 0 1 1 1 +1 0 1 1 1 1 +1 1 NULL 1 1 1 +1 1 0 1 1 1 +1 1 1 1 1 1 +select count(*) from t1_30237_bool +where ((A OR B) OR C) != (A OR (B OR C)); +count(*) +0 +Testing that XOR is associative +select A, B, C, (A XOR B) XOR C, A XOR (B XOR C), A XOR B XOR C +from t1_30237_bool order by A, B, C; +A B C (A XOR B) XOR C A XOR (B XOR C) A XOR B XOR C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 NULL NULL NULL +NULL NULL 1 NULL NULL NULL +NULL 0 NULL NULL NULL NULL +NULL 0 0 NULL NULL NULL +NULL 0 1 NULL NULL NULL +NULL 1 NULL NULL NULL NULL +NULL 1 0 NULL NULL NULL +NULL 1 1 NULL NULL NULL +0 NULL NULL NULL NULL NULL +0 NULL 0 NULL NULL NULL +0 NULL 1 NULL NULL NULL +0 0 NULL NULL NULL NULL +0 0 0 0 0 0 +0 0 1 1 1 1 +0 1 NULL NULL NULL NULL +0 1 0 1 1 1 +0 1 1 0 0 0 +1 NULL NULL NULL NULL NULL +1 NULL 0 NULL NULL NULL +1 NULL 1 NULL NULL NULL +1 0 NULL NULL NULL NULL +1 0 0 1 1 1 +1 0 1 0 0 0 +1 1 NULL NULL NULL NULL +1 1 0 0 0 0 +1 1 1 1 1 1 +select count(*) from t1_30237_bool +where ((A XOR B) XOR C) != (A XOR (B XOR C)); +count(*) +0 +Testing that AND is associative +select A, B, C, (A AND B) AND C, A AND (B AND C), A AND B AND C +from t1_30237_bool order by A, B, C; +A B C (A AND B) AND C A AND (B AND C) A AND B AND C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 0 0 0 +NULL NULL 1 NULL NULL NULL +NULL 0 NULL 0 0 0 +NULL 0 0 0 0 0 +NULL 0 1 0 0 0 +NULL 1 NULL NULL NULL NULL +NULL 1 0 0 0 0 +NULL 1 1 NULL NULL NULL +0 NULL NULL 0 0 0 +0 NULL 0 0 0 0 +0 NULL 1 0 0 0 +0 0 NULL 0 0 0 +0 0 0 0 0 0 +0 0 1 0 0 0 +0 1 NULL 0 0 0 +0 1 0 0 0 0 +0 1 1 0 0 0 +1 NULL NULL NULL NULL NULL +1 NULL 0 0 0 0 +1 NULL 1 NULL NULL NULL +1 0 NULL 0 0 0 +1 0 0 0 0 0 +1 0 1 0 0 0 +1 1 NULL NULL NULL NULL +1 1 0 0 0 0 +1 1 1 1 1 1 +select count(*) from t1_30237_bool +where ((A AND B) AND C) != (A AND (B AND C)); +count(*) +0 +Testing that AND has precedence over OR +select A, B, C, (A OR B) AND C, A OR (B AND C), A OR B AND C +from t1_30237_bool order by A, B, C; +A B C (A OR B) AND C A OR (B AND C) A OR B AND C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 0 NULL NULL +NULL NULL 1 NULL NULL NULL +NULL 0 NULL NULL NULL NULL +NULL 0 0 0 NULL NULL +NULL 0 1 NULL NULL NULL +NULL 1 NULL NULL NULL NULL +NULL 1 0 0 NULL NULL +NULL 1 1 1 1 1 +0 NULL NULL NULL NULL NULL +0 NULL 0 0 0 0 +0 NULL 1 NULL NULL NULL +0 0 NULL 0 0 0 +0 0 0 0 0 0 +0 0 1 0 0 0 +0 1 NULL NULL NULL NULL +0 1 0 0 0 0 +0 1 1 1 1 1 +1 NULL NULL NULL 1 1 +1 NULL 0 0 1 1 +1 NULL 1 1 1 1 +1 0 NULL NULL 1 1 +1 0 0 0 1 1 +1 0 1 1 1 1 +1 1 NULL NULL 1 1 +1 1 0 0 1 1 +1 1 1 1 1 1 +select count(*) from t1_30237_bool +where (A OR (B AND C)) != (A OR B AND C); +count(*) +0 +select A, B, C, (A AND B) OR C, A AND (B OR C), A AND B OR C +from t1_30237_bool order by A, B, C; +A B C (A AND B) OR C A AND (B OR C) A AND B OR C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 NULL NULL NULL +NULL NULL 1 1 NULL 1 +NULL 0 NULL NULL NULL NULL +NULL 0 0 0 0 0 +NULL 0 1 1 NULL 1 +NULL 1 NULL NULL NULL NULL +NULL 1 0 NULL NULL NULL +NULL 1 1 1 NULL 1 +0 NULL NULL NULL 0 NULL +0 NULL 0 0 0 0 +0 NULL 1 1 0 1 +0 0 NULL NULL 0 NULL +0 0 0 0 0 0 +0 0 1 1 0 1 +0 1 NULL NULL 0 NULL +0 1 0 0 0 0 +0 1 1 1 0 1 +1 NULL NULL NULL NULL NULL +1 NULL 0 NULL NULL NULL +1 NULL 1 1 1 1 +1 0 NULL NULL NULL NULL +1 0 0 0 0 0 +1 0 1 1 1 1 +1 1 NULL 1 1 1 +1 1 0 1 1 1 +1 1 1 1 1 1 +select count(*) from t1_30237_bool +where ((A AND B) OR C) != (A AND B OR C); +count(*) +0 +Testing that AND has precedence over XOR +select A, B, C, (A XOR B) AND C, A XOR (B AND C), A XOR B AND C +from t1_30237_bool order by A, B, C; +A B C (A XOR B) AND C A XOR (B AND C) A XOR B AND C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 0 NULL NULL +NULL NULL 1 NULL NULL NULL +NULL 0 NULL NULL NULL NULL +NULL 0 0 0 NULL NULL +NULL 0 1 NULL NULL NULL +NULL 1 NULL NULL NULL NULL +NULL 1 0 0 NULL NULL +NULL 1 1 NULL NULL NULL +0 NULL NULL NULL NULL NULL +0 NULL 0 0 0 0 +0 NULL 1 NULL NULL NULL +0 0 NULL 0 0 0 +0 0 0 0 0 0 +0 0 1 0 0 0 +0 1 NULL NULL NULL NULL +0 1 0 0 0 0 +0 1 1 1 1 1 +1 NULL NULL NULL NULL NULL +1 NULL 0 0 1 1 +1 NULL 1 NULL NULL NULL +1 0 NULL NULL 1 1 +1 0 0 0 1 1 +1 0 1 1 1 1 +1 1 NULL 0 NULL NULL +1 1 0 0 1 1 +1 1 1 0 0 0 +select count(*) from t1_30237_bool +where (A XOR (B AND C)) != (A XOR B AND C); +count(*) +0 +select A, B, C, (A AND B) XOR C, A AND (B XOR C), A AND B XOR C +from t1_30237_bool order by A, B, C; +A B C (A AND B) XOR C A AND (B XOR C) A AND B XOR C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 NULL NULL NULL +NULL NULL 1 NULL NULL NULL +NULL 0 NULL NULL NULL NULL +NULL 0 0 0 0 0 +NULL 0 1 1 NULL 1 +NULL 1 NULL NULL NULL NULL +NULL 1 0 NULL NULL NULL +NULL 1 1 NULL 0 NULL +0 NULL NULL NULL 0 NULL +0 NULL 0 0 0 0 +0 NULL 1 1 0 1 +0 0 NULL NULL 0 NULL +0 0 0 0 0 0 +0 0 1 1 0 1 +0 1 NULL NULL 0 NULL +0 1 0 0 0 0 +0 1 1 1 0 1 +1 NULL NULL NULL NULL NULL +1 NULL 0 NULL NULL NULL +1 NULL 1 NULL NULL NULL +1 0 NULL NULL NULL NULL +1 0 0 0 0 0 +1 0 1 1 1 1 +1 1 NULL NULL NULL NULL +1 1 0 1 1 1 +1 1 1 0 0 0 +select count(*) from t1_30237_bool +where ((A AND B) XOR C) != (A AND B XOR C); +count(*) +0 +Testing that XOR has precedence over OR +select A, B, C, (A XOR B) OR C, A XOR (B OR C), A XOR B OR C +from t1_30237_bool order by A, B, C; +A B C (A XOR B) OR C A XOR (B OR C) A XOR B OR C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 NULL NULL NULL +NULL NULL 1 1 NULL 1 +NULL 0 NULL NULL NULL NULL +NULL 0 0 NULL NULL NULL +NULL 0 1 1 NULL 1 +NULL 1 NULL NULL NULL NULL +NULL 1 0 NULL NULL NULL +NULL 1 1 1 NULL 1 +0 NULL NULL NULL NULL NULL +0 NULL 0 NULL NULL NULL +0 NULL 1 1 1 1 +0 0 NULL NULL NULL NULL +0 0 0 0 0 0 +0 0 1 1 1 1 +0 1 NULL 1 1 1 +0 1 0 1 1 1 +0 1 1 1 1 1 +1 NULL NULL NULL NULL NULL +1 NULL 0 NULL NULL NULL +1 NULL 1 1 0 1 +1 0 NULL 1 NULL 1 +1 0 0 1 1 1 +1 0 1 1 0 1 +1 1 NULL NULL 0 NULL +1 1 0 0 0 0 +1 1 1 1 0 1 +select count(*) from t1_30237_bool +where ((A XOR B) OR C) != (A XOR B OR C); +count(*) +0 +select A, B, C, (A OR B) XOR C, A OR (B XOR C), A OR B XOR C +from t1_30237_bool order by A, B, C; +A B C (A OR B) XOR C A OR (B XOR C) A OR B XOR C +NULL NULL NULL NULL NULL NULL +NULL NULL 0 NULL NULL NULL +NULL NULL 1 NULL NULL NULL +NULL 0 NULL NULL NULL NULL +NULL 0 0 NULL NULL NULL +NULL 0 1 NULL 1 1 +NULL 1 NULL NULL NULL NULL +NULL 1 0 1 1 1 +NULL 1 1 0 NULL NULL +0 NULL NULL NULL NULL NULL +0 NULL 0 NULL NULL NULL +0 NULL 1 NULL NULL NULL +0 0 NULL NULL NULL NULL +0 0 0 0 0 0 +0 0 1 1 1 1 +0 1 NULL NULL NULL NULL +0 1 0 1 1 1 +0 1 1 0 0 0 +1 NULL NULL NULL 1 1 +1 NULL 0 1 1 1 +1 NULL 1 0 1 1 +1 0 NULL NULL 1 1 +1 0 0 1 1 1 +1 0 1 0 1 1 +1 1 NULL NULL 1 1 +1 1 0 1 1 1 +1 1 1 0 1 1 +select count(*) from t1_30237_bool +where (A OR (B XOR C)) != (A OR B XOR C); +count(*) +0 +drop table t1_30237_bool; +Testing that NOT has precedence over OR +select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE; +(NOT FALSE) OR TRUE NOT (FALSE OR TRUE) NOT FALSE OR TRUE +1 0 1 +Testing that NOT has precedence over XOR +select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE; +(NOT FALSE) XOR FALSE NOT (FALSE XOR FALSE) NOT FALSE XOR FALSE +1 1 1 +Testing that NOT has precedence over AND +select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE; +(NOT FALSE) AND FALSE NOT (FALSE AND FALSE) NOT FALSE AND FALSE +0 1 0 +Testing that NOT is associative +select NOT NOT TRUE, NOT NOT NOT FALSE; +NOT NOT TRUE NOT NOT NOT FALSE +1 1 +Testing that IS has precedence over NOT +select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE; +(NOT NULL) IS TRUE NOT (NULL IS TRUE) NOT NULL IS TRUE +0 1 1 +select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE; +(NOT NULL) IS NOT TRUE NOT (NULL IS NOT TRUE) NOT NULL IS NOT TRUE +1 0 0 +select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE; +(NOT NULL) IS FALSE NOT (NULL IS FALSE) NOT NULL IS FALSE +0 1 1 +select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE; +(NOT NULL) IS NOT FALSE NOT (NULL IS NOT FALSE) NOT NULL IS NOT FALSE +1 0 0 +select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN; +(NOT TRUE) IS UNKNOWN NOT (TRUE IS UNKNOWN) NOT TRUE IS UNKNOWN +0 1 1 +select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN; +(NOT TRUE) IS NOT UNKNOWN NOT (TRUE IS NOT UNKNOWN) NOT TRUE IS NOT UNKNOWN +1 0 0 +select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL; +(NOT TRUE) IS NULL NOT (TRUE IS NULL) NOT TRUE IS NULL +0 1 1 +select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL; +(NOT TRUE) IS NOT NULL NOT (TRUE IS NOT NULL) NOT TRUE IS NOT NULL +1 0 0 +Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative +select TRUE IS TRUE IS TRUE IS TRUE; +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 'IS TRUE IS TRUE' at line 1 +select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE; +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 'IS NOT TRUE IS NOT TRUE' at line 1 +select NULL IS FALSE IS FALSE IS FALSE; +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 'IS FALSE IS FALSE' at line 1 +select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE; +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 'IS NOT FALSE IS NOT FALSE' at line 1 +select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN; +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 'IS UNKNOWN IS UNKNOWN' at line 1 +select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN; +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 'IS NOT UNKNOWN IS NOT UNKNOWN' at line 1 +Testing that IS [NOT] NULL predicates are associative +select FALSE IS NULL IS NULL IS NULL; +FALSE IS NULL IS NULL IS NULL +0 +select TRUE IS NOT NULL IS NOT NULL IS NOT NULL; +TRUE IS NOT NULL IS NOT NULL IS NOT NULL +1 +Testing that comparison operators are left associative +select 1 <=> 2 <=> 2, (1 <=> 2) <=> 2, 1 <=> (2 <=> 2); +1 <=> 2 <=> 2 (1 <=> 2) <=> 2 1 <=> (2 <=> 2) +0 0 1 +select 1 = 2 = 2, (1 = 2) = 2, 1 = (2 = 2); +1 = 2 = 2 (1 = 2) = 2 1 = (2 = 2) +0 0 1 +select 1 != 2 != 3, (1 != 2) != 3, 1 != (2 != 3); +1 != 2 != 3 (1 != 2) != 3 1 != (2 != 3) +1 1 0 +select 1 <> 2 <> 3, (1 <> 2) <> 3, 1 <> (2 <> 3); +1 <> 2 <> 3 (1 <> 2) <> 3 1 <> (2 <> 3) +1 1 0 +select 1 < 2 < 3, (1 < 2) < 3, 1 < (2 < 3); +1 < 2 < 3 (1 < 2) < 3 1 < (2 < 3) +1 1 0 +select 3 <= 2 <= 1, (3 <= 2) <= 1, 3 <= (2 <= 1); +3 <= 2 <= 1 (3 <= 2) <= 1 3 <= (2 <= 1) +1 1 0 +select 1 > 2 > 3, (1 > 2) > 3, 1 > (2 > 3); +1 > 2 > 3 (1 > 2) > 3 1 > (2 > 3) +0 0 1 +select 1 >= 2 >= 3, (1 >= 2) >= 3, 1 >= (2 >= 3); +1 >= 2 >= 3 (1 >= 2) >= 3 1 >= (2 >= 3) +0 0 1 +Testing that | is associative +select 0xF0 | 0x0F | 0x55, (0xF0 | 0x0F) | 0x55, 0xF0 | (0x0F | 0x55); +0xF0 | 0x0F | 0x55 (0xF0 | 0x0F) | 0x55 0xF0 | (0x0F | 0x55) +255 255 255 +Testing that & is associative +select 0xF5 & 0x5F & 0x55, (0xF5 & 0x5F) & 0x55, 0xF5 & (0x5F & 0x55); +0xF5 & 0x5F & 0x55 (0xF5 & 0x5F) & 0x55 0xF5 & (0x5F & 0x55) +85 85 85 +Testing that << is left associative +select 4 << 3 << 2, (4 << 3) << 2, 4 << (3 << 2); +4 << 3 << 2 (4 << 3) << 2 4 << (3 << 2) +128 128 16384 +Testing that >> is left associative +select 256 >> 3 >> 2, (256 >> 3) >> 2, 256 >> (3 >> 2); +256 >> 3 >> 2 (256 >> 3) >> 2 256 >> (3 >> 2) +8 8 256 +Testing that & has precedence over | +select 0xF0 & 0x0F | 0x55, (0xF0 & 0x0F) | 0x55, 0xF0 & (0x0F | 0x55); +0xF0 & 0x0F | 0x55 (0xF0 & 0x0F) | 0x55 0xF0 & (0x0F | 0x55) +85 85 80 +select 0x55 | 0xF0 & 0x0F, (0x55 | 0xF0) & 0x0F, 0x55 | (0xF0 & 0x0F); +0x55 | 0xF0 & 0x0F (0x55 | 0xF0) & 0x0F 0x55 | (0xF0 & 0x0F) +85 5 85 +Testing that << has precedence over | +select 0x0F << 4 | 0x0F, (0x0F << 4) | 0x0F, 0x0F << (4 | 0x0F); +0x0F << 4 | 0x0F (0x0F << 4) | 0x0F 0x0F << (4 | 0x0F) +255 255 491520 +select 0x0F | 0x0F << 4, (0x0F | 0x0F) << 4, 0x0F | (0x0F << 4); +0x0F | 0x0F << 4 (0x0F | 0x0F) << 4 0x0F | (0x0F << 4) +255 240 255 +Testing that >> has precedence over | +select 0xF0 >> 4 | 0xFF, (0xF0 >> 4) | 0xFF, 0xF0 >> (4 | 0xFF); +0xF0 >> 4 | 0xFF (0xF0 >> 4) | 0xFF 0xF0 >> (4 | 0xFF) +255 255 0 +select 0xFF | 0xF0 >> 4, (0xFF | 0xF0) >> 4, 0xFF | (0xF0 >> 4); +0xFF | 0xF0 >> 4 (0xFF | 0xF0) >> 4 0xFF | (0xF0 >> 4) +255 15 255 +Testing that << has precedence over & +select 0x0F << 4 & 0xF0, (0x0F << 4) & 0xF0, 0x0F << (4 & 0xF0); +0x0F << 4 & 0xF0 (0x0F << 4) & 0xF0 0x0F << (4 & 0xF0) +240 240 15 +select 0xF0 & 0x0F << 4, (0xF0 & 0x0F) << 4, 0xF0 & (0x0F << 4); +0xF0 & 0x0F << 4 (0xF0 & 0x0F) << 4 0xF0 & (0x0F << 4) +240 0 240 +Testing that >> has precedence over & +select 0xF0 >> 4 & 0x55, (0xF0 >> 4) & 0x55, 0xF0 >> (4 & 0x55); +0xF0 >> 4 & 0x55 (0xF0 >> 4) & 0x55 0xF0 >> (4 & 0x55) +5 5 15 +select 0x0F & 0xF0 >> 4, (0x0F & 0xF0) >> 4, 0x0F & (0xF0 >> 4); +0x0F & 0xF0 >> 4 (0x0F & 0xF0) >> 4 0x0F & (0xF0 >> 4) +15 0 15 +Testing that >> and << have the same precedence +select 0xFF >> 4 << 2, (0xFF >> 4) << 2, 0xFF >> (4 << 2); +0xFF >> 4 << 2 (0xFF >> 4) << 2 0xFF >> (4 << 2) +60 60 0 +select 0x0F << 4 >> 2, (0x0F << 4) >> 2, 0x0F << (4 >> 2); +0x0F << 4 >> 2 (0x0F << 4) >> 2 0x0F << (4 >> 2) +60 60 30 +Testing that binary + is associative +select 1 + 2 + 3, (1 + 2) + 3, 1 + (2 + 3); +1 + 2 + 3 (1 + 2) + 3 1 + (2 + 3) +6 6 6 +Testing that binary - is left associative +select 1 - 2 - 3, (1 - 2) - 3, 1 - (2 - 3); +1 - 2 - 3 (1 - 2) - 3 1 - (2 - 3) +-4 -4 2 +Testing that binary + and binary - have the same precedence +select 1 + 2 - 3, (1 + 2) - 3, 1 + (2 - 3); +1 + 2 - 3 (1 + 2) - 3 1 + (2 - 3) +0 0 0 +select 1 - 2 + 3, (1 - 2) + 3, 1 - (2 + 3); +1 - 2 + 3 (1 - 2) + 3 1 - (2 + 3) +2 2 -4 +Testing that binary + has precedence over | +select 0xF0 + 0x0F | 0x55, (0xF0 + 0x0F) | 0x55, 0xF0 + (0x0F | 0x55); +0xF0 + 0x0F | 0x55 (0xF0 + 0x0F) | 0x55 0xF0 + (0x0F | 0x55) +255 255 335 +select 0x55 | 0xF0 + 0x0F, (0x55 | 0xF0) + 0x0F, 0x55 | (0xF0 + 0x0F); +0x55 | 0xF0 + 0x0F (0x55 | 0xF0) + 0x0F 0x55 | (0xF0 + 0x0F) +255 260 255 +Testing that binary + has precedence over & +select 0xF0 + 0x0F & 0x55, (0xF0 + 0x0F) & 0x55, 0xF0 + (0x0F & 0x55); +0xF0 + 0x0F & 0x55 (0xF0 + 0x0F) & 0x55 0xF0 + (0x0F & 0x55) +85 85 245 +select 0x55 & 0xF0 + 0x0F, (0x55 & 0xF0) + 0x0F, 0x55 & (0xF0 + 0x0F); +0x55 & 0xF0 + 0x0F (0x55 & 0xF0) + 0x0F 0x55 & (0xF0 + 0x0F) +85 95 85 +Testing that binary + has precedence over << +select 2 + 3 << 4, (2 + 3) << 4, 2 + (3 << 4); +2 + 3 << 4 (2 + 3) << 4 2 + (3 << 4) +80 80 50 +select 3 << 4 + 2, (3 << 4) + 2, 3 << (4 + 2); +3 << 4 + 2 (3 << 4) + 2 3 << (4 + 2) +192 50 192 +Testing that binary + has precedence over >> +select 4 + 3 >> 2, (4 + 3) >> 2, 4 + (3 >> 2); +4 + 3 >> 2 (4 + 3) >> 2 4 + (3 >> 2) +1 1 4 +select 3 >> 2 + 1, (3 >> 2) + 1, 3 >> (2 + 1); +3 >> 2 + 1 (3 >> 2) + 1 3 >> (2 + 1) +0 1 0 +Testing that binary - has precedence over | +select 0xFF - 0x0F | 0x55, (0xFF - 0x0F) | 0x55, 0xFF - (0x0F | 0x55); +0xFF - 0x0F | 0x55 (0xFF - 0x0F) | 0x55 0xFF - (0x0F | 0x55) +245 245 160 +select 0x55 | 0xFF - 0xF0, (0x55 | 0xFF) - 0xF0, 0x55 | (0xFF - 0xF0); +0x55 | 0xFF - 0xF0 (0x55 | 0xFF) - 0xF0 0x55 | (0xFF - 0xF0) +95 15 95 +Testing that binary - has precedence over & +select 0xFF - 0xF0 & 0x55, (0xFF - 0xF0) & 0x55, 0xFF - (0xF0 & 0x55); +0xFF - 0xF0 & 0x55 (0xFF - 0xF0) & 0x55 0xFF - (0xF0 & 0x55) +5 5 175 +select 0x55 & 0xFF - 0xF0, (0x55 & 0xFF) - 0xF0, 0x55 & (0xFF - 0xF0); +0x55 & 0xFF - 0xF0 (0x55 & 0xFF) - 0xF0 0x55 & (0xFF - 0xF0) +5 -155 5 +Testing that binary - has precedence over << +select 16 - 3 << 2, (16 - 3) << 2, 16 - (3 << 2); +16 - 3 << 2 (16 - 3) << 2 16 - (3 << 2) +52 52 4 +select 4 << 3 - 2, (4 << 3) - 2, 4 << (3 - 2); +4 << 3 - 2 (4 << 3) - 2 4 << (3 - 2) +8 30 8 +Testing that binary - has precedence over >> +select 16 - 3 >> 2, (16 - 3) >> 2, 16 - (3 >> 2); +16 - 3 >> 2 (16 - 3) >> 2 16 - (3 >> 2) +3 3 16 +select 16 >> 3 - 2, (16 >> 3) - 2, 16 >> (3 - 2); +16 >> 3 - 2 (16 >> 3) - 2 16 >> (3 - 2) +8 0 8 +Testing that * is associative +select 2 * 3 * 4, (2 * 3) * 4, 2 * (3 * 4); +2 * 3 * 4 (2 * 3) * 4 2 * (3 * 4) +24 24 24 +Testing that * has precedence over | +select 2 * 0x40 | 0x0F, (2 * 0x40) | 0x0F, 2 * (0x40 | 0x0F); +2 * 0x40 | 0x0F (2 * 0x40) | 0x0F 2 * (0x40 | 0x0F) +143 143 158 +select 0x0F | 2 * 0x40, (0x0F | 2) * 0x40, 0x0F | (2 * 0x40); +0x0F | 2 * 0x40 (0x0F | 2) * 0x40 0x0F | (2 * 0x40) +143 960 143 +Testing that * has precedence over & +select 2 * 0x40 & 0x55, (2 * 0x40) & 0x55, 2 * (0x40 & 0x55); +2 * 0x40 & 0x55 (2 * 0x40) & 0x55 2 * (0x40 & 0x55) +0 0 128 +select 0xF0 & 2 * 0x40, (0xF0 & 2) * 0x40, 0xF0 & (2 * 0x40); +0xF0 & 2 * 0x40 (0xF0 & 2) * 0x40 0xF0 & (2 * 0x40) +128 0 128 +Testing that * has precedence over << +select 5 * 3 << 4, (5 * 3) << 4, 5 * (3 << 4); +5 * 3 << 4 (5 * 3) << 4 5 * (3 << 4) +240 240 240 +select 2 << 3 * 4, (2 << 3) * 4, 2 << (3 * 4); +2 << 3 * 4 (2 << 3) * 4 2 << (3 * 4) +8192 64 8192 +Testing that * has precedence over >> +select 3 * 4 >> 2, (3 * 4) >> 2, 3 * (4 >> 2); +3 * 4 >> 2 (3 * 4) >> 2 3 * (4 >> 2) +3 3 3 +select 4 >> 2 * 3, (4 >> 2) * 3, 4 >> (2 * 3); +4 >> 2 * 3 (4 >> 2) * 3 4 >> (2 * 3) +0 3 0 +Testing that * has precedence over binary + +select 2 * 3 + 4, (2 * 3) + 4, 2 * (3 + 4); +2 * 3 + 4 (2 * 3) + 4 2 * (3 + 4) +10 10 14 +select 2 + 3 * 4, (2 + 3) * 4, 2 + (3 * 4); +2 + 3 * 4 (2 + 3) * 4 2 + (3 * 4) +14 20 14 +Testing that * has precedence over binary - +select 4 * 3 - 2, (4 * 3) - 2, 4 * (3 - 2); +4 * 3 - 2 (4 * 3) - 2 4 * (3 - 2) +10 10 4 +select 4 - 3 * 2, (4 - 3) * 2, 4 - (3 * 2); +4 - 3 * 2 (4 - 3) * 2 4 - (3 * 2) +-2 2 -2 +Testing that / is left associative +select 15 / 5 / 3, (15 / 5) / 3, 15 / (5 / 3); +15 / 5 / 3 (15 / 5) / 3 15 / (5 / 3) +1.00000000 1.00000000 9.0000 +Testing that / has precedence over | +select 105 / 5 | 2, (105 / 5) | 2, 105 / (5 | 2); +105 / 5 | 2 (105 / 5) | 2 105 / (5 | 2) +23 23 15.0000 +select 105 | 2 / 5, (105 | 2) / 5, 105 | (2 / 5); +105 | 2 / 5 (105 | 2) / 5 105 | (2 / 5) +105 21.4000 105 +Testing that / has precedence over & +select 105 / 5 & 0x0F, (105 / 5) & 0x0F, 105 / (5 & 0x0F); +105 / 5 & 0x0F (105 / 5) & 0x0F 105 / (5 & 0x0F) +5 5 21.0000 +select 0x0F & 105 / 5, (0x0F & 105) / 5, 0x0F & (105 / 5); +0x0F & 105 / 5 (0x0F & 105) / 5 0x0F & (105 / 5) +5 1.8000 5 +Testing that / has precedence over << +select 0x80 / 4 << 2, (0x80 / 4) << 2, 0x80 / (4 << 2); +0x80 / 4 << 2 (0x80 / 4) << 2 0x80 / (4 << 2) +128 128 8.0000 +select 0x80 << 4 / 2, (0x80 << 4) / 2, 0x80 << (4 / 2); +0x80 << 4 / 2 (0x80 << 4) / 2 0x80 << (4 / 2) +512 1024.0000 512 +Testing that / has precedence over >> +select 0x80 / 4 >> 2, (0x80 / 4) >> 2, 0x80 / (4 >> 2); +0x80 / 4 >> 2 (0x80 / 4) >> 2 0x80 / (4 >> 2) +8 8 128.0000 +select 0x80 >> 4 / 2, (0x80 >> 4) / 2, 0x80 >> (4 / 2); +0x80 >> 4 / 2 (0x80 >> 4) / 2 0x80 >> (4 / 2) +32 4.0000 32 +Testing that / has precedence over binary + +select 0x80 / 2 + 2, (0x80 / 2) + 2, 0x80 / (2 + 2); +0x80 / 2 + 2 (0x80 / 2) + 2 0x80 / (2 + 2) +66.0000 66.0000 32.0000 +select 0x80 + 2 / 2, (0x80 + 2) / 2, 0x80 + (2 / 2); +0x80 + 2 / 2 (0x80 + 2) / 2 0x80 + (2 / 2) +129.0000 65.0000 129.0000 +Testing that / has precedence over binary - +select 0x80 / 4 - 2, (0x80 / 4) - 2, 0x80 / (4 - 2); +0x80 / 4 - 2 (0x80 / 4) - 2 0x80 / (4 - 2) +30.0000 30.0000 64.0000 +select 0x80 - 4 / 2, (0x80 - 4) / 2, 0x80 - (4 / 2); +0x80 - 4 / 2 (0x80 - 4) / 2 0x80 - (4 / 2) +126.0000 62.0000 126.0000 +Testing that ^ is associative +select 0xFF ^ 0xF0 ^ 0x0F, (0xFF ^ 0xF0) ^ 0x0F, 0xFF ^ (0xF0 ^ 0x0F); +0xFF ^ 0xF0 ^ 0x0F (0xFF ^ 0xF0) ^ 0x0F 0xFF ^ (0xF0 ^ 0x0F) +0 0 0 +select 0xFF ^ 0xF0 ^ 0x55, (0xFF ^ 0xF0) ^ 0x55, 0xFF ^ (0xF0 ^ 0x55); +0xFF ^ 0xF0 ^ 0x55 (0xFF ^ 0xF0) ^ 0x55 0xFF ^ (0xF0 ^ 0x55) +90 90 90 +Testing that ^ has precedence over | +select 0xFF ^ 0xF0 | 0x0F, (0xFF ^ 0xF0) | 0x0F, 0xFF ^ (0xF0 | 0x0F); +0xFF ^ 0xF0 | 0x0F (0xFF ^ 0xF0) | 0x0F 0xFF ^ (0xF0 | 0x0F) +15 15 0 +select 0xF0 | 0xFF ^ 0xF0, (0xF0 | 0xFF) ^ 0xF0, 0xF0 | (0xFF ^ 0xF0); +0xF0 | 0xFF ^ 0xF0 (0xF0 | 0xFF) ^ 0xF0 0xF0 | (0xFF ^ 0xF0) +255 15 255 +Testing that ^ has precedence over & +select 0xFF ^ 0xF0 & 0x0F, (0xFF ^ 0xF0) & 0x0F, 0xFF ^ (0xF0 & 0x0F); +0xFF ^ 0xF0 & 0x0F (0xFF ^ 0xF0) & 0x0F 0xFF ^ (0xF0 & 0x0F) +15 15 255 +select 0x0F & 0xFF ^ 0xF0, (0x0F & 0xFF) ^ 0xF0, 0x0F & (0xFF ^ 0xF0); +0x0F & 0xFF ^ 0xF0 (0x0F & 0xFF) ^ 0xF0 0x0F & (0xFF ^ 0xF0) +15 255 15 +Testing that ^ has precedence over << +select 0xFF ^ 0xF0 << 2, (0xFF ^ 0xF0) << 2, 0xFF ^ (0xF0 << 2); +0xFF ^ 0xF0 << 2 (0xFF ^ 0xF0) << 2 0xFF ^ (0xF0 << 2) +60 60 831 +select 0x0F << 2 ^ 0xFF, (0x0F << 2) ^ 0xFF, 0x0F << (2 ^ 0xFF); +0x0F << 2 ^ 0xFF (0x0F << 2) ^ 0xFF 0x0F << (2 ^ 0xFF) +0 195 0 +Testing that ^ has precedence over >> +select 0xFF ^ 0xF0 >> 2, (0xFF ^ 0xF0) >> 2, 0xFF ^ (0xF0 >> 2); +0xFF ^ 0xF0 >> 2 (0xFF ^ 0xF0) >> 2 0xFF ^ (0xF0 >> 2) +3 3 195 +select 0xFF >> 2 ^ 0xF0, (0xFF >> 2) ^ 0xF0, 0xFF >> (2 ^ 0xF0); +0xFF >> 2 ^ 0xF0 (0xFF >> 2) ^ 0xF0 0xFF >> (2 ^ 0xF0) +0 207 0 +Testing that ^ has precedence over binary + +select 0xFF ^ 0xF0 + 0x0F, (0xFF ^ 0xF0) + 0x0F, 0xFF ^ (0xF0 + 0x0F); +0xFF ^ 0xF0 + 0x0F (0xFF ^ 0xF0) + 0x0F 0xFF ^ (0xF0 + 0x0F) +30 30 0 +select 0x0F + 0xFF ^ 0xF0, (0x0F + 0xFF) ^ 0xF0, 0x0F + (0xFF ^ 0xF0); +0x0F + 0xFF ^ 0xF0 (0x0F + 0xFF) ^ 0xF0 0x0F + (0xFF ^ 0xF0) +30 510 30 +Testing that ^ has precedence over binary - +select 0xFF ^ 0xF0 - 1, (0xFF ^ 0xF0) - 1, 0xFF ^ (0xF0 - 1); +0xFF ^ 0xF0 - 1 (0xFF ^ 0xF0) - 1 0xFF ^ (0xF0 - 1) +14 14 16 +select 0x55 - 0x0F ^ 0x55, (0x55 - 0x0F) ^ 0x55, 0x55 - (0x0F ^ 0x55); +0x55 - 0x0F ^ 0x55 (0x55 - 0x0F) ^ 0x55 0x55 - (0x0F ^ 0x55) +-5 19 -5 +Testing that ^ has precedence over * +select 0xFF ^ 0xF0 * 2, (0xFF ^ 0xF0) * 2, 0xFF ^ (0xF0 * 2); +0xFF ^ 0xF0 * 2 (0xFF ^ 0xF0) * 2 0xFF ^ (0xF0 * 2) +30 30 287 +select 2 * 0xFF ^ 0xF0, (2 * 0xFF) ^ 0xF0, 2 * (0xFF ^ 0xF0); +2 * 0xFF ^ 0xF0 (2 * 0xFF) ^ 0xF0 2 * (0xFF ^ 0xF0) +30 270 30 +Testing that ^ has precedence over / +select 0xFF ^ 0xF0 / 2, (0xFF ^ 0xF0) / 2, 0xFF ^ (0xF0 / 2); +0xFF ^ 0xF0 / 2 (0xFF ^ 0xF0) / 2 0xFF ^ (0xF0 / 2) +7.5000 7.5000 135 +select 0xF2 / 2 ^ 0xF0, (0xF2 / 2) ^ 0xF0, 0xF2 / (2 ^ 0xF0); +0xF2 / 2 ^ 0xF0 (0xF2 / 2) ^ 0xF0 0xF2 / (2 ^ 0xF0) +1.0000 137 1.0000 +Testing that ^ has precedence over % +select 0xFF ^ 0xF0 % 0x20, (0xFF ^ 0xF0) % 0x20, 0xFF ^ (0xF0 % 0x20); +0xFF ^ 0xF0 % 0x20 (0xFF ^ 0xF0) % 0x20 0xFF ^ (0xF0 % 0x20) +15 15 239 +select 0xFF % 0x20 ^ 0xF0, (0xFF % 0x20) ^ 0xF0, 0xFF % (0x20 ^ 0xF0); +0xFF % 0x20 ^ 0xF0 (0xFF % 0x20) ^ 0xF0 0xFF % (0x20 ^ 0xF0) +47 239 47 +Testing that ^ has precedence over DIV +select 0xFF ^ 0xF0 DIV 2, (0xFF ^ 0xF0) DIV 2, 0xFF ^ (0xF0 DIV 2); +0xFF ^ 0xF0 DIV 2 (0xFF ^ 0xF0) DIV 2 0xFF ^ (0xF0 DIV 2) +7 7 135 +select 0xF2 DIV 2 ^ 0xF0, (0xF2 DIV 2) ^ 0xF0, 0xF2 DIV (2 ^ 0xF0); +0xF2 DIV 2 ^ 0xF0 (0xF2 DIV 2) ^ 0xF0 0xF2 DIV (2 ^ 0xF0) +1 137 1 +Testing that ^ has precedence over MOD +select 0xFF ^ 0xF0 MOD 0x20, (0xFF ^ 0xF0) MOD 0x20, 0xFF ^ (0xF0 MOD 0x20); +0xFF ^ 0xF0 MOD 0x20 (0xFF ^ 0xF0) MOD 0x20 0xFF ^ (0xF0 MOD 0x20) +15 15 239 +select 0xFF MOD 0x20 ^ 0xF0, (0xFF MOD 0x20) ^ 0xF0, 0xFF MOD (0x20 ^ 0xF0); +0xFF MOD 0x20 ^ 0xF0 (0xFF MOD 0x20) ^ 0xF0 0xFF MOD (0x20 ^ 0xF0) +47 239 47 diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 9595676016c..776e6f3a15a 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -631,7 +631,7 @@ flush status; delete from t2 where b > 5; show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 1215 +Handler_read_rnd_next 1115 show status like 'Handler_read_key'; Variable_name Value Handler_read_key 0 @@ -645,7 +645,7 @@ flush status; delete from t2 where b < 5 or b > 3; show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 1215 +Handler_read_rnd_next 1115 show status like 'Handler_read_key'; Variable_name Value Handler_read_key 0 diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 2e226ea84bc..321b08628ee 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1650,6 +1650,35 @@ a (select count(*) from t2) 3 0 4 0 drop table t1,t2; +DROP DATABASE IF EXISTS bug30269; +FLUSH STATUS; +CREATE DATABASE bug30269; +USE bug30269; +CREATE TABLE test1 (id int, name varchar(23)); +CREATE VIEW view1 AS SELECT * FROM test1; +INSERT INTO test1 VALUES (5, 'testit'); +GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost'; +GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost'; +set global query_cache_size= 81920; +USE bug30269; +show status like 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +# Select statement not stored in query cache because of column privileges. +SELECT id FROM test1 WHERE id>2; +id +5 +show status like 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +SELECT id FROM view1 WHERE id>2; +id +5 +show status like 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 1 +DROP DATABASE bug30269; +DROP USER 'bug30269'@'localhost'; set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result index 29d16d8a619..0efb2540c64 100644 --- a/mysql-test/r/query_cache_ps_no_prot.result +++ b/mysql-test/r/query_cache_ps_no_prot.result @@ -371,5 +371,163 @@ Variable_name Value Qcache_hits 21 drop table t1; ---- disconnect connection con1 ---- +######################################################################## +# +# BUG#25843: Changing default database between PREPARE and EXECUTE of +# statement breaks binlog. +# +######################################################################## + +# +# Check that default database and its attributes are fixed at the +# creation time. +# + +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; + +CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci; +CREATE DATABASE mysqltest2 COLLATE utf8_general_ci; + +CREATE TABLE mysqltest1.t1(msg VARCHAR(255)); +CREATE TABLE mysqltest2.t1(msg VARCHAR(255)); + +use mysqltest1; +PREPARE stmt_a_1 FROM 'INSERT INTO t1 VALUES(DATABASE())'; +PREPARE stmt_a_2 FROM 'INSERT INTO t1 VALUES(@@collation_database)'; + +EXECUTE stmt_a_1; +EXECUTE stmt_a_2; + +use mysqltest2; +EXECUTE stmt_a_1; +EXECUTE stmt_a_2; + +SELECT * FROM mysqltest1.t1; +msg +mysqltest1 +utf8_unicode_ci +mysqltest1 +utf8_unicode_ci + +SELECT * FROM mysqltest2.t1; +msg + +DROP PREPARE stmt_a_1; +DROP PREPARE stmt_a_2; + +# +# The Query Cache test case. +# + +DELETE FROM mysqltest1.t1; +DELETE FROM mysqltest2.t1; + +INSERT INTO mysqltest1.t1 VALUES('mysqltest1.t1'); +INSERT INTO mysqltest2.t1 VALUES('mysqltest2.t1'); + +use mysqltest1; +PREPARE stmt_b_1 FROM 'SELECT * FROM t1'; + +use mysqltest2; +PREPARE stmt_b_2 FROM 'SELECT * FROM t1'; + +EXECUTE stmt_b_1; +msg +mysqltest1.t1 + +EXECUTE stmt_b_2; +msg +mysqltest2.t1 + +use mysqltest1; + +EXECUTE stmt_b_1; +msg +mysqltest1.t1 + +EXECUTE stmt_b_2; +msg +mysqltest2.t1 + +DROP PREPARE stmt_b_1; +DROP PREPARE stmt_b_2; + +use test; + +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; + +# +# Check that prepared statements work properly when there is no current +# database. +# + +CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci; +CREATE DATABASE mysqltest2 COLLATE utf8_general_ci; + +use mysqltest1; + +PREPARE stmt_c_1 FROM 'SELECT DATABASE(), @@collation_database'; + +use mysqltest2; + +PREPARE stmt_c_2 FROM 'SELECT DATABASE(), @@collation_database'; + +DROP DATABASE mysqltest2; + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +EXECUTE stmt_c_1; +DATABASE() @@collation_database +mysqltest1 utf8_unicode_ci + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +EXECUTE stmt_c_2; +DATABASE() @@collation_database +NULL latin1_swedish_ci +Warnings: +Note 1049 Unknown database 'mysqltest2' + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +PREPARE stmt_c_3 FROM 'SELECT DATABASE(), @@collation_database'; + +EXECUTE stmt_c_3; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +use mysqltest1; + +EXECUTE stmt_c_2; +DATABASE() @@collation_database +NULL latin1_swedish_ci +Warnings: +Note 1049 Unknown database 'mysqltest2' + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +mysqltest1 utf8_unicode_ci + +EXECUTE stmt_c_3; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +mysqltest1 utf8_unicode_ci + +DROP DATABASE mysqltest1; + +use test; + +######################################################################## set @@global.query_cache_size=@initial_query_cache_size; flush status; diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result index ba675d57f50..dc0c4a0193a 100644 --- a/mysql-test/r/query_cache_ps_ps_prot.result +++ b/mysql-test/r/query_cache_ps_ps_prot.result @@ -371,5 +371,163 @@ Variable_name Value Qcache_hits 19 drop table t1; ---- disconnect connection con1 ---- +######################################################################## +# +# BUG#25843: Changing default database between PREPARE and EXECUTE of +# statement breaks binlog. +# +######################################################################## + +# +# Check that default database and its attributes are fixed at the +# creation time. +# + +DROP DATABASE IF EXISTS mysqltest1; +DROP DATABASE IF EXISTS mysqltest2; + +CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci; +CREATE DATABASE mysqltest2 COLLATE utf8_general_ci; + +CREATE TABLE mysqltest1.t1(msg VARCHAR(255)); +CREATE TABLE mysqltest2.t1(msg VARCHAR(255)); + +use mysqltest1; +PREPARE stmt_a_1 FROM 'INSERT INTO t1 VALUES(DATABASE())'; +PREPARE stmt_a_2 FROM 'INSERT INTO t1 VALUES(@@collation_database)'; + +EXECUTE stmt_a_1; +EXECUTE stmt_a_2; + +use mysqltest2; +EXECUTE stmt_a_1; +EXECUTE stmt_a_2; + +SELECT * FROM mysqltest1.t1; +msg +mysqltest1 +utf8_unicode_ci +mysqltest1 +utf8_unicode_ci + +SELECT * FROM mysqltest2.t1; +msg + +DROP PREPARE stmt_a_1; +DROP PREPARE stmt_a_2; + +# +# The Query Cache test case. +# + +DELETE FROM mysqltest1.t1; +DELETE FROM mysqltest2.t1; + +INSERT INTO mysqltest1.t1 VALUES('mysqltest1.t1'); +INSERT INTO mysqltest2.t1 VALUES('mysqltest2.t1'); + +use mysqltest1; +PREPARE stmt_b_1 FROM 'SELECT * FROM t1'; + +use mysqltest2; +PREPARE stmt_b_2 FROM 'SELECT * FROM t1'; + +EXECUTE stmt_b_1; +msg +mysqltest1.t1 + +EXECUTE stmt_b_2; +msg +mysqltest2.t1 + +use mysqltest1; + +EXECUTE stmt_b_1; +msg +mysqltest1.t1 + +EXECUTE stmt_b_2; +msg +mysqltest2.t1 + +DROP PREPARE stmt_b_1; +DROP PREPARE stmt_b_2; + +use test; + +DROP DATABASE mysqltest1; +DROP DATABASE mysqltest2; + +# +# Check that prepared statements work properly when there is no current +# database. +# + +CREATE DATABASE mysqltest1 COLLATE utf8_unicode_ci; +CREATE DATABASE mysqltest2 COLLATE utf8_general_ci; + +use mysqltest1; + +PREPARE stmt_c_1 FROM 'SELECT DATABASE(), @@collation_database'; + +use mysqltest2; + +PREPARE stmt_c_2 FROM 'SELECT DATABASE(), @@collation_database'; + +DROP DATABASE mysqltest2; + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +EXECUTE stmt_c_1; +DATABASE() @@collation_database +mysqltest1 utf8_unicode_ci + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +EXECUTE stmt_c_2; +DATABASE() @@collation_database +NULL latin1_swedish_ci +Warnings: +Note 1049 Unknown database 'mysqltest2' + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +PREPARE stmt_c_3 FROM 'SELECT DATABASE(), @@collation_database'; + +EXECUTE stmt_c_3; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +use mysqltest1; + +EXECUTE stmt_c_2; +DATABASE() @@collation_database +NULL latin1_swedish_ci +Warnings: +Note 1049 Unknown database 'mysqltest2' + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +mysqltest1 utf8_unicode_ci + +EXECUTE stmt_c_3; +DATABASE() @@collation_database +NULL latin1_swedish_ci + +SELECT DATABASE(), @@collation_database; +DATABASE() @@collation_database +mysqltest1 utf8_unicode_ci + +DROP DATABASE mysqltest1; + +use test; + +######################################################################## set @@global.query_cache_size=@initial_query_cache_size; flush status; diff --git a/mysql-test/r/view_query_cache.result b/mysql-test/r/query_cache_with_views.result index 03430bd504b..03430bd504b 100644 --- a/mysql-test/r/view_query_cache.result +++ b/mysql-test/r/query_cache_with_views.result diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 1ebed6d17d5..48e8bf933e1 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3990,4 +3990,61 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT c1 FROM t1 WHERE (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT (SELECT COUNT(c2))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) > 0; ERROR HY000: Too high level of nesting for select DROP TABLE t1; +CREATE TABLE t1 ( +c1 int(11) NOT NULL AUTO_INCREMENT, +c2 varchar(1000) DEFAULT NULL, +c3 bigint(20) DEFAULT NULL, +c4 bigint(20) DEFAULT NULL, +PRIMARY KEY (c1) +); +EXPLAIN EXTENDED +SELECT join_2.c1 +FROM +t1 AS join_0, +t1 AS join_1, +t1 AS join_2, +t1 AS join_3, +t1 AS join_4, +t1 AS join_5, +t1 AS join_6, +t1 AS join_7 +WHERE +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +OR +join_0.c2 < '?' AND +join_1.c2 < '?' AND +join_2.c2 > '?' AND +join_2.c2 < '!' AND +join_3.c2 > '?' AND +join_4.c2 = '?' AND +join_5.c2 <> '?' AND +join_6.c2 <> '?' AND +join_7.c2 >= '?' AND +join_0.c1=join_1.c1 AND +join_1.c1=join_2.c1 AND +join_2.c1=join_3.c1 AND +join_3.c1=join_4.c1 AND +join_4.c1=join_5.c1 AND +join_5.c1=join_6.c1 AND +join_6.c1=join_7.c1 +GROUP BY +join_3.c1, +join_2.c1, +join_7.c1, +join_1.c1, +join_0.c1; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0' +SHOW WARNINGS; +Level Code Message +Note 1003 select '0' AS `c1` from `test`.`t1` `join_0` join `test`.`t1` `join_1` join `test`.`t1` `join_2` join `test`.`t1` `join_3` join `test`.`t1` `join_4` join `test`.`t1` `join_5` join `test`.`t1` `join_6` join `test`.`t1` `join_7` where 0 group by '0','0','0','0','0' +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 675a59f1fb7..2e0d437aeb6 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -969,6 +969,18 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create user 'mysqltest ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. CREATE FUNCTION bug_13627_f() returns int BEGIN create user 'mysqltest_1'; return 1; END | ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN grant select on t1 to 'mysqltest_1'; END | +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE FUNCTION bug21975() returns int BEGIN grant select on t1 to 'mysqltest_1'; return 1; END | +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN revoke select on t1 from 'mysqltest_1'; END | +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE FUNCTION bug21975() returns int BEGIN revoke select on t1 from 'mysqltest_1'; return 1; END | +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE TRIGGER bug21975 BEFORE INSERT ON t1 FOR EACH ROW BEGIN revoke all privileges on *.* from 'mysqltest_1'; END | +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. +CREATE FUNCTION bug21975() returns int BEGIN revoke all privileges on *.* from 'mysqltest_1'; return 1; END | +ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop user 'mysqltest_1'; END | ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger. CREATE FUNCTION bug_13627_f() returns int BEGIN drop user 'mysqltest_1'; return 1; END | diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 163bbb4aab4..fd09701c125 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6546,4 +6546,56 @@ DROP VIEW v1; DROP FUNCTION f1; DROP FUNCTION f2; DROP TABLE t1; + +# Bug#13675. + +DROP PROCEDURE IF EXISTS p1; +DROP PROCEDURE IF EXISTS p2; +DROP TABLE IF EXISTS t1; + +CREATE PROCEDURE p1(v DATETIME) CREATE TABLE t1 SELECT v; +CREATE PROCEDURE p2(v INT) CREATE TABLE t1 SELECT v; + +CALL p1(NOW()); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + +DROP TABLE t1; + +CALL p1('text'); +Warnings: +Warning 1264 Out of range value for column 'v' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` datetime DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + +DROP TABLE t1; + +CALL p2(10); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` bigint(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + +DROP TABLE t1; + +CALL p2('text'); +Warnings: +Warning 1366 Incorrect integer value: 'text' for column 'v' at row 1 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `v` bigint(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 + +DROP TABLE t1; + +DROP PROCEDURE p1; +DROP PROCEDURE p2; End of 5.0 tests diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 0b1fa565d28..277eea8570e 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -208,3 +208,26 @@ GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION drop user mysqltest_1@localhost; drop procedure 15298_1; drop procedure 15298_2; +drop table if exists t1; +drop procedure if exists p1; +create table t1 (value varchar(15)); +create procedure p1() update t1 set value='updated' where value='old'; +call p1(); +insert into t1 (value) values ("old"); +select get_lock('b26162',120); +get_lock('b26162',120) +1 +select 'rl_acquirer', value from t1 where get_lock('b26162',120);; +set session low_priority_updates=on; +call p1();; +select 'rl_contender', value from t1; +rl_contender value +rl_contender old +select release_lock('b26162'); +release_lock('b26162') +1 +rl_acquirer value +rl_acquirer old +drop procedure p1; +drop table t1; +set session low_priority_updates=default; diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index cf35781d008..8a2c3ae344e 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -16,12 +16,9 @@ unlock tables; lock tables t1 read; update t1 set n = 3; unlock tables; -show status like 'Table_locks_waited%'; +show status like 'Table_locks_waited'; Variable_name Value Table_locks_waited 1 -select * from information_schema.session_status where variable_name like 'Table_locks_waited%'; -VARIABLE_NAME VARIABLE_VALUE -TABLE_LOCKS_WAITED 1 drop table t1; select 1; 1 diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index c1dccd53035..cc1a2535896 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -215,11 +215,11 @@ ERROR 22007: Incorrect date value: '2004-10-00 15:30:00' for column 'col1' at ro INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-09-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2003-02-29 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); @@ -230,11 +230,11 @@ ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' a INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col2) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col2' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); @@ -246,11 +246,11 @@ ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' a INSERT INTO t1 (col3) VALUES(STR_TO_DATE('31.9.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-09-31 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('29.02.2003 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2003-02-29 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(STR_TO_DATE('15.13.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_date INSERT INTO t1 (col3) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect datetime value: '0000-00-00' for column 'col3' at row 1 drop table t1; @@ -1070,24 +1070,24 @@ create table t1 (col1 datetime); insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i')); ERROR 22007: Truncated incorrect datetime value: '31.10.2004 15.30 abc' insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); -ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +ERROR HY000: Incorrect datetime value: '32.10.2004 15.30' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r')); -ERROR HY000: Incorrect time value: '22:22:33 AM' for function str_to_time +ERROR HY000: Incorrect time value: '22:22:33 AM' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T')); -ERROR HY000: Incorrect time value: 'abc' for function str_to_time +ERROR HY000: Incorrect time value: 'abc' for function str_to_date set sql_mode=''; insert into t1 values(STR_TO_DATE('31.10.2004 15.30 abc','%d.%m.%Y %H.%i')); Warnings: Warning 1292 Truncated incorrect datetime value: '31.10.2004 15.30 abc' insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i')); Warnings: -Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_time +Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r')); Warnings: -Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_time +Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_date insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T')); Warnings: -Error 1411 Incorrect time value: 'abc' for function str_to_time +Error 1411 Incorrect time value: 'abc' for function str_to_date insert into t1 values(STR_TO_DATE('31.10.2004 15.30','%d.%m.%Y %H.%i')); insert into t1 values(STR_TO_DATE('2004.12.12 11:22:33 AM','%Y.%m.%d %r')); insert into t1 values(STR_TO_DATE('2004.12.12 10:22:59','%Y.%m.%d %T')); @@ -1105,9 +1105,9 @@ select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') I count(*) 7 Warnings: -Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time -Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time -Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_time +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date +Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date drop table t1; create table t1 (col1 char(3), col2 integer); insert into t1 (col1) values (cast(1000 as char(3))); diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index bba722e523c..f1e47905f5d 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -334,4 +334,28 @@ Qcache_queries_in_cache 0 drop table t1; drop function metaphon; set GLOBAL query_cache_size=default; +CREATE TABLE const_len_bug ( +str_const varchar(4000), +result1 varchar(4000), +result2 varchar(4000) +); +CREATE TRIGGER check_const_len_trigger BEFORE INSERT ON const_len_bug FOR EACH ROW BEGIN +set NEW.str_const = 'bar'; +set NEW.result2 = check_const_len(NEW.str_const); +END | +CREATE PROCEDURE check_const_len_sp (IN str_const VARCHAR(4000)) +BEGIN +DECLARE result VARCHAR(4000); +SET result = check_const_len(str_const); +insert into const_len_bug values(str_const, result, ""); +END | +CREATE FUNCTION check_const_len RETURNS string SONAME "UDF_EXAMPLE_LIB"; +CALL check_const_len_sp("foo"); +SELECT * from const_len_bug; +str_const result1 result2 +bar Correct length Correct length +DROP FUNCTION check_const_len; +DROP PROCEDURE check_const_len_sp; +DROP TRIGGER check_const_len_trigger; +DROP TABLE const_len_bug; End of 5.0 tests. |