Commit a3908e32 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Update upstream source from tag 'upstream/5.5.61'

Update to upstream version '5.5.61'
with Debian dir 20b939dcfbc305feda76bc5cca6748b5c526a79c
parents 908ae0c2 1627a8b1
#
# MDEV-13748 Assertion `status_var.local_memory_used == 0 || !debug_assert_on_not_freed_memory' failed in virtual THD::~THD after query with INTERSECT
#
create table t1 (a blob, b varchar(20000)) engine=aria row_format=dynamic;
insert t1 (b) values (repeat('a', 20000));
update t1 set b='b';
drop table t1;
......@@ -2697,3 +2697,32 @@ ALTER TABLE t1 DISABLE KEYS;
INSERT INTO t1 (b) VALUES ('');
ALTER TABLE t1 ENABLE KEYS;
DROP TABLE t1;
#
# Start of 5.5 tests
#
#
# MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
#
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=ARIA;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` tinyint(4) NOT NULL AUTO_INCREMENT,
`name` char(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
id name
-1 dog
2 cat
DROP TABLE t1;
#
# End of 5.5 tests
#
......@@ -1990,3 +1990,28 @@ aria_page_checksum=$default_checksum,
aria_log_file_size=$default_log_file_size;
--enable_result_log
--enable_query_log
--echo #
--echo # Start of 5.5 tests
--echo #
--echo #
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
--echo #
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=ARIA;
SHOW CREATE TABLE t1;
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
......@@ -16,6 +16,15 @@ select * from t1;
pk dt
1 2017-09-28 15:12:00
drop table t1;
create table t1 (a int) engine=Aria transactional=1 partition by hash(a) partitions 2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 TRANSACTIONAL=1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 2 */
drop table t1;
#
# MDEV-13788 Server crash when issuing bad SQL partition syntax
#
......
......@@ -17,5 +17,12 @@ alter table t1 drop partition p20181231;
select * from t1;
drop table t1;
#
# MDEV-13982 Server crashes in in ha_partition::engine_name
#
create table t1 (a int) engine=Aria transactional=1 partition by hash(a) partitions 2;
show create table t1;
drop table t1;
--let $engine=Aria
--source inc/part_alter_values.inc
......@@ -182,6 +182,17 @@ select 2;
2
2
drop table t1;
set global server_audit_events='query_dml_no_select';
create table t1(id int);
insert into t1 values (1), (2);
select * from t1;
id
1
2
select 2;
2
2
drop table t1;
set global server_audit_events='';
set global server_audit_query_log_limit= 15;
select (1), (2), (3), (4);
......@@ -332,6 +343,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD \n# comment\nFOR u1
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0
......
......@@ -42,8 +42,10 @@ select 1,
3;
insert into t2 values (1), (2);
select * from t2;
--disable_ps_protocol
--error ER_NO_SUCH_TABLE
select * from t_doesnt_exist;
--enable_ps_protocol
--error 1064
syntax_error_query;
drop table renamed_t1, t2;
......@@ -119,6 +121,13 @@ select 2;
/*! select 2*/;
/*comment*/ select 2;
drop table t1;
set global server_audit_events='query_dml_no_select';
create table t1(id int);
insert into t1 values (1), (2);
select * from t1;
select 2;
drop table t1;
set global server_audit_events='';
set global server_audit_query_log_limit= 15;
......
......@@ -28,10 +28,11 @@ sub start_test {
}
{
my $bin=$ENV{MTR_BINDIR} || '..';
return "Not run for embedded server" if $::opt_embedded_server;
return "Not configured to run ctest" unless -f "../CTestTestfile.cmake";
my ($ctest_vs)= $opt_vs_config ? "--build-config $opt_vs_config" : "";
my (@ctest_list)= `cd .. && ctest $opt_vs_config --show-only --verbose`;
return "Not configured to run ctest" unless -f "$bin/CTestTestfile.cmake";
my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : "";
my (@ctest_list)= `cd $bin && ctest $ctest_vs --show-only --verbose`;
return "No ctest" if $?;
my ($command, %tests);
......
......@@ -354,5 +354,15 @@ a b c
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
#
SHOW TABLES;
Tables_in_test
t1
SHOW CREATE TABLE t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
ALTER TABLE t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
#
# End of 5.5 tests
#
--source include/have_ucs2.inc
let $MYSQLD_DATADIR= `select @@datadir`;
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
......@@ -318,6 +320,22 @@ SELECT * FROM t1;
DROP TABLE t1;
SET sql_mode=DEFAULT;
--echo #
--echo # MDEV-15834 The code in TABLE_SHARE::init_from_binary_frm_image() is not safe
--echo #
--copy_file std_data/frm/t1.frm $MYSQLD_DATADIR/test/t1.frm
SHOW TABLES;
--replace_result $MYSQLD_DATADIR ./
--error ER_NOT_FORM_FILE
SHOW CREATE TABLE t1;
--replace_result $MYSQLD_DATADIR ./
--error ER_NOT_FORM_FILE
ALTER TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.frm
--echo #
--echo # End of 5.5 tests
--echo #
......@@ -397,3 +397,28 @@ insert into t1 values(null);
select last_insert_id();
select * from t1;
drop table t1;
--echo #
--echo # Start of 5.5 tests
--echo #
--echo #
--echo # MDEV-16534 PPC64: Unexpected error with a negative values into auto-increment columns in HEAP, MyISAM, ARIA
--echo #
CREATE TABLE t1 (
id TINYINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
INSERT INTO t1 (name) VALUES ('dog');
UPDATE t1 SET id=-1 WHERE id=1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
source include/have_debug.inc;
set @old_dbug=@@global.debug_dbug;
#
# use after free if need plugin change and auth aborted
#
set global debug_dbug='+d,auth_disconnect';
create user 'bad' identified by 'worse';
--error 1
--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse
set global debug_dbug=@old_dbug;
drop user bad;
......@@ -885,6 +885,28 @@ DESCRIBE t1;
DROP TABLE t1;
--echo #
--echo # MDEV-15624 Changing the default character set to utf8mb4 changes query evaluation in a very surprising way
--echo #
SET NAMES utf8;
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT COUNT(DISTINCT c) FROM (SELECT id, REPLACE(uuid_short(), '0', CAST('o' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
--replace_column 1 xxxxxxxxxxxxxxxxx
SELECT DISTINCT REPLACE(uuid_short(), '0', CAST('o' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
SELECT COUNT(DISTINCT c) FROM (SELECT id, INSERT(uuid_short(), 1, 1, CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
--replace_column 1 xxxxxxxxxxxxxxxxx
SELECT DISTINCT INSERT(uuid_short(), 1, 1, CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
SELECT COUNT(DISTINCT c) FROM (SELECT id, CONCAT(uuid_short(), CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
--replace_column 1 xxxxxxxxxxxxxxxxx
SELECT DISTINCT CONCAT(uuid_short(), CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
......@@ -1858,6 +1858,25 @@ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub;
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub;
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
--echo #
--echo # MDEV-15624 Changing the default character set to utf8mb4 changes query evaluation in a very surprising way
--echo #
SET NAMES utf8mb4;
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT COUNT(DISTINCT c) FROM (SELECT id, REPLACE(UUID(), "-", "") AS c FROM t1) AS d1;
--replace_column 1 xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
SELECT DISTINCT INSERT(uuid(), 9, 1, "X") AS c FROM t1;
SELECT COUNT(DISTINCT c) FROM (SELECT id, INSERT(UUID(), 9, 1, "X") AS c FROM t1) AS d1;
--replace_column 1 xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
SELECT DISTINCT INSERT(UUID(), 9, 1, "X") AS c FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
......
......@@ -864,5 +864,64 @@ select distinct t1.id, tt.id, tt.data
drop table t1;
--echo #
--echo # MDEV-14241: Server crash in key_copy / get_matching_chain_by_join_key
--echo # or valgrind warnings
--echo #
CREATE TABLE t1 (a VARCHAR(10)) ENGINE=MyISAM;
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES ('foo'),('bar');
CREATE TABLE t2 (b integer auto_increment primary key) ENGINE=MyISAM;
INSERT INTO t2 VALUES (NULL),(NULL);
CREATE TABLE t3 (c VARCHAR(1024) CHARACTER SET utf8, d INT) ENGINE=MyISAM;
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3;
INSERT INTO t3 VALUES ('abc',NULL),('def',4);
set @save_join_cache_level= @@join_cache_level;
SET join_cache_level= 8;
explain
SELECT * FROM v1, t2, v3 WHERE a = c AND b = d;
SELECT * FROM v1, t2, v3 WHERE a = c AND b = d;
DROP VIEW v1, v3;
DROP TABLE t1, t2, t3;
--echo #
--echo # MDEV-14786: Server crashes in Item_cond::transform on 2nd
--echo # execution of SP querying from a view
--echo #
create table t1 (i int, row_start timestamp(6) not null default now(),
row_end timestamp(6) not null default '2030-01-01 0:0:0');
create view v1 as select i from t1 where i < 5 and (row_end =
TIMESTAMP'2030-01-01 0:0:0' or row_end is null);
create procedure pr(x int) select i from v1;
call pr(1);
call pr(2);
drop procedure pr;
drop view v1;
drop table t1;
set @@join_cache_level= @save_join_cache_level;
--echo #
--echo # MDEV-16307: Incorrect results when using BNLH join instead of BNL join with views
--echo #
CREATE TABLE t1 (c1 text, c2 int);
INSERT INTO t1 VALUES ('a',1), ('c',3), ('g',7), ('d',4), ('c',3);
CREATE TABLE t2 (c1 text, c2 int);
INSERT INTO t2 VALUES ('b',2), ('c',3);
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
explain SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
set @save_join_cache_level= @@join_cache_level;
set @@join_cache_level=4;
explain SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
SELECT v1.c1, v1.c2, t2.c1, t2.c2 FROM v1, t2 WHERE v1.c1=t2.c1;
drop table t1,t2;
drop view v1;
set @@join_cache_level= @save_join_cache_level;
--echo # end of 5.5
......@@ -596,6 +596,18 @@ AND 57813X540X1723 = 'Test';
drop table t1;
--echo #
--echo # MDEV-15630 uuid() function evaluates at wrong time in query
--echo #
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
--replace_column 2 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
SELECT COUNT(1), UUID() as uid FROM t1 GROUP BY uid;
DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
......
......@@ -1574,15 +1574,7 @@ drop database mysqltest1;
--echo End of 5.0 tests
#
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
#
set names utf8;
grant select on test.* to юзер_юзер@localhost;
--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()"
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
--error ER_WRONG_STRING_LENGTH
grant select on test.* to очень_длинный_юзер@localhost;
set names default;
......@@ -1667,6 +1659,9 @@ use test;
#
# Bug#16470 crash on grant if old grant tables
#
call mtr.add_suppression("Can't open and lock privilege tables");
--echo FLUSH PRIVILEGES without procs_priv table.
RENAME TABLE mysql.procs_priv TO mysql.procs_gone;
--error ER_NO_SUCH_TABLE
......
# UTF8 parameters to mysql client do not work on Windows
--source include/not_windows.inc
--source include/not_embedded.inc
#
# Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
#
set names utf8;
grant select on test.* to юзер_юзер@localhost;
--exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()"
revoke all on test.* from юзер_юзер@localhost;
drop user юзер_юзер@localhost;
set names default;
......@@ -744,3 +744,12 @@ SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0;
set sql_mode=@save_sql_mode;
drop table t1;
--echo #
--echo # mdev-16235: impossible HAVING in query without aggregation
--echo #
explain extended
select * from mysql.help_topic where example = 'foo' having description is null;
select * from mysql.help_topic where example = 'foo' having description is null;
......@@ -423,3 +423,13 @@ SET GLOBAL myisam_data_pointer_size = @old_myisam_data_pointer_size;
DROP TABLE t1;
--echo End of 5.1 tests
#
# MDEV-15318 CREATE .. SELECT VALUES produces invalid table structure
#
create table t1 (i int);
create table t2 as select values(i) as a from t1;
show create table t2;
drop table t1, t2;
--echo End of 5.5 tests
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment