mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Manual merge from the mysql-5.1-bugteam.
This commit is contained in:
@ -1623,3 +1623,24 @@ INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
|
||||
SELECT COUNT(t1.a) FROM t1, t1 a, t1 b, t1 c, t1 d, t1 e;
|
||||
DROP TABLE t1;
|
||||
SET @@join_buffer_size= @save_join_buffer_size;
|
||||
|
||||
#
|
||||
# BUG#47012 archive tables are not upgradeable, and server crashes on any access
|
||||
#
|
||||
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
||||
copy_file std_data/bug47012.frm $MYSQLD_DATADIR/test/t1.frm;
|
||||
copy_file std_data/bug47012.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
|
||||
copy_file std_data/bug47012.ARM $MYSQLD_DATADIR/test/t1.ARM;
|
||||
|
||||
--error ER_TABLE_NEEDS_UPGRADE
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--error ER_TABLE_NEEDS_UPGRADE
|
||||
SELECT * FROM t1;
|
||||
|
||||
--error ER_TABLE_NEEDS_UPGRADE
|
||||
INSERT INTO t1 (col1, col2) VALUES (1, "value");
|
||||
|
||||
REPAIR TABLE t1;
|
||||
DROP TABLE t1;
|
||||
remove_file $MYSQLD_DATADIR/test/t1.ARM;
|
||||
|
@ -328,4 +328,28 @@ drop table t1;
|
||||
|
||||
set global low_priority_updates = @old_delayed_updates;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #47682 strange behaviour of INSERT DELAYED
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (f1 integer);
|
||||
CREATE TABLE t2 (f1 integer);
|
||||
|
||||
FLUSH TABLES WITH READ LOCK;
|
||||
LOCK TABLES t1 READ;
|
||||
|
||||
# ER_CANT_UPDATE_WITH_READLOCK with normal execution
|
||||
# ER_TABLE_NOT_LOCKED when executed as prepared statement
|
||||
--error ER_CANT_UPDATE_WITH_READLOCK, ER_TABLE_NOT_LOCKED
|
||||
INSERT DELAYED INTO t2 VALUES (1);
|
||||
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -336,3 +336,25 @@ SELECT * FROM t2;
|
||||
SELECT * FROM t3;
|
||||
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #46425 crash in Diagnostics_area::set_ok_status,
|
||||
--echo # empty statement, DELETE IGNORE
|
||||
--echo #
|
||||
|
||||
CREATE table t1 (i INTEGER);
|
||||
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
--delimiter |
|
||||
|
||||
CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t1 SELECT * FROM t1 AS A;
|
||||
END |
|
||||
|
||||
--delimiter ;
|
||||
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
||||
DELETE IGNORE FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
@ -1016,6 +1016,18 @@ SELECT a, MAX(b) FROM t WHERE b > 0 AND b < 2 GROUP BY a;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #48472: Loose index scan inappropriately chosen for some WHERE
|
||||
--echo # conditions
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t (a INT, b INT, INDEX (a,b));
|
||||
INSERT INTO t VALUES (2,0), (2,0), (2,1), (2,1);
|
||||
INSERT INTO t SELECT * FROM t;
|
||||
|
||||
SELECT a, MAX(b) FROM t WHERE 0=b+0 GROUP BY a;
|
||||
|
||||
DROP TABLE t;
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
@ -70,6 +70,40 @@ commit;
|
||||
set autocommit=default;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #37183 insert ignore into .. select ... hangs
|
||||
--echo # after deadlock was encountered
|
||||
--echo #
|
||||
connect (con1,localhost,root,,);
|
||||
create table t1(id int primary key,v int)engine=innodb;
|
||||
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
|
||||
create table t2 like t1;
|
||||
|
||||
--connection con1
|
||||
begin;
|
||||
update t1 set v=id*2 where id=1;
|
||||
|
||||
--connection default
|
||||
begin;
|
||||
update t1 set v=id*2 where id=2;
|
||||
|
||||
--connection con1
|
||||
--error 1205
|
||||
update t1 set v=id*2 where id=2;
|
||||
|
||||
--connection default
|
||||
--error 1205
|
||||
insert ignore into t2 select * from t1 where id=1;
|
||||
rollback;
|
||||
|
||||
--connection con1
|
||||
rollback;
|
||||
|
||||
--connection default
|
||||
disconnect con1;
|
||||
drop table t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug#41756 Strange error messages about locks from InnoDB
|
||||
--echo #
|
||||
|
@ -14,6 +14,15 @@
|
||||
drop table if exists t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug#48276: can't add column if subpartition exists
|
||||
CREATE TABLE t1 (a INT, b INT)
|
||||
PARTITION BY LIST (a)
|
||||
SUBPARTITION BY HASH (b)
|
||||
(PARTITION p1 VALUES IN (1));
|
||||
ALTER TABLE t1 ADD COLUMN c INT;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#46639: 1030 (HY000): Got error 124 from storage engine on
|
||||
# INSERT ... SELECT ...
|
||||
@ -61,6 +70,17 @@ SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#45904: Error when CHARSET=utf8 and subpartitioning
|
||||
#
|
||||
create table t1 (a int NOT NULL, b varchar(5) NOT NULL)
|
||||
default charset=utf8
|
||||
partition by list (a)
|
||||
subpartition by key (b)
|
||||
(partition p0 values in (1),
|
||||
partition p1 values in (2));
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug#44059: rec_per_key on empty partition gives weird optimiser results
|
||||
#
|
||||
@ -2031,11 +2051,14 @@ DROP TABLE t1;
|
||||
--echo #
|
||||
--echo # Bug #45807: crash accessing partitioned table and sql_mode
|
||||
--echo # contains ONLY_FULL_GROUP_BY
|
||||
--echo # Bug#46923: select count(*) from partitioned table fails with
|
||||
--echo # ONLY_FULL_GROUP_BY
|
||||
--echo #
|
||||
|
||||
SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY';
|
||||
CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
|
||||
PARTITION BY HASH(id) PARTITIONS 2;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET SESSION SQL_MODE=DEFAULT;
|
||||
|
||||
|
@ -1260,4 +1260,25 @@ SELECT str_to_date('', '%Y-%m-%d');
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # Bug #48665: sql-bench's insert test fails due to wrong result
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a));
|
||||
|
||||
INSERT INTO t1 VALUES (0,0), (1,1);
|
||||
|
||||
--replace_column 1 @ 2 @ 3 @ 5 @ 6 @ 7 @ 8 @ 9 @ 10 @
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 FORCE INDEX (PRIMARY)
|
||||
WHERE (a>=1 AND a<=2) OR (a>=4 AND a<=5) OR (a>=0 AND a <=10);
|
||||
|
||||
--echo # Should return 2 rows
|
||||
SELECT * FROM t1 FORCE INDEX (PRIMARY)
|
||||
WHERE (a>=1 AND a<=2) OR (a>=4 AND a<=5) OR (a>=0 AND a <=10);
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -3931,4 +3931,37 @@ SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON
|
||||
|
||||
drop table A,AA,B,BB;
|
||||
--echo #end of test for bug#45266
|
||||
|
||||
--echo #
|
||||
--echo # BUG#48052: Valgrind warning - uninitialized value in init_read_record()
|
||||
--echo #
|
||||
|
||||
# Needed in 6.0 codebase
|
||||
#--echo # Disable Index condition pushdown
|
||||
#--replace_column 1 #
|
||||
#SELECT @old_icp:=@@engine_condition_pushdown;
|
||||
#SET SESSION engine_condition_pushdown = 'OFF';
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk int(11) NOT NULL,
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (2,7,'m');
|
||||
INSERT INTO t1 VALUES (3,9,'m');
|
||||
|
||||
SELECT v
|
||||
FROM t1
|
||||
WHERE NOT pk > 0
|
||||
HAVING v <= 't'
|
||||
ORDER BY pk;
|
||||
|
||||
# Needed in 6.0 codebase
|
||||
#--echo # Restore old value for Index condition pushdown
|
||||
#SET SESSION engine_condition_pushdown=@old_icp;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
@ -12,6 +12,9 @@
|
||||
# mysqltest should be fixed to allow REPLACE_RESULT in error message
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
# Supress warnings written to the log file
|
||||
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted");
|
||||
|
||||
# Backup proc table
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--copy_file $MYSQLD_DATADIR/mysql/proc.frm $MYSQLTEST_VARDIR/tmp/proc.frm
|
||||
@ -38,15 +41,14 @@ create trigger t1_ai after insert on t1 for each row call bug14233();
|
||||
|
||||
# Unsupported tampering with the mysql.proc definition
|
||||
alter table mysql.proc drop type;
|
||||
--replace_result $MYSQL_TEST_DIR .
|
||||
--error ER_SP_PROC_TABLE_CORRUPT
|
||||
--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
|
||||
call bug14233();
|
||||
--replace_result $MYSQL_TEST_DIR .
|
||||
--error ER_SP_PROC_TABLE_CORRUPT
|
||||
--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
|
||||
create view v1 as select bug14233_f();
|
||||
--replace_result $MYSQL_TEST_DIR .
|
||||
--error ER_SP_PROC_TABLE_CORRUPT
|
||||
--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
|
||||
insert into t1 values (0);
|
||||
--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
|
||||
show procedure status;
|
||||
|
||||
flush table mysql.proc;
|
||||
|
||||
@ -155,3 +157,43 @@ drop procedure bug14233_3;
|
||||
# Assert: These should show nothing.
|
||||
show procedure status where db=DATABASE();
|
||||
show function status where db=DATABASE();
|
||||
|
||||
#
|
||||
# Bug#41726 upgrade from 5.0 to 5.1.30 crashes if you didn't run mysql_upgrade
|
||||
#
|
||||
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS proc_backup;
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
--enable_warnings
|
||||
|
||||
--echo # Backup the proc table
|
||||
|
||||
RENAME TABLE mysql.proc TO proc_backup;
|
||||
CREATE TABLE mysql.proc LIKE proc_backup;
|
||||
FLUSH TABLE mysql.proc;
|
||||
|
||||
--echo # Test with a valid table.
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
SET @foo = 10;
|
||||
CALL p1();
|
||||
--replace_column 5 '0000-00-00 00:00:00' 6 '0000-00-00 00:00:00'
|
||||
SHOW PROCEDURE STATUS;
|
||||
|
||||
--echo # Modify a field of the table.
|
||||
|
||||
ALTER TABLE mysql.proc MODIFY comment CHAR (32);
|
||||
|
||||
--error ER_CANNOT_LOAD_FROM_TABLE
|
||||
CREATE PROCEDURE p2()
|
||||
SET @foo = 10;
|
||||
--echo # Procedure loaded from the cache
|
||||
CALL p1();
|
||||
--error ER_CANNOT_LOAD_FROM_TABLE
|
||||
SHOW PROCEDURE STATUS;
|
||||
|
||||
DROP TABLE mysql.proc;
|
||||
RENAME TABLE proc_backup TO mysql.proc;
|
||||
FLUSH TABLE mysql.proc;
|
||||
|
Reference in New Issue
Block a user