mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
merged 5.1-5.1.29-rc -> 5.1-bugteam
This commit is contained in:
@@ -90,4 +90,9 @@ Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
|
||||
Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat('0',`test`.`t2`.`a`,'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a TIMESTAMP);
|
||||
INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
|
||||
SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
|
||||
a
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
||||
@@ -328,4 +328,81 @@ create event
|
||||
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
|
||||
on schedule every 2 year do select 1;
|
||||
ERROR 42000: Identifier name 'очень_очень_очень_очень_очень_очень_очень_очень_длинна' is too long
|
||||
create event event_35981 on schedule every 6 month on completion preserve
|
||||
disable
|
||||
do
|
||||
select 1;
|
||||
The following SELECTs should all give 1
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'PRESERVE';
|
||||
count(*)
|
||||
1
|
||||
alter event event_35981 enable;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'PRESERVE';
|
||||
count(*)
|
||||
1
|
||||
alter event event_35981 on completion not preserve;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'NOT PRESERVE';
|
||||
count(*)
|
||||
1
|
||||
alter event event_35981 disable;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'NOT PRESERVE';
|
||||
count(*)
|
||||
1
|
||||
alter event event_35981 on completion preserve;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'PRESERVE';
|
||||
count(*)
|
||||
1
|
||||
drop event event_35981;
|
||||
create event event_35981 on schedule every 6 month disable
|
||||
do
|
||||
select 1;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'NOT PRESERVE';
|
||||
count(*)
|
||||
1
|
||||
drop event event_35981;
|
||||
create event event_35981 on schedule every 1 hour starts current_timestamp
|
||||
on completion not preserve
|
||||
do
|
||||
select 1;
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00';
|
||||
ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
|
||||
drop event event_35981;
|
||||
create event event_35981 on schedule every 1 hour starts current_timestamp
|
||||
on completion not preserve
|
||||
do
|
||||
select 1;
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00' on completion preserve;
|
||||
Warnings:
|
||||
Note 1544 Event execution time is in the past. Event has been disabled
|
||||
drop event event_35981;
|
||||
create event event_35981 on schedule every 1 hour starts current_timestamp
|
||||
on completion preserve
|
||||
do
|
||||
select 1;
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00';
|
||||
Warnings:
|
||||
Note 1544 Event execution time is in the past. Event has been disabled
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00' on completion not preserve;
|
||||
ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00' on completion preserve;
|
||||
Warnings:
|
||||
Note 1544 Event execution time is in the past. Event has been disabled
|
||||
drop event event_35981;
|
||||
drop database events_test;
|
||||
|
||||
@@ -832,6 +832,35 @@ Execute select '000 001 002 003 004 005 006 007 008 009010 011 012 013 014 015 0
|
||||
Query set global general_log = off
|
||||
deallocate prepare long_query;
|
||||
set global general_log = @old_general_log_state;
|
||||
DROP TABLE IF EXISTS log_count;
|
||||
DROP TABLE IF EXISTS slow_log_copy;
|
||||
DROP TABLE IF EXISTS general_log_copy;
|
||||
CREATE TABLE log_count (count BIGINT(21));
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET @old_slow_log_state = @@global.slow_query_log;
|
||||
SET GLOBAL general_log = ON;
|
||||
SET GLOBAL slow_query_log = ON;
|
||||
CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
|
||||
DROP TABLE slow_log_copy;
|
||||
CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
|
||||
DROP TABLE general_log_copy;
|
||||
SET GLOBAL general_log = OFF;
|
||||
SET GLOBAL slow_query_log = OFF;
|
||||
CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
|
||||
DROP TABLE slow_log_copy;
|
||||
CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
|
||||
DROP TABLE general_log_copy;
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
DROP TABLE log_count;
|
||||
SET @old_slow_log_state = @@global.slow_query_log;
|
||||
SET SESSION long_query_time = 0;
|
||||
SET GLOBAL slow_query_log = ON;
|
||||
|
||||
@@ -277,3 +277,16 @@ drop table t3;
|
||||
drop table t4;
|
||||
drop table t5;
|
||||
drop table t6;
|
||||
SELECT @@global.storage_engine INTO @old_engine;
|
||||
SET GLOBAL storage_engine=InnoDB;
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES();
|
||||
SELECT COUNT(*) FROM v1;
|
||||
COUNT(*)
|
||||
1
|
||||
SELECT COUNT(*) FROM v1;
|
||||
COUNT(*)
|
||||
1
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
SET GLOBAL storage_engine=@old_engine;
|
||||
|
||||
@@ -2004,7 +2004,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
@@ -2101,7 +2101,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`a` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
@@ -2175,7 +2175,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
@@ -2291,7 +2291,7 @@ SET character_set_client = utf8;
|
||||
`a` int(11),
|
||||
`b` int(11),
|
||||
`c` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
@@ -2299,7 +2299,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v3`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||
@@ -2309,7 +2309,7 @@ SET character_set_client = utf8;
|
||||
`a` int(11),
|
||||
`b` int(11),
|
||||
`c` varchar(30)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
/*!50001 DROP TABLE `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
@@ -3046,7 +3046,7 @@ SET character_set_client = utf8;
|
||||
`a` int(11),
|
||||
`b` varchar(32),
|
||||
`c` varchar(32)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
@@ -3056,7 +3056,7 @@ SET character_set_client = utf8;
|
||||
`a` int(11),
|
||||
`b` varchar(32),
|
||||
`c` varchar(32)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
@@ -3066,7 +3066,7 @@ SET character_set_client = utf8;
|
||||
`a` int(11),
|
||||
`b` varchar(32),
|
||||
`c` varchar(32)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `test`;
|
||||
@@ -3446,7 +3446,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`id` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `mysqldump_test_db`;
|
||||
@@ -3506,7 +3506,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `nasishnasifu` (
|
||||
`id` bigint(20) unsigned
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `mysqldump_tables`;
|
||||
@@ -3964,7 +3964,7 @@ SET @saved_cs_client = @@character_set_client;
|
||||
SET character_set_client = utf8;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`id` int(11)
|
||||
) */;
|
||||
) ENGINE=MyISAM */;
|
||||
SET character_set_client = @saved_cs_client;
|
||||
|
||||
USE `mysqldump_test_db`;
|
||||
|
||||
@@ -742,3 +742,23 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where
|
||||
DROP TABLE t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
CREATE TABLE t2 (
|
||||
defid int(10) unsigned NOT NULL,
|
||||
day int(10) unsigned NOT NULL,
|
||||
count int(10) unsigned NOT NULL,
|
||||
filler char(200),
|
||||
KEY (defid,day)
|
||||
)
|
||||
PARTITION BY RANGE (day) (
|
||||
PARTITION p7 VALUES LESS THAN (20070401) ,
|
||||
PARTITION p8 VALUES LESS THAN (20070501));
|
||||
insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B;
|
||||
insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B;
|
||||
insert into t2 values(52, 20070321, 123, 'filler') ;
|
||||
insert into t2 values(52, 20070322, 456, 'filler') ;
|
||||
select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
|
||||
sum(count)
|
||||
579
|
||||
drop table t1, t2;
|
||||
|
||||
@@ -121,8 +121,8 @@ select @a:=0;
|
||||
select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i;
|
||||
@a+0 @a:=@a+0+count(*) count(*) @a+0
|
||||
0 1 1 0
|
||||
1 3 2 0
|
||||
3 6 3 0
|
||||
0 2 2 0
|
||||
0 3 3 0
|
||||
set @a=0;
|
||||
select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i;
|
||||
@a @a:="hello" @a @a:=3 @a @a:="hello again"
|
||||
@@ -370,4 +370,33 @@ select @rownum := @rownum + 1 as row,
|
||||
@prev_score := a as score
|
||||
from t1 order by score desc;
|
||||
drop table t1;
|
||||
create table t1(b bigint);
|
||||
insert into t1 (b) values (10), (30), (10);
|
||||
set @var := 0;
|
||||
select if(b=@var, 999, b) , @var := b from t1 order by b;
|
||||
if(b=@var, 999, b) @var := b
|
||||
10 10
|
||||
999 10
|
||||
30 30
|
||||
drop table t1;
|
||||
create temporary table t1 (id int);
|
||||
insert into t1 values (2), (3), (3), (4);
|
||||
set @lastid=-1;
|
||||
select @lastid != id, @lastid, @lastid := id from t1;
|
||||
@lastid != id @lastid @lastid := id
|
||||
1 -1 2
|
||||
1 2 3
|
||||
0 3 3
|
||||
1 3 4
|
||||
drop table t1;
|
||||
create temporary table t1 (id bigint);
|
||||
insert into t1 values (2), (3), (3), (4);
|
||||
set @lastid=-1;
|
||||
select @lastid != id, @lastid, @lastid := id from t1;
|
||||
@lastid != id @lastid @lastid := id
|
||||
1 -1 2
|
||||
1 2 3
|
||||
0 3 3
|
||||
1 3 4
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
||||
71
mysql-test/suite/binlog/r/binlog_stm_row.result
Normal file
71
mysql-test/suite/binlog/r/binlog_stm_row.result
Normal file
@@ -0,0 +1,71 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
SET GLOBAL BINLOG_FORMAT = STATEMENT;
|
||||
SET SESSION BINLOG_FORMAT = STATEMENT;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
select @@SESSION.BINLOG_FORMAT;
|
||||
@@SESSION.BINLOG_FORMAT
|
||||
STATEMENT
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(2);
|
||||
#
|
||||
# Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
|
||||
# lock that will prevent the source table from being modified.
|
||||
#
|
||||
# con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
GET_LOCK('Bug#34306', 120)
|
||||
1
|
||||
# con2
|
||||
PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
EXECUTE stmt;;
|
||||
# default
|
||||
INSERT INTO t2 VALUES (3);;
|
||||
# con1
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
RELEASE_LOCK('Bug#34306')
|
||||
1
|
||||
# con2
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
RELEASE_LOCK('Bug#34306')
|
||||
1
|
||||
# default
|
||||
#
|
||||
# Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
|
||||
# not prevent the source table from being modified if under RBR.
|
||||
#
|
||||
# con2
|
||||
SET SESSION BINLOG_FORMAT = ROW;
|
||||
# con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
GET_LOCK('Bug#34306', 120)
|
||||
1
|
||||
# con2
|
||||
EXECUTE stmt;;
|
||||
# default
|
||||
# con1
|
||||
INSERT INTO t2 VALUES (4);
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
RELEASE_LOCK('Bug#34306')
|
||||
1
|
||||
# con2
|
||||
# default
|
||||
# Show binlog events
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 LIKE t1
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES(2)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (4)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
107
mysql-test/suite/binlog/t/binlog_stm_row.test
Normal file
107
mysql-test/suite/binlog/t/binlog_stm_row.test
Normal file
@@ -0,0 +1,107 @@
|
||||
--source include/have_log_bin.inc
|
||||
--source include/have_binlog_format_row_or_statement.inc
|
||||
|
||||
# Get rid of previous tests binlog
|
||||
--disable_query_log
|
||||
reset master;
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Bug#34306: Can't make copy of log tables when server binary log is enabled
|
||||
#
|
||||
# This is an additional test for Bug#34306 in order to ensure that INSERT INTO
|
||||
# .. SELECT FROM is properly replicated under SBR and RBR and that the proper
|
||||
# read lock type are acquired.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--enable_warnings
|
||||
|
||||
SET GLOBAL BINLOG_FORMAT = STATEMENT;
|
||||
SET SESSION BINLOG_FORMAT = STATEMENT;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
select @@SESSION.BINLOG_FORMAT;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(2);
|
||||
|
||||
--connect(con1,localhost,root,,)
|
||||
--connect(con2,localhost,root,,)
|
||||
|
||||
--echo #
|
||||
--echo # Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
|
||||
--echo # lock that will prevent the source table from being modified.
|
||||
--echo #
|
||||
|
||||
--connection con1
|
||||
--echo # con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
--connection con2
|
||||
--echo # con2
|
||||
PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
--send EXECUTE stmt;
|
||||
--connection default
|
||||
--echo # default
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
|
||||
state = "User lock" AND
|
||||
info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
--source include/wait_condition.inc
|
||||
--send INSERT INTO t2 VALUES (3);
|
||||
--connection con1
|
||||
--echo # con1
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
|
||||
state = "Locked" and info = "INSERT INTO t2 VALUES (3)";
|
||||
--source include/wait_condition.inc
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
--connection con2
|
||||
--echo # con2
|
||||
--reap
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
--connection default
|
||||
--echo # default
|
||||
--reap
|
||||
|
||||
--echo #
|
||||
--echo # Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
|
||||
--echo # not prevent the source table from being modified if under RBR.
|
||||
--echo #
|
||||
|
||||
--connection con2
|
||||
--echo # con2
|
||||
SET SESSION BINLOG_FORMAT = ROW;
|
||||
--connection con1
|
||||
--echo # con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
--connection con2
|
||||
--echo # con2
|
||||
--send EXECUTE stmt;
|
||||
--connection default
|
||||
--echo # default
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
|
||||
state = "User lock" AND
|
||||
info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
--source include/wait_condition.inc
|
||||
--connection con1
|
||||
--echo # con1
|
||||
INSERT INTO t2 VALUES (4);
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
--connection con2
|
||||
--echo # con2
|
||||
--reap
|
||||
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
--connection default
|
||||
--echo # default
|
||||
|
||||
--echo # Show binlog events
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
@@ -76,4 +76,13 @@ FROM t2 ORDER BY a;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
#
|
||||
# Bug #39353: Multiple conditions on timestamp column crashes server
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a TIMESTAMP);
|
||||
INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
|
||||
SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
@@ -411,6 +411,108 @@ create event
|
||||
очень_очень_очень_очень_очень_очень_очень_очень_длинная_строка_66
|
||||
on schedule every 2 year do select 1;
|
||||
|
||||
#
|
||||
# Bug#35981: ALTER EVENT causes the server to change the PRESERVE option.
|
||||
#
|
||||
|
||||
create event event_35981 on schedule every 6 month on completion preserve
|
||||
disable
|
||||
do
|
||||
select 1;
|
||||
|
||||
echo The following SELECTs should all give 1;
|
||||
|
||||
# show current ON_COMPLETION
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'PRESERVE';
|
||||
|
||||
# show ON_COMPLETION remains "PRESERVE" when not given in ALTER EVENT
|
||||
alter event event_35981 enable;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'PRESERVE';
|
||||
|
||||
# show we can change ON_COMPLETION
|
||||
alter event event_35981 on completion not preserve;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'NOT PRESERVE';
|
||||
|
||||
# show ON_COMPLETION remains "NOT PRESERVE" when not given in ALTER EVENT
|
||||
alter event event_35981 disable;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'NOT PRESERVE';
|
||||
|
||||
# show we can change ON_COMPLETION
|
||||
alter event event_35981 on completion preserve;
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'PRESERVE';
|
||||
|
||||
|
||||
drop event event_35981;
|
||||
|
||||
create event event_35981 on schedule every 6 month disable
|
||||
do
|
||||
select 1;
|
||||
|
||||
# show that the defaults for CREATE EVENT are still correct (NOT PRESERVE)
|
||||
select count(*) from information_schema.events
|
||||
where event_schema = database() and event_name = 'event_35981' and
|
||||
on_completion = 'NOT PRESERVE';
|
||||
|
||||
drop event event_35981;
|
||||
|
||||
|
||||
# show that backdating doesn't break
|
||||
|
||||
create event event_35981 on schedule every 1 hour starts current_timestamp
|
||||
on completion not preserve
|
||||
do
|
||||
select 1;
|
||||
|
||||
# should fail thanks to above's NOT PRESERVE
|
||||
--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00';
|
||||
|
||||
drop event event_35981;
|
||||
|
||||
create event event_35981 on schedule every 1 hour starts current_timestamp
|
||||
on completion not preserve
|
||||
do
|
||||
select 1;
|
||||
|
||||
# succeed with warning
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00' on completion preserve;
|
||||
|
||||
drop event event_35981;
|
||||
|
||||
|
||||
|
||||
create event event_35981 on schedule every 1 hour starts current_timestamp
|
||||
on completion preserve
|
||||
do
|
||||
select 1;
|
||||
|
||||
# this should succeed thanks to above PRESERVE! give a warning though.
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00';
|
||||
|
||||
# this should fail, as the event would have passed already
|
||||
--error ER_EVENT_CANNOT_ALTER_IN_THE_PAST
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00' on completion not preserve;
|
||||
|
||||
# should succeed giving a warning
|
||||
alter event event_35981 on schedule every 1 hour starts '1999-01-01 00:00:00'
|
||||
ends '1999-01-02 00:00:00' on completion preserve;
|
||||
|
||||
drop event event_35981;
|
||||
|
||||
#
|
||||
# End of tests
|
||||
#
|
||||
|
||||
@@ -936,6 +936,52 @@ select command_type, argument from mysql.general_log where thread_id = @thread_i
|
||||
deallocate prepare long_query;
|
||||
set global general_log = @old_general_log_state;
|
||||
|
||||
#
|
||||
# Bug#34306: Can't make copy of log tables when server binary log is enabled
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS log_count;
|
||||
DROP TABLE IF EXISTS slow_log_copy;
|
||||
DROP TABLE IF EXISTS general_log_copy;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE log_count (count BIGINT(21));
|
||||
|
||||
SET @old_general_log_state = @@global.general_log;
|
||||
SET @old_slow_log_state = @@global.slow_query_log;
|
||||
|
||||
SET GLOBAL general_log = ON;
|
||||
SET GLOBAL slow_query_log = ON;
|
||||
|
||||
CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
|
||||
DROP TABLE slow_log_copy;
|
||||
|
||||
CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
|
||||
DROP TABLE general_log_copy;
|
||||
|
||||
SET GLOBAL general_log = OFF;
|
||||
SET GLOBAL slow_query_log = OFF;
|
||||
|
||||
CREATE TABLE slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO slow_log_copy SELECT * FROM mysql.slow_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.slow_log));
|
||||
DROP TABLE slow_log_copy;
|
||||
|
||||
CREATE TABLE general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO general_log_copy SELECT * FROM mysql.general_log;
|
||||
INSERT INTO log_count (count) VALUES ((SELECT count(*) FROM mysql.general_log));
|
||||
DROP TABLE general_log_copy;
|
||||
|
||||
SET GLOBAL general_log = @old_general_log_state;
|
||||
SET GLOBAL slow_query_log = @old_slow_log_state;
|
||||
|
||||
DROP TABLE log_count;
|
||||
|
||||
#
|
||||
# Bug #31700: thd->examined_row_count not incremented for 'const' type queries
|
||||
#
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -807,24 +807,24 @@ DROP TABLE t1;
|
||||
#
|
||||
# BUG#30573: get wrong result with "group by" on PARTITIONed table
|
||||
#
|
||||
#create table t1 (a int);
|
||||
#insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
#CREATE TABLE t2 (
|
||||
# defid int(10) unsigned NOT NULL,
|
||||
# day int(10) unsigned NOT NULL,
|
||||
# count int(10) unsigned NOT NULL,
|
||||
# filler char(200),
|
||||
# KEY (defid,day)
|
||||
#)
|
||||
#PARTITION BY RANGE (day) (
|
||||
# PARTITION p7 VALUES LESS THAN (20070401) ,
|
||||
# PARTITION p8 VALUES LESS THAN (20070501));
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
CREATE TABLE t2 (
|
||||
defid int(10) unsigned NOT NULL,
|
||||
day int(10) unsigned NOT NULL,
|
||||
count int(10) unsigned NOT NULL,
|
||||
filler char(200),
|
||||
KEY (defid,day)
|
||||
)
|
||||
PARTITION BY RANGE (day) (
|
||||
PARTITION p7 VALUES LESS THAN (20070401) ,
|
||||
PARTITION p8 VALUES LESS THAN (20070501));
|
||||
|
||||
#insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B;
|
||||
#insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B;
|
||||
#insert into t2 values(52, 20070321, 123, 'filler') ;
|
||||
#insert into t2 values(52, 20070322, 456, 'filler') ;
|
||||
insert into t2 select 20, 20070311, 1, 'filler' from t1 A, t1 B;
|
||||
insert into t2 select 20, 20070411, 1, 'filler' from t1 A, t1 B;
|
||||
insert into t2 values(52, 20070321, 123, 'filler') ;
|
||||
insert into t2 values(52, 20070322, 456, 'filler') ;
|
||||
|
||||
#select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
|
||||
#drop table t1, t2;
|
||||
select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid;
|
||||
drop table t1, t2;
|
||||
|
||||
|
||||
@@ -263,4 +263,26 @@ from t1 order by score desc;
|
||||
--enable_result_log
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#26020: User-Defined Variables are not consistent with columns data types
|
||||
#
|
||||
|
||||
create table t1(b bigint);
|
||||
insert into t1 (b) values (10), (30), (10);
|
||||
set @var := 0;
|
||||
select if(b=@var, 999, b) , @var := b from t1 order by b;
|
||||
drop table t1;
|
||||
|
||||
create temporary table t1 (id int);
|
||||
insert into t1 values (2), (3), (3), (4);
|
||||
set @lastid=-1;
|
||||
select @lastid != id, @lastid, @lastid := id from t1;
|
||||
drop table t1;
|
||||
|
||||
create temporary table t1 (id bigint);
|
||||
insert into t1 values (2), (3), (3), (4);
|
||||
set @lastid=-1;
|
||||
select @lastid != id, @lastid, @lastid := id from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
Reference in New Issue
Block a user