summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--appveyor.yml8
-rw-r--r--client/mysql.cc14
-rw-r--r--cmake/cpack_rpm.cmake73
-rw-r--r--extra/mariabackup/ds_compress.cc8
-rw-r--r--mysql-test/lib/My/Debugger.pm3
-rw-r--r--mysql-test/main/alter_table.result16
-rw-r--r--mysql-test/main/alter_table.test41
-rw-r--r--mysql-test/main/ctype_cp850.result1050
-rw-r--r--mysql-test/main/ctype_cp850.test32
-rw-r--r--mysql-test/main/ctype_cp866.result12
-rw-r--r--mysql-test/main/ctype_cp866.test14
-rw-r--r--mysql-test/main/ctype_tis620.result9
-rw-r--r--mysql-test/main/ctype_tis620.test7
-rw-r--r--mysql-test/main/ctype_utf8.result11
-rw-r--r--mysql-test/main/ctype_utf8.test9
-rw-r--r--mysql-test/main/long_unique.result7
-rw-r--r--mysql-test/main/long_unique.test1
-rw-r--r--mysql-test/main/long_unique_bugs.result1
-rw-r--r--mysql-test/main/long_unique_bugs.test2
-rw-r--r--mysql-test/suite/encryption/r/encrypt_and_grep.result9
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.test16
-rw-r--r--mysql-test/suite/innodb/r/innodb_ctype_tis620.result28
-rw-r--r--mysql-test/suite/innodb/t/innodb_ctype_tis620.test29
-rw-r--r--mysql-test/suite/maria/maria.result11
-rw-r--r--mysql-test/suite/maria/maria.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_big_table_id.test1
-rw-r--r--mysql-test/suite/versioning/r/create.result25
-rw-r--r--mysql-test/suite/versioning/r/partition.result3
-rw-r--r--mysql-test/suite/versioning/t/create.test17
-rw-r--r--sql/ha_partition.cc7
-rw-r--r--sql/handler.cc10
-rw-r--r--sql/handler.h1
-rw-r--r--sql/item.h13
-rw-r--r--sql/item_cmpfunc.cc4
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/sql_alter.cc4
-rw-r--r--sql/sql_alter.h1
-rw-r--r--sql/sql_table.cc52
-rw-r--r--storage/innobase/pars/pars0grm.cc2
-rw-r--r--storage/innobase/pars/pars0grm.y2
-rw-r--r--storage/maria/ha_maria.cc5
-rw-r--r--storage/maria/ma_extra.c8
-rw-r--r--storage/myisam/mi_create.c6
-rw-r--r--strings/ctype-mb.c4
-rw-r--r--strings/ctype-tis620.c8
46 files changed, 1534 insertions, 65 deletions
diff --git a/appveyor.yml b/appveyor.yml
index b42453a8350..9797aec6b44 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -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
diff --git a/client/mysql.cc b/client/mysql.cc
index 5db52a3ef36..d16ae4471d7 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2018, Oracle and/or its affiliates.
- Copyright (c) 2009, 2019, 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
@@ -90,10 +90,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
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 1d216525f96..fe66f3ad883 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -48,21 +48,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}
diff --git a/extra/mariabackup/ds_compress.cc b/extra/mariabackup/ds_compress.cc
index 3c28e55e1fe..514c86f5a17 100644
--- a/extra/mariabackup/ds_compress.cc
+++ b/extra/mariabackup/ds_compress.cc
@@ -370,6 +370,7 @@ create_worker_threads(uint n)
thd)) {
msg("compress: pthread_create() failed: "
"errno = %d", errno);
+ pthread_mutex_unlock(&thd->ctrl_mutex);
goto err;
}
}
@@ -386,6 +387,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;
}
diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm
index cc151b233d5..8d09189e766 100644
--- a/mysql-test/lib/My/Debugger.pm
+++ b/mysql-test/lib/My/Debugger.pm
@@ -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",
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 3c59b83f2ce..f6c17d4de8c 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -2585,6 +2585,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
#
#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index fa931fcadbf..6dcb441d30a 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2100,6 +2100,47 @@ 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 #
diff --git a/mysql-test/main/ctype_cp850.result b/mysql-test/main/ctype_cp850.result
index c028f72b58a..c6aba9d3f4e 100644
--- a/mysql-test/main/ctype_cp850.result
+++ b/mysql-test/main/ctype_cp850.result
@@ -12,3 +12,1053 @@ DROP TABLE t1;
#
# End of 5.5 tests
#
+#
+# Start of 10.2 tests
+#
+#
+# MDEV-25610 Assertion `escape != -1' failed in Item_func_like::val_int
+#
+SET NAMES cp850;
+SELECT '' LIKE '' ESCAPE _cp850 0xFF;
+'' LIKE '' ESCAPE _cp850 0xFF
+1
+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;
+$$
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x10
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x10
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x11
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x11
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x12
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x12
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x13
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x13
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x14
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x14
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x15
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x15
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x16
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x16
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x17
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x17
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x18
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x18
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x19
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x19
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x1F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x1F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x20
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x20
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x21
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x21
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x22
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x22
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x23
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x23
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x24
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x24
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x25
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x25
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x26
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x26
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x27
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x27
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x28
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x28
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x29
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x29
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x2F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x2F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x30
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x30
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x31
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x31
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x32
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x32
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x33
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x33
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x34
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x34
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x35
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x35
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x36
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x36
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x37
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x37
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x38
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x38
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x39
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x39
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x3F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x3F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x40
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x40
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x41
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x41
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x42
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x42
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x43
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x43
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x44
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x44
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x45
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x45
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x46
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x46
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x47
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x47
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x48
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x48
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x49
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x49
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x4F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x4F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x50
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x50
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x51
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x51
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x52
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x52
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x53
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x53
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x54
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x54
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x55
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x55
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x56
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x56
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x57
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x57
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x58
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x58
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x59
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x59
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x5F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x5F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x60
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x60
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x61
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x61
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x62
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x62
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x63
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x63
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x64
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x64
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x65
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x65
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x66
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x66
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x67
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x67
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x68
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x68
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x69
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x69
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x6F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x6F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x70
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x70
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x71
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x71
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x72
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x72
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x73
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x73
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x74
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x74
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x75
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x75
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x76
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x76
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x77
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x77
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x78
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x78
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x79
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x79
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x7F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x7F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x80
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x80
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x81
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x81
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x82
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x82
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x83
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x83
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x84
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x84
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x85
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x85
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x86
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x86
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x87
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x87
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x88
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x88
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x89
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x89
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x8F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x8F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x90
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x90
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x91
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x91
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x92
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x92
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x93
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x93
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x94
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x94
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x95
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x95
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x96
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x96
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x97
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x97
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x98
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x98
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x99
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x99
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9A
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9A
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9B
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9B
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9C
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9C
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9D
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9D
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9E
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9E
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0x9F
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0x9F
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xA9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xA9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xAA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xAA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xAB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xAB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xAC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xAC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xAD
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xAD
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xAE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xAE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xAF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xAF
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xB9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xB9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xBA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xBA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xBB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xBB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xBC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xBC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xBD
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xBD
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xBE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xBE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xBF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xBF
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xC9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xC9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xCA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xCA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xCB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xCB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xCC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xCC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xCD
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xCD
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xCE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xCE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xCF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xCF
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xD9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xD9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xDA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xDA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xDB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xDB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xDC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xDC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xDD
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xDD
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xDE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xDE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xDF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xDF
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xE9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xE9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xEA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xEA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xEB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xEB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xEC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xEC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xED
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xED
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xEE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xEE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xEF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xEF
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF0
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF0
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF1
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF1
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF2
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF2
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF3
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF3
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF4
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF4
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF5
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF5
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF6
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF6
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF7
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF7
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF8
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF8
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xF9
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xF9
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xFA
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xFA
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xFB
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xFB
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xFC
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xFC
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xFD
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xFD
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xFE
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xFE
+1
+@query
+SELECT _cp850'' LIKE _cp850'' ESCAPE _cp850 0xFF
+_cp850'' LIKE _cp850'' ESCAPE _cp850 0xFF
+1
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/main/ctype_cp850.test b/mysql-test/main/ctype_cp850.test
index 358829eb351..d2fac6f3646 100644
--- a/mysql-test/main/ctype_cp850.test
+++ b/mysql-test/main/ctype_cp850.test
@@ -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 #
diff --git a/mysql-test/main/ctype_cp866.result b/mysql-test/main/ctype_cp866.result
new file mode 100644
index 00000000000..008f94f3c79
--- /dev/null
+++ b/mysql-test/main/ctype_cp866.result
@@ -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
+#
diff --git a/mysql-test/main/ctype_cp866.test b/mysql-test/main/ctype_cp866.test
new file mode 100644
index 00000000000..cdc694d2fc7
--- /dev/null
+++ b/mysql-test/main/ctype_cp866.test
@@ -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 #
diff --git a/mysql-test/main/ctype_tis620.result b/mysql-test/main/ctype_tis620.result
index 9650c366d38..d0c30a112e3 100644
--- a/mysql-test/main/ctype_tis620.result
+++ b/mysql-test/main/ctype_tis620.result
@@ -4421,5 +4421,14 @@ DROP TABLE t1;
#
SET 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
#
diff --git a/mysql-test/main/ctype_tis620.test b/mysql-test/main/ctype_tis620.test
index 7bc248aec2b..7f6382fe7bc 100644
--- a/mysql-test/main/ctype_tis620.test
+++ b/mysql-test/main/ctype_tis620.test
@@ -210,5 +210,12 @@ 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 #
diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result
index 7235cba31b7..34f7530e815 100644
--- a/mysql-test/main/ctype_utf8.result
+++ b/mysql-test/main/ctype_utf8.result
@@ -11258,6 +11258,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
#
#
diff --git a/mysql-test/main/ctype_utf8.test b/mysql-test/main/ctype_utf8.test
index 2e1f1e230f1..e2c47e75993 100644
--- a/mysql-test/main/ctype_utf8.test
+++ b/mysql-test/main/ctype_utf8.test
@@ -2184,6 +2184,15 @@ 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 #
diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result
index eb61a080c96..23d25e2f124 100644
--- a/mysql-test/main/long_unique.result
+++ b/mysql-test/main/long_unique.result
@@ -596,17 +596,17 @@ t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
UNIQUE KEY `db_row_hash_1` (`db_row_hash_1`),
UNIQUE KEY `db_row_hash_2` (`db_row_hash_2`),
+ UNIQUE KEY `d` (`d`) USING HASH,
UNIQUE KEY `e` (`e`),
- UNIQUE KEY `a` (`a`),
- UNIQUE KEY `d` (`d`) USING HASH
+ UNIQUE KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 db_row_hash_1 1 db_row_hash_1 A NULL NULL NULL YES BTREE
t1 0 db_row_hash_2 1 db_row_hash_2 A NULL NULL NULL YES BTREE
+t1 0 d 1 d A NULL NULL NULL YES HASH
t1 0 e 1 e A NULL NULL NULL YES BTREE
t1 0 a 1 a A NULL NULL NULL YES BTREE
-t1 0 d 1 d A NULL NULL NULL YES HASH
alter table t1 add column clm1 blob unique,add column clm2 blob unique;
#try changing the name;
alter table t1 change column clm1 clm_changed1 blob, change column clm2 clm_changed2 blob;
@@ -1478,3 +1478,4 @@ SELECT t2.b FROM t1 JOIN t2 ON t1.d = t2.f WHERE t2.pk >= 20;
b
drop table t1,t2;
set @@GLOBAL.max_allowed_packet= @allowed_packet;
+# End of 10.4 tests
diff --git a/mysql-test/main/long_unique.test b/mysql-test/main/long_unique.test
index c0bd77ca5c9..7aaff303ae7 100644
--- a/mysql-test/main/long_unique.test
+++ b/mysql-test/main/long_unique.test
@@ -557,3 +557,4 @@ SELECT t2.b FROM t1 JOIN t2 ON t1.d = t2.f WHERE t2.pk >= 20;
drop table t1,t2;
set @@GLOBAL.max_allowed_packet= @allowed_packet;
+--echo # End of 10.4 tests
diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result
index 738744867c0..bf53b8f1d88 100644
--- a/mysql-test/main/long_unique_bugs.result
+++ b/mysql-test/main/long_unique_bugs.result
@@ -302,3 +302,4 @@ c
1
DELETE FROM t;
DROP TABLE t;
+# End of 10.4 tests
diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test
index 319940690ea..b0e6c2b3bf6 100644
--- a/mysql-test/main/long_unique_bugs.test
+++ b/mysql-test/main/long_unique_bugs.test
@@ -384,3 +384,5 @@ SELECT * FROM t;
DELETE FROM t;
DROP TABLE t;
+
+--echo # End of 10.4 tests
diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep.result b/mysql-test/suite/encryption/r/encrypt_and_grep.result
index 635dca14868..72d612eeac8 100644
--- a/mysql-test/suite/encryption/r/encrypt_and_grep.result
+++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result
@@ -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;
diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test
index 5fec86304b4..03f67db83f9 100644
--- a/mysql-test/suite/encryption/t/encrypt_and_grep.test
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test
@@ -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;
diff --git a/mysql-test/suite/innodb/r/innodb_ctype_tis620.result b/mysql-test/suite/innodb/r/innodb_ctype_tis620.result
new file mode 100644
index 00000000000..164212097bd
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_ctype_tis620.result
@@ -0,0 +1,28 @@
+SET 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
+#
diff --git a/mysql-test/suite/innodb/t/innodb_ctype_tis620.test b/mysql-test/suite/innodb/t/innodb_ctype_tis620.test
new file mode 100644
index 00000000000..fee1b283ac3
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_ctype_tis620.test
@@ -0,0 +1,29 @@
+--source include/have_innodb.inc
+--source include/have_tis620.inc
+
+SET 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 #
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index 03d37270eed..17cc6fa0373 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -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;
diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test
index d5b9d839699..3cabba3b1e8 100644
--- a/mysql-test/suite/maria/maria.test
+++ b/mysql-test/suite/maria/maria.test
@@ -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;
diff --git a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
index 02665c70b9e..c44bfa80ad4 100644
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
@@ -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;
diff --git a/mysql-test/suite/rpl/t/rpl_row_big_table_id.test b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
index abf22cc876e..d898e894bc6 100644
--- a/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
+++ b/mysql-test/suite/rpl/t/rpl_row_big_table_id.test
@@ -7,6 +7,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
diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result
index 75f7b560f30..1197a0e805a 100644
--- a/mysql-test/suite/versioning/r/create.result
+++ b/mysql-test/suite/versioning/r/create.result
@@ -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;
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 9ccc900cd12..6bb2f352e52 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -611,8 +611,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
diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test
index 6f8cff3ca2e..61fac4d6a1f 100644
--- a/mysql-test/suite/versioning/t/create.test
+++ b/mysql-test/suite/versioning/t/create.test
@@ -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;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index c8d5d68b5d6..7f53eeb565c 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -10932,11 +10932,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)
diff --git a/sql/handler.cc b/sql/handler.cc
index f7fb0ea4854..812de48fa68 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -7523,15 +7523,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");
@@ -7541,8 +7542,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;
diff --git a/sql/handler.h b/sql/handler.h
index f3be9e7de6a..94ac56c3073 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -454,6 +454,7 @@ enum enum_alter_inplace_result {
#define HA_CREATE_TMP_ALTER 8U
#define HA_LEX_CREATE_SEQUENCE 16U
#define HA_VERSIONED_TABLE 32U
+#define HA_SKIP_KEY_SORT 64U
#define HA_MAX_REC_LENGTH 65535
diff --git a/sql/item.h b/sql/item.h
index 6b64e7788bc..2e4383cf9ac 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -7540,6 +7540,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.
This parameter is quite non-standard so the specific function.
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 6cf8b985486..c2e58a72dd2 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -5476,7 +5476,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)
{
@@ -5580,7 +5580,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())
{
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ec77366129a..7d734d091cd 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8908,7 +8908,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 */
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index f1a67e7d968..6d75c20e868 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -256,7 +256,7 @@ Alter_table_ctx::Alter_table_ctx()
db(null_clex_str), table_name(null_clex_str), alias(null_clex_str),
new_db(null_clex_str), new_name(null_clex_str), new_alias(null_clex_str),
fk_error_if_delete_row(false), fk_error_id(NULL),
- fk_error_table(NULL)
+ fk_error_table(NULL), modified_primary_key(false)
#ifdef DBUG_ASSERT_EXISTS
, tmp_table(false)
#endif
@@ -276,7 +276,7 @@ Alter_table_ctx::Alter_table_ctx(THD *thd, TABLE_LIST *table_list,
tables_opened(tables_opened_arg),
new_db(*new_db_arg), new_name(*new_name_arg),
fk_error_if_delete_row(false), fk_error_id(NULL),
- fk_error_table(NULL)
+ fk_error_table(NULL), modified_primary_key(false)
#ifdef DBUG_ASSERT_EXISTS
, tmp_table(false)
#endif
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index 71920b84792..d9749592a4f 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -324,6 +324,7 @@ public:
const char *fk_error_id;
/** Name of table for the above error. */
const char *fk_error_table;
+ bool modified_primary_key;
private:
char new_filename[FN_REFLEN + 1];
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f64abe72bac..e46a13ce7a9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4256,9 +4256,30 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
my_message(ER_WRONG_AUTO_KEY, ER_THD(thd, ER_WRONG_AUTO_KEY), MYF(0));
DBUG_RETURN(TRUE);
}
- /* Sort keys in optimized order */
- my_qsort((uchar*) *key_info_buffer, *key_count, sizeof(KEY),
- (qsort_cmp) sort_keys);
+ /*
+ We cannot do qsort of key info if MyISAM/Aria does inplace. These engines
+ do not synchronise key info on inplace alter and that qsort is
+ indeterministic (MDEV-25803).
+
+ Yet we do not know whether we do inplace or not. That detection is done
+ after this create_table_impl() and that cannot be changed because of chicken
+ and egg problem (inplace processing requires key info made by
+ create_table_impl()).
+
+ MyISAM/Aria cannot add index inplace so we are safe to qsort key info in
+ that case. And if we don't add index then we do not need qsort at all.
+ */
+ if (!(create_info->options & HA_SKIP_KEY_SORT))
+ {
+ /*
+ Sort keys in optimized order.
+
+ Note: PK must be always first key, otherwise init_from_binary_frm_image()
+ can not understand it.
+ */
+ my_qsort((uchar*) *key_info_buffer, *key_count, sizeof(KEY),
+ (qsort_cmp) sort_keys);
+ }
create_info->null_bits= null_fields;
/* Check fields. */
@@ -8085,7 +8106,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
uint used_fields, dropped_sys_vers_fields= 0;
KEY *key_info=table->key_info;
bool rc= TRUE;
- bool modified_primary_key= FALSE;
bool vers_system_invisible= false;
Create_field *def;
Field **f_ptr,*field;
@@ -8471,6 +8491,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (key_info->flags & HA_INVISIBLE_KEY)
continue;
const char *key_name= key_info->name.str;
+ const bool primary_key= table->s->primary_key == i;
+ const bool explicit_pk= primary_key &&
+ !my_strcasecmp(system_charset_info, key_name,
+ primary_key_name);
+ const bool implicit_pk= primary_key && !explicit_pk;
+
Alter_drop *drop;
drop_it.rewind();
while ((drop=drop_it++))
@@ -8484,7 +8510,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (table->s->tmp_table == NO_TMP_TABLE)
{
(void) delete_statistics_for_index(thd, table, key_info, FALSE);
- if (i == table->s->primary_key)
+ if (primary_key)
{
KEY *tab_key_info= table->key_info;
for (uint j=0; j < table->s->keys; j++, tab_key_info++)
@@ -8534,13 +8560,19 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
if (!cfield)
{
- if (table->s->primary_key == i)
- modified_primary_key= TRUE;
+ if (primary_key)
+ alter_ctx->modified_primary_key= true;
delete_index_stat= TRUE;
if (!(kfield->flags & VERS_SYSTEM_FIELD))
dropped_key_part= key_part_name;
continue; // Field is removed
}
+
+ DBUG_ASSERT(!primary_key || kfield->flags & NOT_NULL_FLAG);
+ if (implicit_pk && !alter_ctx->modified_primary_key &&
+ !(cfield->flags & NOT_NULL_FLAG))
+ alter_ctx->modified_primary_key= true;
+
key_part_length= key_part->length;
if (cfield->field) // Not new field
{
@@ -8589,7 +8621,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
{
if (delete_index_stat)
(void) delete_statistics_for_index(thd, table, key_info, FALSE);
- else if (modified_primary_key &&
+ else if (alter_ctx->modified_primary_key &&
key_info->user_defined_key_parts != key_info->ext_key_parts)
(void) delete_statistics_for_index(thd, table, key_info, TRUE);
}
@@ -8633,7 +8665,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
key_type= Key::SPATIAL;
else if (key_info->flags & HA_NOSAME)
{
- if (! my_strcasecmp(system_charset_info, key_name, primary_key_name))
+ if (explicit_pk)
key_type= Key::PRIMARY;
else
key_type= Key::UNIQUE;
@@ -10123,6 +10155,8 @@ do_continue:;
tmp_disable_binlog(thd);
create_info->options|=HA_CREATE_TMP_ALTER;
+ if (!(alter_info->flags & ALTER_ADD_INDEX) && !alter_ctx.modified_primary_key)
+ create_info->options|= HA_SKIP_KEY_SORT;
create_info->alias= alter_ctx.table_name;
error= create_table_impl(thd, alter_ctx.db, alter_ctx.table_name,
alter_ctx.new_db, alter_ctx.tmp_name,
diff --git a/storage/innobase/pars/pars0grm.cc b/storage/innobase/pars/pars0grm.cc
index 10d0d0becd7..1e10a61f5ad 100644
--- a/storage/innobase/pars/pars0grm.cc
+++ b/storage/innobase/pars/pars0grm.cc
@@ -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
diff --git a/storage/innobase/pars/pars0grm.y b/storage/innobase/pars/pars0grm.y
index 3fb0865f608..ed2b9bc09b0 100644
--- a/storage/innobase/pars/pars0grm.y
+++ b/storage/innobase/pars/pars0grm.y
@@ -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
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index aa99bc157c9..15cacbba075 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -736,6 +736,11 @@ static int table2maria(TABLE *table_arg, data_file_type row_type,
- compare SPATIAL keys;
- compare FIELD_SKIP_ZERO which is converted to FIELD_NORMAL correctly
(should be correctly detected in table2maria).
+
+ FIXME:
+ maria_check_definition() is never used! CHECK TABLE does not detect the
+ corruption! Do maria_check_definition() like check_definition() is done
+ by MyISAM (related to MDEV-25803).
*/
int maria_check_definition(MARIA_KEYDEF *t1_keyinfo,
diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c
index 2573133ece5..fe2a4c9b8ac 100644
--- a/storage/maria/ma_extra.c
+++ b/storage/maria/ma_extra.c
@@ -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;
diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c
index de516d9fb6a..ebe139bb342 100644
--- a/storage/myisam/mi_create.c
+++ b/storage/myisam/mi_create.c
@@ -711,7 +711,11 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
}
#endif
- /* Write key and keyseg definitions */
+ /* Write key and keyseg definitions
+
+ TODO: update key and keyseg definitions for inplace alter (grep sql layer by
+ MDEV-25803). Do the same for Aria.
+ */
DBUG_PRINT("info", ("write key and keyseg definitions"));
for (i=0 ; i < share.base.keys - uniques; i++)
{
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index a890c147055..fc882d087fb 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -401,10 +401,10 @@ 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= cs->cset->well_formed_char_length(cs,
- src, src + src_length,
+ src, src + min_length,
nchars, status);
DBUG_ASSERT(well_formed_nchars <= nchars);
well_formed_length= status->m_source_end_pos - src;
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index afc5771d6c5..9760ea25162 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -605,8 +605,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);
@@ -628,8 +628,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);