mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge 5.1-bugteam -> bug 32124 5.1 tree
This commit is contained in:
@ -933,5 +933,45 @@ SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #37348: Crash in or immediately after JOIN::make_sum_func_list
|
||||
#
|
||||
|
||||
CREATE TABLE derived1 (a bigint(21));
|
||||
INSERT INTO derived1 VALUES (2);
|
||||
|
||||
|
||||
CREATE TABLE D (
|
||||
pk int(11) NOT NULL AUTO_INCREMENT,
|
||||
int_nokey int(11) DEFAULT NULL,
|
||||
int_key int(11) DEFAULT NULL,
|
||||
filler blob,
|
||||
PRIMARY KEY (pk),
|
||||
KEY int_key (int_key)
|
||||
);
|
||||
|
||||
INSERT INTO D VALUES
|
||||
(39,40,4,repeat(' X', 42)),
|
||||
(43,56,4,repeat(' X', 42)),
|
||||
(47,12,4,repeat(' X', 42)),
|
||||
(71,28,4,repeat(' X', 42)),
|
||||
(76,54,4,repeat(' X', 42)),
|
||||
(83,45,4,repeat(' X', 42)),
|
||||
(105,53,12,NULL);
|
||||
|
||||
SELECT
|
||||
(SELECT COUNT( int_nokey )
|
||||
FROM derived1 AS X
|
||||
WHERE
|
||||
X.int_nokey < 61
|
||||
GROUP BY pk
|
||||
LIMIT 1)
|
||||
FROM D AS X
|
||||
WHERE X.int_key < 13
|
||||
GROUP BY int_nokey LIMIT 1;
|
||||
|
||||
DROP TABLE derived1;
|
||||
DROP TABLE D;
|
||||
|
||||
###
|
||||
--echo End of 5.0 tests
|
||||
|
@ -10,6 +10,7 @@ drop table if exists t1;
|
||||
connect (a,localhost,root,,);
|
||||
connect (b,localhost,root,,);
|
||||
connection a;
|
||||
set binlog_format=mixed;
|
||||
set session transaction isolation level read committed;
|
||||
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
|
||||
@ -17,6 +18,7 @@ set autocommit=0;
|
||||
# this should lock the entire table
|
||||
select * from t1 where a=3 lock in share mode;
|
||||
connection b;
|
||||
set binlog_format=mixed;
|
||||
set session transaction isolation level read committed;
|
||||
set autocommit=0;
|
||||
-- error ER_LOCK_WAIT_TIMEOUT
|
||||
|
@ -701,6 +701,7 @@ insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
|
||||
select id, code, name from t1 order by id;
|
||||
COMMIT;
|
||||
|
||||
SET binlog_format='MIXED';
|
||||
BEGIN;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
|
||||
@ -2000,10 +2001,12 @@ connection a;
|
||||
create table t1(a int not null, b int, primary key(a)) engine=innodb;
|
||||
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
|
||||
commit;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
update t1 set b = 5 where b = 1;
|
||||
connection b;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
#
|
||||
@ -2071,6 +2074,7 @@ commit;
|
||||
set autocommit = 0;
|
||||
select * from t2 for update;
|
||||
connection b;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
insert into t1 select * from t2;
|
||||
@ -2127,46 +2131,55 @@ commit;
|
||||
set autocommit = 0;
|
||||
select * from t2 for update;
|
||||
connection b;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
--send
|
||||
insert into t1 select * from t2;
|
||||
connection c;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
--send
|
||||
update t3 set b = (select b from t2 where a = d);
|
||||
connection d;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
||||
--send
|
||||
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
|
||||
connection e;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send
|
||||
insert into t5 (select * from t2 lock in share mode);
|
||||
connection f;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send
|
||||
update t6 set e = (select b from t2 where a = d lock in share mode);
|
||||
connection g;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send
|
||||
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
|
||||
connection h;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send
|
||||
insert into t8 (select * from t2 for update);
|
||||
connection i;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send
|
||||
update t9 set e = (select b from t2 where a = d for update);
|
||||
connection j;
|
||||
SET binlog_format='MIXED';
|
||||
set autocommit = 0;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--send
|
||||
@ -2380,6 +2393,7 @@ DROP TABLE t1;
|
||||
CONNECT (c1,localhost,root,,);
|
||||
CONNECT (c2,localhost,root,,);
|
||||
CONNECTION c1;
|
||||
SET binlog_format='MIXED';
|
||||
SET TX_ISOLATION='read-committed';
|
||||
SET AUTOCOMMIT=0;
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
@ -2387,6 +2401,7 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
SELECT * FROM t2;
|
||||
CONNECTION c2;
|
||||
SET binlog_format='MIXED';
|
||||
SET TX_ISOLATION='read-committed';
|
||||
SET AUTOCOMMIT=0;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
@ -2398,10 +2413,12 @@ DISCONNECT c2;
|
||||
CONNECT (c1,localhost,root,,);
|
||||
CONNECT (c2,localhost,root,,);
|
||||
CONNECTION c1;
|
||||
SET binlog_format='MIXED';
|
||||
SET TX_ISOLATION='read-committed';
|
||||
SET AUTOCOMMIT=0;
|
||||
SELECT * FROM t2;
|
||||
CONNECTION c2;
|
||||
SET binlog_format='MIXED';
|
||||
SET TX_ISOLATION='read-committed';
|
||||
SET AUTOCOMMIT=0;
|
||||
INSERT INTO t1 VALUES (2);
|
||||
|
@ -38,9 +38,9 @@ SELECT @@global.log AS INIT_VALUE;
|
||||
|
||||
SELECT @@log AS INIT_VALUE;
|
||||
|
||||
SET @@global.log = ON;
|
||||
SET @@global.general_log = ON;
|
||||
|
||||
SET global log = 0;
|
||||
SET global general_log = 0;
|
||||
|
||||
--echo 'Bug# 34832: log is a system but it is not accessible using SET @@global.log;'
|
||||
--echo 'SET GLOBAL log; and SELECT @@global.log. SHOW VARIABLES shows the value of log.'
|
||||
|
@ -259,6 +259,32 @@ SET GLOBAL slow_query_log_file = @slow_query_log_file_saved;
|
||||
|
||||
###########################################################################
|
||||
|
||||
|
||||
|
||||
## WL#4403 - deprecate @log and @slow_log_queries variables
|
||||
|
||||
## these are all deprecated -- show for command-line as well!
|
||||
--echo deprecated:
|
||||
SET GLOBAL log = 0;
|
||||
SET GLOBAL log_slow_queries = 0;
|
||||
SET GLOBAL log = DEFAULT;
|
||||
SET GLOBAL log_slow_queries = DEFAULT;
|
||||
|
||||
## these are NOT deprecated
|
||||
--echo not deprecated:
|
||||
SELECT @@global.general_log_file INTO @my_glf;
|
||||
SELECT @@global.slow_query_log_file INTO @my_sqlf;
|
||||
SET GLOBAL general_log = 0;
|
||||
SET GLOBAL slow_query_log = 0;
|
||||
SET GLOBAL general_log_file = 'WL4403_G.log';
|
||||
SET GLOBAL slow_query_log_file = 'WL4403_SQ.log';
|
||||
SET GLOBAL general_log_file = @my_glf;
|
||||
SET GLOBAL slow_query_log_file = @my_sqlf;
|
||||
SET GLOBAL general_log = DEFAULT;
|
||||
SET GLOBAL slow_query_log = DEFAULT;
|
||||
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
--enable_ps_protocol
|
||||
|
@ -1816,4 +1816,53 @@ SET SQL_MODE= @orig_sql_mode;
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Bug #38005 Partitions: error with insert select
|
||||
#
|
||||
|
||||
create table t1 (s1 int) partition by hash(s1) partitions 2;
|
||||
create index i on t1 (s1);
|
||||
insert into t1 values (1);
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1 order by s1 desc;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (s1 int) partition by range(s1)
|
||||
(partition pa1 values less than (10),
|
||||
partition pa2 values less than MAXVALUE);
|
||||
create index i on t1 (s1);
|
||||
insert into t1 values (1);
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1 order by s1 desc;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (s1 int) partition by range(s1)
|
||||
(partition pa1 values less than (10),
|
||||
partition pa2 values less than MAXVALUE);
|
||||
create index i on t1 (s1);
|
||||
insert into t1 values (20);
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1 order by s1 desc;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (s1 int) partition by range(s1)
|
||||
(partition pa1 values less than (10),
|
||||
partition pa2 values less than MAXVALUE);
|
||||
create index i on t1 (s1);
|
||||
insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8);
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1;
|
||||
insert into t1 select s1 from t1 order by s1 desc;
|
||||
insert into t1 select s1 from t1 where s1=3;
|
||||
select count(*) from t1;
|
||||
drop table t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -162,3 +162,18 @@ DROP TABLE t2, t1;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
--echo BUG#31612
|
||||
--echo Trigger fired multiple times leads to gaps in auto_increment sequence
|
||||
create table t1 (a int, val char(1)) engine=InnoDB;
|
||||
create table t2 (b int auto_increment primary key,
|
||||
val char(1)) engine=InnoDB;
|
||||
create trigger t1_after_insert after
|
||||
insert on t1 for each row insert into t2 set val=NEW.val;
|
||||
insert into t1 values ( 123, 'a'), ( 123, 'b'), ( 123, 'c'),
|
||||
(123, 'd'), (123, 'e'), (123, 'f'), (123, 'g');
|
||||
insert into t1 values ( 654, 'a'), ( 654, 'b'), ( 654, 'c'),
|
||||
(654, 'd'), (654, 'e'), (654, 'f'), (654, 'g');
|
||||
select * from t2 order by b;
|
||||
drop trigger t1_after_insert;
|
||||
drop table t1,t2;
|
||||
|
@ -75,10 +75,12 @@ INSERT INTO t1 VALUES(24, 24);
|
||||
--echo ** Connection con0 **
|
||||
connection con0;
|
||||
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
|
||||
set binlog_format=mixed;
|
||||
|
||||
--echo ** Connection con1 **
|
||||
connection con1;
|
||||
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
|
||||
set binlog_format=mixed;
|
||||
|
||||
#
|
||||
# Testing WHERE on keys using IN clause
|
||||
|
Reference in New Issue
Block a user