Skip to content

Commit

Permalink
Merge bb-10.2-ext into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Nov 10, 2017
2 parents 8409f72 + 386e5d4 commit a48aa0c
Show file tree
Hide file tree
Showing 273 changed files with 8,048 additions and 11,290 deletions.
2 changes: 1 addition & 1 deletion client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ inline bool is_delimiter_command(char *name, ulong len)
only name(first DELIMITER_NAME_LEN bytes) is checked.
*/
return (len >= DELIMITER_NAME_LEN &&
!my_strnncoll(charset_info, (uchar*) name, DELIMITER_NAME_LEN,
!my_strnncoll(&my_charset_latin1, (uchar*) name, DELIMITER_NAME_LEN,
(uchar *) DELIMITER_NAME, DELIMITER_NAME_LEN));
}

Expand Down
35 changes: 20 additions & 15 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <ut0mem.h>
#include <srv0start.h>
#include <fil0fil.h>
#include <trx0sys.h>
#include <set>
#include <string>
#include <mysqld.h>
Expand Down Expand Up @@ -1680,26 +1681,30 @@ copy_back()
ut_crc32_init();

/* copy undo tablespaces */
if (srv_undo_tablespaces > 0) {

dst_dir = (srv_undo_dir && *srv_undo_dir)
? srv_undo_dir : mysql_data_home;

ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);
dst_dir = (srv_undo_dir && *srv_undo_dir)
? srv_undo_dir : mysql_data_home;

for (ulong i = 1; i <= srv_undo_tablespaces; i++) {
char filename[20];
sprintf(filename, "undo%03lu", i);
if (!(ret = copy_or_move_file(filename, filename,
dst_dir, 1))) {
goto cleanup;
}
}
ds_data = ds_create(dst_dir, DS_TYPE_LOCAL);

ds_destroy(ds_data);
ds_data = NULL;
for (uint i = 1; i <= TRX_SYS_MAX_UNDO_SPACES; i++) {
char filename[20];
sprintf(filename, "undo%03u", i);
if (!file_exists(filename)) {
break;
}
if (!(ret = copy_or_move_file(filename, filename,
dst_dir, 1))) {
goto cleanup;
}
}

ds_destroy(ds_data);
ds_data = NULL;

/* copy redo logs */

dst_dir = (srv_log_group_home_dir && *srv_log_group_home_dir)
? srv_log_group_home_dir : mysql_data_home;

Expand Down Expand Up @@ -1825,7 +1830,7 @@ copy_back()
}
}

/* copy buufer pool dump */
/* copy buffer pool dump */

