Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä 2021-11-09 08:50:33 +02:00
commit 9c18b96603
46 changed files with 1536 additions and 55 deletions

View file

@ -1,3 +1,9 @@
init:
# Install bison
- choco feature disable --name showDownloadProgress
- choco install -y winflexbison
- C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe --version
version: build-{build}~branch-{branch}
clone_depth: 1
@ -17,7 +23,7 @@ build_script:
- set BUILD_TYPE=MinSizeRel
- set GENERATOR=-GNinja
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
- cmake -E time cmake %GENERATOR% .. -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMYSQL_MAINTAINER_MODE=ERR -DFAST_BUILD=1 -DBISON_EXECUTABLE=C:\cygwin64\bin\bison -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_FEEDBACK=NO
- cmake -E time cmake %GENERATOR% .. -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DMYSQL_MAINTAINER_MODE=ERR -DFAST_BUILD=1 -DBISON_EXECUTABLE=C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe -DPLUGIN_PERFSCHEMA=NO -DPLUGIN_FEEDBACK=NO
- set /A jobs=2*%NUMBER_OF_PROCESSORS%
- cmake -E time cmake --build . -j %jobs% --config %BUILD_TYPE% --target minbuild

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
Copyright (c) 2009, 2020, MariaDB Corporation.
Copyright (c) 2009, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -91,10 +91,14 @@ extern "C" {
#if defined(__WIN__)
#include <conio.h>
#else
#include <readline.h>
#if !defined(USE_LIBEDIT_INTERFACE)
#include <history.h>
#endif
# ifdef __APPLE__
# include <editline/readline.h>
# else
# include <readline.h>
# if !defined(USE_LIBEDIT_INTERFACE)
# include <history.h>
# endif
# endif
#define HAVE_READLINE
#define USE_POPEN
#endif

View file

@ -49,21 +49,82 @@ SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)
SET(CPACK_PACKAGE_RELOCATABLE FALSE)
SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
SET(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_URL})
SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
SET(CPACK_RPM_shared_PACKAGE_VENDOR "MariaDB Corporation Ab")
SET(CPACK_RPM_shared_PACKAGE_LICENSE "LGPLv2.1")
SET(CPACK_RPM_shared_PACKAGE_SUMMARY "LGPL MariaDB client library")
SET(CPACK_RPM_shared_PACKAGE_DESCRIPTION "
This is LGPL MariaDB client library that can be used to connect to MySQL
# Set default description for packages
SET(CPACK_RPM_PACKAGE_DESCRIPTION "MariaDB: a very fast and robust SQL database server
It is GPL v2 licensed, which means you can use the it free of charge under the
conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
MariaDB documentation can be found at https://mariadb.com/kb
MariaDB bug reports should be submitted through https://jira.mariadb.org")
# Packages with default description
SET(CPACK_RPM_client_PACKAGE_SUMMARY "MariaDB database client binaries")
SET(CPACK_RPM_common_PACKAGE_SUMMARY "MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)")
SET(CPACK_RPM_compat_PACKAGE_SUMMARY "MariaDB database client library MySQL compat package")
SET(CPACK_RPM_devel_PACKAGE_SUMMARY "MariaDB database development files")
SET(CPACK_RPM_server_PACKAGE_SUMMARY "MariaDB database server binaries")
SET(CPACK_RPM_test_PACKAGE_SUMMARY "MariaDB database regression test suite")
# libmariadb3
SET(CPACK_RPM_shared_PACKAGE_SUMMARY "LGPL MariaDB database client library")
SET(CPACK_RPM_shared_PACKAGE_DESCRIPTION "This is LGPL MariaDB client library that can be used to connect to MySQL
or MariaDB.
This code is based on the LGPL libmysql client library from MySQL 3.23
and PHP's mysqlnd extension.
This product includes PHP software, freely available from
<http://www.php.net/software/>
")
http://www.php.net/software/")
# Summary and descriptions per package
SET(CPACK_RPM_backup_PACKAGE_SUMMARY "Backup tool for MariaDB server")
SET(CPACK_RPM_backup_PACKAGE_DESCRIPTION "Mariabackup is an open source tool provided by MariaDB
for performing physical online backups of InnoDB, Aria and MyISAM tables.
For InnoDB, hot online backups are possible.
It was originally forked from Percona XtraBackup 2.3.8.")
SET(CPACK_RPM_cassandra-engine_PACKAGE_SUMMARY "Cassandra storage engine for MariaDB")
SET(CPACK_RPM_cassandra-engine_PACKAGE_DESCRIPTION "The Cassandra Storage Engine allows access to data in a Cassandra cluster from
MariaDB, combining the best of SQL and no-SQL worlds. Cassandra SE (storage
engine) makes Cassandra's column family appear as a table in MariaDB that you
can insert to, update, and select from. You can write joins against this table,
it is possible to join data that's stored in MariaDB with data that's stored in
Cassandra.")
SET(CPACK_RPM_connect-engine_PACKAGE_SUMMARY "Connect storage engine for MariaDB")
SET(CPACK_RPM_connect-engine_PACKAGE_DESCRIPTION "Connect engine supports a number of file formats (dbf, xml, txt, bin, etc),
connections to ODBC tables and remote MySQL tables, as well as a number of
other interesting features.")
SET(CPACK_RPM_cracklib-password-check_PACKAGE_SUMMARY "CrackLib Password Validation Plugin for MariaDB")
SET(CPACK_RPM_cracklib-password-check_PACKAGE_DESCRIPTION "This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.")
SET(CPACK_RPM_gssapi-server_PACKAGE_SUMMARY "GSSAPI authentication plugin for MariaDB server")
SET(CPACK_RPM_gssapi-server_PACKAGE_DESCRIPTION "The gssapi authentication plugin allows the user to authenticate with services
that use the Generic Security Services Application Program Interface (GSSAPI).
The gssapi authentication plugin is most often used for authenticating with Microsoft Active Directory.")
SET(CPACK_RPM_oqgraph-engine_PACKAGE_SUMMARY "OQGraph storage engine for MariaDB")
SET(CPACK_RPM_oqgraph-engine_PACKAGE_DESCRIPTION "The Open Query GRAPH computation engine, or OQGRAPH as the engine itself is called,
allows you to handle hierarchies (tree structures) and complex graphs
(nodes having many connections in several directions).
It is intended to be used for retrieving hierarchical information, such as those used for graphs,
routes or social relationships, in plain SQL.")
SET(CPACK_RPM_rocksdb-engine_PACKAGE_SUMMARY "RocksDB storage engine for MariaDB")
SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is a high performance storage engine, aimed
at maximising storage efficiency while maintaining InnoDB-like performance.")
SET(CPACK_RPM_tokudb-engine_PACKAGE_SUMMARY "TokuDB storage engine for MariaDB")
SET(CPACK_RPM_tokudb-engine_PACKAGE_DESCRIPTION "The TokuDB storage engine is for use in high-performance and write-intensive
environments, offering increased compression and better performance based
on fractal indexes.")
SET(CPACK_RPM_SPEC_MORE_DEFINE "
%define mysql_vendor ${CPACK_PACKAGE_VENDOR}

View file

@ -367,6 +367,7 @@ create_worker_threads(uint n)
thd)) {
msg("compress: pthread_create() failed: "
"errno = %d", errno);
pthread_mutex_unlock(&thd->ctrl_mutex);
goto err;
}
}
@ -383,6 +384,13 @@ create_worker_threads(uint n)
return threads;
err:
while (i > 0) {
comp_thread_ctxt_t *thd;
i--;
thd = threads + i;
pthread_mutex_unlock(&thd->ctrl_mutex);
}
my_free(threads);
return NULL;
}

View file

@ -147,7 +147,8 @@ sub do_args($$$$$) {
my %vars = (
vardir => $::opt_vardir,
exe => $$exe,
args => join(' ', map { quote_from_mtr $_ } @$$args, '--loose-gdb'),
args => join(' ', map { quote_from_mtr $_ } @$$args,
'--loose-debug-gdb', '--loose-skip-stack-trace'),
input => $input,
script => "$::opt_vardir/tmp/${k}init.$type",
log => "$::opt_vardir/log/$type.$k",

View file

@ -2588,6 +2588,22 @@ set max_statement_time= 0;
drop table t1;
drop view v1;
#
# MDEV-25803 Inplace ALTER breaks MyISAM/Aria tables when order of keys is changed
#
set @save_default_engine= @@default_storage_engine;
create or replace table t1 (x int, y int, unique (y), unique (x), primary key(x)) engine myisam;
alter table t1 change x xx int, algorithm=inplace;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
create or replace table t1 (x int, y int, unique (y), unique (x), primary key(x));
alter table t1 change x xx int, algorithm=inplace;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
set @@default_storage_engine= @save_default_engine;
#
# End of 10.3 tests
#
#

View file

@ -2099,6 +2099,47 @@ set max_statement_time= 0;
drop table t1;
drop view v1;
--echo #
--echo # MDEV-25803 Inplace ALTER breaks MyISAM/Aria tables when order of keys is changed
--echo #
set @save_default_engine= @@default_storage_engine;
--disable_query_log
if ($MTR_COMBINATION_INNODB)
{
set default_storage_engine= innodb;
}
if ($MTR_COMBINATION_ARIA)
{
set default_storage_engine= aria;
}
--enable_query_log
if (!$MTR_COMBINATION_INNODB)
{
--disable_query_log
--disable_result_log
# There is no inplace ADD INDEX for MyISAM/Aria:
create or replace table t1 (x int);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 add unique (x), algorithm=inplace;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 add primary key(x), algorithm=inplace;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 add index(x), algorithm=inplace;
--enable_query_log
--enable_result_log
}
create or replace table t1 (x int, y int, unique (y), unique (x), primary key(x)) engine myisam;
alter table t1 change x xx int, algorithm=inplace;
check table t1;
create or replace table t1 (x int, y int, unique (y), unique (x), primary key(x));
alter table t1 change x xx int, algorithm=inplace;
check table t1;
# cleanup
drop table t1;
set @@default_storage_engine= @save_default_engine;
--echo #
--echo # End of 10.3 tests
--echo #

File diff suppressed because it is too large Load diff

View file

@ -14,3 +14,35 @@ DROP TABLE t1;
--echo #
--echo # End of 5.5 tests
--echo #
--echo #
--echo # Start of 10.2 tests
--echo #
--echo #
--echo # MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
--echo #
SET NAMES cp850;
SELECT '' LIKE '' ESCAPE _cp850 0xFF;
DELIMITER $$;
BEGIN NOT ATOMIC
DECLARE ch INT DEFAULT 0x00;
DECLARE query TEXT DEFAULT 'SELECT _cp850'''' LIKE _cp850'''' ESCAPE _cp850 0xFF';
WHILE ch <= 0xFF DO
SET @query= REPLACE(query, 'FF', CONV(ch, 10, 16));
SELECT @query;
PREPARE stmt FROM @query;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET ch=ch+1;
END WHILE;
END;
$$
DELIMITER ;$$
--echo #
--echo # End of 10.2 tests
--echo #

View file

@ -0,0 +1,12 @@
#
# Start of 10.2 tests
#
#
# MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
#
SELECT _cp866'' LIKE _cp866'' ESCAPE _cp866 0xFF;
_cp866'' LIKE _cp866'' ESCAPE _cp866 0xFF
1
#
# End of 10.2 tests
#

View file

@ -0,0 +1,14 @@
--echo #
--echo # Start of 10.2 tests
--echo #
--echo #
--echo # MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
--echo #
SELECT _cp866'' LIKE _cp866'' ESCAPE _cp866 0xFF;
--echo #
--echo # End of 10.2 tests
--echo #

View file

@ -4421,5 +4421,14 @@ DROP TABLE t1;
#
SET DEFAULT_STORAGE_ENGINE=Default;
#
# MDEV-24901 SIGSEGV in fts_get_table_name, SIGSEGV in ib_vector_size, SIGSEGV in row_merge_fts_doc_tokenize, stack smashing
#
SELECT HEX(WEIGHT_STRING(_tis620 'a\0b'));
HEX(WEIGHT_STRING(_tis620 'a\0b'))
610062
SELECT HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci));
HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci))
610062
#
# End of 10.2 tests
#

View file

@ -209,6 +209,13 @@ let $coll='tis620_nopad_bin';
let $coll_pad='tis620_bin';
--source include/ctype_pad_all_engines.inc
--echo #
--echo # MDEV-24901 SIGSEGV in fts_get_table_name, SIGSEGV in ib_vector_size, SIGSEGV in row_merge_fts_doc_tokenize, stack smashing
--echo #
SELECT HEX(WEIGHT_STRING(_tis620 'a\0b'));
SELECT HEX(WEIGHT_STRING(_tis620 'a\0b' COLLATE tis620_thai_nopad_ci));
--echo #
--echo # End of 10.2 tests
--echo #

View file

@ -11261,6 +11261,17 @@ DROP TABLE kv;
DROP VIEW v1;
SET NAMES utf8;
#
# MDEV-24335 Unexpected question mark in the end of a TINYTEXT column
#
CREATE TABLE t1 (a TINYTEXT character set utf8);
INSERT IGNORE INTO t1 VALUES (REPEAT(_utf8 0xD184, 250));
Warnings:
Warning 1366 Incorrect string value: '\xD1\x84\xD1\x84\xD1\x84...' for column `test`.`t1`.`a` at row 1
SELECT LENGTH(a), CHAR_LENGTH(a), RIGHT(a,3) FROM t1;
LENGTH(a) CHAR_LENGTH(a) RIGHT(a,3)
254 127 ффф
DROP TABLE t1;
#
# End of 10.2 tests
#
#

View file

@ -2184,6 +2184,15 @@ DROP TABLE kv;
DROP VIEW v1;
SET NAMES utf8;
--echo #
--echo # MDEV-24335 Unexpected question mark in the end of a TINYTEXT column
--echo #
CREATE TABLE t1 (a TINYTEXT character set utf8);
INSERT IGNORE INTO t1 VALUES (REPEAT(_utf8 0xD184, 250));
SELECT LENGTH(a), CHAR_LENGTH(a), RIGHT(a,3) FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #

View file

@ -1493,3 +1493,4 @@ DROP TABLE t1, t2;
CREATE TABLE t1 (pk INT, a TEXT NOT NULL DEFAULT '', PRIMARY KEY (pk), b INT AUTO_INCREMENT, UNIQUE(b), UNIQUE (a,b)) ENGINE=myisam;
ERROR HY000: AUTO_INCREMENT column `b` cannot be used in the UNIQUE index `a`
set @@GLOBAL.max_allowed_packet= @allowed_packet;
# End of 10.4 tests

View file

@ -575,3 +575,4 @@ CREATE TABLE t1 (pk INT, a TEXT NOT NULL DEFAULT '', PRIMARY KEY (pk), b INT AUT
# Cleanup
set @@GLOBAL.max_allowed_packet= @allowed_packet;
--echo # End of 10.4 tests

View file

@ -289,6 +289,21 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t2 0 a 1 a A NULL NULL NULL YES HASH
t2 0 a 2 b A NULL NULL NULL YES HASH
DROP TABLE t1,t2;
#
# MDEV-26453 Assertion `0' failed in row_upd_sec_index_entry & corruption
#
CREATE TABLE t (c INT AUTO_INCREMENT KEY, UNIQUE USING HASH(c));
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `c`
CREATE TABLE t (c INT AUTO_INCREMENT KEY);
CREATE UNIQUE INDEX i USING HASH ON t (c);
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the USING HASH clause of `c`
INSERT INTO t VALUES (0);
SELECT * FROM t;
c
1
DELETE FROM t;
DROP TABLE t;
# End of 10.4 tests
create temporary table tmp ( a int, b int, c blob not null, d int, e int default 0, f int, unique key (c)) engine=innodb;
create table t2 (x int);
lock table t2 write;

View file

@ -370,6 +370,24 @@ show index from t2;
# Cleanup
DROP TABLE t1,t2;
--echo #
--echo # MDEV-26453 Assertion `0' failed in row_upd_sec_index_entry & corruption
--echo #
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE TABLE t (c INT AUTO_INCREMENT KEY, UNIQUE USING HASH(c));
CREATE TABLE t (c INT AUTO_INCREMENT KEY);
--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
CREATE UNIQUE INDEX i USING HASH ON t (c);
INSERT INTO t VALUES (0);
SELECT * FROM t;
DELETE FROM t;
DROP TABLE t;
--echo # End of 10.4 tests
#
# MDEV-22113 SIGSEGV, ASAN use-after-poison, Assertion `next_insert_id == 0' in handler::ha_external_lock
#

View file

@ -4,14 +4,14 @@ OPTIMIZER_TRACE QUERY
OPTIMIZER_TRACE TRACE
OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE
OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES
show variables like 'optimizer_trace';
Variable_name Value
optimizer_trace enabled=off
set optimizer_trace="enabled=on";
show variables like 'optimizer_trace';
Variable_name Value
optimizer_trace enabled=on
set optimizer_trace="enabled=off";
show variables like 'optimizer_trace';
Variable_name Value
optimizer_trace enabled=off
create table t1 (a int, b int);
insert into t1 values (1,2),(2,3);
create table t2 (b int);

View file

@ -1,10 +1,10 @@
--source include/not_embedded.inc
--source include/have_sequence.inc
SELECT table_name, column_name FROM information_schema.columns where table_name="OPTIMIZER_TRACE";
show variables like 'optimizer_trace';
set optimizer_trace="enabled=on";
show variables like 'optimizer_trace';
set optimizer_trace="enabled=off";
show variables like 'optimizer_trace';
create table t1 (a int, b int);
insert into t1 values (1,2),(2,3);

View file

@ -0,0 +1,8 @@
# Verify that compile-time default for optimizer trace is OFF (enabled=off).
select
global_value_origin,
default_value
from
INFORMATION_SCHEMA.SYSTEM_VARIABLES where variable_name='optimizer_trace';
global_value_origin default_value
COMPILE-TIME enabled=off

View file

@ -0,0 +1,11 @@
if (`SELECT 'COMPILE-TIME'<>GLOBAL_VALUE_ORIGIN from INFORMATION_SCHEMA.SYSTEM_VARIABLES where variable_name='optimizer_trace'`) {
--Skip Needs optimizer_trace default to be the compile-time default
}
--echo # Verify that compile-time default for optimizer trace is OFF (enabled=off).
select
global_value_origin,
default_value
from
INFORMATION_SCHEMA.SYSTEM_VARIABLES where variable_name='optimizer_trace';

View file

@ -19,6 +19,7 @@ mysql/innodb_table_stats
mysql/transaction_registry
test/t1
test/t2
FLUSH TABLES t1,t2,t3 FOR EXPORT;
# t1 yes on expecting NOT FOUND
NOT FOUND /foobarsecret/ in t1.ibd
# t2 ... on expecting NOT FOUND
@ -27,7 +28,7 @@ NOT FOUND /tempsecret/ in t2.ibd
FOUND 12 /dummysecret/ in t3.ibd
# ibdata1 expecting NOT FOUND
NOT FOUND /foobarsecret/ in ibdata1
# restart
UNLOCK TABLES;
# Now turn off encryption and wait for threads to decrypt everything
SET GLOBAL innodb_encrypt_tables = off;
# Wait max 10 min for key encryption threads to decrypt all spaces
@ -42,6 +43,7 @@ test/t3
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
NAME
test/t1
FLUSH TABLES t1,t2,t3 FOR EXPORT;
# t1 yes on expecting NOT FOUND
NOT FOUND /foobarsecret/ in t1.ibd
# t2 ... default expecting FOUND
@ -50,7 +52,7 @@ FOUND 12 /tempsecret/ in t2.ibd
FOUND 12 /dummysecret/ in t3.ibd
# ibdata1 expecting NOT FOUND
NOT FOUND /foobarsecret/ in ibdata1
# restart
UNLOCK TABLES;
# Now turn on encryption and wait for threads to encrypt all spaces
SET GLOBAL innodb_encrypt_tables = on;
# Wait max 10 min for key encryption threads to encrypt all spaces
@ -65,6 +67,7 @@ mysql/innodb_table_stats
mysql/transaction_registry
test/t1
test/t2
FLUSH TABLES t1,t2,t3 FOR EXPORT;
# t1 yes on expecting NOT FOUND
NOT FOUND /foobarsecret/ in t1.ibd
# t2 ... on expecting NOT FOUND
@ -73,5 +76,5 @@ NOT FOUND /tempsecret/ in t2.ibd
FOUND 12 /dummysecret/ in t3.ibd
# ibdata1 expecting NOT FOUND
NOT FOUND /foobarsecret/ in ibdata1
# restart
UNLOCK TABLES;
drop table t1, t2, t3;

View file

@ -1,9 +1,6 @@
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
#
# MDEV-8138: strange results from encrypt-and-grep test
#
@ -35,7 +32,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--source include/shutdown_mysqld.inc
FLUSH TABLES t1,t2,t3 FOR EXPORT;
--let SEARCH_PATTERN=foobarsecret
--echo # t1 yes on expecting NOT FOUND
@ -54,7 +51,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
-- source include/start_mysqld.inc
UNLOCK TABLES;
--echo # Now turn off encryption and wait for threads to decrypt everything
@ -71,7 +68,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--source include/shutdown_mysqld.inc
FLUSH TABLES t1,t2,t3 FOR EXPORT;
--let SEARCH_PATTERN=foobarsecret
--echo # t1 yes on expecting NOT FOUND
@ -90,8 +87,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
-- source include/start_mysqld.inc
UNLOCK TABLES;
--echo # Now turn on encryption and wait for threads to encrypt all spaces
SET GLOBAL innodb_encrypt_tables = on;
@ -106,7 +102,7 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
--sorted_result
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--source include/shutdown_mysqld.inc
FLUSH TABLES t1,t2,t3 FOR EXPORT;
--let SEARCH_PATTERN=foobarsecret
--echo # t1 yes on expecting NOT FOUND
@ -125,6 +121,6 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
-- source include/start_mysqld.inc
UNLOCK TABLES;
drop table t1, t2, t3;

View file

@ -0,0 +1,28 @@
SET DEFAULT_STORAGE_ENGINE=InnoDB;
#
# Start of 10.2 tests
#
#
# MDEV-24901 SIGSEGV in fts_get_table_name, SIGSEGV in ib_vector_size, SIGSEGV in row_merge_fts_doc_tokenize, stack smashing Export
#
CREATE TABLE t1(c TEXT CHARACTER SET tis620);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` text CHARACTER SET tis620 DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES('100');
ALTER TABLE t1 ADD FULLTEXT INDEX(c), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1(c TEXT CHARACTER SET tis620 COLLATE tis620_thai_nopad_ci);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` text CHARACTER SET tis620 COLLATE tis620_thai_nopad_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES('100');
ALTER TABLE t1 ADD FULLTEXT INDEX(c), ALGORITHM=INPLACE;
DROP TABLE t1;
#
# End of 10.2 tests
#

View file

@ -0,0 +1,29 @@
--source include/have_innodb.inc
--source include/have_tis620.inc
SET DEFAULT_STORAGE_ENGINE=InnoDB;
--echo #
--echo # Start of 10.2 tests
--echo #
--echo #
--echo # MDEV-24901 SIGSEGV in fts_get_table_name, SIGSEGV in ib_vector_size, SIGSEGV in row_merge_fts_doc_tokenize, stack smashing Export
--echo #
CREATE TABLE t1(c TEXT CHARACTER SET tis620);
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES('100');
ALTER TABLE t1 ADD FULLTEXT INDEX(c), ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1(c TEXT CHARACTER SET tis620 COLLATE tis620_thai_nopad_ci);
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES('100');
ALTER TABLE t1 ADD FULLTEXT INDEX(c), ALGORITHM=INPLACE;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #

View file

@ -2882,3 +2882,14 @@ insert into t1 values (8,'0');
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
unlock tables;
drop table t1;
#
# MDEV-22284 Aria table key read crash because wrong index used
#
create table t1 (
a int auto_increment,
b int, c int,
key(c, a), unique(b)
) engine aria
partition by hash (b);
replace into t1 values (1, 0, 0), (2, 0, 0), (0, 0, 0);
drop table t1;

View file

@ -2099,3 +2099,16 @@ aria_page_checksum=$default_checksum,
aria_log_file_size=$default_log_file_size;
--enable_result_log
--enable_query_log
--echo #
--echo # MDEV-22284 Aria table key read crash because wrong index used
--echo #
create table t1 (
a int auto_increment,
b int, c int,
key(c, a), unique(b)
) engine aria
partition by hash (b);
replace into t1 values (1, 0, 0), (2, 0, 0), (0, 0, 0);
# cleanup
drop table t1;

View file

@ -8,6 +8,7 @@
# Finish the following tests by calling its common test script:
# include/rpl_get_master_version_and_clock.test.
source include/not_valgrind.inc;
source include/have_debug.inc;
source include/have_debug_sync.inc;
source include/master-slave.inc;

View file

@ -9,6 +9,7 @@
# Verify row-based events applying when table map id value is about and greater
# than 1 << 32.
##################################################################
--source include/not_valgrind.inc
--source include/word_size.inc
--source include/have_debug.inc
--source include/have_binlog_format_row.inc

View file

@ -611,3 +611,28 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
drop table t1;
#
# MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields
#
create or replace table t1 (x int, y int with system versioning);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
`y` int(11) DEFAULT NULL
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
create or replace table t1 (
x int, y int with system versioning,
row_start timestamp(6) as row start,
row_end timestamp(6) as row end,
period for system_time(row_start, row_end));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING,
`y` int(11) DEFAULT NULL,
`row_start` timestamp(6) GENERATED ALWAYS AS ROW START WITHOUT SYSTEM VERSIONING,
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END WITHOUT SYSTEM VERSIONING,
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
drop table t1;

View file

@ -996,8 +996,7 @@ delete from t1;
delete from t1;
check table t1;
Table Op Msg_type Msg_text
test.t1 check note Not supported for non-INTERVAL history partitions
test.t1 check note The storage engine for the table doesn't support check
test.t1 check status OK
drop table t1;
#
# MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache

View file

@ -451,3 +451,20 @@ show index from t1;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
drop table t1;
--echo #
--echo # MDEV-26928 Column-inclusive WITH SYSTEM VERSIONING doesn't work with explicit system fields
--echo #
create or replace table t1 (x int, y int with system versioning);
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
create or replace table t1 (
x int, y int with system versioning,
row_start timestamp(6) as row start,
row_end timestamp(6) as row end,
period for system_time(row_start, row_end));
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
drop table t1;

View file

@ -517,6 +517,7 @@ enum enum_vcol_info_type
{
VCOL_GENERATED_VIRTUAL, VCOL_GENERATED_STORED,
VCOL_DEFAULT, VCOL_CHECK_FIELD, VCOL_CHECK_TABLE,
VCOL_USING_HASH,
/* Additional types should be added here */
/* Following is the highest value last */
VCOL_TYPE_NONE = 127 // Since the 0 value is already in use
@ -534,6 +535,8 @@ static inline const char *vcol_type_name(enum_vcol_info_type type)
case VCOL_CHECK_FIELD:
case VCOL_CHECK_TABLE:
return "CHECK";
case VCOL_USING_HASH:
return "USING HASH";
case VCOL_TYPE_NONE:
return "UNTYPED";
}

View file

@ -11051,11 +11051,8 @@ int ha_partition::check_misplaced_rows(uint read_part_id, bool do_repair)
read_part_id != m_part_info->vers_info->now_part->id &&
!m_part_info->vers_info->interval.is_set())
{
print_admin_msg(ha_thd(), MYSQL_ERRMSG_SIZE, "note",
table_share->db.str, table->alias,
opt_op_name[CHECK_PARTS],
"Not supported for non-INTERVAL history partitions");
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
/* Skip this check as it is not supported for non-INTERVAL history partitions. */
DBUG_RETURN(HA_ADMIN_OK);
}
if (do_repair)

View file

@ -7937,15 +7937,16 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
if (!vers_info.need_check(alter_info))
return false;
if (!vers_info.versioned_fields && vers_info.unversioned_fields &&
!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING))
const bool add_versioning= alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING;
if (!vers_info.versioned_fields && vers_info.unversioned_fields && !add_versioning)
{
// All is correct but this table is not versioned.
options&= ~HA_VERSIONED_TABLE;
return false;
}
if (!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING) && vers_info)
if (!add_versioning && vers_info && !vers_info.versioned_fields)
{
my_error(ER_MISSING, MYF(0), create_table.table_name.str,
"WITH SYSTEM VERSIONING");
@ -7955,8 +7956,7 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields(
List_iterator<Create_field> it(alter_info->create_list);
while (Create_field *f= it++)
{
if ((f->versioning == Column_definition::VERSIONING_NOT_SET &&
!(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING)) ||
if ((f->versioning == Column_definition::VERSIONING_NOT_SET && !add_versioning) ||
f->versioning == Column_definition::WITHOUT_VERSIONING)
{
f->flags|= VERS_UPDATE_UNVERSIONED_FLAG;

View file

@ -7535,6 +7535,19 @@ public:
};
/*
fix_escape_item() sets the out "escape" parameter to:
- native code in case of an 8bit character set
- Unicode code point in case of a multi-byte character set
The value meaning a not-initialized ESCAPE character must not be equal to
any valid value, so must be outside of these ranges:
- -128..+127, not to conflict with a valid 8bit charcter
- 0..0x10FFFF, not to conflict with a valid Unicode code point
The exact value does not matter.
*/
#define ESCAPE_NOT_INITIALIZED -1000
/*
It's used in ::fix_fields() methods of LIKE and JSON_SEARCH
functions to handle the ESCAPE parameter.

View file

@ -5619,7 +5619,7 @@ void Item_func_like::print(String *str, enum_query_type query_type)
longlong Item_func_like::val_int()
{
DBUG_ASSERT(fixed == 1);
DBUG_ASSERT(escape != -1);
DBUG_ASSERT(escape != ESCAPE_NOT_INITIALIZED);
String* res= args[0]->val_str(&cmp_value1);
if (args[0]->null_value)
{
@ -5723,7 +5723,7 @@ bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str,
return TRUE;
}
IF_DBUG(*escape= -1,);
IF_DBUG(*escape= ESCAPE_NOT_INITIALIZED,);
if (escape_item->const_item())
{

View file

@ -8578,7 +8578,6 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
{
/* Allow break with SIGINT, no core or stack trace */
test_flags|= TEST_SIGINT;
opt_stack_trace= 1;
test_flags&= ~TEST_CORE_ON_SIGNAL;
}
/* Set global MyISAM variables from delay_key_write_options */

View file

@ -1106,6 +1106,8 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share,
}
}
static bool fix_and_check_vcol_expr(THD *thd, TABLE *table,
Virtual_column_info *vcol);
/** Parse TABLE_SHARE::vcol_defs
@ -1297,6 +1299,9 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
Virtual_column_info *v= new (mem_root) Virtual_column_info();
field->vcol_info= v;
field->vcol_info->expr= hash_item;
field->vcol_info->set_vcol_type(VCOL_USING_HASH);
if (fix_and_check_vcol_expr(thd, table, v))
goto end;
key->user_defined_key_parts= key->ext_key_parts= key->usable_key_parts= 1;
key->key_part+= parts;

View file

@ -79,7 +79,7 @@ que_node_t */
#include "que0que.h"
#include "row0sel.h"
#ifdef __GNUC__
#if defined __GNUC__ && (!defined __clang_major__ || __clang_major__ > 11)
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
#endif

View file

@ -38,7 +38,7 @@ que_node_t */
#include "que0que.h"
#include "row0sel.h"
#ifdef __GNUC__
#if defined __GNUC__ && (!defined __clang_major__ || __clang_major__ > 11)
#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
#endif

View file

@ -210,7 +210,13 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
info->last_key.data + share->base.max_key_length*2,
info->save_lastkey_data_length + info->save_lastkey_ref_length);
info->update= info->save_update | HA_STATE_WRITTEN;
info->lastinx= info->save_lastinx;
if (info->lastinx != info->save_lastinx) /* Index changed */
{
info->lastinx = info->save_lastinx;
info->last_key.keyinfo= info->s->keyinfo + info->lastinx;
info->last_key.flag= 0;
info->page_changed=1;
}
info->cur_row.lastpos= info->save_lastpos;
info->last_key.data_length= info->save_lastkey_data_length;
info->last_key.ref_length= info->save_lastkey_ref_length;

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2020, MariaDB Corporation.
Copyright (c) 2009, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -401,9 +401,9 @@ my_copy_fix_mb(CHARSET_INFO *cs,
size_t well_formed_nchars;
size_t well_formed_length;
size_t fixed_length;
size_t min_length= MY_MIN(src_length, dst_length);
set_if_smaller(src_length, dst_length);
well_formed_nchars= my_ci_well_formed_char_length(cs, src, src + src_length,
well_formed_nchars= my_ci_well_formed_char_length(cs, src, src + min_length,
nchars, status);
DBUG_ASSERT(well_formed_nchars <= nchars);
well_formed_length= status->m_source_end_pos - src;

View file

@ -607,8 +607,8 @@ my_strnxfrm_tis620(CHARSET_INFO *cs,
const uchar *src, size_t srclen, uint flags)
{
size_t len, dstlen0= dstlen;
len= (uint) (strmake((char*) dst, (char*) src, MY_MIN(dstlen, srclen)) -
(char*) dst);
len= MY_MIN(dstlen, srclen);
memcpy(dst, src, len);
len= thai2sortable(dst, len);
set_if_smaller(dstlen, nweights);
set_if_smaller(len, dstlen);
@ -630,8 +630,8 @@ my_strnxfrm_tis620_nopad(CHARSET_INFO *cs,
const uchar *src, size_t srclen, uint flags)
{
size_t len, dstlen0= dstlen;
len= (uint) (strmake((char*) dst, (char*) src, MY_MIN(dstlen, srclen)) -
(char*) dst);
len= MY_MIN(dstlen, srclen);
memcpy(dst, src, len);
len= thai2sortable(dst, len);
set_if_smaller(dstlen, nweights);
set_if_smaller(len, dstlen);