summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2023-04-05 15:42:27 +0400
committerAlexander Barkov <bar@mariadb.com>2023-04-05 16:16:19 +0400
commit62e137d4d739fcba6810a66242175230e8170727 (patch)
tree3d277e4400c735ff13f84870fd09d808b7311d8e
parentafdf19cf3303bf3797fe47e5cef398227134cc32 (diff)
parent06393cd8f81e6c9a01e9ae1c8783a7f6dac21fbd (diff)
downloadmariadb-git-62e137d4d739fcba6810a66242175230e8170727.tar.gz
Merge remote-tracking branch 'origin/10.4' into 10.5
-rw-r--r--client/mysqltest.cc16
-rw-r--r--include/m_ctype.h25
-rw-r--r--mysql-test/include/ctype_nopad_prefix_unique.inc85
-rw-r--r--mysql-test/main/ctype_utf8_uca.result148
-rw-r--r--mysql-test/main/ctype_utf8_uca.test18
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522.result14
-rw-r--r--mysql-test/suite/innodb/r/innodb_ctype_utf8.result98
-rw-r--r--mysql-test/suite/innodb/t/import_tablespace_race.test8
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522.test21
-rw-r--r--mysql-test/suite/innodb/t/innodb_ctype_utf8.test12
-rw-r--r--mysql-test/suite/innodb/t/restart.test23
-rw-r--r--mysql-test/suite/maria/aria_log_dir_path.result29
-rw-r--r--mysql-test/suite/maria/aria_log_dir_path.test65
-rw-r--r--mysql-test/suite/maria/maria3.result1
-rw-r--r--mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result36
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_aria.result12
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result10
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result10
-rw-r--r--mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test35
-rw-r--r--mysql-test/suite/sys_vars/t/sysvars_aria.test4
-rw-r--r--sql/field.cc22
-rw-r--r--sql/field.h8
-rw-r--r--sql/key.cc3
-rw-r--r--sql/table.cc2
-rw-r--r--storage/innobase/rem/rem0cmp.cc3
-rw-r--r--storage/maria/ha_maria.cc2
-rw-r--r--storage/spider/spd_table.cc3
-rw-r--r--strings/ctype-bin.c6
-rw-r--r--strings/ctype-simple.c3
-rw-r--r--strings/ctype-tis620.c3
-rw-r--r--strings/ctype-uca.inl27
-rw-r--r--strings/ctype.c6
-rw-r--r--strings/strcoll.inl3
-rw-r--r--strings/strings_def.h6
-rw-r--r--unittest/strings/strings-t.c420
35 files changed, 918 insertions, 269 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 08e18be3f1b..9fa1b1dafe9 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -3815,9 +3815,21 @@ void do_move_file(struct st_command *command)
sizeof(move_file_args)/sizeof(struct command_arg),
' ');
- if (bad_path(ds_to_file.str))
- DBUG_VOID_RETURN;
+ size_t from_plen = strlen(ds_from_file.str);
+ size_t to_plen = strlen(ds_to_file.str);
+ const char *vardir= getenv("MYSQLTEST_VARDIR");
+ const char *tmpdir= getenv("MYSQL_TMP_DIR");
+ if (!((is_sub_path(ds_from_file.str, from_plen, vardir) &&
+ is_sub_path(ds_to_file.str, to_plen, vardir)) ||
+ (is_sub_path(ds_from_file.str, from_plen, tmpdir) &&
+ is_sub_path(ds_to_file.str, to_plen, tmpdir)))) {
+ report_or_die("Paths '%s' and '%s' are not both under MYSQLTEST_VARDIR '%s'"
+ "or both under MYSQL_TMP_DIR '%s'",
+ ds_from_file, ds_to_file, vardir, tmpdir);
+ DBUG_VOID_RETURN;
+ }
+
DBUG_PRINT("info", ("Move %s to %s", ds_from_file.str, ds_to_file.str));
error= (my_rename(ds_from_file.str, ds_to_file.str,
MYF(disable_warnings ? 0 : MY_WME)) != 0);
diff --git a/include/m_ctype.h b/include/m_ctype.h
index f0af80315ba..daa06d254fb 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -267,6 +267,28 @@ typedef enum enum_repertoire_t
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */
#define MY_STRXFRM_REVERSE_SHIFT 16
+/* Flags to strnncollsp_nchars */
+/*
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES -
+ defines if inside strnncollsp_nchars()
+ short strings should be virtually extended to "nchars"
+ characters by emulating trimmed trailing spaces.
+
+ This flag is needed when comparing packed strings of the CHAR
+ data type, when trailing spaces are trimmed on storage (like in InnoDB),
+ however the actual values (after unpacking) will have those trailing
+ spaces.
+
+ If this flag is passed, strnncollsp_nchars() performs both
+ truncating longer strings and extending shorter strings
+ to exactly "nchars".
+
+ If this flag is not passed, strnncollsp_nchars() only truncates longer
+ strings to "nchars", but does not extend shorter strings to "nchars".
+*/
+#define MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES 1
+
+
/*
Collation IDs for MariaDB that should not conflict with MySQL.
We reserve 256..511, because MySQL will most likely use this range
@@ -402,7 +424,8 @@ struct my_collation_handler_st
int (*strnncollsp_nchars)(CHARSET_INFO *,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars);
+ size_t nchars,
+ uint flags);
size_t (*strnxfrm)(CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
diff --git a/mysql-test/include/ctype_nopad_prefix_unique.inc b/mysql-test/include/ctype_nopad_prefix_unique.inc
new file mode 100644
index 00000000000..b25128e9fef
--- /dev/null
+++ b/mysql-test/include/ctype_nopad_prefix_unique.inc
@@ -0,0 +1,85 @@
+--echo #
+--echo # MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+--echo #
+
+# TEXT
+
+if (`SELECT UPPER(@@storage_engine) != 'MEMORY'`)
+{
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+}
+
+
+# VARCHAR
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+--error ER_DUP_ENTRY
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+
+# CHAR
+
+# MyISAM is buggy on CHAR+BTREE+UNIQUE+PREFIX (see MDEV-30048), disable for now
+# Other engines work fine
+
+if (`SELECT UPPER(@@storage_engine) != 'MYISAM'`)
+{
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+}
+
+EXECUTE IMMEDIATE REPLACE(
+ 'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+ '<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
diff --git a/mysql-test/main/ctype_utf8_uca.result b/mysql-test/main/ctype_utf8_uca.result
index 7475eb5d8c9..dee65b04c1a 100644
--- a/mysql-test/main/ctype_utf8_uca.result
+++ b/mysql-test/main/ctype_utf8_uca.result
@@ -761,3 +761,151 @@ DROP TABLE case_folding;
#
# End of 10.3 tests
#
+#
+# Start of 10.4 tests
+#
+SET DEFAULT_STORAGE_ENGINE=MyISAM;
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+#
+# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+#
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+SET DEFAULT_STORAGE_ENGINE=HEAP;
+#
+# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+#
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+SET DEFAULT_STORAGE_ENGINE=DEFAULT;
+#
+# End of 10.4 tests
+#
diff --git a/mysql-test/main/ctype_utf8_uca.test b/mysql-test/main/ctype_utf8_uca.test
index 38bcce8f4ba..6361bd32a4a 100644
--- a/mysql-test/main/ctype_utf8_uca.test
+++ b/mysql-test/main/ctype_utf8_uca.test
@@ -50,3 +50,21 @@ SET NAMES utf8mb3 COLLATE utf8mb3_thai_520_w2;
--echo #
--echo # End of 10.3 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+SET DEFAULT_STORAGE_ENGINE=MyISAM;
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+--source include/ctype_nopad_prefix_unique.inc
+
+SET DEFAULT_STORAGE_ENGINE=HEAP;
+--source include/ctype_nopad_prefix_unique.inc
+
+SET DEFAULT_STORAGE_ENGINE=DEFAULT;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result
index d5ebfe2b959..33081000a24 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522.result
@@ -63,16 +63,24 @@ a b c
# Done restarting server
# List before t1 DISCARD
db.opt
+t1.cfg.sav
t1.frm
t1.ibd
+t1.ibd.sav
+t2.cfg.sav
t2.frm
t2.ibd
+t2.ibd.sav
ALTER TABLE t1 DISCARD TABLESPACE;
# List after t1 DISCARD
db.opt
+t1.cfg.sav
t1.frm
+t1.ibd.sav
+t2.cfg.sav
t2.frm
t2.ibd
+t2.ibd.sav
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
@@ -90,10 +98,14 @@ a b c
638 Cavalry ..asdasdfaeraf
db.opt
t1.cfg
+t1.cfg.sav
t1.frm
t1.ibd
+t1.ibd.sav
+t2.cfg.sav
t2.frm
t2.ibd
+t2.ibd.sav
SELECT COUNT(*) FROM t1;
COUNT(*)
640
@@ -112,7 +124,9 @@ ALTER TABLE t2 ROW_FORMAT=DYNAMIC;
ALTER TABLE t2 DISCARD TABLESPACE;
# List after t2 DISCARD
db.opt
+t2.cfg.sav
t2.frm
+t2.ibd.sav
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Schema mismatch (Table flags don't match, server table has 0x21 and the meta-data file has 0x1; .cfg file uses ROW_FORMAT=COMPACT)
ALTER TABLE t2 IMPORT TABLESPACE;
diff --git a/mysql-test/suite/innodb/r/innodb_ctype_utf8.result b/mysql-test/suite/innodb/r/innodb_ctype_utf8.result
index c7e60934eb2..e399f18ce35 100644
--- a/mysql-test/suite/innodb/r/innodb_ctype_utf8.result
+++ b/mysql-test/suite/innodb/r/innodb_ctype_utf8.result
@@ -283,3 +283,101 @@ DROP TABLE t1;
#
# End of 10.2 tests
#
+#
+# Start of 10.4 tests
+#
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+#
+# MDEV-30034 UNIQUE USING HASH accepts duplicate entries for tricky collations
+#
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a TEXT COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a VARCHAR(2000) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2000) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+ERROR 23000: Duplicate entry 'ß ' for key 'a'
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)))',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+EXECUTE IMMEDIATE REPLACE(
+'CREATE TABLE t1 ( '
+ ' a CHAR(20) COLLATE <COLLATION>,'
+ 'UNIQUE(a(3)) USING HASH)',
+'<COLLATION>', @@collation_connection);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(20) CHARACTER SET utf8 COLLATE utf8_unicode_nopad_ci DEFAULT NULL,
+ UNIQUE KEY `a` (`a`(3)) USING HASH
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+INSERT INTO t1 VALUES ('ss ');
+INSERT INTO t1 VALUES (_utf8mb3 0xC39F20)/*SZ+SPACE*/;
+DROP TABLE t1;
+#
+# End 10.4 tests
+#
diff --git a/mysql-test/suite/innodb/t/import_tablespace_race.test b/mysql-test/suite/innodb/t/import_tablespace_race.test
index 532c2684dde..4540834cf75 100644
--- a/mysql-test/suite/innodb/t/import_tablespace_race.test
+++ b/mysql-test/suite/innodb/t/import_tablespace_race.test
@@ -36,8 +36,8 @@ ALTER TABLE t NOWAIT ADD INDEX (c);
FLUSH TABLE t FOR EXPORT;
--let $create= query_get_value(SHOW CREATE TABLE t, Create Table, 1)
---copy_file $datadir/test/t.cfg $MYSQL_TMP_DIR/t.cfg
---copy_file $datadir/test/t.ibd $MYSQL_TMP_DIR/t.ibd
+--copy_file $datadir/test/t.cfg $datadir/test/t.cfg.sav
+--copy_file $datadir/test/t.ibd $datadir/test/t.ibd.sav
UNLOCK TABLES;
DROP TABLE t;
@@ -46,8 +46,8 @@ eval $create;
--enable_query_log
ALTER TABLE t DISCARD TABLESPACE;
---move_file $MYSQL_TMP_DIR/t.cfg $datadir/test/t.cfg
---move_file $MYSQL_TMP_DIR/t.ibd $datadir/test/t.ibd
+--move_file $datadir/test/t.cfg.sav $datadir/test/t.cfg
+--move_file $datadir/test/t.ibd.sav $datadir/test/t.ibd
ALTER TABLE t IMPORT TABLESPACE;
# Cleanup
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test
index 7bad2ae9002..309bd7a5d8b 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522.test
@@ -9,7 +9,6 @@ call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it alre
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
FLUSH TABLES;
-let $MYSQLD_TMPDIR = `SELECT @@tmpdir`;
let $MYSQLD_DATADIR = `SELECT @@datadir`;
let $checksum_algorithm = `SELECT @@innodb_checksum_algorithm`;
@@ -39,10 +38,10 @@ CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT;
FLUSH TABLE t1, t2 FOR EXPORT;
--echo # List before copying files
--list_files $MYSQLD_DATADIR/test
---copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
---copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
---move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2.cfg
---copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg.sav
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd.sav
+--move_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_DATADIR/test/t2.cfg.sav
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd.sav
UNLOCK TABLES;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1;
@@ -56,8 +55,8 @@ SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
ALTER TABLE t1 DISCARD TABLESPACE;
--echo # List after t1 DISCARD
--list_files $MYSQLD_DATADIR/test
---copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
---copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.cfg.sav $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd.sav $MYSQLD_DATADIR/test/t1.ibd
ALTER TABLE t1 IMPORT TABLESPACE;
ALTER TABLE t1 ENGINE InnoDB;
SELECT COUNT(*) FROM t1;
@@ -68,15 +67,15 @@ SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
DROP TABLE t1;
---remove_file $MYSQLD_TMPDIR/t1.cfg
---remove_file $MYSQLD_TMPDIR/t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t1.cfg.sav
+--remove_file $MYSQLD_DATADIR/test/t1.ibd.sav
ALTER TABLE t2 ROW_FORMAT=DYNAMIC;
ALTER TABLE t2 DISCARD TABLESPACE;
--echo # List after t2 DISCARD
--list_files $MYSQLD_DATADIR/test
---move_file $MYSQLD_TMPDIR/t2.ibd $MYSQLD_DATADIR/test/t2.ibd
---move_file $MYSQLD_TMPDIR/t2.cfg $MYSQLD_DATADIR/test/t2.cfg
+--move_file $MYSQLD_DATADIR/test/t2.ibd.sav $MYSQLD_DATADIR/test/t2.ibd
+--move_file $MYSQLD_DATADIR/test/t2.cfg.sav $MYSQLD_DATADIR/test/t2.cfg
--error ER_TABLE_SCHEMA_MISMATCH
ALTER TABLE t2 IMPORT TABLESPACE;
--remove_file $MYSQLD_DATADIR/test/t2.cfg
diff --git a/mysql-test/suite/innodb/t/innodb_ctype_utf8.test b/mysql-test/suite/innodb/t/innodb_ctype_utf8.test
index c3abaa99731..99b79253215 100644
--- a/mysql-test/suite/innodb/t/innodb_ctype_utf8.test
+++ b/mysql-test/suite/innodb/t/innodb_ctype_utf8.test
@@ -23,3 +23,15 @@ let $coll_pad='utf8_bin';
--echo #
--echo # End of 10.2 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.4 tests
+--echo #
+
+SET NAMES utf8mb3 COLLATE utf8mb3_unicode_nopad_ci;
+--source include/ctype_nopad_prefix_unique.inc
+
+--echo #
+--echo # End 10.4 tests
+--echo #
diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test
index 3e726c971ab..859d9325985 100644
--- a/mysql-test/suite/innodb/t/restart.test
+++ b/mysql-test/suite/innodb/t/restart.test
@@ -4,6 +4,7 @@
let datadir= `select @@datadir`;
let page_size= `select @@innodb_page_size`;
+let tmp_in_vardir=$MYSQLTEST_VARDIR/tmp;
--echo #
--echo # MDEV-15333 MariaDB (still) slow start
@@ -28,19 +29,19 @@ call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace for `test`\\
CREATE TABLE tr(a INT)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
CREATE TABLE tc(a INT)ENGINE=InnoDB ROW_FORMAT=COMPACT
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
---replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+--replace_result $tmp_in_vardir MYSQL_TMP_DIR
eval CREATE TABLE td(a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
-STATS_PERSISTENT=0 DATA DIRECTORY='$MYSQL_TMP_DIR';
+STATS_PERSISTENT=0 DATA DIRECTORY='$tmp_in_vardir';
--source include/shutdown_mysqld.inc
--move_file $datadir/test/tr.ibd $datadir/test/tr0.ibd
--move_file $datadir/test/tc.ibd $datadir/test/tc0.ibd
---move_file $MYSQL_TMP_DIR/test/td.ibd $datadir/test/td0.ibd
+--move_file $tmp_in_vardir/test/td.ibd $datadir/test/td0.ibd
# TODO: test that MariaDB does not even attempt to open the files
#--mkdir $datadir/test/tr.ibd
#--mkdir $datadir/test/tc.ibd
-#--mkdir $MYSQL_TMP_DIR/test/td.ibd
+#--mkdir $tmp_in_vardir/test/td.ibd
perl;
die unless open OUT, ">", "$ENV{datadir}/test/tr.ibd";
@@ -49,7 +50,7 @@ close OUT or die;
die unless open OUT, ">", "$ENV{datadir}/test/tc.ibd";
print OUT "bar " x $ENV{page_size};
close OUT or die;
-die unless open OUT, ">", "$ENV{MYSQL_TMP_DIR}/test/td.ibd";
+die unless open OUT, ">", "$ENV{tmp_in_vardir}/test/td.ibd";
print OUT "Xyz " x $ENV{page_size};
close OUT or die;
EOF
@@ -67,14 +68,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
# TODO: test that MariaDB does not even attempt to open the files
#--rmdir $datadir/test/tr.ibd
#--rmdir $datadir/test/tc.ibd
-#--rmdir $MYSQL_TMP_DIR/test/td.ibd
+#--rmdir $tmp_in_vardir/test/td.ibd
--remove_file $datadir/test/tr.ibd
--remove_file $datadir/test/tc.ibd
---remove_file $MYSQL_TMP_DIR/test/td.ibd
+--remove_file $tmp_in_vardir/test/td.ibd
--move_file $datadir/test/tr0.ibd $datadir/test/tr.ibd
--move_file $datadir/test/tc0.ibd $datadir/test/tc.ibd
---move_file $datadir/test/td0.ibd $MYSQL_TMP_DIR/test/td.ibd
+--move_file $datadir/test/td0.ibd $tmp_in_vardir/test/td.ibd
--source include/start_mysqld.inc
SELECT * FROM tr;
@@ -144,13 +145,13 @@ if ($MTR_COMBINATION_64K)
}
--error 1
-exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$MYSQL_TMP_DIR/attempted_start.err;
+exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$tmp_in_vardir/attempted_start.err;
-let SEARCH_FILE= $MYSQL_TMP_DIR/attempted_start.err;
+let SEARCH_FILE= $tmp_in_vardir/attempted_start.err;
let SEARCH_PATTERN= InnoDB: MySQL-8\.0 tablespace in \./ibdata1;
source include/search_pattern_in_file.inc;
---remove_file $MYSQL_TMP_DIR/attempted_start.err
+--remove_file $tmp_in_vardir/attempted_start.err
--remove_file $MYSQLD_DATADIR/ibdata1
--move_file $MYSQLD_DATADIR/ibdata1.bak $MYSQLD_DATADIR/ibdata1
diff --git a/mysql-test/suite/maria/aria_log_dir_path.result b/mysql-test/suite/maria/aria_log_dir_path.result
new file mode 100644
index 00000000000..0a4201544a5
--- /dev/null
+++ b/mysql-test/suite/maria/aria_log_dir_path.result
@@ -0,0 +1,29 @@
+#
+# MDEV-30971 Add a new system variable aria_data_home_dir
+#
+# restart: --loose-aria-log-file-size=8388608 --loose-aria-log-dir-path=MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1
+SET @@global.aria_log_purge_type=external;
+SHOW VARIABLES LIKE 'aria_log_file_size';
+Variable_name Value
+aria_log_file_size 8388608
+SELECT @@aria_log_dir_path;
+@@aria_log_dir_path
+MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 in use
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+BEGIN NOT ATOMIC
+FOR id IN 0..9 DO
+INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+END FOR;
+END;
+$$
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+SHOW ENGINE aria logs;
+Type Name Status
+Aria aria_log.00000001 free
+Aria aria_log.00000002 in use
+DROP TABLE t1;
+# restart
diff --git a/mysql-test/suite/maria/aria_log_dir_path.test b/mysql-test/suite/maria/aria_log_dir_path.test
new file mode 100644
index 00000000000..bc0a31a76b9
--- /dev/null
+++ b/mysql-test/suite/maria/aria_log_dir_path.test
@@ -0,0 +1,65 @@
+--source include/have_maria.inc
+--let $datadir= `SELECT @@datadir`
+
+--echo #
+--echo # MDEV-30971 Add a new system variable aria_data_home_dir
+--echo #
+
+--let $ARIA_LOGDIR=$MYSQLTEST_VARDIR/tmp/aria_log_dir_path_1
+--mkdir $ARIA_LOGDIR
+--let $restart_parameters=--loose-aria-log-file-size=8388608 --loose-aria-log-dir-path=$ARIA_LOGDIR
+--source include/restart_mysqld.inc
+
+#
+# Test that:
+# - aria_log_dir_path is set to a non-default directory.
+# - New Aria log files are created in the non-default directory.
+# - The contents of the log directory (according to "file_exists" commands)
+# is in sync with the "SHOW ENGINE aria logs" ouput.
+#
+
+# Prevent automatic purge
+SET @@global.aria_log_purge_type=external;
+
+SHOW VARIABLES LIKE 'aria_log_file_size';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+SELECT @@aria_log_dir_path;
+
+
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+--file_exists $ARIA_LOGDIR/aria_log_control
+--file_exists $ARIA_LOGDIR/aria_log.00000001
+--error 1
+--file_exists $ARIA_LOGDIR/aria_log.00000002
+--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
+SHOW ENGINE aria logs;
+
+
+CREATE TABLE t1 (id INT, txt LONGTEXT) ENGINE=Aria;
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ FOR id IN 0..9 DO
+ INSERT INTO test.t1 (id, txt) VALUES (id, REPEAT(id,1024*1024));
+ END FOR;
+END;
+$$
+DELIMITER ;$$
+
+
+SET @@global.aria_checkpoint_interval=DEFAULT /*Force checkpoint*/;
+--file_exists $ARIA_LOGDIR/aria_log_control
+--file_exists $ARIA_LOGDIR/aria_log.00000001
+--file_exists $ARIA_LOGDIR/aria_log.00000002
+--error 1
+--file_exists $ARIA_LOGDIR/aria_log.00000003
+--replace_regex /Size +[0-9]+ ; .+aria_log/aria_log/
+SHOW ENGINE aria logs;
+
+DROP TABLE t1;
+
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+--remove_file $ARIA_LOGDIR/aria_log_control
+--remove_file $ARIA_LOGDIR/aria_log.00000001
+--remove_file $ARIA_LOGDIR/aria_log.00000002
+--rmdir $ARIA_LOGDIR
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index f0a5e3ade6c..a2fb1c8cb1d 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -311,6 +311,7 @@ aria_encrypt_tables #
aria_force_start_after_recovery_failures #
aria_group_commit #
aria_group_commit_interval #
+aria_log_dir_path #
aria_log_file_size #
aria_log_purge_type #
aria_max_sort_file_size #
diff --git a/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result b/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result
new file mode 100644
index 00000000000..8563b024a75
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/aria_log_dir_path_basic.result
@@ -0,0 +1,36 @@
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SET @@GLOBAL.aria_log_dir_path=1;
+ERROR HY000: Variable 'aria_log_dir_path' is a read only variable
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SELECT @@GLOBAL.aria_log_dir_path = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+@@GLOBAL.aria_log_dir_path = VARIABLE_VALUE
+1
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+COUNT(VARIABLE_VALUE)
+1
+SELECT @@aria_log_dir_path = @@GLOBAL.aria_log_dir_path;
+@@aria_log_dir_path = @@GLOBAL.aria_log_dir_path
+1
+SELECT COUNT(@@aria_log_dir_path);
+COUNT(@@aria_log_dir_path)
+1
+SELECT COUNT(@@local.aria_log_dir_path);
+ERROR HY000: Variable 'aria_log_dir_path' is a GLOBAL variable
+SELECT COUNT(@@SESSION.aria_log_dir_path);
+ERROR HY000: Variable 'aria_log_dir_path' is a GLOBAL variable
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+COUNT(@@GLOBAL.aria_log_dir_path)
+1
+SELECT aria_log_dir_path = @@SESSION.aria_log_dir_path;
+ERROR 42S22: Unknown column 'aria_log_dir_path' in 'field list'
diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result
index 8cec099d28c..181c0de74df 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_aria.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result
@@ -85,6 +85,18 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_DIR_PATH
+SESSION_VALUE NULL
+DEFAULT_VALUE DATADIR
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the directory where to store transactional log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
SESSION_VALUE NULL
DEFAULT_VALUE 1073741824
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index fd8e66d0c18..488d2bcf5de 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -102,6 +102,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_DIR_PATH
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the directory where to store transactional log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index e60ff4c1ebf..843b9d9c8af 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -102,6 +102,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME ARIA_LOG_DIR_PATH
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Path to the directory where to store transactional log
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_LOG_FILE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
diff --git a/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test b/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test
new file mode 100644
index 00000000000..f09705e6f0d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/aria_log_dir_path_basic.test
@@ -0,0 +1,35 @@
+--source include/have_maria.inc
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.aria_log_dir_path=1;
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+
+
+SELECT @@GLOBAL.aria_log_dir_path = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+
+SELECT COUNT(VARIABLE_VALUE)
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='aria_log_dir_path';
+
+
+SELECT @@aria_log_dir_path = @@GLOBAL.aria_log_dir_path;
+
+
+SELECT COUNT(@@aria_log_dir_path);
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.aria_log_dir_path);
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.aria_log_dir_path);
+
+SELECT COUNT(@@GLOBAL.aria_log_dir_path);
+
+--Error ER_BAD_FIELD_ERROR
+SELECT aria_log_dir_path = @@SESSION.aria_log_dir_path;
diff --git a/mysql-test/suite/sys_vars/t/sysvars_aria.test b/mysql-test/suite/sys_vars/t/sysvars_aria.test
index b01e39eebf5..b042f1010f4 100644
--- a/mysql-test/suite/sys_vars/t/sysvars_aria.test
+++ b/mysql-test/suite/sys_vars/t/sysvars_aria.test
@@ -2,7 +2,11 @@
--source include/have_aria_used_for_temp_tables.inc
--source include/word_size.inc
+let datadir=`select @@datadir`;
+
--vertical_results
+
+--replace_result $datadir DATADIR
select VARIABLE_NAME, SESSION_VALUE, DEFAULT_VALUE, VARIABLE_SCOPE, VARIABLE_TYPE, VARIABLE_COMMENT, NUMERIC_MIN_VALUE, NUMERIC_MAX_VALUE, NUMERIC_BLOCK_SIZE, ENUM_VALUE_LIST, READ_ONLY, COMMAND_LINE_ARGUMENT from information_schema.system_variables
where variable_name like 'aria%'
order by variable_name;
diff --git a/sql/field.cc b/sql/field.cc
index a6bbd8c9c16..83fc694c3af 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -7558,7 +7558,8 @@ int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr) const
return field_charset()->coll->strnncollsp_nchars(field_charset(),
a_ptr, field_length,
b_ptr, field_length,
- Field_string::char_length());
+ Field_string::char_length(),
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
}
@@ -7925,10 +7926,11 @@ int Field_varstring::cmp(const uchar *a_ptr, const uchar *b_ptr) const
int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{
- /* avoid expensive well_formed_char_length if possible */
- if (prefix_len == table->field[field_index]->field_length)
+ /* avoid more expensive strnncollsp_nchars() if possible */
+ if (prefix_char_len * field_charset()->mbmaxlen ==
+ table->field[field_index]->field_length)
return Field_varstring::cmp(a_ptr, b_ptr);
size_t a_length, b_length;
@@ -7948,8 +7950,8 @@ int Field_varstring::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
a_length,
b_ptr + length_bytes,
b_length,
- prefix_len /
- field_charset()->mbmaxlen);
+ prefix_char_len,
+ 0);
}
@@ -8736,7 +8738,7 @@ int Field_blob::cmp(const uchar *a_ptr, const uchar *b_ptr) const
int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{
uchar *blob1,*blob2;
memcpy(&blob1, a_ptr+packlength, sizeof(char*));
@@ -8745,8 +8747,8 @@ int Field_blob::cmp_prefix(const uchar *a_ptr, const uchar *b_ptr,
return field_charset()->coll->strnncollsp_nchars(field_charset(),
blob1, a_len,
blob2, b_len,
- prefix_len /
- field_charset()->mbmaxlen);
+ prefix_char_len,
+ 0);
}
@@ -9942,7 +9944,7 @@ my_decimal *Field_bit::val_decimal(my_decimal *deciaml_value)
(not the table->record[0] necessarily)
*/
int Field_bit::cmp_prefix(const uchar *a, const uchar *b,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{
my_ptrdiff_t a_diff= a - ptr;
my_ptrdiff_t b_diff= b - ptr;
diff --git a/sql/field.h b/sql/field.h
index ffba863073f..99e73fcc282 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1294,7 +1294,7 @@ public:
Currently it's only used in partitioning.
*/
virtual int cmp_prefix(const uchar *a, const uchar *b,
- size_t prefix_len) const
+ size_t prefix_char_len) const
{ return cmp(a, b); }
virtual int cmp(const uchar *,const uchar *) const=0;
virtual int cmp_binary(const uchar *a,const uchar *b, uint32 max_length=~0U) const
@@ -4176,7 +4176,7 @@ public:
my_decimal *val_decimal(my_decimal *) override;
bool send(Protocol *protocol) override;
int cmp(const uchar *a,const uchar *b) const override;
- int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) const
+ int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
override;
void sort_string(uchar *buff,uint length) override;
uint get_key_image(uchar *buff, uint length,
@@ -4469,7 +4469,7 @@ public:
String *val_str(String *, String *) override;
my_decimal *val_decimal(my_decimal *) override;
int cmp(const uchar *a, const uchar *b) const override;
- int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_len) const
+ int cmp_prefix(const uchar *a, const uchar *b, size_t prefix_char_len) const
override;
int cmp(const uchar *a, uint32 a_length, const uchar *b, uint32 b_length)
const;
@@ -4954,7 +4954,7 @@ public:
int cmp_binary_offset(uint row_offset) override
{ return cmp_offset(row_offset); }
int cmp_prefix(const uchar *a, const uchar *b,
- size_t max_length) const override;
+ size_t prefix_char_length) const override;
int key_cmp(const uchar *a, const uchar *b) const override
{ return cmp_binary((uchar *) a, (uchar *) b); }
int key_cmp(const uchar *str, uint length) const override;
diff --git a/sql/key.cc b/sql/key.cc
index 79f1c55b61c..d801bcc982b 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -611,7 +611,8 @@ int key_rec_cmp(void *key_p, uchar *first_rec, uchar *second_rec)
that take the max length into account.
*/
if ((result= field->cmp_prefix(field->ptr+first_diff, field->ptr+sec_diff,
- key_part->length)))
+ key_part->length /
+ field->charset()->mbmaxlen)))
DBUG_RETURN(result);
next_loop:
key_part++;
diff --git a/sql/table.cc b/sql/table.cc
index 1c13a244afd..0bd2148bdd5 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -9013,7 +9013,7 @@ bool TABLE::check_period_overlaps(const KEY &key,
return false;
uint kp_len= key.key_part[part_nr].length;
if (f->cmp_prefix(f->ptr_in_record(lhs), f->ptr_in_record(rhs),
- kp_len) != 0)
+ kp_len / f->charset()->mbmaxlen) != 0)
return false;
}
diff --git a/storage/innobase/rem/rem0cmp.cc b/storage/innobase/rem/rem0cmp.cc
index 6c42aaa0f38..89eea764e06 100644
--- a/storage/innobase/rem/rem0cmp.cc
+++ b/storage/innobase/rem/rem0cmp.cc
@@ -291,7 +291,8 @@ static int cmp_data(ulint mtype, ulint prtype, const byte *data1, ulint len1,
if (CHARSET_INFO *cs= get_charset(dtype_get_charset_coll(prtype),
MYF(MY_WME)))
return cs->coll->strnncollsp_nchars(cs, data1, len1, data2, len2,
- std::max(len1, len2));
+ std::max(len1, len2),
+ MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES);
goto no_collation;
case DATA_VARCHAR:
case DATA_CHAR:
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 8d02ae31524..7cc60aa18c2 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -187,7 +187,7 @@ static MYSQL_SYSVAR_BOOL(page_checksum, maria_page_checksums, 0,
/* It is only command line argument */
static MYSQL_SYSVAR_CONST_STR(log_dir_path, maria_data_root,
- PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Path to the directory where to store transactional log",
NULL, NULL, mysql_real_data_home);
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 349e34f6632..3eeeff069c3 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -10283,6 +10283,8 @@ void *spider_table_bg_sts_action(
thd->mysys_var->current_cond = &thread->cond;
thd->mysys_var->current_mutex = &thread->mutex;
}
+ bool spd_wsrep_on = thd->variables.wsrep_on;
+ thd->variables.wsrep_on = false;
while (spider_init_queries[i].length && !thd->killed && !thread->killed &&
thread->init_command)
{
@@ -10296,6 +10298,7 @@ void *spider_table_bg_sts_action(
}
++i;
}
+ thd->variables.wsrep_on = spd_wsrep_on;
thd->mysys_var->current_cond = &thread->cond;
thd->mysys_var->current_mutex = &thread->mutex;
thd->client_capabilities -= CLIENT_MULTI_RESULTS;
diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c
index a8420722f25..509d44672d2 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -130,7 +130,8 @@ static int my_strnncollsp_binary(CHARSET_INFO * cs __attribute__((unused)),
static int my_strnncollsp_nchars_binary(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(slen, nchars);
set_if_smaller(tlen, nchars);
@@ -215,7 +216,8 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)),
static int my_strnncollsp_nchars_8bit_bin(CHARSET_INFO * cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(a_length, nchars);
set_if_smaller(b_length, nchars);
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 220cecbabfe..a50c570ec6b 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -212,7 +212,8 @@ static int
my_strnncollsp_nchars_simple(CHARSET_INFO * cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(a_length, nchars);
set_if_smaller(b_length, nchars);
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index e6f6ad24eec..8bc9d9e8be0 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -591,7 +591,8 @@ static int
my_strnncollsp_nchars_tis620(CHARSET_INFO * cs,
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(a_length, nchars);
set_if_smaller(b_length, nchars);
diff --git a/strings/ctype-uca.inl b/strings/ctype-uca.inl
index ddc397ce212..0bde7d60d51 100644
--- a/strings/ctype-uca.inl
+++ b/strings/ctype-uca.inl
@@ -317,6 +317,7 @@ MY_FUNCTION_NAME(strnncollsp_nopad_multilevel)(CHARSET_INFO *cs,
static inline weight_and_nchars_t
MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner,
size_t nchars,
+ uint flags,
uint *generated)
{
weight_and_nchars_t res;
@@ -330,7 +331,10 @@ MY_FUNCTION_NAME(scanner_next_pad_trim)(my_uca_scanner *scanner,
We reached the end of the string, but the caller wants more weights.
Perform space padding.
*/
- res.weight= my_space_weight(scanner->level);
+ res.weight=
+ flags & MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES ?
+ my_space_weight(scanner->level) : 0;
+
res.nchars= 1;
(*generated)++;
}
@@ -367,7 +371,8 @@ MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(CHARSET_INFO *cs,
const MY_UCA_WEIGHT_LEVEL *level,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
my_uca_scanner sscanner;
my_uca_scanner tscanner;
@@ -385,15 +390,17 @@ MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(CHARSET_INFO *cs,
int diff;
s_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&sscanner, s_nchars_left,
- &generated);
+ flags, &generated);
t_res= MY_FUNCTION_NAME(scanner_next_pad_trim)(&tscanner, t_nchars_left,
- &generated);
+ flags, &generated);
+
if ((diff= (s_res.weight - t_res.weight)))
return diff;
if (generated == 2)
{
- if (cs->state & MY_CS_NOPAD)
+ if ((cs->state & MY_CS_NOPAD) &&
+ (flags & MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES))
{
/*
Both values are auto-generated. There's no real data any more.
@@ -445,11 +452,12 @@ static int
MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
return MY_FUNCTION_NAME(strnncollsp_nchars_onelevel)(cs, &cs->uca->level[0],
s, slen, t, tlen,
- nchars);
+ nchars, flags);
}
@@ -460,7 +468,8 @@ static int
MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs,
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
uint num_level= cs->levels_for_order;
uint i;
@@ -470,7 +479,7 @@ MY_FUNCTION_NAME(strnncollsp_nchars_multilevel)(CHARSET_INFO *cs,
&cs->uca->level[i],
s, slen,
t, tlen,
- nchars);
+ nchars, flags);
if (ret)
return ret;
}
diff --git a/strings/ctype.c b/strings/ctype.c
index f18d5b61a37..f1c1ec9d7fc 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1356,7 +1356,8 @@ outp:
int my_strnncollsp_nchars_generic(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
int error;
len1= my_well_formed_length(cs, (const char *) str1,
@@ -1373,7 +1374,8 @@ int my_strnncollsp_nchars_generic(CHARSET_INFO *cs,
int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
set_if_smaller(len1, nchars);
set_if_smaller(len2, nchars);
diff --git a/strings/strcoll.inl b/strings/strcoll.inl
index 50849c06e7d..1a727e23847 100644
--- a/strings/strcoll.inl
+++ b/strings/strcoll.inl
@@ -305,7 +305,8 @@ static int
MY_FUNCTION_NAME(strnncollsp_nchars)(CHARSET_INFO *cs __attribute__((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
- size_t nchars)
+ size_t nchars,
+ uint flags)
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
diff --git a/strings/strings_def.h b/strings/strings_def.h
index ba7601f5886..f3602f390a2 100644
--- a/strings/strings_def.h
+++ b/strings/strings_def.h
@@ -108,12 +108,14 @@ static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
int my_strnncollsp_nchars_generic(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars);
+ size_t nchars,
+ uint flags);
int my_strnncollsp_nchars_generic_8bit(CHARSET_INFO *cs,
const uchar *str1, size_t len1,
const uchar *str2, size_t len2,
- size_t nchars);
+ size_t nchars,
+ uint flags);
uint my_8bit_charset_flags_from_data(CHARSET_INFO *cs);
uint my_8bit_collation_flags_from_data(CHARSET_INFO *cs);
diff --git a/unittest/strings/strings-t.c b/unittest/strings/strings-t.c
index e28e498b6bb..42b3f575623 100644
--- a/unittest/strings/strings-t.c
+++ b/unittest/strings/strings-t.c
@@ -788,9 +788,14 @@ typedef struct
LEX_CSTRING a;
LEX_CSTRING b;
size_t nchars;
+ uint flags;
int res;
} STRNNCOLLSP_CHAR_PARAM;
+#undef TCHAR
+#define TCHAR MY_STRNNCOLLSP_NCHARS_EMULATE_TRIMMED_TRAILING_SPACES
+
+#define TVCHAR 0
/*
Some lines in the below test data are marked as follows:
@@ -812,266 +817,273 @@ typedef struct
*/
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_common[]=
{
- {{CSTR("a")}, {CSTR("a")}, 0, 0},
- {{CSTR("a")}, {CSTR("a")}, 1, 0},
- {{CSTR("a")}, {CSTR("a")}, 2, 0},
- {{CSTR("a")}, {CSTR("a")}, 3, 0},
- {{CSTR("a")}, {CSTR("a")}, 100, 0},
-
- {{CSTR("a")}, {CSTR("ab")}, 0, 0},
- {{CSTR("a")}, {CSTR("ab")}, 1, 0},
- {{CSTR("a")}, {CSTR("ab")}, 2, -1},
- {{CSTR("a")}, {CSTR("ab")}, 3, -1},
- {{CSTR("a")}, {CSTR("ab")}, 100, -1},
-
- {{CSTR("a")}, {CSTR("a ")}, 0, 0},
- {{CSTR("a")}, {CSTR("a ")}, 1, 0},
- {{CSTR("a")}, {CSTR("a ")}, 2, 0},
- {{CSTR("a")}, {CSTR("a ")}, 3, 0},
- {{CSTR("a")}, {CSTR("a ")}, 100, 0},
-
- {{CSTR("a")}, {CSTR("a ")}, 0, 0},
- {{CSTR("a")}, {CSTR("a ")}, 1, 0},
- {{CSTR("a")}, {CSTR("a ")}, 2, 0},
- {{CSTR("a")}, {CSTR("a ")}, 3, 0},
- {{CSTR("a")}, {CSTR("a ")}, 100, 0},
-
- {{CSTR("ss")}, {CSTR("ss")}, 0, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 1, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 2, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 3, 0},
- {{CSTR("ss")}, {CSTR("ss")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("a")}, {CSTR("a")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 2, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 3, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a")}, 100, TCHAR, 0},
+
+ {{CSTR("a")}, {CSTR("ab")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("ab")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("ab")}, 2, TCHAR, -1},
+ {{CSTR("a")}, {CSTR("ab")}, 3, TCHAR, -1},
+ {{CSTR("a")}, {CSTR("ab")}, 100, TCHAR, -1},
+
+ {{CSTR("a")}, {CSTR("a ")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 2, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 3, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 100, TCHAR, 0},
+
+ {{CSTR("a")}, {CSTR("a ")}, 0, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 1, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 2, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 3, TCHAR, 0},
+ {{CSTR("a")}, {CSTR("a ")}, 100, TCHAR, 0},
+
+ {{CSTR("ss")}, {CSTR("ss")}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 1, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("ss")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
/* Tests for utf8, for both PAD SPACE and NOPAD collations */
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_common[]=
{
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, 0},
- {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 1, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 2, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 3, TCHAR, 0},
+ {{CSTR(UTF8_sz)}, {CSTR(UTF8_sz)}, 100, TCHAR, 0},
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
/* Tests for latin1, for both PAD and NOPAD collations */
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_xpad_common[]=
{
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, 0},
- {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 0, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 1, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 2, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 3, TCHAR, 0},
+ {{CSTR(LATIN1_sz)}, {CSTR(LATIN1_sz)}, 100, TCHAR, 0},
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
/* Tests for utf8 collations that sort "A WITH DIAERESIS" equal to "A" */
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_xpad_a_eq_auml[]=
{
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, 0},
-
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, 0},
- {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 0, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 1, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 2, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 3, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah")}, 100, TCHAR, 0},
+
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 0, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 1, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 2, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 3, TCHAR, 0},
+ {{CSTR(UTF8_auml "h")}, {CSTR("ah ")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_ci[]=
{
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 0},
-
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, TCHAR, 0},
+
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_unicode_nopad_ci[]=
{
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, 0},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, 1},
- {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, 1},
-
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, -1},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 1, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 3, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 4, TCHAR, 1},
+ {{CSTR("ss")}, {CSTR("s" "\x00" "s")}, 100, TCHAR, 1},
+
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, -1},
+
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TVCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 4, TVCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TVCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mb3_danish_ci[]=
{
- {{CSTR("aa")}, {CSTR("")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, 1},
- {{CSTR("aa")}, {CSTR("")}, 2, 1},
- {{CSTR("aa")}, {CSTR("")}, 3, 1},
- {{CSTR("aa")}, {CSTR("")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR("a")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, 0},
- {{CSTR("aa")}, {CSTR("a")}, 2, 1},
- {{CSTR("aa")}, {CSTR("a")}, 3, 1},
- {{CSTR("aa")}, {CSTR("a")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR("aa")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, 0},
- {{CSTR("aa")}, {CSTR("aa")}, 2, 0},
- {{CSTR("aa")}, {CSTR("aa")}, 3, 0},
- {{CSTR("aa")}, {CSTR("aa")}, 100, 0},
-
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, 1},
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, 1},
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, 1},
- {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, 1},
- {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, 1},
- {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, 0},
- {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, 0},
-
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, 0},
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, 1},
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, 1},
- {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, 1},
-
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, 0},
- {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, -1},
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, 0},
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, 0},
- {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("aa")}, {CSTR("")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("")}, 1, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("")}, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR("a")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("a")}, 1, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("a")}, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR("aa")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("aa")}/*CF*/, 1, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("aa")}, 2, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("aa")}, 3, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("aa")}, 100, TCHAR, 0},
+
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("\x00" "a")}/*IF*/, 1, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "a")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("\x00" "aa")}/*IF*/, 1, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}, 3, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("\x00" "aa")}, 100, TCHAR, 0},
+
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR("a" "\x00" "a")}, 1, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}/*IF*/, 2, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 3, TCHAR, 1},
+ {{CSTR("aa")}, {CSTR("a" "\x00" "a")}, 100, TCHAR, 1},
+
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 0, TCHAR, 0},
+ {{CSTR("aa")}/*CF*/, {CSTR(UTF8_ARING)}, 1, TCHAR, -1},
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 2, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 3, TCHAR, 0},
+ {{CSTR("aa")}, {CSTR(UTF8_ARING)}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_latin1_german2_ci[]=
{
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, 0},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, 0},
- {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, -1},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, -1},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, 0},
- {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(LATIN1_sz)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(LATIN1_auml " ")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_utf8mbx_german2_ci[]=
{
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, -1},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, 0},
- {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, -1},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, 0},
-
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, -1},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, 0},
- {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, 0},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 0, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 1, TCHAR, -1},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 2, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 3, TCHAR, 0},
+ {{CSTR("ss")}, {CSTR(UTF8_sz)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml)}, 100, TCHAR, 0},
+
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 0, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 1, TCHAR, -1},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 2, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 3, TCHAR, 0},
+ {{CSTR("ae")}, {CSTR(UTF8_auml " ")}, 100, TCHAR, 0},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen1_xpad_czech[]=
{
- {{CSTR("c")}, {CSTR("ch")}, 0, 0},
- {{CSTR("c")}, {CSTR("ch")}, 1, 0},
- {{CSTR("c")}, {CSTR("ch")}, 2, -1},
+ {{CSTR("c")}, {CSTR("ch")}, 0, TCHAR, 0},
+ {{CSTR("c")}, {CSTR("ch")}, 1, TCHAR, 0},
+ {{CSTR("c")}, {CSTR("ch")}, 2, TCHAR, -1},
- {{CSTR("h")}, {CSTR("ch")}, 0, 0},
- {{CSTR("h")}, {CSTR("ch")}, 1, 1},
- {{CSTR("h")}, {CSTR("ch")}, 2, -1},
+ {{CSTR("h")}, {CSTR("ch")}, 0, TCHAR, 0},
+ {{CSTR("h")}, {CSTR("ch")}, 1, TCHAR, 1},
+ {{CSTR("h")}, {CSTR("ch")}, 2, TCHAR, -1},
- {{CSTR("i")}, {CSTR("ch")}, 0, 0},
- {{CSTR("i")}, {CSTR("ch")}, 1, 1},
- {{CSTR("i")}, {CSTR("ch")}, 2, 1},
+ {{CSTR("i")}, {CSTR("ch")}, 0, TCHAR, 0},
+ {{CSTR("i")}, {CSTR("ch")}, 1, TCHAR, 1},
+ {{CSTR("i")}, {CSTR("ch")}, 2, TCHAR, 1},
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
static STRNNCOLLSP_CHAR_PARAM strnncollsp_char_mbminlen2_xpad_common[]=
{
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, 0},
-
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, 0},
-
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, 0},
-
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, 0},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, -1},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, -1},
- {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, -1},
-
- {{NULL, 0}, {NULL, 0}, 0, 0}
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 2, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 3, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a)}, 100, TCHAR, 0},
+
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 2, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 3, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp)}, 100, TCHAR, 0},
+
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 2, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 3, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_sp UCS2_sp)}, 100, TCHAR, 0},
+
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 0, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 1, TCHAR, 0},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 2, TCHAR, -1},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 3, TCHAR, -1},
+ {{CSTR(UCS2_a)}, {CSTR(UCS2_a UCS2_b)}, 100, TCHAR, -1},
+
+ {{NULL, 0}, {NULL, 0}, 0, 0, 0}
};
@@ -1083,7 +1095,7 @@ strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p)
int res= cs->coll->strnncollsp_nchars(cs,
(uchar *) p->a.str, p->a.length,
(uchar *) p->b.str, p->b.length,
- p->nchars);
+ p->nchars, p->flags);
str2hex(ahex, sizeof(ahex), p->a.str, p->a.length);
str2hex(bhex, sizeof(bhex), p->b.str, p->b.length);
diag("%-25s %-12s %-12s %3d %7d %7d%s",
@@ -1099,7 +1111,7 @@ strnncollsp_char_one(CHARSET_INFO *cs, const STRNNCOLLSP_CHAR_PARAM *p)
res= cs->coll->strnncollsp_nchars(cs,
(uchar *) p->b.str, p->b.length,
(uchar *) p->a.str, p->a.length,
- p->nchars);
+ p->nchars, p->flags);
if (!eqres(res, -p->res))
{
diag("Comparison in reverse order failed. Expected %d, got %d",