if (innobase_buffer_pool_filename) {
const char *src_name;
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2836,7 +2836,7 @@ static dberr_t enumerate_ibd_files(process_single_tablespace_func_t callback)
/* We found a symlink or a file */
if (strlen(fileinfo.name) > 4) {
bool is_isl= false;
if (ends_with(fileinfo.name, ".ibd") || ((is_isl = ends_with(fileinfo.name, ".ibd"))))
if (ends_with(fileinfo.name, ".ibd") || ((is_isl = ends_with(fileinfo.name, ".isl"))))
(*callback)(dbinfo.name, fileinfo.name, is_isl);
}
}
Expand Down
1 change: 1 addition & 0 deletions include/my_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ typedef struct st_mem_root
/* if block have less memory it will be put in 'used' list */
size_t min_malloc;
size_t block_size; /* initial block size */
size_t total_alloc;
unsigned int block_num; /* allocated blocks counter */
/*
first free block in queue test counter (if it exceed
Expand Down
1 change: 1 addition & 0 deletions include/mysql.h.pp
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
USED_MEM *pre_alloc;
size_t min_malloc;
size_t block_size;
size_t total_alloc;
unsigned int block_num;
unsigned int first_block_usage;
void (*error_handler)(void);
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/extra/binlog_tests/binlog_index.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
call mtr.add_suppression('Could not open .*');
call mtr.add_suppression('Could not use .*');
call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;

Expand Down
4 changes: 2 additions & 2 deletions mysql-test/extra/rpl_tests/rpl_binlog_errors.inc
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ SET GLOBAL debug_dbug=@old_debug;
### file or failure to write the rotate event.

call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Could not open .*");
call mtr.add_suppression("Could not use .*");

RESET MASTER;
SHOW WARNINGS;
Expand Down Expand Up @@ -392,7 +392,7 @@ RESET MASTER;

call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
call mtr.add_suppression("Error writing file .*");
call mtr.add_suppression("Could not open .*");
call mtr.add_suppression("Could not use .*");
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
-- echo ###################### TEST #13
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/include/check-testcase.test
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ call mtr.check_testcase();

let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info;
list_files $datadir/test #sql*;
list_files $datadir/mysql #sql*;

--enable_query_log

12 changes: 6 additions & 6 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1914,10 +1914,10 @@ ()
#print "Major: $1 Minor: $2 Build: $3\n";
$mysql_version_id= $1*10000 + $2*100 + $3;
#print "mysql_version_id: $mysql_version_id\n";
mtr_report("MySQL Version $1.$2.$3");
mtr_report("MariaDB Version $1.$2.$3");
$mysql_version_extra= $4;
}
mtr_error("Could not find version of MySQL") unless $mysql_version_id;
mtr_error("Could not find version of MariaDBL") unless $mysql_version_id;
}

sub find_mysqld {
Expand Down Expand Up @@ -2207,7 +2207,7 @@ sub environment_setup {
$ENV{'UMASK_DIR'}= "0770"; # The octal *string*

#
# MySQL tests can produce output in various character sets
# MariaDB tests can produce output in various character sets
# (especially, ctype_xxx.test). To avoid confusing Perl
# with output which is incompatible with the current locale
# settings, we reset the current values of LC_ALL and LC_CTYPE to "C".
Expand Down Expand Up @@ -2538,7 +2538,7 @@ ()
if (check_socket_path_length("$opt_tmpdir/testsocket.sock")){
mtr_error("Socket path '$opt_tmpdir' too long, it would be ",
"truncated and thus not possible to use for connection to ",
"MySQL Server. Set a shorter with --tmpdir=<path> option");
"MariaDB Server. Set a shorter with --tmpdir=<path> option");
}

# copy all files from std_data into var/std_data
Expand Down Expand Up @@ -4394,12 +4394,12 @@ ($$)
qr/Slave I\/O: error reconnecting to master '.*' - retry-time: [1-3] retries/,
qr/Slave I\/0: Master command COM_BINLOG_DUMP failed/,
qr/Error reading packet/,
qr/Lost connection to MySQL server at 'reading initial communication packet'/,
qr/Lost connection to MariaDB server at 'reading initial communication packet'/,
qr/Failed on request_dump/,
qr/Slave: Can't drop database.* database doesn't exist/,
qr/Slave: Operation DROP USER failed for 'create_rout_db'/,
qr|Checking table: '\..mtr.test_suppressions'|,
qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|,
qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in|,
qr|Table '\..mtr.test_suppressions' is marked as crashed and should be repaired|,
qr|Table 'test_suppressions' is marked as crashed and should be repaired|,
qr|Can't open shared library|,
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/r/create.result
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,7 @@ t1 CREATE TABLE `t1` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
Expand All @@ -1196,6 +1197,7 @@ t1 CREATE TEMPORARY TABLE `t1` (
`MAX_STAGE` tinyint(2) NOT NULL DEFAULT 0,
`PROGRESS` decimal(7,3) NOT NULL DEFAULT 0.000,
`MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`MAX_MEMORY_USED` bigint(7) NOT NULL DEFAULT 0,
`EXAMINED_ROWS` int(7) NOT NULL DEFAULT 0,
`QUERY_ID` bigint(4) NOT NULL DEFAULT 0,
`INFO_BINARY` blob DEFAULT NULL,
Expand Down
68 changes: 68 additions & 0 deletions mysql-test/r/cte_nonrecursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -1079,3 +1079,71 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
NULL UNION RESULT <union1,4> ALL NULL NULL NULL NULL NULL
DROP TABLE t1,t2;
#
# MDEV-13780: tower of embedding CTEs with multiple usage of them
#
create table t1 (a int);
insert into t1 values (3), (2), (4), (7), (1), (2), (5);
with cte_e as
(
with cte_o as
(
with cte_i as (select * from t1 where a < 7)
select * from cte_i where a > 1
)
select * from cte_o as cto_o1 where a < 3
union
select * from cte_o as cto_o2 where a > 4
)
select * from cte_e as cte_e1 where a > 1
union
select * from cte_e as cte_e2;
a
2
5
explain extended with cte_e as
(
with cte_o as
(
with cte_i as (select * from t1 where a < 7)
select * from cte_i where a > 1
)
select * from cte_o as cto_o1 where a < 3
union
select * from cte_o as cto_o2 where a > 4
)
select * from cte_e as cte_e1 where a > 1
union
select * from cte_e as cte_e2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 14 100.00 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using where
5 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where
NULL UNION RESULT <union2,5> ALL NULL NULL NULL NULL NULL NULL
6 UNION <derived9> ALL NULL NULL NULL NULL 14 100.00
9 DERIVED t1 ALL NULL NULL NULL NULL 7 100.00 Using where
12 UNION t1 ALL NULL NULL NULL NULL 7 100.00 Using where
NULL UNION RESULT <union9,12> ALL NULL NULL NULL NULL NULL NULL
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1003 with cte_e as (with cte_o as (with cte_i as (/* select#4 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 7)/* select#3 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 1)/* select#2 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` < 3 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1 union /* select#5 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` > 4 and `test`.`t1`.`a` > 1 and `test`.`t1`.`a` < 7 and `test`.`t1`.`a` > 1)/* select#1 */ select `cte_e1`.`a` AS `a` from `cte_e` `cte_e1` where `cte_e1`.`a` > 1 union /* select#6 */ select `cte_e2`.`a` AS `a` from `cte_e` `cte_e2`
drop table t1;
#
# MDEV-13753: embedded CTE in a VIEW created in prepared statement
#
SET @sql_query = "
CREATE OR REPLACE VIEW cte_test AS
WITH cte1 AS ( SELECT 1 as a from dual )
, cte2 AS ( SELECT * FROM cte1 )
SELECT * FROM cte2;
";
PREPARE stmt FROM @sql_query;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SHOW CREATE VIEW cte_test;
View Create View character_set_client collation_connection
cte_test CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `cte_test` AS with cte1 as (select 1 AS `a`), cte2 as (select `cte1`.`a` AS `a` from `cte1`)select `cte2`.`a` AS `a` from `cte2` latin1 latin1_swedish_ci
SELECT * FROM cte_test;
a
1
DROP VIEW cte_test;
45 changes: 45 additions & 0 deletions mysql-test/r/cte_recursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -2881,3 +2881,48 @@ f
2
set standard_compliant_cte=default;
DROP TABLE t;
#
# mdev-14184: recursive CTE embedded into CTE with multiple references
#
WITH
cte1 AS (
SELECT n FROM (
WITH RECURSIVE rec_cte(n) AS (
SELECT 1 as n1
UNION ALL
SELECT n+1 as n2 FROM rec_cte WHERE n < 3
) SELECT n FROM rec_cte
) AS X
),
cte2 as (
SELECT 2 FROM cte1
)
SELECT *
FROM cte1;
n
1
2
3
#
# MDEV-14217 [db crash] Recursive CTE when SELECT includes new field
#
CREATE TEMPORARY TABLE a_tbl (
a VARCHAR(33) PRIMARY KEY,
b VARCHAR(33)
);
INSERT INTO a_tbl VALUES ('block0', 'block0'), ('block1', NULL);
WITH RECURSIVE Q0 AS (
SELECT T0.a, T0.b, 5
FROM a_tbl T0
WHERE b IS NULL
UNION ALL
SELECT T1.a, T1.b
FROM Q0
JOIN a_tbl T1
ON T1.a=Q0.a
) SELECT distinct(Q0.a), Q0.b
FROM Q0;
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE a_tbl;
WITH RECURSIVE x AS (SELECT 1,2 UNION ALL SELECT 1 FROM x) SELECT * FROM x;
ERROR 21000: The used SELECT statements have a different number of columns
2 changes: 2 additions & 0 deletions mysql-test/r/delimiter_command_case_sensitivity.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1
1
41 changes: 41 additions & 0 deletions mysql-test/r/derived_cond_pushdown.result
Original file line number Diff line number Diff line change
Expand Up @@ -8783,6 +8783,47 @@ EXPLAIN
DROP VIEW v2;
DROP TABLE t1,t2;
#
# MDEV-14237: derived with regexp_substr() in select list
#
create table t1 (a char(8));
insert into t1 values ('b'), ('a'), ('xx');
select *
from ( select distinct regexp_substr(t1.a,'^[A-Za-z]+') as f from t1) as t
where t.f = 'a' or t.f = 'b';
f
b
a
explain format=json select *
from ( select distinct regexp_substr(t1.a,'^[A-Za-z]+') as f from t1) as t
where t.f = 'a' or t.f = 'b';
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t.f = 'a' or t.f = 'b'",
"materialized": {
"query_block": {
"select_id": 2,
"temporary_table": {
"table": {
"table_name": "t1",
"access_type": "ALL",
"rows": 3,
"filtered": 100
}
}
}
}
}
}
}
drop table t1;
#
# MDEV-10855: Pushdown into derived with window functions
#
set @save_optimizer_switch= @@optimizer_switch;
Expand Down
8 changes: 8 additions & 0 deletions mysql-test/r/errors.result
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,11 @@ set max_session_mem_used = 50000;
select * from seq_1_to_1000;
set max_session_mem_used = 8192;
select * from seq_1_to_1000;
#
# MDEV-14269 errors.test fails with valgrind (Conditional jump or move depends on uninitialised value)
#
SET NAMES utf8;
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null);
ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728'
SELECT UPDATEXML(-73 * -2465717823867977728,@@global.long_query_time,null);
ERROR 22003: BIGINT value is out of range in '-73 * -2465717823867977728'
14 changes: 14 additions & 0 deletions mysql-test/r/func_misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,20 @@ CONCAT(NAME_CONST('name',15),'오')
15오
SET NAMES latin1;
#
# MDEV-14116 INET6_NTOA output is set as null to varchar(39) variable
#
CREATE PROCEDURE p1()
BEGIN
DECLARE ip_full_addr varchar(39) DEFAULT "";
SELECT INET6_NTOA(UNHEX('20000000000000000000000000000000')) into ip_full_addr;
SELECT ip_full_addr;
END;
$$
CALL p1();
ip_full_addr
2000::
DROP PROCEDURE p1;
#
# Start of 10.2 tests
#
#
Expand Down
Loading

0 comments on commit a48aa0c

Please sign in to comment.