mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@@ -152,10 +152,12 @@ ENDMACRO(SETA)
|
||||
|
||||
SETA(CPACK_RPM_client_PACKAGE_OBSOLETES
|
||||
"mysql-client"
|
||||
"MySQL-client")
|
||||
"MySQL-client"
|
||||
"mytop <= 1.7")
|
||||
SETA(CPACK_RPM_client_PACKAGE_PROVIDES
|
||||
"MySQL-client"
|
||||
"mysql-client")
|
||||
"mysql-client"
|
||||
"mytop")
|
||||
SETA(CPACK_RPM_client_PACKAGE_CONFLICTS
|
||||
"MariaDB-server < 10.6.0")
|
||||
|
||||
@@ -187,7 +189,7 @@ SETA(CPACK_RPM_test_PACKAGE_PROVIDES
|
||||
|
||||
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
|
||||
"MariaDB-common >= 10.6.1"
|
||||
"MariaDB-client")
|
||||
"MariaDB-client >= 10.6.1")
|
||||
|
||||
IF(WITH_WSREP)
|
||||
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
|
||||
@@ -230,7 +232,7 @@ ALTERNATIVE_NAME("test" "mysql-test")
|
||||
IF(RPM MATCHES "(rhel|centos)6")
|
||||
ALTERNATIVE_NAME("client" "mysql")
|
||||
ELSEIF(RPM MATCHES "fedora" OR RPM MATCHES "(rhel|centos)7")
|
||||
SET(epoch 1:) # this is fedora
|
||||
SET(epoch 1:)
|
||||
ALTERNATIVE_NAME("client" "mariadb")
|
||||
ALTERNATIVE_NAME("client" "mysql")
|
||||
ALTERNATIVE_NAME("devel" "mariadb-devel")
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
#
|
||||
# - INSTALL_UNIX_ADDRDIR (path to mysql.sock)
|
||||
#
|
||||
# When changing this page, _please_ do not forget to update public Wiki
|
||||
# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
|
||||
|
||||
IF(NOT INSTALL_LAYOUT)
|
||||
IF(DEB)
|
||||
|
||||
@@ -64,3 +64,11 @@ make_scope_exit(Callable &&f)
|
||||
return detail::scope_exit<typename std::decay<Callable>::type>(
|
||||
std::forward<Callable>(f));
|
||||
}
|
||||
|
||||
#define CONCAT_IMPL(x, y) x##y
|
||||
|
||||
#define CONCAT(x, y) CONCAT_IMPL(x, y)
|
||||
|
||||
#define ANONYMOUS_VARIABLE CONCAT(_anonymous_variable, __LINE__)
|
||||
|
||||
#define SCOPE_EXIT auto ANONYMOUS_VARIABLE= make_scope_exit
|
||||
|
||||
@@ -159,7 +159,7 @@ sub my_build_path_list {
|
||||
# User can select to look in a special build dir
|
||||
# which is a subdirectory of any of the paths
|
||||
my @extra_dirs;
|
||||
my $build_dir= $::opt_vs_config || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
|
||||
my $build_dir= $::multiconfig || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
|
||||
push(@extra_dirs, $build_dir) if defined $build_dir;
|
||||
|
||||
if (defined $extension){
|
||||
|
||||
@@ -141,7 +141,7 @@ our $opt_tmpdir; # A path but set directly on cmd line
|
||||
# configuration used to build them. To make life easier, an environment
|
||||
# variable or command-line option may be specified to control which set of
|
||||
# executables will be used by the test suite.
|
||||
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
|
||||
our $multiconfig = $ENV{'MTR_VS_CONFIG'};
|
||||
|
||||
our $default_vardir;
|
||||
|
||||
@@ -502,7 +502,7 @@ sub command_line_setup () {
|
||||
'compress' => \$opt_compress,
|
||||
'bench' => \$opt_bench,
|
||||
'small-bench' => \$opt_small_bench,
|
||||
'vs-config' => \$opt_vs_config,
|
||||
'vs-config' => \$multiconfig,
|
||||
|
||||
# Control what test suites or cases to run
|
||||
'force' => \$opt_force,
|
||||
@@ -2213,9 +2213,9 @@ sub vs_config_dirs ($$) {
|
||||
|
||||
$exe = "" if not defined $exe;
|
||||
|
||||
if ($opt_vs_config)
|
||||
if ($multiconfig)
|
||||
{
|
||||
return ("$glob_bindir/$path_part/$opt_vs_config/$exe");
|
||||
return ("$glob_bindir/$path_part/$multiconfig/$exe");
|
||||
}
|
||||
|
||||
return ("$glob_bindir/$path_part/release/$exe",
|
||||
|
||||
@@ -219,6 +219,157 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
connection default;
|
||||
disconnect c1;
|
||||
#
|
||||
# MDEV-25399 Assertion `name.length == strlen(name.str)' failed in Item_func_sp::make_send_field
|
||||
#
|
||||
SET sql_mode='';
|
||||
CREATE FUNCTION f(i INT) RETURNS INT RETURN 1;
|
||||
PREPARE s FROM "SELECT f('\0')";
|
||||
EXECUTE s;
|
||||
f('\x00')
|
||||
1
|
||||
DROP FUNCTION f;
|
||||
SET sql_mode=DEFAULT;
|
||||
#
|
||||
# MDEV-22380: Assertion `name.length == strlen(name.str)' failed
|
||||
# in Item::print_item_w_name on SELECT w/ optimizer_trace enabled
|
||||
#
|
||||
SELECT '' LIMIT 0;
|
||||
|
||||
CREATE TABLE t1 AS SELECT '';
|
||||
ERROR 42000: Incorrect column name ''
|
||||
CREATE PROCEDURE test_inject(arg TEXT CHARACTER SET latin1)
|
||||
BEGIN
|
||||
SET @stmt=CONCAT('SELECT ''', arg, ''', CONCAT(''', arg, ''') LIMIT 0');
|
||||
PREPARE stmt FROM @stmt;
|
||||
EXECUTE stmt;
|
||||
SET @stmt=CONCAT('CREATE TABLE t1 AS ', @stmt);
|
||||
PREPARE stmt FROM @stmt;
|
||||
EXECUTE stmt;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
END;
|
||||
$$
|
||||
SELECT x'FF32', CONCAT(x'FF32') LIMIT 0;
|
||||
x'FF32' CONCAT(x'FF32')
|
||||
CREATE TABLE t1 AS SELECT x'FF32', CONCAT(x'FF32');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x'FF32'` varbinary(2) NOT NULL,
|
||||
`CONCAT(x'FF32')` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject(x'FF32');
|
||||
<EFBFBD>2 CONCAT('<27>2')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`<60>2` varchar(2) NOT NULL,
|
||||
`CONCAT('<27>2')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT x'32FF', CONCAT(x'32FF') LIMIT 0;
|
||||
x'32FF' CONCAT(x'32FF')
|
||||
CREATE TABLE t1 AS SELECT x'32FF', CONCAT(x'32FF');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x'32FF'` varbinary(2) NOT NULL,
|
||||
`CONCAT(x'32FF')` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject(x'32FF');
|
||||
2<EFBFBD> CONCAT('2<>')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`2<>` varchar(2) NOT NULL,
|
||||
`CONCAT('2<>')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT x'0032', CONCAT(x'0032') LIMIT 0;
|
||||
x'0032' CONCAT(x'0032')
|
||||
CREATE TABLE t1 AS SELECT x'0032', CONCAT(x'0032');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x'0032'` varbinary(2) NOT NULL,
|
||||
`CONCAT(x'0032')` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject(x'0032');
|
||||
2 CONCAT('\x002')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`2` varchar(2) NOT NULL,
|
||||
`CONCAT('\x002')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT x'3200', CONCAT(x'3200') LIMIT 0;
|
||||
x'3200' CONCAT(x'3200')
|
||||
CREATE TABLE t1 AS SELECT x'3200', CONCAT(x'3200');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`x'3200'` varbinary(2) NOT NULL,
|
||||
`CONCAT(x'3200')` varbinary(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject(x'3200');
|
||||
2\x00 CONCAT('2\x00')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`2\x00` varchar(2) NOT NULL,
|
||||
`CONCAT('2\x00')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT '0\a', CONCAT('0\a') LIMIT 0;
|
||||
0a CONCAT('0\a')
|
||||
CREATE TABLE t1 AS SELECT '0\a', CONCAT('0\a');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`0a` varchar(2) NOT NULL,
|
||||
`CONCAT('0\a')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject('0\a');
|
||||
0a CONCAT('0a')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`0a` varchar(2) NOT NULL,
|
||||
`CONCAT('0a')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT 'a\0', CONCAT('a\0') LIMIT 0;
|
||||
a\x00 CONCAT('a\0')
|
||||
CREATE TABLE t1 AS SELECT 'a\0', CONCAT('a\0');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a\x00` varchar(2) NOT NULL,
|
||||
`CONCAT('a\0')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject('a\0');
|
||||
a\x00 CONCAT('a\x00')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a\x00` varchar(2) NOT NULL,
|
||||
`CONCAT('a\x00')` varchar(2) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT 'a\0b', CONCAT('a\0b') LIMIT 0;
|
||||
a\x00b CONCAT('a\0b')
|
||||
CREATE TABLE t1 AS SELECT 'a\0b', CONCAT('a\0b');
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a\x00b` varchar(3) NOT NULL,
|
||||
`CONCAT('a\0b')` varchar(3) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CALL test_inject('a\0b');
|
||||
a\x00b CONCAT('a\x00b')
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a\x00b` varchar(3) NOT NULL,
|
||||
`CONCAT('a\x00b')` varchar(3) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP PROCEDURE test_inject;
|
||||
#
|
||||
# MDEV-23519
|
||||
#
|
||||
create or replace table t1 (a int);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -402,7 +402,7 @@ select cast(_latin1'test' as char character set latin2);
|
||||
cast(_latin1'test' as char character set latin2)
|
||||
test
|
||||
select cast(_koi8r'<27><><EFBFBD><EFBFBD>' as char character set cp1251);
|
||||
cast(_koi8r'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' as char character set cp1251)
|
||||
cast(_koi8r'\xD4\xC5\xD3\xD4' as char character set cp1251)
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
create table t1 select cast(_koi8r'<27><><EFBFBD><EFBFBD>' as char character set cp1251) as t;
|
||||
show create table t1;
|
||||
|
||||
@@ -4710,7 +4710,7 @@ SELECT @@character_set_client, @@character_set_connection, @@character_set_resul
|
||||
@@character_set_client @@character_set_connection @@character_set_results
|
||||
binary big5 binary
|
||||
SELECT HEX('<27>\['), HEX('\<5C>\[');
|
||||
HEX('<EFBFBD>\[') HEX('\<EFBFBD>\[')
|
||||
HEX('\xE0\[') HEX('\\xE0\[')
|
||||
E05B E05B
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
@@ -20418,7 +20418,7 @@ SELECT @@character_set_client, @@character_set_connection, @@character_set_resul
|
||||
@@character_set_client @@character_set_connection @@character_set_results
|
||||
binary cp932 binary
|
||||
SELECT HEX('<27>\['), HEX('\<5C>\[');
|
||||
HEX('<EFBFBD>\[') HEX('\<EFBFBD>\[')
|
||||
HEX('\xE0\[') HEX('\\xE0\[')
|
||||
E05B E05B
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
@@ -5058,7 +5058,7 @@ SELECT @@character_set_client, @@character_set_connection, @@character_set_resul
|
||||
@@character_set_client @@character_set_connection @@character_set_results
|
||||
binary gbk binary
|
||||
SELECT HEX('<27>\['), HEX('\<5C>\[');
|
||||
HEX('<EFBFBD>\[') HEX('\<EFBFBD>\[')
|
||||
HEX('\xE0\[') HEX('\\xE0\[')
|
||||
E05B E05B
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
@@ -7965,37 +7965,37 @@ SELECT '
|
||||
?
|
||||
?
|
||||
SELECT HEX('<27>');
|
||||
HEX('<EFBFBD>')
|
||||
HEX('\xC2')
|
||||
3F
|
||||
SELECT HEX(CAST('<27>' AS CHAR CHARACTER SET utf8));
|
||||
HEX(CAST('<EFBFBD>' AS CHAR CHARACTER SET utf8))
|
||||
HEX(CAST('\xC2' AS CHAR CHARACTER SET utf8))
|
||||
3F
|
||||
SELECT HEX(CAST('<27>' AS CHAR CHARACTER SET latin1));
|
||||
HEX(CAST('<EFBFBD>' AS CHAR CHARACTER SET latin1))
|
||||
HEX(CAST('\xC2' AS CHAR CHARACTER SET latin1))
|
||||
3F
|
||||
SELECT HEX(CONVERT('<27>' USING utf8));
|
||||
HEX(CONVERT('<EFBFBD>' USING utf8))
|
||||
HEX(CONVERT('\xC2' USING utf8))
|
||||
3F
|
||||
SELECT HEX(CONVERT('<27>' USING latin1));
|
||||
HEX(CONVERT('<EFBFBD>' USING latin1))
|
||||
HEX(CONVERT('\xC2' USING latin1))
|
||||
3F
|
||||
SELECT '<27>x';
|
||||
?x
|
||||
?x
|
||||
SELECT HEX('<27>x');
|
||||
HEX('<EFBFBD>x')
|
||||
HEX('\xC2x')
|
||||
3F78
|
||||
SELECT HEX(CAST('<27>x' AS CHAR CHARACTER SET utf8));
|
||||
HEX(CAST('<EFBFBD>x' AS CHAR CHARACTER SET utf8))
|
||||
HEX(CAST('\xC2x' AS CHAR CHARACTER SET utf8))
|
||||
3F78
|
||||
SELECT HEX(CAST('<27>x' AS CHAR CHARACTER SET latin1));
|
||||
HEX(CAST('<EFBFBD>x' AS CHAR CHARACTER SET latin1))
|
||||
HEX(CAST('\xC2x' AS CHAR CHARACTER SET latin1))
|
||||
3F78
|
||||
SELECT HEX(CONVERT('<27>x' USING utf8));
|
||||
HEX(CONVERT('<EFBFBD>x' USING utf8))
|
||||
HEX(CONVERT('\xC2x' USING utf8))
|
||||
3F78
|
||||
SELECT HEX(CONVERT('<27>x' USING latin1));
|
||||
HEX(CONVERT('<EFBFBD>x' USING latin1))
|
||||
HEX(CONVERT('\xC2x' USING latin1))
|
||||
3F78
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
|
||||
@@ -18682,7 +18682,7 @@ SELECT @@character_set_client, @@character_set_connection, @@character_set_resul
|
||||
@@character_set_client @@character_set_connection @@character_set_results
|
||||
binary sjis binary
|
||||
SELECT HEX('<27>\['), HEX('\<5C>\[');
|
||||
HEX('<EFBFBD>\[') HEX('\<EFBFBD>\[')
|
||||
HEX('\xE0\[') HEX('\\xE0\[')
|
||||
E05B E05B
|
||||
CREATE TABLE t1 AS SELECT REPEAT(' ', 10) AS a LIMIT 0;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
@@ -67,13 +67,13 @@ select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
|
||||
_utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%')
|
||||
1
|
||||
select convert(_latin1'G<>nter Andr<64>' using utf8) like CONVERT(_latin1'G<>NTER%' USING utf8);
|
||||
convert(_latin1'G<EFBFBD>nter Andr<EFBFBD>' using utf8) like CONVERT(_latin1'G<EFBFBD>NTER%' USING utf8)
|
||||
convert(_latin1'G\xFCnter Andr\xE9' using utf8) like CONVERT(_latin1'G\xDCNTER%' USING utf8)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8);
|
||||
CONVERT(_koi8r'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' USING utf8)
|
||||
CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8) LIKE CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8);
|
||||
CONVERT(_koi8r'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' USING utf8) LIKE CONVERT(_koi8r'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' USING utf8)
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
@@ -1295,7 +1295,7 @@ concat(concat(_latin1'->',f1),_latin1'<-')
|
||||
-><-
|
||||
drop table t1;
|
||||
select convert(_koi8r'<27>' using utf8) < convert(_koi8r'<27>' using utf8);
|
||||
convert(_koi8r'<EFBFBD>' using utf8) < convert(_koi8r'<EFBFBD>' using utf8)
|
||||
convert(_koi8r'\xC9' using utf8) < convert(_koi8r'\xCA' using utf8)
|
||||
1
|
||||
set names latin1;
|
||||
create table t1 (a varchar(10)) character set utf8;
|
||||
|
||||
@@ -67,13 +67,13 @@ select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4
|
||||
_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%')
|
||||
1
|
||||
select convert(_latin1'G<>nter Andr<64>' using utf8mb4) like CONVERT(_latin1'G<>NTER%' USING utf8mb4);
|
||||
convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4)
|
||||
convert(_latin1'G\xFCnter Andr\xE9' using utf8mb4) like CONVERT(_latin1'G\xDCNTER%' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
@@ -1316,7 +1316,7 @@ concat(concat(_latin1'->',f1),_latin1'<-')
|
||||
-><-
|
||||
drop table t1;
|
||||
select convert(_koi8r'<27>' using utf8mb4) < convert(_koi8r'<27>' using utf8mb4);
|
||||
convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4)
|
||||
convert(_koi8r'\xC9' using utf8mb4) < convert(_koi8r'\xCA' using utf8mb4)
|
||||
1
|
||||
set names latin1;
|
||||
create table t1 (a varchar(10)) character set utf8mb4;
|
||||
|
||||
@@ -67,13 +67,13 @@ select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4
|
||||
_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%')
|
||||
1
|
||||
select convert(_latin1'G<>nter Andr<64>' using utf8mb4) like CONVERT(_latin1'G<>NTER%' USING utf8mb4);
|
||||
convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4)
|
||||
convert(_latin1'G\xFCnter Andr\xE9' using utf8mb4) like CONVERT(_latin1'G\xDCNTER%' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
@@ -1215,7 +1215,7 @@ concat(concat(_latin1'->',f1),_latin1'<-')
|
||||
-><-
|
||||
drop table t1;
|
||||
select convert(_koi8r'<27>' using utf8mb4) < convert(_koi8r'<27>' using utf8mb4);
|
||||
convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4)
|
||||
convert(_koi8r'\xC9' using utf8mb4) < convert(_koi8r'\xCA' using utf8mb4)
|
||||
1
|
||||
set names latin1;
|
||||
create table t1 (a varchar(10)) character set utf8mb4 engine heap;
|
||||
|
||||
@@ -67,13 +67,13 @@ select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4
|
||||
_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%')
|
||||
1
|
||||
select convert(_latin1'G<>nter Andr<64>' using utf8mb4) like CONVERT(_latin1'G<>NTER%' USING utf8mb4);
|
||||
convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4)
|
||||
convert(_latin1'G\xFCnter Andr\xE9' using utf8mb4) like CONVERT(_latin1'G\xDCNTER%' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
@@ -1278,7 +1278,7 @@ concat(concat(_latin1'->',f1),_latin1'<-')
|
||||
-><-
|
||||
drop table t1;
|
||||
select convert(_koi8r'<27>' using utf8mb4) < convert(_koi8r'<27>' using utf8mb4);
|
||||
convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4)
|
||||
convert(_koi8r'\xC9' using utf8mb4) < convert(_koi8r'\xCA' using utf8mb4)
|
||||
1
|
||||
set names latin1;
|
||||
create table t1 (a varchar(10)) character set utf8mb4 engine InnoDB;
|
||||
|
||||
@@ -67,13 +67,13 @@ select _utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4
|
||||
_utf8mb4 0xD0B0D0B1D0B2 like concat(_utf8mb4'%',_utf8mb4 0xD0B1,_utf8mb4 '%')
|
||||
1
|
||||
select convert(_latin1'G<>nter Andr<64>' using utf8mb4) like CONVERT(_latin1'G<>NTER%' USING utf8mb4);
|
||||
convert(_latin1'G?nter Andr?' using utf8mb4) like CONVERT(_latin1'G?NTER%' USING utf8mb4)
|
||||
convert(_latin1'G\xFCnter Andr\xE9' using utf8mb4) like CONVERT(_latin1'G\xDCNTER%' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4) LIKE CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4)
|
||||
1
|
||||
select CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4) LIKE CONVERT(_koi8r'<27><><EFBFBD><EFBFBD>' USING utf8mb4);
|
||||
CONVERT(_koi8r'????' USING utf8mb4) LIKE CONVERT(_koi8r'????' USING utf8mb4)
|
||||
CONVERT(_koi8r'\xF7\xE1\xF3\xF1' USING utf8mb4) LIKE CONVERT(_koi8r'\xD7\xC1\xD3\xD1' USING utf8mb4)
|
||||
1
|
||||
SELECT 'a' = 'a ';
|
||||
'a' = 'a '
|
||||
@@ -1281,7 +1281,7 @@ concat(concat(_latin1'->',f1),_latin1'<-')
|
||||
-><-
|
||||
drop table t1;
|
||||
select convert(_koi8r'<27>' using utf8mb4) < convert(_koi8r'<27>' using utf8mb4);
|
||||
convert(_koi8r'?' using utf8mb4) < convert(_koi8r'?' using utf8mb4)
|
||||
convert(_koi8r'\xC9' using utf8mb4) < convert(_koi8r'\xCA' using utf8mb4)
|
||||
1
|
||||
set names latin1;
|
||||
create table t1 (a varchar(10)) character set utf8mb4 engine MyISAM;
|
||||
|
||||
@@ -8668,6 +8668,41 @@ select count(*) from information_schema.optimizer_trace;
|
||||
select * from information_schema.optimizer_trace;
|
||||
set max_session_mem_used=default;
|
||||
#
|
||||
# MDEV-22380 Assertion `name.length == strlen(name.str)' failed in Item::print_item_w_name on SELECT w/ optimizer_trace enabled
|
||||
#
|
||||
SET optimizer_trace="enabled=on";
|
||||
SELECT 'a\0' LIMIT 0;
|
||||
a\x00
|
||||
SELECT query, trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
|
||||
query trace
|
||||
SELECT 'a\0' LIMIT 0 {
|
||||
"steps": [
|
||||
{
|
||||
"join_preparation": {
|
||||
"select_id": 1,
|
||||
"steps": [
|
||||
{
|
||||
"expanded_query": "select 'a\0' AS `a\x00` limit 0"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"join_optimization": {
|
||||
"select_id": 1,
|
||||
"steps": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"join_execution": {
|
||||
"select_id": 1,
|
||||
"steps": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
SET optimizer_trace=DEFAULT;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
||||
set optimizer_trace='enabled=on';
|
||||
|
||||
@@ -637,6 +637,15 @@ select * from information_schema.optimizer_trace;
|
||||
--enable_result_log
|
||||
set max_session_mem_used=default;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22380 Assertion `name.length == strlen(name.str)' failed in Item::print_item_w_name on SELECT w/ optimizer_trace enabled
|
||||
--echo #
|
||||
|
||||
SET optimizer_trace="enabled=on";
|
||||
SELECT 'a\0' LIMIT 0;
|
||||
SELECT query, trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
|
||||
SET optimizer_trace=DEFAULT;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
||||
@@ -320,7 +320,7 @@ select plugin_name from information_schema.plugins where plugin_library like 'ha
|
||||
plugin_name
|
||||
set names utf8;
|
||||
select convert('admin𝌆' using utf8);
|
||||
convert('admin𝌆' using utf8)
|
||||
convert('admin\xF0\x9D\x8C\x86' using utf8)
|
||||
admin????
|
||||
Warnings:
|
||||
Warning 1300 Invalid utf8mb3 character string: '\xF0\x9D\x8C\x86'
|
||||
|
||||
@@ -170,7 +170,7 @@ my $path_config_file; # The generated config file, var/my.cnf
|
||||
# configuration used to build them. To make life easier, an environment
|
||||
# variable or command-line option may be specified to control which set of
|
||||
# executables will be used by the test suite.
|
||||
our $opt_vs_config = $ENV{'MTR_VS_CONFIG'};
|
||||
our $multiconfig = $ENV{'MTR_VS_CONFIG'};
|
||||
|
||||
my @DEFAULT_SUITES= qw(
|
||||
main-
|
||||
@@ -1087,7 +1087,7 @@ sub command_line_setup {
|
||||
'ssl|with-openssl' => \$opt_ssl,
|
||||
'skip-ssl' => \$opt_skip_ssl,
|
||||
'compress' => \$opt_compress,
|
||||
'vs-config=s' => \$opt_vs_config,
|
||||
'vs-config=s' => \$multiconfig,
|
||||
|
||||
# Max number of parallel threads to use
|
||||
'parallel=s' => \$opt_parallel,
|
||||
@@ -1271,8 +1271,8 @@ sub command_line_setup {
|
||||
{
|
||||
$path_client_bindir= mtr_path_exists("$bindir/client_release",
|
||||
"$bindir/client_debug",
|
||||
"$bindir/client/debug",
|
||||
"$bindir/client$opt_vs_config",
|
||||
"$bindir/client/$multiconfig",
|
||||
"$bindir/client$multiconfig",
|
||||
"$bindir/client",
|
||||
"$bindir/bin");
|
||||
}
|
||||
@@ -1850,7 +1850,7 @@ sub executable_setup () {
|
||||
if ( $opt_embedded_server )
|
||||
{
|
||||
$exe_mysqltest=
|
||||
mtr_exe_exists("$bindir/libmysqld/examples$opt_vs_config/mysqltest_embedded",
|
||||
mtr_exe_exists("$bindir/libmysqld/examples$multiconfig/mysqltest_embedded",
|
||||
"$path_client_bindir/mysqltest_embedded");
|
||||
}
|
||||
else
|
||||
@@ -1954,10 +1954,10 @@ sub mysql_client_test_arguments(){
|
||||
# mysql_client_test executable may _not_ exist
|
||||
if ( $opt_embedded_server ) {
|
||||
$exe= mtr_exe_maybe_exists(
|
||||
"$bindir/libmysqld/examples$opt_vs_config/mysql_client_test_embedded",
|
||||
"$bindir/libmysqld/examples$multiconfig/mysql_client_test_embedded",
|
||||
"$bindir/bin/mysql_client_test_embedded");
|
||||
} else {
|
||||
$exe= mtr_exe_maybe_exists("$bindir/tests$opt_vs_config/mysql_client_test",
|
||||
$exe= mtr_exe_maybe_exists("$bindir/tests$multiconfig/mysql_client_test",
|
||||
"$bindir/bin/mysql_client_test");
|
||||
}
|
||||
|
||||
@@ -2131,13 +2131,13 @@ sub environment_setup {
|
||||
$ENV{'MARIADB_CONV'}= "$exe_mariadb_conv --character-sets-dir=$path_charsetsdir";
|
||||
if(IS_WINDOWS)
|
||||
{
|
||||
$ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$opt_vs_config/mysql_install_db",
|
||||
$ENV{'MYSQL_INSTALL_DB_EXE'}= mtr_exe_exists("$bindir/sql$multiconfig/mysql_install_db",
|
||||
"$bindir/bin/mysql_install_db");
|
||||
}
|
||||
|
||||
my $client_config_exe=
|
||||
mtr_exe_maybe_exists(
|
||||
"$bindir/libmariadb/mariadb_config$opt_vs_config/mariadb_config",
|
||||
"$bindir/libmariadb/mariadb_config$multiconfig/mariadb_config",
|
||||
"$bindir/bin/mariadb_config");
|
||||
if ($client_config_exe)
|
||||
{
|
||||
@@ -2156,7 +2156,7 @@ sub environment_setup {
|
||||
# some versions, test using it should be skipped
|
||||
# ----------------------------------------------------
|
||||
my $exe_bug25714=
|
||||
mtr_exe_maybe_exists("$bindir/tests$opt_vs_config/bug25714");
|
||||
mtr_exe_maybe_exists("$bindir/tests$multiconfig/bug25714");
|
||||
$ENV{'MYSQL_BUG25714'}= native_path($exe_bug25714);
|
||||
|
||||
# ----------------------------------------------------
|
||||
@@ -2173,7 +2173,7 @@ sub environment_setup {
|
||||
# my_print_defaults
|
||||
# ----------------------------------------------------
|
||||
my $exe_my_print_defaults=
|
||||
mtr_exe_exists("$bindir/extra$opt_vs_config/my_print_defaults",
|
||||
mtr_exe_exists("$bindir/extra$multiconfig/my_print_defaults",
|
||||
"$path_client_bindir/my_print_defaults");
|
||||
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= native_path($exe_my_print_defaults);
|
||||
|
||||
@@ -2208,16 +2208,16 @@ sub environment_setup {
|
||||
# ----------------------------------------------------
|
||||
# perror
|
||||
# ----------------------------------------------------
|
||||
my $exe_perror= mtr_exe_exists("$bindir/extra$opt_vs_config/perror",
|
||||
my $exe_perror= mtr_exe_exists("$bindir/extra$multiconfig/perror",
|
||||
"$path_client_bindir/perror");
|
||||
$ENV{'MY_PERROR'}= native_path($exe_perror);
|
||||
|
||||
# ----------------------------------------------------
|
||||
# mysql_tzinfo_to_sql
|
||||
# ----------------------------------------------------
|
||||
my $exe_mysql_tzinfo_to_sql= mtr_exe_exists("$basedir/sql$opt_vs_config/mysql_tzinfo_to_sql",
|
||||
my $exe_mysql_tzinfo_to_sql= mtr_exe_exists("$basedir/sql$multiconfig/mysql_tzinfo_to_sql",
|
||||
"$path_client_bindir/mysql_tzinfo_to_sql",
|
||||
"$bindir/sql$opt_vs_config/mysql_tzinfo_to_sql");
|
||||
"$bindir/sql$multiconfig/mysql_tzinfo_to_sql");
|
||||
$ENV{'MYSQL_TZINFO_TO_SQL'}= native_path($exe_mysql_tzinfo_to_sql);
|
||||
|
||||
# ----------------------------------------------------
|
||||
@@ -2225,7 +2225,7 @@ sub environment_setup {
|
||||
# ----------------------------------------------------
|
||||
my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'),
|
||||
"$basedir/extra/replace",
|
||||
"$bindir/extra$opt_vs_config/replace",
|
||||
"$bindir/extra$multiconfig/replace",
|
||||
"$path_client_bindir/replace");
|
||||
$ENV{'REPLACE'}= native_path($exe_replace);
|
||||
|
||||
@@ -2233,7 +2233,7 @@ sub environment_setup {
|
||||
# innochecksum
|
||||
# ----------------------------------------------------
|
||||
my $exe_innochecksum=
|
||||
mtr_exe_maybe_exists("$bindir/extra$opt_vs_config/innochecksum",
|
||||
mtr_exe_maybe_exists("$bindir/extra$multiconfig/innochecksum",
|
||||
"$path_client_bindir/innochecksum");
|
||||
$ENV{'INNOCHECKSUM'}= native_path($exe_innochecksum) if $exe_innochecksum;
|
||||
|
||||
@@ -2241,13 +2241,13 @@ sub environment_setup {
|
||||
# mariabackup
|
||||
# ----------------------------------------------------
|
||||
my $exe_mariabackup= mtr_exe_maybe_exists(
|
||||
"$bindir/extra/mariabackup$opt_vs_config/mariabackup",
|
||||
"$bindir/extra/mariabackup$multiconfig/mariabackup",
|
||||
"$path_client_bindir/mariabackup");
|
||||
|
||||
$ENV{XTRABACKUP}= native_path($exe_mariabackup) if $exe_mariabackup;
|
||||
|
||||
my $exe_xbstream= mtr_exe_maybe_exists(
|
||||
"$bindir/extra/mariabackup/$opt_vs_config/mbstream",
|
||||
"$bindir/extra/mariabackup/$multiconfig/mbstream",
|
||||
"$path_client_bindir/mbstream");
|
||||
$ENV{XBSTREAM}= native_path($exe_xbstream) if $exe_xbstream;
|
||||
|
||||
@@ -2439,10 +2439,10 @@ sub setup_vardir() {
|
||||
{
|
||||
if (!$opt_embedded_server)
|
||||
{
|
||||
for (<$bindir/storage/*$opt_vs_config/*.dll>,
|
||||
<$bindir/plugin/*$opt_vs_config/*.dll>,
|
||||
<$bindir/libmariadb$opt_vs_config/*.dll>,
|
||||
<$bindir/sql$opt_vs_config/*.dll>)
|
||||
for (<$bindir/storage/*$multiconfig/*.dll>,
|
||||
<$bindir/plugin/*$multiconfig/*.dll>,
|
||||
<$bindir/libmariadb$multiconfig/*.dll>,
|
||||
<$bindir/sql$multiconfig/*.dll>)
|
||||
{
|
||||
my $pname=basename($_);
|
||||
copy rel2abs($_), "$plugindir/$pname";
|
||||
@@ -2459,12 +2459,11 @@ sub setup_vardir() {
|
||||
unlink "$plugindir/symlink_test";
|
||||
}
|
||||
|
||||
for (<$bindir/storage/*/*.so>,
|
||||
<$bindir/plugin/*/*.so>,
|
||||
<$bindir/plugin/*/auth_pam_tool_dir>,
|
||||
for (<$bindir/storage/*$multiconfig/*.so>,
|
||||
<$bindir/plugin/*$multiconfig/*.so>,
|
||||
<$bindir/libmariadb/plugins/*/*.so>,
|
||||
<$bindir/libmariadb/*.so>,
|
||||
<$bindir/sql/*.so>)
|
||||
<$bindir/libmariadb/$multiconfig/*.so>,
|
||||
<$bindir/sql$multiconfig/*.so>)
|
||||
{
|
||||
my $pname=basename($_);
|
||||
if ($opt_use_copy)
|
||||
@@ -2584,7 +2583,7 @@ sub check_debug_support {
|
||||
|
||||
|
||||
#
|
||||
# Helper function to find the correct value for the opt_vs_config
|
||||
# Helper function to find the correct value for the multiconfig
|
||||
# if it was not set explicitly.
|
||||
#
|
||||
# the configuration with the most recent build dir in sql/ is selected.
|
||||
@@ -2595,29 +2594,30 @@ sub check_debug_support {
|
||||
# executables, and plugins - that is, something that can affect the test suite
|
||||
#
|
||||
sub fix_vs_config_dir () {
|
||||
return $opt_vs_config="" unless IS_WINDOWS;
|
||||
return $opt_vs_config="/$opt_vs_config" if $opt_vs_config;
|
||||
return $multiconfig="/$multiconfig" if $multiconfig;
|
||||
|
||||
my $modified = 1e30;
|
||||
$opt_vs_config="";
|
||||
$multiconfig="";
|
||||
|
||||
|
||||
for (<$bindir/sql/*/mysqld.exe>) { #/
|
||||
for (<$bindir/sql/*/mysqld.exe>,
|
||||
<$bindir/sql/*/mysqld>
|
||||
) { #/
|
||||
if (-M $_ < $modified)
|
||||
{
|
||||
$modified = -M _;
|
||||
$opt_vs_config = basename(dirname($_));
|
||||
$multiconfig = basename(dirname($_));
|
||||
}
|
||||
}
|
||||
|
||||
mtr_report("VS config: $opt_vs_config");
|
||||
$opt_vs_config="/$opt_vs_config" if $opt_vs_config;
|
||||
mtr_report("VS config: $multiconfig");
|
||||
$multiconfig="/$multiconfig" if $multiconfig;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Helper function to handle configuration-based subdirectories which Visual
|
||||
# Studio uses for storing binaries. If opt_vs_config is set, this returns
|
||||
# Studio uses for storing binaries. If multiconfig is set, this returns
|
||||
# a path based on that setting; if not, it returns paths for the default
|
||||
# /release/ and /debug/ subdirectories.
|
||||
#
|
||||
@@ -2631,9 +2631,9 @@ sub vs_config_dirs ($$) {
|
||||
# Don't look in these dirs when not on windows
|
||||
return () unless IS_WINDOWS;
|
||||
|
||||
if ($opt_vs_config)
|
||||
if ($multiconfig)
|
||||
{
|
||||
return ("$basedir/$path_part/$opt_vs_config/$exe");
|
||||
return ("$basedir/$path_part/$multiconfig/$exe");
|
||||
}
|
||||
|
||||
return ("$basedir/$path_part/release/$exe",
|
||||
|
||||
24
mysql-test/suite/encryption/r/instant_alter_import.result
Normal file
24
mysql-test/suite/encryption/r/instant_alter_import.result
Normal file
@@ -0,0 +1,24 @@
|
||||
SET GLOBAL innodb_encrypt_tables = ON;
|
||||
SET GLOBAL innodb_encryption_threads = 4;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT)
|
||||
ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
||||
INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
DROP TABLE t2, t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT)
|
||||
ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4 PAGE_COMPRESSED=1;
|
||||
INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
DROP TABLE t2, t1;
|
||||
SET GLOBAL innodb_encrypt_tables = OFF;
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
52
mysql-test/suite/encryption/t/instant_alter_import.test
Normal file
52
mysql-test/suite/encryption/t/instant_alter_import.test
Normal file
@@ -0,0 +1,52 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_file_key_management_plugin.inc
|
||||
|
||||
SET GLOBAL innodb_encrypt_tables = ON;
|
||||
SET GLOBAL innodb_encryption_threads = 4;
|
||||
|
||||
|
||||
--let $MYSQLD_DATADIR= `SELECT @@datadir`
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT)
|
||||
ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
||||
|
||||
INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT)
|
||||
ENGINE=INNODB ENCRYPTED=YES ENCRYPTION_KEY_ID=4 PAGE_COMPRESSED=1;
|
||||
|
||||
INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
SET GLOBAL innodb_encrypt_tables = OFF;
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
@@ -1,3 +1,4 @@
|
||||
call mtr.add_suppression("Index for table 'tab' is corrupt; try to repair it");
|
||||
SET @row_format = @@GLOBAL.innodb_default_row_format;
|
||||
# ###########################################################
|
||||
# Check with Import/Export tablespace with Default_row_format
|
||||
@@ -38,7 +39,7 @@ tab InnoDB # Compact # # # # # # NULL # NULL NULL latin1_swedish_ci NULL 0 N
|
||||
ALTER TABLE tab DISCARD TABLESPACE;
|
||||
call mtr.add_suppression("InnoDB: Tried to read .* bytes at offset 0");
|
||||
ALTER TABLE tab IMPORT TABLESPACE;
|
||||
ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`tab` : I/O error
|
||||
ERROR HY000: Index for table 'tab' is corrupt; try to repair it
|
||||
ALTER TABLE tab IMPORT TABLESPACE;
|
||||
SELECT * FROM tab;
|
||||
a
|
||||
|
||||
@@ -46,7 +46,7 @@ t1 CREATE TABLE `t1` (
|
||||
`b` blob DEFAULT NULL,
|
||||
`c` blob DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
UPDATE t1 set b = repeat("de", 100) where b = repeat("cd", 200);
|
||||
explain SELECT a FROM t1 where b = repeat("de", 100);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -127,7 +127,7 @@ t1 CREATE TABLE `t1` (
|
||||
`c2` point NOT NULL,
|
||||
`c3` linestring NOT NULL,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=14325 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=16372 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
UPDATE t1 SET C2 = ST_GeomFromText('POINT(0 0)');
|
||||
SELECT COUNT(*) FROM t1;
|
||||
COUNT(*)
|
||||
|
||||
@@ -936,7 +936,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
|
||||
restore: t1 .ibd and .cfg files
|
||||
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption
|
||||
ERROR HY000: Index for table 't1' is corrupt; try to repair it
|
||||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
DROP TABLE t1;
|
||||
unlink: t1.ibd
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
call mtr.add_suppression("Operating system error number .* in a file operation.");
|
||||
call mtr.add_suppression("The error means the system cannot find the path specified.");
|
||||
call mtr.add_suppression("File ./test/t1.ibd: 'delete' returned OS error");
|
||||
set default_storage_engine=innodb;
|
||||
#
|
||||
# MDEV-18295 IMPORT TABLESPACE fails with instant-altered tables
|
||||
@@ -61,13 +64,10 @@ alter table t1 discard tablespace;
|
||||
flush tables t2 for export;
|
||||
unlock tables;
|
||||
alter table t1 import tablespace;
|
||||
ERROR HY000: Schema mismatch (Index field count 4 doesn't match tablespace metadata file value 5)
|
||||
select * from t1;
|
||||
ERROR HY000: Tablespace has been discarded for table `t1`
|
||||
alter table t1 import tablespace;
|
||||
ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Unsupported
|
||||
select * from t1;
|
||||
ERROR HY000: Tablespace has been discarded for table `t1`
|
||||
z
|
||||
42
|
||||
41
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i1 INT) ENGINE=INNODB;
|
||||
@@ -78,3 +78,46 @@ FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
DROP TABLE t2, t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, i2 INT, i1 INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
ALTER TABLE t1 MODIFY COLUMN i2 INT AFTER i1, ALGORITHM=INSTANT;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
SELECT * FROM t2;
|
||||
id i1 i2
|
||||
1 1 1
|
||||
DROP TABLE t2, t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, i2 INT, i1 INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
SELECT * FROM t2;
|
||||
id i1
|
||||
1 1
|
||||
DROP TABLE t2, t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, i2 INT, i1 INT)
|
||||
ENGINE=INNODB PAGE_COMPRESSED=1;
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
DROP TABLE t2, t1;
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT) ENGINE=INNODB;
|
||||
INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
--source include/have_innodb.inc
|
||||
|
||||
call mtr.add_suppression("Index for table 'tab' is corrupt; try to repair it");
|
||||
|
||||
|
||||
SET @row_format = @@GLOBAL.innodb_default_row_format;
|
||||
|
||||
# set the variables
|
||||
@@ -78,7 +81,7 @@ ALTER TABLE tab DISCARD TABLESPACE;
|
||||
|
||||
call mtr.add_suppression("InnoDB: Tried to read .* bytes at offset 0");
|
||||
|
||||
--error ER_INTERNAL_ERROR
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE tab IMPORT TABLESPACE;
|
||||
--remove_file $MYSQLD_DATADIR/test/tab.ibd
|
||||
--move_file $MYSQLD_DATADIR/tab.ibd $MYSQLD_DATADIR/test/tab.ibd
|
||||
|
||||
@@ -1352,7 +1352,7 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
|
||||
|
||||
--replace_regex /'.*t1.cfg'/'t1.cfg'/
|
||||
|
||||
--error ER_INTERNAL_ERROR
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
|
||||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/innodb_checksum_algorithm.inc
|
||||
|
||||
call mtr.add_suppression("Operating system error number .* in a file operation.");
|
||||
call mtr.add_suppression("The error means the system cannot find the path specified.");
|
||||
call mtr.add_suppression("File ./test/t1.ibd: 'delete' returned OS error");
|
||||
|
||||
set default_storage_engine=innodb;
|
||||
|
||||
--echo #
|
||||
@@ -70,14 +77,7 @@ flush tables t2 for export;
|
||||
--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t1.ibd
|
||||
unlock tables;
|
||||
|
||||
--error ER_TABLE_SCHEMA_MISMATCH
|
||||
alter table t1 import tablespace;
|
||||
--error ER_TABLESPACE_DISCARDED
|
||||
select * from t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.cfg
|
||||
--error ER_INTERNAL_ERROR
|
||||
alter table t1 import tablespace;
|
||||
--error ER_TABLESPACE_DISCARDED
|
||||
select * from t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.ibd
|
||||
|
||||
@@ -102,3 +102,86 @@ UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, i2 INT, i1 INT) ENGINE=INNODB;
|
||||
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
ALTER TABLE t1 MODIFY COLUMN i2 INT AFTER i1, ALGORITHM=INSTANT;
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
|
||||
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, i2 INT, i1 INT) ENGINE=INNODB;
|
||||
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
|
||||
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY, i2 INT, i1 INT)
|
||||
ENGINE=INNODB PAGE_COMPRESSED=1;
|
||||
|
||||
INSERT INTO t1 VALUES (1, 1, 1);
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
|
||||
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT) ENGINE=INNODB;
|
||||
|
||||
INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
|
||||
ALTER TABLE t1 DROP COLUMN i2, ALGORITHM=INSTANT;
|
||||
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
ALTER TABLE t2 DISCARD TABLESPACE;
|
||||
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
|
||||
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
@@ -403,7 +403,7 @@ ERROR HY000: Tablespace has been discarded for table `t1`
|
||||
restore: t1 .ibd and .cfg files
|
||||
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption
|
||||
ERROR HY000: Index for table 't1' is corrupt; try to repair it
|
||||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
DROP TABLE t1;
|
||||
unlink: t1.ibd
|
||||
|
||||
@@ -612,7 +612,7 @@ EOF
|
||||
|
||||
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
|
||||
|
||||
--error ER_INTERNAL_ERROR
|
||||
--error ER_NOT_KEYFILE
|
||||
ALTER TABLE t1 IMPORT TABLESPACE;
|
||||
|
||||
SET SESSION debug_dbug=@saved_debug_dbug;
|
||||
|
||||
@@ -39,7 +39,7 @@ 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 "$bin/CTestTestfile.cmake";
|
||||
my ($ctest_vs)= $::opt_vs_config ? "-C ".substr($::opt_vs_config,1) : "";
|
||||
my ($ctest_vs)= $::multiconfig ? "-C ".substr($::multiconfig,1) : "";
|
||||
my (@ctest_list)= `cd "$bin" && ctest $ctest_vs --show-only --verbose`;
|
||||
return "No ctest" if $?;
|
||||
|
||||
|
||||
@@ -2159,3 +2159,38 @@ IFNULL(c, '::1')
|
||||
::1
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-26732 Assertion `0' failed in Item::val_native
|
||||
#
|
||||
SELECT CAST(CONCAT('::', REPEAT('',RAND())) AS INET6) AS f, var_pop('x') FROM dual HAVING f > '';
|
||||
f var_pop('x')
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'x'
|
||||
Warning 1292 Incorrect inet6 value: ''
|
||||
SELECT CAST(CONCAT('::', REPEAT('',RAND())) AS INET6) AS f, var_pop(1) FROM dual HAVING f >= '::';
|
||||
f var_pop(1)
|
||||
:: 0.0000
|
||||
CREATE TABLE t1(id INET6 NOT NULL PRIMARY KEY, dsc INET6);
|
||||
INSERT INTO t1 VALUES ('::1', '1::1'),('::3', '1::3'),('::4', NULL);
|
||||
CREATE TABLE t2 SELECT COALESCE(t1.dsc), COUNT(*) FROM t1 GROUP BY t1.id;
|
||||
SELECT * FROM t2 ORDER BY 1,2;
|
||||
COALESCE(t1.dsc) COUNT(*)
|
||||
NULL 1
|
||||
1::1 1
|
||||
1::3 1
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion
|
||||
#
|
||||
CREATE TABLE t1 (a INET6);
|
||||
INSERT INTO t1 VALUES ('::'),('::');
|
||||
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
|
||||
f
|
||||
Warnings:
|
||||
Warning 1292 Incorrect inet6 value: ''
|
||||
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::';
|
||||
f
|
||||
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
|
||||
f
|
||||
::
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -1586,3 +1586,29 @@ SELECT * FROM t2;
|
||||
DROP TABLE t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-26732 Assertion `0' failed in Item::val_native
|
||||
--echo #
|
||||
|
||||
# This tests Item_copy_inet6::val_native()
|
||||
SELECT CAST(CONCAT('::', REPEAT('',RAND())) AS INET6) AS f, var_pop('x') FROM dual HAVING f > '';
|
||||
SELECT CAST(CONCAT('::', REPEAT('',RAND())) AS INET6) AS f, var_pop(1) FROM dual HAVING f >= '::';
|
||||
|
||||
# This tests Item_copy_inet6::save_in_field()
|
||||
CREATE TABLE t1(id INET6 NOT NULL PRIMARY KEY, dsc INET6);
|
||||
INSERT INTO t1 VALUES ('::1', '1::1'),('::3', '1::3'),('::4', NULL);
|
||||
CREATE TABLE t2 SELECT COALESCE(t1.dsc), COUNT(*) FROM t1 GROUP BY t1.id;
|
||||
SELECT * FROM t2 ORDER BY 1,2;
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24619 Wrong result or Assertion `0' in Item::val_native / Type_handler_inet6::Item_val_native_with_conversion
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INET6);
|
||||
INSERT INTO t1 VALUES ('::'),('::');
|
||||
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '';
|
||||
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::';
|
||||
SELECT IF(1, '::', a) AS f FROM t1 GROUP BY 'foo' HAVING f != '::1';
|
||||
DROP TABLE t1;
|
||||
|
||||
@@ -1231,6 +1231,57 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class Item_copy_inet6: public Item_copy
|
||||
{
|
||||
NativeBufferInet6 m_value;
|
||||
public:
|
||||
Item_copy_inet6(THD *thd, Item *item_arg): Item_copy(thd, item_arg) {}
|
||||
|
||||
bool val_native(THD *thd, Native *to) override
|
||||
{
|
||||
if (null_value)
|
||||
return true;
|
||||
return to->copy(m_value.ptr(), m_value.length());
|
||||
}
|
||||
String *val_str(String *to) override
|
||||
{
|
||||
if (null_value)
|
||||
return NULL;
|
||||
Inet6_null tmp(m_value.ptr(), m_value.length());
|
||||
return tmp.is_null() || tmp.to_string(to) ? NULL : to;
|
||||
}
|
||||
my_decimal *val_decimal(my_decimal *to) override
|
||||
{
|
||||
my_decimal_set_zero(to);
|
||||
return to;
|
||||
}
|
||||
double val_real() override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
longlong val_int() override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
|
||||
{
|
||||
set_zero_time(ltime, MYSQL_TIMESTAMP_TIME);
|
||||
return null_value;
|
||||
}
|
||||
void copy() override
|
||||
{
|
||||
null_value= item->val_native(current_thd, &m_value);
|
||||
DBUG_ASSERT(null_value == item->null_value);
|
||||
}
|
||||
int save_in_field(Field *field, bool no_conversions) override
|
||||
{
|
||||
return Item::save_in_field(field, no_conversions);
|
||||
}
|
||||
Item *get_copy(THD *thd) override
|
||||
{ return get_item_copy<Item_copy_inet6>(thd, this); }
|
||||
};
|
||||
|
||||
|
||||
class in_inet6 :public in_vector
|
||||
{
|
||||
Inet6 m_value;
|
||||
@@ -1466,6 +1517,12 @@ Item_cache *Type_handler_inet6::Item_get_cache(THD *thd, const Item *item) const
|
||||
}
|
||||
|
||||
|
||||
Item_copy *Type_handler_inet6::create_item_copy(THD *thd, Item *item) const
|
||||
{
|
||||
return new (thd->mem_root) Item_copy_inet6(thd, item);
|
||||
}
|
||||
|
||||
|
||||
Item *
|
||||
Type_handler_inet6::make_const_item_for_comparison(THD *thd,
|
||||
Item *src,
|
||||
|
||||
@@ -691,6 +691,7 @@ public:
|
||||
Item *create_typecast_item(THD *thd, Item *item,
|
||||
const Type_cast_attributes &attr) const override;
|
||||
|
||||
Item_copy *create_item_copy(THD *thd, Item *item) const override;
|
||||
int cmp_native(const Native &a, const Native &b) const override
|
||||
{
|
||||
DBUG_ASSERT(a.length() == Inet6::binary_length());
|
||||
|
||||
@@ -258,7 +258,7 @@ SET(mysql_config_COMPONENT Development)
|
||||
SET(msql2mysql_COMPONENT Client)
|
||||
SET(mariadb-access_COMPONENT Client)
|
||||
SET(mariadb-find-rows_COMPONENT Client)
|
||||
SET(mytop_COMPONENT Mytop)
|
||||
SET(mytop_COMPONENT Client)
|
||||
SET(mariadb-hotcopy_COMPONENT COMPONENT Client)
|
||||
SET(mariadb-convert-table-format_COMPONENT COMPONENT Client)
|
||||
SET(mariadb-setpermission_COMPONENT COMPONENT Client)
|
||||
|
||||
96
sql/item.cc
96
sql/item.cc
@@ -1131,6 +1131,80 @@ bool Item::check_type_scalar(const LEX_CSTRING &opname) const
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
/*
|
||||
All values greater than MY_NAME_BINARY_VALUE are
|
||||
interpreted as binary bytes.
|
||||
The exact constant value does not matter,
|
||||
but it must be greater than 0x10FFFF,
|
||||
which is the maximum possible character in Unicode.
|
||||
*/
|
||||
#define MY_NAME_BINARY_VALUE 0x200000
|
||||
|
||||
/*
|
||||
Print all binary bytes as well as zero character U+0000 in hex notation.
|
||||
Print other characters normally.
|
||||
*/
|
||||
static int
|
||||
my_wc_mb_item_name(CHARSET_INFO *cs, my_wc_t wc, uchar *str, uchar *end)
|
||||
{
|
||||
if (wc == 0 || wc >= MY_NAME_BINARY_VALUE)
|
||||
{
|
||||
if (str + 4 >= end)
|
||||
return MY_CS_TOOSMALL3;
|
||||
str[0]= '\\';
|
||||
str[1]= 'x';
|
||||
str[2]= _dig_vec_upper[(uchar) (wc >> 4)];
|
||||
str[3]= _dig_vec_upper[(uchar) wc & 0x0F];
|
||||
return 4;
|
||||
}
|
||||
return my_charset_utf8mb3_handler.wc_mb(cs, wc, str, end);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Scan characters and mark all illegal sequences as binary byte values,
|
||||
to have my_wc_mb_utf8_escape_name() print them using HEX notation.
|
||||
*/
|
||||
static int
|
||||
my_mb_wc_item_name(CHARSET_INFO *cs, my_wc_t *pwc,
|
||||
const uchar *str, const uchar *end)
|
||||
{
|
||||
int rc= cs->cset->mb_wc(cs, pwc, str, end);
|
||||
if (rc == MY_CS_ILSEQ)
|
||||
{
|
||||
*pwc= MY_NAME_BINARY_VALUE + *str;
|
||||
return 1;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static LEX_CSTRING
|
||||
make_name(THD *thd,
|
||||
const char *str, size_t length, CHARSET_INFO *cs,
|
||||
size_t max_octet_length)
|
||||
{
|
||||
uint errors;
|
||||
size_t dst_nbytes= length * system_charset_info->mbmaxlen;
|
||||
set_if_smaller(dst_nbytes, max_octet_length);
|
||||
char *dst= (char*) thd->alloc(dst_nbytes + 1);
|
||||
if (!dst)
|
||||
return null_clex_str;
|
||||
uint32 cnv_length= my_convert_using_func(dst, dst_nbytes, system_charset_info,
|
||||
my_wc_mb_item_name,
|
||||
str, length,
|
||||
cs == &my_charset_bin ?
|
||||
system_charset_info : cs,
|
||||
my_mb_wc_item_name, &errors);
|
||||
dst[cnv_length]= '\0';
|
||||
return Lex_cstring(dst, cnv_length);
|
||||
}
|
||||
|
||||
|
||||
void Item::set_name(THD *thd, const char *str, size_t length, CHARSET_INFO *cs)
|
||||
{
|
||||
if (!length)
|
||||
@@ -1181,32 +1255,14 @@ void Item::set_name(THD *thd, const char *str, size_t length, CHARSET_INFO *cs)
|
||||
ER_REMOVED_SPACES, ER_THD(thd, ER_REMOVED_SPACES),
|
||||
buff);
|
||||
}
|
||||
if (!my_charset_same(cs, system_charset_info))
|
||||
{
|
||||
size_t res_length;
|
||||
name.str= sql_strmake_with_convert(thd, str, length, cs,
|
||||
MAX_ALIAS_NAME, system_charset_info,
|
||||
&res_length);
|
||||
name.length= res_length;
|
||||
}
|
||||
else
|
||||
name.str= thd->strmake(str, (name.length= MY_MIN(length,MAX_ALIAS_NAME)));
|
||||
name= make_name(thd, str, length, cs, MAX_ALIAS_NAME - 1);
|
||||
}
|
||||
|
||||
|
||||
void Item::set_name_no_truncate(THD *thd, const char *str, uint length,
|
||||
CHARSET_INFO *cs)
|
||||
{
|
||||
if (!my_charset_same(cs, system_charset_info))
|
||||
{
|
||||
size_t res_length;
|
||||
name.str= sql_strmake_with_convert(thd, str, length, cs,
|
||||
UINT_MAX, system_charset_info,
|
||||
&res_length);
|
||||
name.length= res_length;
|
||||
}
|
||||
else
|
||||
name.str= thd->strmake(str, (name.length= length));
|
||||
name= make_name(thd, str, length, cs, UINT_MAX - 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13337,25 +13337,6 @@ ha_innobase::discard_or_import_tablespace(
|
||||
err, m_prebuilt->table->flags, NULL));
|
||||
}
|
||||
|
||||
/* Evict and reload the table definition in order to invoke
|
||||
btr_cur_instant_init(). */
|
||||
table_id_t id = m_prebuilt->table->id;
|
||||
ut_ad(id);
|
||||
dict_sys.lock(SRW_LOCK_CALL);
|
||||
m_prebuilt->table->release();
|
||||
dict_sys.remove(m_prebuilt->table);
|
||||
m_prebuilt->table = dict_table_open_on_id(id, TRUE,
|
||||
DICT_TABLE_OP_NORMAL);
|
||||
dict_sys.unlock();
|
||||
if (!m_prebuilt->table) {
|
||||
err = DB_TABLE_NOT_FOUND;
|
||||
} else {
|
||||
if (const Field* ai = table->found_next_number_field) {
|
||||
initialize_auto_increment(m_prebuilt->table, ai);
|
||||
}
|
||||
dict_stats_init(m_prebuilt->table);
|
||||
}
|
||||
|
||||
if (dict_stats_is_persistent_enabled(m_prebuilt->table)) {
|
||||
dberr_t ret;
|
||||
|
||||
|
||||
@@ -678,6 +678,18 @@ public:
|
||||
static bool full_crc32(ulint flags) {
|
||||
return flags & FSP_FLAGS_FCRC32_MASK_MARKER;
|
||||
}
|
||||
/** Determine if full_crc32 is used along with compression */
|
||||
static bool is_full_crc32_compressed(ulint flags)
|
||||
{
|
||||
if (full_crc32(flags))
|
||||
{
|
||||
ulint algo= FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(flags);
|
||||
DBUG_ASSERT(algo <= PAGE_ALGORITHM_LAST);
|
||||
return algo > 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
/** @return whether innodb_checksum_algorithm=full_crc32 is active */
|
||||
bool full_crc32() const { return full_crc32(flags); }
|
||||
/** Determine the logical page size.
|
||||
@@ -739,21 +751,15 @@ public:
|
||||
unsigned zip_size() const { return zip_size(flags); }
|
||||
/** @return the physical page size */
|
||||
unsigned physical_size() const { return physical_size(flags); }
|
||||
/** Check whether the compression enabled in tablespace.
|
||||
@param[in] flags tablespace flags */
|
||||
static bool is_compressed(ulint flags) {
|
||||
|
||||
if (full_crc32(flags)) {
|
||||
ulint algo = FSP_FLAGS_FCRC32_GET_COMPRESSED_ALGO(
|
||||
flags);
|
||||
DBUG_ASSERT(algo <= PAGE_ALGORITHM_LAST);
|
||||
return algo > 0;
|
||||
}
|
||||
|
||||
return FSP_FLAGS_HAS_PAGE_COMPRESSION(flags);
|
||||
}
|
||||
/** @return whether the compression enabled for the tablespace. */
|
||||
bool is_compressed() const { return is_compressed(flags); }
|
||||
/** Check whether the compression enabled in tablespace.
|
||||
@param[in] flags tablespace flags */
|
||||
static bool is_compressed(ulint flags)
|
||||
{
|
||||
return is_full_crc32_compressed(flags) ||
|
||||
FSP_FLAGS_HAS_PAGE_COMPRESSION(flags);
|
||||
}
|
||||
/** @return whether the compression enabled for the tablespace. */
|
||||
bool is_compressed() const { return is_compressed(flags); }
|
||||
|
||||
/** Get the compression algorithm for full crc32 format.
|
||||
@param[in] flags tablespace flags
|
||||
|
||||
@@ -32,8 +32,8 @@ Created 2012-02-08 by Sunny Bains.
|
||||
#include "que0que.h"
|
||||
#include "dict0boot.h"
|
||||
#include "dict0load.h"
|
||||
#include "ibuf0ibuf.h"
|
||||
#include "pars0pars.h"
|
||||
#include "row0row.h"
|
||||
#include "row0sel.h"
|
||||
#include "row0mysql.h"
|
||||
#include "srv0start.h"
|
||||
@@ -48,6 +48,8 @@ Created 2012-02-08 by Sunny Bains.
|
||||
#include "snappy-c.h"
|
||||
#endif
|
||||
|
||||
#include "scope.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#ifdef HAVE_MY_AES_H
|
||||
@@ -191,6 +193,9 @@ struct row_import {
|
||||
dberr_t match_schema(
|
||||
THD* thd) UNIV_NOTHROW;
|
||||
|
||||
dberr_t match_flags(THD *thd) const ;
|
||||
|
||||
|
||||
dict_table_t* m_table; /*!< Table instance */
|
||||
|
||||
ulint m_version; /*!< Version of config file */
|
||||
@@ -328,7 +333,7 @@ public:
|
||||
mtr_t m_mtr;
|
||||
};
|
||||
|
||||
/** Class that purges delete marked reocords from indexes, both secondary
|
||||
/** Class that purges delete marked records from indexes, both secondary
|
||||
and cluster. It does a pessimistic delete. This should only be done if we
|
||||
couldn't purge the delete marked reocrds during Phase I. */
|
||||
class IndexPurge {
|
||||
@@ -606,8 +611,6 @@ AbstractCallback::init(
|
||||
if (!fil_space_t::is_valid_flags(m_space_flags, true)) {
|
||||
ulint cflags = fsp_flags_convert_from_101(m_space_flags);
|
||||
if (cflags == ULINT_UNDEFINED) {
|
||||
ib::error() << "Invalid FSP_SPACE_FLAGS="
|
||||
<< ib::hex(m_space_flags);
|
||||
return(DB_CORRUPTION);
|
||||
}
|
||||
m_space_flags = cflags;
|
||||
@@ -1124,7 +1127,8 @@ row_import::match_index_columns(
|
||||
|
||||
for (ulint i = 0; i < index->n_fields; ++i, ++field, ++cfg_field) {
|
||||
|
||||
if (strcmp(field->name(), cfg_field->name()) != 0) {
|
||||
if (field->name() && cfg_field->name()
|
||||
&& strcmp(field->name(), cfg_field->name()) != 0) {
|
||||
ib_errf(thd, IB_LOG_LEVEL_ERROR,
|
||||
ER_TABLE_SCHEMA_MISMATCH,
|
||||
"Index field name %s doesn't match"
|
||||
@@ -1293,6 +1297,61 @@ row_import::match_table_columns(
|
||||
return(err);
|
||||
}
|
||||
|
||||
dberr_t row_import::match_flags(THD *thd) const
|
||||
{
|
||||
ulint mismatch= (m_table->flags ^ m_flags) & ~DICT_TF_MASK_DATA_DIR;
|
||||
if (!mismatch)
|
||||
return DB_SUCCESS;
|
||||
|
||||
const char *msg;
|
||||
if (mismatch & DICT_TF_MASK_ZIP_SSIZE)
|
||||
{
|
||||
if ((m_table->flags & DICT_TF_MASK_ZIP_SSIZE) &&
|
||||
(m_flags & DICT_TF_MASK_ZIP_SSIZE))
|
||||
{
|
||||
switch (m_flags & DICT_TF_MASK_ZIP_SSIZE) {
|
||||
case 0U << DICT_TF_POS_ZIP_SSIZE:
|
||||
goto uncompressed;
|
||||
case 1U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg= "ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1";
|
||||
break;
|
||||
case 2U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg= "ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2";
|
||||
break;
|
||||
case 3U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg= "ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4";
|
||||
break;
|
||||
case 4U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg= "ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8";
|
||||
break;
|
||||
case 5U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg= "ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16";
|
||||
break;
|
||||
default:
|
||||
msg= "strange KEY_BLOCK_SIZE";
|
||||
}
|
||||
}
|
||||
else if (m_flags & DICT_TF_MASK_ZIP_SSIZE)
|
||||
msg= "ROW_FORMAT=COMPRESSED";
|
||||
else
|
||||
goto uncompressed;
|
||||
}
|
||||
else
|
||||
{
|
||||
uncompressed:
|
||||
msg= (m_flags & DICT_TF_MASK_ATOMIC_BLOBS) ? "ROW_FORMAT=DYNAMIC"
|
||||
: (m_flags & DICT_TF_MASK_COMPACT) ? "ROW_FORMAT=COMPACT"
|
||||
: "ROW_FORMAT=REDUNDANT";
|
||||
}
|
||||
|
||||
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
|
||||
"Table flags don't match, server table has 0x%x and the meta-data "
|
||||
"file has 0x%zx; .cfg file uses %s",
|
||||
m_table->flags, m_flags, msg);
|
||||
|
||||
return DB_ERROR;
|
||||
}
|
||||
|
||||
/** Check if the table (and index) schema that was read from the .cfg file
|
||||
matches the in memory table definition.
|
||||
@param thd MySQL session variable
|
||||
@@ -1303,60 +1362,7 @@ row_import::match_schema(
|
||||
{
|
||||
/* Do some simple checks. */
|
||||
|
||||
if (ulint mismatch = (m_table->flags ^ m_flags)
|
||||
& ~DICT_TF_MASK_DATA_DIR) {
|
||||
const char* msg;
|
||||
if (mismatch & DICT_TF_MASK_ZIP_SSIZE) {
|
||||
if ((m_table->flags & DICT_TF_MASK_ZIP_SSIZE)
|
||||
&& (m_flags & DICT_TF_MASK_ZIP_SSIZE)) {
|
||||
switch (m_flags & DICT_TF_MASK_ZIP_SSIZE) {
|
||||
case 0U << DICT_TF_POS_ZIP_SSIZE:
|
||||
goto uncompressed;
|
||||
case 1U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg = "ROW_FORMAT=COMPRESSED"
|
||||
" KEY_BLOCK_SIZE=1";
|
||||
break;
|
||||
case 2U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg = "ROW_FORMAT=COMPRESSED"
|
||||
" KEY_BLOCK_SIZE=2";
|
||||
break;
|
||||
case 3U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg = "ROW_FORMAT=COMPRESSED"
|
||||
" KEY_BLOCK_SIZE=4";
|
||||
break;
|
||||
case 4U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg = "ROW_FORMAT=COMPRESSED"
|
||||
" KEY_BLOCK_SIZE=8";
|
||||
break;
|
||||
case 5U << DICT_TF_POS_ZIP_SSIZE:
|
||||
msg = "ROW_FORMAT=COMPRESSED"
|
||||
" KEY_BLOCK_SIZE=16";
|
||||
break;
|
||||
default:
|
||||
msg = "strange KEY_BLOCK_SIZE";
|
||||
}
|
||||
} else if (m_flags & DICT_TF_MASK_ZIP_SSIZE) {
|
||||
msg = "ROW_FORMAT=COMPRESSED";
|
||||
} else {
|
||||
goto uncompressed;
|
||||
}
|
||||
} else {
|
||||
uncompressed:
|
||||
msg = (m_flags & DICT_TF_MASK_ATOMIC_BLOBS)
|
||||
? "ROW_FORMAT=DYNAMIC"
|
||||
: (m_flags & DICT_TF_MASK_COMPACT)
|
||||
? "ROW_FORMAT=COMPACT"
|
||||
: "ROW_FORMAT=REDUNDANT";
|
||||
}
|
||||
|
||||
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
|
||||
"Table flags don't match, server table has 0x%x"
|
||||
" and the meta-data file has 0x" ULINTPFx ";"
|
||||
" .cfg file uses %s",
|
||||
m_table->flags, m_flags, msg);
|
||||
|
||||
return(DB_ERROR);
|
||||
} else if (m_table->n_cols != m_n_cols) {
|
||||
if (m_table->n_cols != m_n_cols) {
|
||||
ib_errf(thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
|
||||
"Number of columns don't match, table has %u "
|
||||
"columns but the tablespace meta-data file has "
|
||||
@@ -1974,42 +1980,7 @@ PageConverter::update_index_page(
|
||||
}
|
||||
|
||||
if (m_index->m_srv_index->is_clust()) {
|
||||
if (page_id.page_no() == m_index->m_srv_index->page) {
|
||||
dict_index_t* index = const_cast<dict_index_t*>(
|
||||
m_index->m_srv_index);
|
||||
/* Preserve the PAGE_ROOT_AUTO_INC. */
|
||||
if (index->table->supports_instant()) {
|
||||
if (btr_cur_instant_root_init(index, page)) {
|
||||
return(DB_CORRUPTION);
|
||||
}
|
||||
|
||||
if (index->n_core_fields > index->n_fields) {
|
||||
/* Some columns have been dropped.
|
||||
Refuse to IMPORT TABLESPACE for now.
|
||||
|
||||
NOTE: This is not an accurate check.
|
||||
Columns could have been both
|
||||
added and dropped instantly.
|
||||
For an accurate check, we must read
|
||||
the metadata BLOB page pointed to
|
||||
by the leftmost leaf page.
|
||||
|
||||
But we would have to read
|
||||
those pages in a special way,
|
||||
bypassing the buffer pool! */
|
||||
return DB_UNSUPPORTED;
|
||||
}
|
||||
|
||||
/* Provisionally set all instantly
|
||||
added columns to be DEFAULT NULL. */
|
||||
for (unsigned i = index->n_core_fields;
|
||||
i < index->n_fields; i++) {
|
||||
dict_col_t* col = index->fields[i].col;
|
||||
col->def_val.len = UNIV_SQL_NULL;
|
||||
col->def_val.data = NULL;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (page_id.page_no() != m_index->m_srv_index->page) {
|
||||
goto clear_page_max_trx_id;
|
||||
}
|
||||
} else if (page_is_leaf(page)) {
|
||||
@@ -3098,6 +3069,375 @@ row_import_read_meta_data(
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
#define BTR_BLOB_HDR_PART_LEN 0 /*!< BLOB part len on this page */
|
||||
#define BTR_BLOB_HDR_NEXT_PAGE_NO 4 /*!< next BLOB part page no,
|
||||
FIL_NULL if none */
|
||||
#define BTR_BLOB_HDR_SIZE 8 /*!< Size of a BLOB part header, in bytes */
|
||||
|
||||
/* decrypt and decompress page if needed */
|
||||
static dberr_t decrypt_decompress(fil_space_crypt_t *space_crypt,
|
||||
size_t space_flags, span<byte> page,
|
||||
size_t space_id, byte *page_compress_buf)
|
||||
{
|
||||
auto *data= page.data();
|
||||
|
||||
if (space_crypt && space_crypt->should_encrypt())
|
||||
{
|
||||
if (!buf_page_verify_crypt_checksum(data, space_flags))
|
||||
return DB_CORRUPTION;
|
||||
|
||||
dberr_t err;
|
||||
if (!fil_space_decrypt(space_id, space_crypt, data, page.size(),
|
||||
space_flags, data, &err) || err != DB_SUCCESS)
|
||||
return err;
|
||||
}
|
||||
|
||||
bool page_compressed= false;
|
||||
|
||||
if (fil_space_t::full_crc32(space_flags) &&
|
||||
fil_space_t::is_compressed(space_flags))
|
||||
page_compressed= buf_page_is_compressed(data, space_flags);
|
||||
else
|
||||
{
|
||||
switch (fil_page_get_type(data)) {
|
||||
case FIL_PAGE_PAGE_COMPRESSED:
|
||||
case FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED:
|
||||
page_compressed= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (page_compressed)
|
||||
{
|
||||
auto compress_length=
|
||||
fil_page_decompress(page_compress_buf, data, space_flags);
|
||||
ut_ad(compress_length != srv_page_size);
|
||||
|
||||
if (compress_length == 0)
|
||||
return DB_CORRUPTION;
|
||||
}
|
||||
|
||||
return DB_SUCCESS;
|
||||
}
|
||||
|
||||
static size_t get_buf_size()
|
||||
{
|
||||
return srv_page_size
|
||||
#ifdef HAVE_LZO
|
||||
+ LZO1X_1_15_MEM_COMPRESS
|
||||
#elif defined HAVE_SNAPPY
|
||||
+ snappy_max_compressed_length(srv_page_size)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/* find, parse instant metadata, performing variaous checks,
|
||||
and apply it to dict_table_t
|
||||
@return DB_SUCCESS or some error */
|
||||
static dberr_t handle_instant_metadata(dict_table_t *table,
|
||||
const row_import &cfg)
|
||||
{
|
||||
dict_get_and_save_data_dir_path(table, false);
|
||||
|
||||
char *filepath;
|
||||
if (DICT_TF_HAS_DATA_DIR(table->flags))
|
||||
{
|
||||
ut_a(table->data_dir_path);
|
||||
filepath= fil_make_filepath(table->data_dir_path, table->name, IBD, true);
|
||||
}
|
||||
else
|
||||
filepath= fil_make_filepath(nullptr, table->name, IBD, false);
|
||||
|
||||
if (!filepath)
|
||||
return DB_OUT_OF_MEMORY;
|
||||
|
||||
SCOPE_EXIT([filepath]() { ut_free(filepath); });
|
||||
|
||||
bool success;
|
||||
auto file= os_file_create_simple_no_error_handling(
|
||||
innodb_data_file_key, filepath, OS_FILE_OPEN, OS_FILE_READ_WRITE, false,
|
||||
&success);
|
||||
if (!success)
|
||||
return DB_IO_ERROR;
|
||||
|
||||
if (os_file_get_size(file) < srv_page_size * 4)
|
||||
return DB_CORRUPTION;
|
||||
|
||||
SCOPE_EXIT([&file]() { os_file_close(file); });
|
||||
|
||||
std::unique_ptr<byte[], decltype(&aligned_free)> first_page(
|
||||
static_cast<byte *>(aligned_malloc(srv_page_size, srv_page_size)),
|
||||
&aligned_free);
|
||||
|
||||
if (dberr_t err= os_file_read_no_error_handling(IORequestReadPartial,
|
||||
file, first_page.get(), 0,
|
||||
srv_page_size, nullptr))
|
||||
return err;
|
||||
|
||||
auto space_flags= fsp_header_get_flags(first_page.get());
|
||||
|
||||
if (!fil_space_t::is_valid_flags(space_flags, true))
|
||||
{
|
||||
auto cflags= fsp_flags_convert_from_101(space_flags);
|
||||
if (cflags == ULINT_UNDEFINED)
|
||||
{
|
||||
ib::error() << "Invalid FSP_SPACE_FLAGS=" << ib::hex(space_flags);
|
||||
return DB_CORRUPTION;
|
||||
}
|
||||
space_flags= static_cast<decltype(space_flags)>(cflags);
|
||||
}
|
||||
|
||||
if (!cfg.m_missing)
|
||||
{
|
||||
if (dberr_t err= cfg.match_flags(current_thd))
|
||||
return err;
|
||||
}
|
||||
|
||||
const auto zip_size= fil_space_t::zip_size(space_flags);
|
||||
const uint64_t physical_size= zip_size ? zip_size : srv_page_size;
|
||||
ut_ad(physical_size <= UNIV_PAGE_SIZE_MAX);
|
||||
const auto space_id= page_get_space_id(first_page.get());
|
||||
|
||||
auto *space_crypt= fil_space_read_crypt_data(zip_size, first_page.get());
|
||||
SCOPE_EXIT([&space_crypt]() {
|
||||
if (space_crypt)
|
||||
fil_space_destroy_crypt_data(&space_crypt);
|
||||
});
|
||||
|
||||
std::unique_ptr<byte[], decltype(&aligned_free)> page(
|
||||
static_cast<byte *>(
|
||||
aligned_malloc(UNIV_PAGE_SIZE_MAX, UNIV_PAGE_SIZE_MAX)),
|
||||
&aligned_free);
|
||||
|
||||
if (dberr_t err= os_file_read_no_error_handling(
|
||||
IORequestReadPartial, file, page.get(), 3 * physical_size,
|
||||
physical_size, nullptr))
|
||||
return err;
|
||||
|
||||
std::unique_ptr<byte[]> page_compress_buf(new byte[get_buf_size()]);
|
||||
|
||||
if (dberr_t err= decrypt_decompress(space_crypt, space_flags,
|
||||
{page.get(), static_cast<size_t>
|
||||
(physical_size)},
|
||||
space_id, page_compress_buf.get()))
|
||||
return err;
|
||||
|
||||
if (table->supports_instant())
|
||||
{
|
||||
dict_index_t *index= dict_table_get_first_index(table);
|
||||
|
||||
auto tmp1= table->space_id;
|
||||
table->space_id= page_get_space_id(page.get());
|
||||
SCOPE_EXIT([tmp1, table]() { table->space_id= tmp1; });
|
||||
|
||||
auto tmp2= index->page;
|
||||
index->page= page_get_page_no(page.get());
|
||||
SCOPE_EXIT([tmp2, index]() { index->page= tmp2; });
|
||||
|
||||
if (!page_is_comp(page.get()) != !dict_table_is_comp(table))
|
||||
{
|
||||
ib_errf(current_thd, IB_LOG_LEVEL_ERROR, ER_TABLE_SCHEMA_MISMATCH,
|
||||
"ROW_FORMAT mismatch");
|
||||
return DB_CORRUPTION;
|
||||
}
|
||||
|
||||
if (btr_cur_instant_root_init(index, page.get()))
|
||||
return DB_ERROR;
|
||||
|
||||
ut_ad(index->n_core_null_bytes != dict_index_t::NO_CORE_NULL_BYTES);
|
||||
|
||||
if (fil_page_get_type(page.get()) == FIL_PAGE_INDEX)
|
||||
{
|
||||
ut_ad(!index->is_instant());
|
||||
return DB_SUCCESS;
|
||||
}
|
||||
|
||||
mem_heap_t *heap= NULL;
|
||||
SCOPE_EXIT([&heap]() { mem_heap_free(heap); });
|
||||
|
||||
while (btr_page_get_level(page.get()) != 0)
|
||||
{
|
||||
const rec_t *rec= page_rec_get_next(page_get_infimum_rec(page.get()));
|
||||
|
||||
/* Relax the assertion in rec_init_offsets(). */
|
||||
ut_ad(!index->in_instant_init);
|
||||
ut_d(index->in_instant_init= true);
|
||||
rec_offs *offsets=
|
||||
rec_get_offsets(rec, index, nullptr, 0, ULINT_UNDEFINED, &heap);
|
||||
ut_d(index->in_instant_init= false);
|
||||
|
||||
uint64_t child_page_no= btr_node_ptr_get_child_page_no(rec, offsets);
|
||||
|
||||
if (dberr_t err=
|
||||
os_file_read_no_error_handling(IORequestReadPartial, file,
|
||||
page.get(),
|
||||
child_page_no * physical_size,
|
||||
physical_size, nullptr))
|
||||
return err;
|
||||
|
||||
if (dberr_t err= decrypt_decompress(space_crypt, space_flags,
|
||||
{page.get(), static_cast<size_t>
|
||||
(physical_size)}, space_id,
|
||||
page_compress_buf.get()))
|
||||
return err;
|
||||
}
|
||||
|
||||
const auto *rec= page_rec_get_next(page_get_infimum_rec(page.get()));
|
||||
const auto comp= dict_table_is_comp(index->table);
|
||||
const auto info_bits= rec_get_info_bits(rec, comp);
|
||||
|
||||
if (page_rec_is_supremum(rec) || !(info_bits & REC_INFO_MIN_REC_FLAG))
|
||||
{
|
||||
ib::error() << "Table " << index->table->name
|
||||
<< " is missing instant ALTER metadata";
|
||||
index->table->corrupted= true;
|
||||
return DB_CORRUPTION;
|
||||
}
|
||||
|
||||
if ((info_bits & ~REC_INFO_DELETED_FLAG) != REC_INFO_MIN_REC_FLAG ||
|
||||
(comp && rec_get_status(rec) != REC_STATUS_INSTANT))
|
||||
{
|
||||
incompatible:
|
||||
ib::error() << "Table " << index->table->name
|
||||
<< " contains unrecognizable instant ALTER metadata";
|
||||
index->table->corrupted= true;
|
||||
return DB_CORRUPTION;
|
||||
}
|
||||
|
||||
if (info_bits & REC_INFO_DELETED_FLAG)
|
||||
{
|
||||
ulint trx_id_offset= index->trx_id_offset;
|
||||
ut_ad(index->n_uniq);
|
||||
|
||||
if (trx_id_offset)
|
||||
{
|
||||
}
|
||||
else if (index->table->not_redundant())
|
||||
{
|
||||
|
||||
for (uint i= index->n_uniq; i--;)
|
||||
trx_id_offset+= index->fields[i].fixed_len;
|
||||
}
|
||||
else if (rec_get_1byte_offs_flag(rec))
|
||||
{
|
||||
trx_id_offset= rec_1_get_field_end_info(rec, index->n_uniq - 1);
|
||||
ut_ad(!(trx_id_offset & REC_1BYTE_SQL_NULL_MASK));
|
||||
trx_id_offset&= ~REC_1BYTE_SQL_NULL_MASK;
|
||||
}
|
||||
else
|
||||
{
|
||||
trx_id_offset= rec_2_get_field_end_info(rec, index->n_uniq - 1);
|
||||
ut_ad(!(trx_id_offset & REC_2BYTE_SQL_NULL_MASK));
|
||||
trx_id_offset&= ~REC_2BYTE_SQL_NULL_MASK;
|
||||
}
|
||||
|
||||
const byte *ptr=
|
||||
rec + trx_id_offset + (DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN);
|
||||
|
||||
if (mach_read_from_4(ptr + BTR_EXTERN_LEN))
|
||||
goto incompatible;
|
||||
|
||||
uint len= mach_read_from_4(ptr + BTR_EXTERN_LEN + 4);
|
||||
if (!len || mach_read_from_4(ptr + BTR_EXTERN_OFFSET) != FIL_PAGE_DATA)
|
||||
goto incompatible;
|
||||
|
||||
std::unique_ptr<byte[], decltype(&aligned_free)>
|
||||
second_page(static_cast<byte*>(aligned_malloc(physical_size,
|
||||
physical_size)),
|
||||
&aligned_free);
|
||||
|
||||
if (dberr_t err=
|
||||
os_file_read_no_error_handling(IORequestReadPartial, file,
|
||||
second_page.get(), physical_size *
|
||||
mach_read_from_4(ptr +
|
||||
BTR_EXTERN_PAGE_NO),
|
||||
srv_page_size, nullptr))
|
||||
return err;
|
||||
|
||||
if (dberr_t err= decrypt_decompress(space_crypt, space_flags,
|
||||
{second_page.get(),
|
||||
static_cast<size_t>(physical_size)},
|
||||
space_id, page_compress_buf.get()))
|
||||
return err;
|
||||
|
||||
if (fil_page_get_type(second_page.get()) != FIL_PAGE_TYPE_BLOB ||
|
||||
mach_read_from_4(
|
||||
&second_page[FIL_PAGE_DATA + BTR_BLOB_HDR_NEXT_PAGE_NO]) !=
|
||||
FIL_NULL ||
|
||||
mach_read_from_4(
|
||||
&second_page[FIL_PAGE_DATA + BTR_BLOB_HDR_PART_LEN]) != len)
|
||||
goto incompatible;
|
||||
|
||||
/* The unused part of the BLOB page should be zero-filled. */
|
||||
for (const byte *
|
||||
b= second_page.get() + (FIL_PAGE_DATA + BTR_BLOB_HDR_SIZE) +
|
||||
len,
|
||||
*const end= second_page.get() + srv_page_size - BTR_EXTERN_LEN;
|
||||
b < end;)
|
||||
{
|
||||
if (*b++)
|
||||
goto incompatible;
|
||||
}
|
||||
|
||||
if (index->table->deserialise_columns(
|
||||
&second_page[FIL_PAGE_DATA + BTR_BLOB_HDR_SIZE], len))
|
||||
goto incompatible;
|
||||
}
|
||||
|
||||
rec_offs *offsets= rec_get_offsets(
|
||||
rec, index, nullptr, index->n_core_fields, ULINT_UNDEFINED, &heap);
|
||||
if (rec_offs_any_default(offsets))
|
||||
{
|
||||
inconsistent:
|
||||
goto incompatible;
|
||||
}
|
||||
|
||||
/* In fact, because we only ever append fields to the metadata
|
||||
record, it is also OK to perform READ UNCOMMITTED and
|
||||
then ignore any extra fields, provided that
|
||||
trx_sys.is_registered(DB_TRX_ID). */
|
||||
if (rec_offs_n_fields(offsets) >
|
||||
ulint(index->n_fields) + !!index->table->instant &&
|
||||
!trx_sys.is_registered(current_trx(),
|
||||
row_get_rec_trx_id(rec, index, offsets)))
|
||||
goto inconsistent;
|
||||
|
||||
for (unsigned i= index->n_core_fields; i < index->n_fields; i++)
|
||||
{
|
||||
dict_col_t *col= index->fields[i].col;
|
||||
const unsigned o= i + !!index->table->instant;
|
||||
ulint len;
|
||||
const byte *data= rec_get_nth_field(rec, offsets, o, &len);
|
||||
ut_ad(!col->is_added());
|
||||
ut_ad(!col->def_val.data);
|
||||
col->def_val.len= len;
|
||||
switch (len) {
|
||||
case UNIV_SQL_NULL:
|
||||
continue;
|
||||
case 0:
|
||||
col->def_val.data= field_ref_zero;
|
||||
continue;
|
||||
}
|
||||
ut_ad(len != UNIV_SQL_DEFAULT);
|
||||
if (!rec_offs_nth_extern(offsets, o))
|
||||
col->def_val.data= mem_heap_dup(index->table->heap, data, len);
|
||||
else if (len < BTR_EXTERN_FIELD_REF_SIZE ||
|
||||
!memcmp(data + len - BTR_EXTERN_FIELD_REF_SIZE, field_ref_zero,
|
||||
BTR_EXTERN_FIELD_REF_SIZE))
|
||||
{
|
||||
col->def_val.len= UNIV_SQL_DEFAULT;
|
||||
goto inconsistent;
|
||||
}
|
||||
else
|
||||
{
|
||||
col->def_val.data= btr_copy_externally_stored_field(
|
||||
&col->def_val.len, data, srv_page_size, len, index->table->heap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return DB_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
Read the contents of the <tablename>.cfg file.
|
||||
@return DB_SUCCESS or error code. */
|
||||
@@ -3404,14 +3744,7 @@ dberr_t FetchIndexRootPages::run(const fil_iterator_t& iter,
|
||||
{
|
||||
const unsigned zip_size= fil_space_t::zip_size(m_space_flags);
|
||||
const unsigned size= zip_size ? zip_size : unsigned(srv_page_size);
|
||||
const ulint buf_size=
|
||||
#ifdef HAVE_LZO
|
||||
LZO1X_1_15_MEM_COMPRESS+
|
||||
#elif defined HAVE_SNAPPY
|
||||
snappy_max_compressed_length(srv_page_size) +
|
||||
#endif
|
||||
srv_page_size;
|
||||
byte* page_compress_buf = static_cast<byte*>(malloc(buf_size));
|
||||
byte* page_compress_buf= static_cast<byte*>(malloc(get_buf_size()));
|
||||
const bool full_crc32 = fil_space_t::full_crc32(m_space_flags);
|
||||
bool skip_checksum_check = false;
|
||||
ut_ad(!srv_read_only_mode);
|
||||
@@ -3503,14 +3836,7 @@ static dberr_t fil_iterate(
|
||||
const ulint size = callback.physical_size();
|
||||
ulint n_bytes = iter.n_io_buffers * size;
|
||||
|
||||
const ulint buf_size = srv_page_size
|
||||
#ifdef HAVE_LZO
|
||||
+ LZO1X_1_15_MEM_COMPRESS
|
||||
#elif defined HAVE_SNAPPY
|
||||
+ snappy_max_compressed_length(srv_page_size)
|
||||
#endif
|
||||
;
|
||||
byte* page_compress_buf = static_cast<byte*>(malloc(buf_size));
|
||||
byte* page_compress_buf= static_cast<byte*>(malloc(get_buf_size()));
|
||||
ut_ad(!srv_read_only_mode);
|
||||
|
||||
if (!page_compress_buf) {
|
||||
@@ -4047,6 +4373,10 @@ row_import_for_mysql(
|
||||
|
||||
if (err == DB_SUCCESS) {
|
||||
|
||||
if (dberr_t err = handle_instant_metadata(table, cfg)) {
|
||||
return row_import_error(prebuilt, err);
|
||||
}
|
||||
|
||||
/* We have a schema file, try and match it with our
|
||||
data dictionary. */
|
||||
|
||||
@@ -4099,6 +4429,11 @@ row_import_for_mysql(
|
||||
|
||||
if (err == DB_SUCCESS) {
|
||||
err = cfg.set_root_by_heuristic();
|
||||
|
||||
if (err == DB_SUCCESS) {
|
||||
err = handle_instant_metadata(table,
|
||||
cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ use strict;
|
||||
|
||||
my $sst_dump=
|
||||
::mtr_exe_maybe_exists(
|
||||
"$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
|
||||
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||
"$::path_client_bindir/sst_dump");
|
||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||
|
||||
@@ -13,7 +13,7 @@ use strict;
|
||||
|
||||
my $sst_dump=
|
||||
::mtr_exe_maybe_exists(
|
||||
"$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
|
||||
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||
"$::path_client_bindir/sst_dump");
|
||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||
|
||||
@@ -15,7 +15,7 @@ use strict;
|
||||
|
||||
my $sst_dump=
|
||||
::mtr_exe_maybe_exists(
|
||||
"$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
|
||||
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||
"$::path_client_bindir/sst_dump");
|
||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||
|
||||
@@ -12,7 +12,7 @@ use strict;
|
||||
|
||||
my $sst_dump=
|
||||
::mtr_exe_maybe_exists(
|
||||
"$::bindir/storage/rocksdb$::opt_vs_config/sst_dump",
|
||||
"$::bindir/storage/rocksdb$::multiconfig/sst_dump",
|
||||
"$::path_client_bindir/sst_dump");
|
||||
return "RocksDB is not compiled, no sst_dump" unless $sst_dump;
|
||||
$ENV{MARIAROCKS_SST_DUMP}="$sst_dump";
|
||||
|
||||
Reference in New Issue
Block a user