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

Update upstream source from tag 'upstream/10.1.38'

Update to upstream version '10.1.38'
with Debian dir bf5887327d488168695833ed7a82628c14b6eac8
parents 4b96bd2d e07d9be7
...@@ -287,7 +287,7 @@ typedef struct st_mysql ...@@ -287,7 +287,7 @@ typedef struct st_mysql
/* session-wide random string */ /* session-wide random string */
char scramble[SCRAMBLE_LENGTH+1]; char scramble[SCRAMBLE_LENGTH+1];
my_bool unused1; my_bool auto_local_infile;
void *unused2, *unused3, *unused4, *unused5; void *unused2, *unused3, *unused4, *unused5;
LIST *stmts; /* list of all statements */ LIST *stmts; /* list of all statements */
......
...@@ -350,7 +350,7 @@ typedef struct st_mysql ...@@ -350,7 +350,7 @@ typedef struct st_mysql
my_bool free_me; my_bool free_me;
my_bool reconnect; my_bool reconnect;
char scramble[20 +1]; char scramble[20 +1];
my_bool unused1; my_bool auto_local_infile;
void *unused2, *unused3, *unused4, *unused5; void *unused2, *unused3, *unused4, *unused5;
LIST *stmts; LIST *stmts;
const struct st_mysql_methods *methods; const struct st_mysql_methods *methods;
......
/* Copyright (c) 2013, Monty Program Ab. /* Copyright (c) 2013, 2018, MariaDB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
time-consuming loops, and gracefully abort the operation if it is time-consuming loops, and gracefully abort the operation if it is
non-zero. non-zero.
thd_is_killed(thd) thd_killed(thd)
@return 0 - no KILL statement was issued, continue normally @return 0 - no KILL statement was issued, continue normally
@return 1 - there was a KILL statement, abort the execution. @return 1 - there was a KILL statement, abort the execution.
......
...@@ -34,7 +34,7 @@ ENDIF(UNIX) ...@@ -34,7 +34,7 @@ ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
COMPONENT Test) COMPONENT Test)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcre pcreposix) TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver pcreposix pcre)
IF(CMAKE_GENERATOR MATCHES "Xcode") IF(CMAKE_GENERATOR MATCHES "Xcode")
# It does not seem possible to tell Xcode the resulting target might need # It does not seem possible to tell Xcode the resulting target might need
......
...@@ -21,3 +21,4 @@ innodb-wl5522-debug-zip : broken upstream ...@@ -21,3 +21,4 @@ innodb-wl5522-debug-zip : broken upstream
innodb_bug12902967 : broken upstream innodb_bug12902967 : broken upstream
file_contents : MDEV-6526 these files are not installed anymore file_contents : MDEV-6526 these files are not installed anymore
max_statement_time : cannot possibly work, depends on timing max_statement_time : cannot possibly work, depends on timing
partition_open_files_limit : open_files_limit check broken by MDEV-18360
[crypt]
innodb_encrypt_tables=ON
plugin-load-add=$FILE_KEY_MANAGEMENT_SO
loose-file-key-management
loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
file-key-management-encryption-algorithm=aes_cbc
[clear]
innodb_encrypt_tables=OFF
plugin-load-add=$FILE_KEY_MANAGEMENT_SO
loose-file-key-management
loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
file-key-management-encryption-algorithm=aes_cbc
# The goal of including this file is to enable innodb_encrypt_tables combinations
# (see include/innodb_encrypt_tables.combinations)
--source include/have_innodb.inc
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
# Tool used for executing a suite of .test file # Tool used for executing a suite of .test file
# #
# See the "MySQL Test framework manual" for more information # See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html # https://mariadb.com/kb/en/library/mysqltest/
# #
# Please keep the test framework tools identical in all versions! # Please keep the test framework tools identical in all versions!
# #
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
# Tool used for executing a suite of .test files # Tool used for executing a suite of .test files
# #
# See the "MySQL Test framework manual" for more information # See the "MySQL Test framework manual" for more information
# http://dev.mysql.com/doc/mysqltest/en/index.html # https://mariadb.com/kb/en/library/mysqltest/
# #
# #
############################################################################## ##############################################################################
...@@ -5285,6 +5285,7 @@ sub server_need_restart { ...@@ -5285,6 +5285,7 @@ sub server_need_restart {
exists $server->{'restart_opts'}) exists $server->{'restart_opts'})
{ {
my $use_dynamic_option_switch= 0; my $use_dynamic_option_switch= 0;
delete $server->{'restart_opts'};
if (!$use_dynamic_option_switch) if (!$use_dynamic_option_switch)
{ {
mtr_verbose_restart($server, "running with different options '" . mtr_verbose_restart($server, "running with different options '" .
......
...@@ -264,3 +264,17 @@ delete from t1 where a=32767; ...@@ -264,3 +264,17 @@ delete from t1 where a=32767;
insert into t1 values(NULL); insert into t1 values(NULL);
ERROR 22003: Out of range value for column 'a' at row 1 ERROR 22003: Out of range value for column 'a' at row 1
drop table t1; drop table t1;
create table t1 (pk int auto_increment primary key, f varchar(20));
insert t1 (f) values ('a'), ('b'), ('c'), ('d');
select null, f into outfile 'load.data' from t1 limit 1;
load data infile 'load.data' into table t1;
insert t1 (f) values ('<===');
select * from t1;
pk f
1 a
2 b
3 c
4 d
5 a
6 <===
drop table t1;
...@@ -508,3 +508,14 @@ DROP TABLE t1; ...@@ -508,3 +508,14 @@ DROP TABLE t1;
SELECT 100 BETWEEN 1 AND 9223372036854775808; SELECT 100 BETWEEN 1 AND 9223372036854775808;
100 BETWEEN 1 AND 9223372036854775808 100 BETWEEN 1 AND 9223372036854775808
1 1
#
# MDEV-17724 Wrong result for BETWEEN 0 AND 18446744073709551615
#
CREATE TABLE t1 (c1 bigint(20) unsigned NOT NULL);
INSERT INTO t1 VALUES (0),(101),(255);
SELECT * FROM t1 WHERE c1 BETWEEN 0 AND 18446744073709551615 ORDER BY c1;
c1
0
101
255
DROP TABLE t1;
...@@ -82,8 +82,20 @@ connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET); ...@@ -82,8 +82,20 @@ connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET); connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
select user,host,password,plugin,authentication_string from mysql.user where user='test';
user host password plugin authentication_string
test localhost *5FDFF3268A50F41C5D18D2CA2F754D7BDB9B3E59
test 127.0.0.1 *5FDFF3268A50F41C5D18D2CA2F754D7BDB9B3E59
update mysql.user set password=old_password("gambling2") where user=_binary"test"; update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges; flush privileges;
show grants for test@localhost;
Grants for test@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
update mysql.user set plugin='mysql_old_password' where user='test';
flush privileges;
show grants for test@localhost;
Grants for test@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '2f27438961437573'
set password=""; set password="";
set password='gambling3'; set password='gambling3';
ERROR HY000: Password hash should be a 41-digit hexadecimal number ERROR HY000: Password hash should be a 41-digit hexadecimal number
......
...@@ -8013,6 +8013,15 @@ ABCDEFGHI-ABCDEFGHI ...@@ -8013,6 +8013,15 @@ ABCDEFGHI-ABCDEFGHI
DROP TABLE t1; DROP TABLE t1;
SET optimizer_switch=@save_optimizer_switch; SET optimizer_switch=@save_optimizer_switch;
# #
# MDEV-17298 ASAN unknown-crash / READ of size 1 in my_strntoul_8bit upon INSERT .. SELECT
#
SET NAMES latin1;
CREATE TABLE t1 (a CHAR);
CREATE TABLE t2 (b ENUM('foo','bar'));
INSERT INTO t1 VALUES ('1');
INSERT INTO t2 SELECT * FROM t1;
DROP TABLE t1, t2;
#
# End of 10.0 tests # End of 10.0 tests
# #
# #
......
...@@ -508,7 +508,6 @@ ERROR HY000: Table 't1' was locked with a READ lock and can't be updated ...@@ -508,7 +508,6 @@ ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES; UNLOCK TABLES;
LOCK TABLES v1 WRITE; LOCK TABLES v1 WRITE;
FLUSH TABLES v1; FLUSH TABLES v1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
UNLOCK TABLES; UNLOCK TABLES;
LOCK TABLES v1 READ; LOCK TABLES v1 READ;
FLUSH TABLES t1; FLUSH TABLES t1;
......
...@@ -246,4 +246,34 @@ EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b; ...@@ -246,4 +246,34 @@ EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL b 263 NULL 3 Using index for group-by 1 SIMPLE t1 range NULL b 263 NULL 3 Using index for group-by
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
#
set @save_innodb_file_format= @@innodb_file_format;
set @save_innodb_large_prefix= @@innodb_large_prefix;
set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;
CREATE TABLE t1 (v1 varchar(1020), v2 varchar(2), v3 varchar(2),
KEY k1 (v3,v2,v1)) ENGINE=InnoDB CHARACTER SET=utf8 ROW_FORMAT=DYNAMIC;
INSERT INTO t1 VALUES ('king', 'qu','qu'), ('bad','go','go');
explain
SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
SELECT MIN(t1.v1) FROM t1 where t1.v2='qu' and t1.v3='qu';
MIN(t1.v1)
king
drop table t1;
CREATE TABLE t1 (v1 varchar(1024) CHARACTER SET utf8, KEY v1 (v1)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1 VALUES ('king'), ('bad');
explain
SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
SELECT MIN(x.v1) FROM (SELECT t1.* FROM t1 WHERE t1.v1 >= 'p') x;
MIN(x.v1)
NULL
drop table t1;
set global innodb_file_format = @save_innodb_file_format;
set global innodb_large_prefix = @save_innodb_large_prefix;
End of 5.5 tests End of 5.5 tests
...@@ -1471,3 +1471,11 @@ CALL p1(); ...@@ -1471,3 +1471,11 @@ CALL p1();
ip_full_addr ip_full_addr
2000:: 2000::
DROP PROCEDURE p1; DROP PROCEDURE p1;
#
# MDEV-18195 ASAN use-after-poison in my_strcasecmp_utf8 / Item::eq upon prepared statement with ORDER BY NAME_CONST
#
PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )";
EXECUTE stmt;
x
x
DEALLOCATE PREPARE stmt;
...@@ -16,3 +16,10 @@ show grants for foo@'%'; ...@@ -16,3 +16,10 @@ show grants for foo@'%';
ERROR 42000: Access denied for user 'test'@'%' to database 'mysql' ERROR 42000: Access denied for user 'test'@'%' to database 'mysql'
drop user test, foo; drop user test, foo;
drop role foo; drop role foo;
CREATE TABLE t1 (a INT);
LOCK TABLE t1 WRITE;
REVOKE EXECUTE ON PROCEDURE sp FROM u;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
REVOKE PROCESS ON *.* FROM u;
ERROR HY000: Table 'user' was not locked with LOCK TABLES
DROP TABLE t1;
set global max_allowed_packet=1024*1024*10;
ERROR HY000: The definition for table `t1` is too big ERROR HY000: The definition for table `t1` is too big
set global max_allowed_packet=default;
...@@ -1712,3 +1712,53 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1712,3 +1712,53 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY,c1,i,c2 NULL NULL NULL 69 Using where 1 SIMPLE t1 ALL PRIMARY,c1,i,c2 NULL NULL NULL 69 Using where
DROP TABLE t1; DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save; set optimizer_switch= @optimizer_switch_save;
#
# MDEV-16695: Estimate for rows of derived tables is very high when we are using index_merge union
#
create table t0
(
key1 int not null,
INDEX i1(key1)
);
insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
set @d=8;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
insert into t0 select key1+ @d from t0;
set @d=@d*2;
alter table t0 add key2 int not null, add index i2(key2);
alter table t0 add key3 int not null, add index i3(key3);
alter table t0 add key8 int not null, add index i8(key8);
update t0 set key2=key1,key3=key1,key8=1024-key1;
analyze table t0;
Table Op Msg_type Msg_text
test.t0 analyze status OK
set @optimizer_switch_save=@@optimizer_switch;
set optimizer_switch='derived_merge=off,derived_with_keys=off';
explain select * from (select * from t0 where key1 = 3 or key2 =3) as Z where Z.key8 > 5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where
2 DERIVED t0 index_merge i1,i2 i1,i2 4,4 NULL 2 Using union(i1,i2); Using where
select * from (select * from t0 where key1 = 3 or key2 =3) as Z where Z.key8 > 5;
key1 key2 key3 key8
3 3 3 1021
set optimizer_use_condition_selectivity=2;
explain select * from (select * from t0 where key1 = 3 or key2 =3) as Z where Z.key8 > 5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where
2 DERIVED t0 index_merge i1,i2 i1,i2 4,4 NULL 2 Using union(i1,i2); Using where
select * from (select * from t0 where key1 = 3 or key2 =3) as Z where Z.key8 > 5;
key1 key2 key3 key8
3 3 3 1021
set @@optimizer_switch= @optimizer_switch_save;
drop table t0;
...@@ -1089,6 +1089,7 @@ from ...@@ -1089,6 +1089,7 @@ from
t0 A, t0 B, t0 C; t0 A, t0 B, t0 C;
drop table t0,t1; drop table t0,t1;
# #
#
# MDEV-10360: Extended keys: index properties depend on index order # MDEV-10360: Extended keys: index properties depend on index order
# #
create table t0 (a int); create table t0 (a int);
......
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