From 992d85025cf7c60038587e469e5de5ca13fcc5d3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 6 Mar 2025 10:03:04 +0100 Subject: [PATCH 1/8] cmake CMP0177 policy, no dot in the install destination path --- mysql-test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index 7487e301df5..bb467b8ec22 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA -INSTALL_MYSQL_TEST("." ".") +INSTALL_MYSQL_TEST("." "") IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) # Enable running mtr from build directory From 6aa860be27480db134a3c71065b9b47d15b72674 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 11 Mar 2025 11:22:00 +0100 Subject: [PATCH 2/8] MDEV-36268 mariadb-dump used wrong quoting character use ' not " and use quote_for_equal() --- client/mysqldump.c | 15 +++++++---- mysql-test/main/mysqldump-system.result | 6 ++--- mysql-test/main/mysqldump.result | 33 +++++++++++++++++++++++++ mysql-test/main/mysqldump.test | 9 +++++++ 4 files changed, 55 insertions(+), 8 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 1cb41b66e30..e7264c07ad9 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2098,7 +2098,7 @@ static char *quote_for_equal(const char *name, char *buff) *to++='\\'; } if (*name == '\'') - *to++= '\\'; + *to++= '\''; *to++= *name++; } to[0]= '\''; @@ -3612,7 +3612,7 @@ static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs, fprintf(sql_file, "DELIMITER ;;\n" - "/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n" + "/*!50003 SET SESSION SQL_MODE='%s' */;;\n" "/*!50003 CREATE */ ", (*show_trigger_row)[6]); @@ -4578,17 +4578,19 @@ static int dump_all_users_roles_and_grants() return 1; while ((row= mysql_fetch_row(tableres))) { + char buf[200]; if (opt_replace_into) /* Protection against removing the current import user */ /* MySQL-8.0 export capability */ fprintf(md_result_file, "DELIMITER |\n" - "/*M!100101 IF current_user()=\"%s\" THEN\n" + "/*M!100101 IF current_user()=%s THEN\n" " SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001," " MESSAGE_TEXT=\"Don't remove current user %s'\";\n" "END IF */|\n" "DELIMITER ;\n" - "/*!50701 DROP USER IF EXISTS %s */;\n", row[0], row[0], row[0]); + "/*!50701 DROP USER IF EXISTS %s */;\n", + quote_for_equal(row[0],buf), row[0], row[0]); if (dump_create_user(row[0])) result= 1; /* if roles exist, defer dumping grants until after roles created */ @@ -6698,6 +6700,7 @@ static my_bool get_view_structure(char *table, char* db) char *result_table, *opt_quoted_table; char table_buff[NAME_LEN*2+3]; char table_buff2[NAME_LEN*2+3]; + char temp_buff[NAME_LEN*2 + 3], temp_buff2[NAME_LEN*2 + 3]; char query[QUERY_LENGTH]; FILE *sql_file= md_result_file; DBUG_ENTER("get_view_structure"); @@ -6758,7 +6761,9 @@ static my_bool get_view_structure(char *table, char* db) "SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE, " " CHARACTER_SET_CLIENT, COLLATION_CONNECTION " "FROM information_schema.views " - "WHERE table_name=\"%s\" AND table_schema=\"%s\"", table, db); + "WHERE table_name=%s AND table_schema=%s", + quote_for_equal(table, temp_buff2), + quote_for_equal(db, temp_buff)); if (mysql_query(mysql, query)) { diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result index e011132b0f9..14cbc7eb5c0 100644 --- a/mysql-test/main/mysqldump-system.result +++ b/mysql-test/main/mysqldump-system.result @@ -176,21 +176,21 @@ UNLOCK TABLES; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DELIMITER | -/*M!100101 IF current_user()="'mariadb.sys'@'localhost'" THEN +/*M!100101 IF current_user()='''mariadb.sys''@''localhost''' THEN SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'mariadb.sys'@'localhost''"; END IF */| DELIMITER ; /*!50701 DROP USER IF EXISTS 'mariadb.sys'@'localhost' */; CREATE /*M!100103 OR REPLACE */ USER `mariadb.sys`@`localhost` PASSWORD EXPIRE; DELIMITER | -/*M!100101 IF current_user()="'root'@'localhost'" THEN +/*M!100101 IF current_user()='''root''@''localhost''' THEN SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'root'@'localhost''"; END IF */| DELIMITER ; /*!50701 DROP USER IF EXISTS 'root'@'localhost' */; CREATE /*M!100103 OR REPLACE */ USER `root`@`localhost`; DELIMITER | -/*M!100101 IF current_user()="'USER'@'%'" THEN +/*M!100101 IF current_user()='''USER''@''%''' THEN SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'USER'@'%''"; END IF */| DELIMITER ; diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result index 93e0f9ee89c..8e8e342d833 100644 --- a/mysql-test/main/mysqldump.result +++ b/mysql-test/main/mysqldump.result @@ -6590,4 +6590,37 @@ CREATE TABLE `t1` ( /*!40101 SET character_set_client = @saved_cs_client */; ERROR at line 9: Not allowed in the sandbox mode drop table t1; +# +# MDEV-36268 mariadb-dump used wrong quoting character +# +create table t1 (a int); +create view `v'1"2` as select * from t1 with check option; +/*M!999999\- enable the sandbox mode */ +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; +/*!40101 SET character_set_client = @saved_cs_client */; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8mb4; +/*!50001 CREATE VIEW `v'1"2` AS SELECT + 1 AS `a` */; +SET character_set_client = @saved_cs_client; +/*!50001 DROP VIEW IF EXISTS `v'1"2`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8 */; +/*!50001 SET character_set_results = utf8 */; +/*!50001 SET collation_connection = utf8_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ +/*!50001 VIEW `v'1"2` AS select `t1`.`a` AS `a` from `t1` */ +/*!50002 WITH CASCADED CHECK OPTION */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +drop view `v'1"2`; +drop table t1; # End of 10.5 tests diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test index 00569a9db7a..58790c15fd2 100644 --- a/mysql-test/main/mysqldump.test +++ b/mysql-test/main/mysqldump.test @@ -3023,4 +3023,13 @@ EOF --remove_file $MYSQLTEST_VARDIR/tmp/mdev33727.sql drop table t1; +--echo # +--echo # MDEV-36268 mariadb-dump used wrong quoting character +--echo # +create table t1 (a int); +create view `v'1"2` as select * from t1 with check option; # "' +--exec $MYSQL_DUMP --compact test +drop view `v'1"2`; # "' +drop table t1; + --echo # End of 10.5 tests From 1cc138958e312e4b252691a97f9ee2eafec0de1f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 16 Mar 2025 11:26:30 +0100 Subject: [PATCH 3/8] MDEV-35727 main.mysql-interactive fails in buildbot on debian fix failing main.mysql-interactive * increase socat EOF timeout from 0.5s to 10s * add an explicit exit to not wait 10s (or even 0.5s - the test now finishes in 0.15s) * enable it for libedit --- mysql-test/main/mysql-interactive.result | 4 +++- mysql-test/main/mysql-interactive.test | 11 ++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/mysql-test/main/mysql-interactive.result b/mysql-test/main/mysql-interactive.result index a18c018b932..cdb0931418a 100644 --- a/mysql-test/main/mysql-interactive.result +++ b/mysql-test/main/mysql-interactive.result @@ -4,6 +4,7 @@ delimiter $ select 1; $ +exit Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is X Server version: Y @@ -21,4 +22,5 @@ MariaDB [(none)]> select 1; +---+ 1 row in set -MariaDB [(none)]> \ No newline at end of file +MariaDB [(none)]> exit +Bye diff --git a/mysql-test/main/mysql-interactive.test b/mysql-test/main/mysql-interactive.test index 0051d8e58c6..e387f937226 100644 --- a/mysql-test/main/mysql-interactive.test +++ b/mysql-test/main/mysql-interactive.test @@ -6,23 +6,16 @@ source include/not_windows.inc; # this would need an instrumented ncurses library source include/not_msan.inc; -error 0,1; -exec $MYSQL -V|grep -q readline; -if ($sys_errno == 1) -{ - # strangely enough - skip does not work with libedit; -} - write_file $MYSQL_TMP_DIR/mysql_in; delimiter $ select 1; $ +exit EOF let TERM=dumb; replace_regex /id is \d+/id is X/ /Server version: .*/Server version: Y/ / \(\d+\.\d+ sec\)//; error 0,127; -exec socat EXEC:"$MYSQL",pty STDIO < $MYSQL_TMP_DIR/mysql_in; +exec socat -t10 EXEC:"$MYSQL",pty STDIO < $MYSQL_TMP_DIR/mysql_in; if ($sys_errno == 127) { remove_file $MYSQL_TMP_DIR/mysql_in; From bca07a6f88db9278d00eb460c8c1a79f05e867cd Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 21 Mar 2025 16:59:34 +0100 Subject: [PATCH 4/8] cleanup: mysql_upgrade.test make it strict, don't just ignore all the pesky numbers it shows, replace the current mariadb version with X.Y.Z, replace first two components of the current version with X.Y replace the first component (or first-1, if the second is 0) with X fix perl to write mysql_upgrade_info files in binary mode, otherwise mariadb-upgrade reads them incorrectly on Windows. --- mysql-test/main/mysql_upgrade.result | 23 ++++++++++++----------- mysql-test/main/mysql_upgrade.test | 25 +++++++++++++++++-------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result index bc33cc75cfa..8c3d7354604 100644 --- a/mysql-test/main/mysql_upgrade.result +++ b/mysql-test/main/mysql_upgrade.result @@ -47,7 +47,8 @@ test Phase 7/7: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed -This installation of MariaDB is already upgraded to VERSION.There is no need to run mysql_upgrade again for VERSION. +This installation of MariaDB is already upgraded to X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. You can use --force if you still want to run mysql_upgrade Force should run it regardless of whether it has been run before Phase 1/7: Checking and upgrading mysql database @@ -776,11 +777,11 @@ FLUSH PRIVILEGES; # # MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed # -This installation of MariaDB is already upgraded to MariaDB . -There is no need to run mysql_upgrade again for MariaDB . +This installation of MariaDB is already upgraded to X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. Looking for 'mariadb' as: mariadb -This installation of MariaDB is already upgraded to MariaDB . -There is no need to run mysql_upgrade again for MariaDB . +This installation of MariaDB is already upgraded to X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. # # MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it # @@ -790,17 +791,17 @@ Empty or non existent ...mysql_upgrade_info. Assuming mysql_upgrade has to be ru # MDEV-27279: mariadb_upgrade check-if-upgrade with minor version change # Looking for 'mariadb' as: mariadb -This installation of MariaDB is already upgraded to MariaDB . -There is no need to run mysql_upgrade again for MariaDB . -This installation of MariaDB is already upgraded to MariaDB . -There is no need to run mysql_upgrade again for MariaDB . +This installation of MariaDB is already upgraded to X.Y.0-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. +This installation of MariaDB is already upgraded to X.Y.0-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. You can use --force if you still want to run mysql_upgrade # # MDEV-27279: mariadb_upgrade check-if-upgrade with major version change # -Major version upgrade detected from MariaDB to MariaDB . Check required! +Major version upgrade detected from X.0.99 to X.Y.Z-MariaDB. Check required! Looking for 'mysql' as: mysql -Major version upgrade detected from MariaDB to MariaDB . Check required! +Major version upgrade detected from X.0.99 to X.Y.Z-MariaDB. Check required! drop table mysql.global_priv; rename table mysql.global_priv_bak to mysql.global_priv; # End of 10.2 tests diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test index 647106facf1..1a7b6ac85f3 100644 --- a/mysql-test/main/mysql_upgrade.test +++ b/mysql-test/main/mysql_upgrade.test @@ -4,6 +4,10 @@ -- source include/have_partition.inc -- source include/no_valgrind_without_big.inc +let majorminor=`select substring_index(version(), '.', 2)`; +# for major upgrade test, see below +let major=`select substring_index(version(), '.', 1) - (version() like '%.0.%')`; + set sql_mode=""; # @@ -18,7 +22,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; file_exists $MYSQLD_DATADIR/mysql_upgrade_info; --echo Run it again - should say already completed ---replace_regex /upgraded to [^\n].*/upgraded to VERSION./ /again for [^\n]*/again for VERSION./ +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB --exec $MYSQL_UPGRADE 2>&1 # It should have created a file in the MySQL Servers datadir @@ -288,10 +292,11 @@ FLUSH PRIVILEGES; --error 1 --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent ---replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB --error 1 --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed ---replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/ +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB +--replace_regex /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/ --error 1 --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose @@ -319,16 +324,18 @@ perl; my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set"; $ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.$2.0$4/; open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file"; + binmode FILE; print FILE "$ver\n"; close(FILE); EOF --error 1 --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent ---replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/ +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $majorminor X.Y +--replace_regex /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/ --error 1 --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose ---replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $majorminor X.Y --exec $MYSQL_UPGRADE --remove_file $MYSQLD_DATADIR/mysql_upgrade_info @@ -343,16 +350,18 @@ let DATADIR= $MYSQLD_DATADIR; perl; my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set"; my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set"; - $ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.0.$3$4/; + $ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.0.99/; open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file"; + binmode FILE; print FILE "$ver\n"; close(FILE); EOF --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --silent ---replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $major X --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed ---replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mysql' as: mysql/ +--replace_result $MYSQL_SERVER_VERSION X.Y.Z-MariaDB $major X +--replace_regex /'mariadb.* as:[^\n]*/'mysql' as: mysql/ --exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose --remove_file $MYSQLD_DATADIR/mysql_upgrade_info drop table mysql.global_priv; From 04771ff6b1dae3ea1c35029744cfbbf2b6da4538 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 21 Mar 2025 17:52:43 +0100 Subject: [PATCH 5/8] MDEV-28209 New mysql_upgrade message on minor-only upgrades is confusing --- client/mysql_upgrade.c | 14 +++++++++----- mysql-test/main/mysql_upgrade.result | 10 +++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index f81cff2797c..3afe24e2dd7 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -855,8 +855,7 @@ static int upgrade_already_done(int silent) s= strchr(version, '.'); s= strchr(s + 1, '.'); - if (strncmp(upgrade_from_version, version, - (size_t)(s - version + 1))) + if (strncmp(upgrade_from_version, version, (size_t)(s - version + 1))) { if (calc_server_version(upgrade_from_version) <= MYSQL_VERSION_ID) { @@ -870,9 +869,14 @@ static int upgrade_already_done(int silent) } if (!silent) { - verbose("This installation of MariaDB is already upgraded to %s.\n" - "There is no need to run mysql_upgrade again for %s.", - upgrade_from_version, version); + if (strcmp(upgrade_from_version, version)) + verbose("This installation of MariaDB is already upgraded to %s.\n" + "There is no need to run mysql_upgrade again for %s, because " + "they're both %.*s.", + upgrade_from_version, version, (int)(s - version), version); + else + verbose("This installation of MariaDB is already upgraded to %s.\n" + "There is no need to run mysql_upgrade again.", version); if (!opt_check_upgrade) verbose("You can use --force if you still want to run mysql_upgrade"); } diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result index 8c3d7354604..33f1df35feb 100644 --- a/mysql-test/main/mysql_upgrade.result +++ b/mysql-test/main/mysql_upgrade.result @@ -48,7 +48,7 @@ Phase 7/7: Running 'FLUSH PRIVILEGES' OK Run it again - should say already completed This installation of MariaDB is already upgraded to X.Y.Z-MariaDB. -There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again. You can use --force if you still want to run mysql_upgrade Force should run it regardless of whether it has been run before Phase 1/7: Checking and upgrading mysql database @@ -778,10 +778,10 @@ FLUSH PRIVILEGES; # MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed # This installation of MariaDB is already upgraded to X.Y.Z-MariaDB. -There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again. Looking for 'mariadb' as: mariadb This installation of MariaDB is already upgraded to X.Y.Z-MariaDB. -There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again. # # MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it # @@ -792,9 +792,9 @@ Empty or non existent ...mysql_upgrade_info. Assuming mysql_upgrade has to be ru # Looking for 'mariadb' as: mariadb This installation of MariaDB is already upgraded to X.Y.0-MariaDB. -There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB, because they're both X.Y. This installation of MariaDB is already upgraded to X.Y.0-MariaDB. -There is no need to run mysql_upgrade again for X.Y.Z-MariaDB. +There is no need to run mysql_upgrade again for X.Y.Z-MariaDB, because they're both X.Y. You can use --force if you still want to run mysql_upgrade # # MDEV-27279: mariadb_upgrade check-if-upgrade with major version change From bc13c8e4ae3cf8335f569dc0cff11d655e136f86 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 26 Mar 2025 12:32:34 +0100 Subject: [PATCH 6/8] MDEV-36078 PCRE2 10.45 breaks main.func_regexp_pcre due to change in PCRE 10.45 is correct, update test results to match. allow builds with <10.45 too (for old distros) but remove the buggy test --- cmake/pcre.cmake | 4 ++-- mysql-test/main/func_regexp_pcre.result | 28 +------------------------ mysql-test/main/func_regexp_pcre.test | 2 +- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake index db685c3572d..3d84fd145f6 100644 --- a/cmake/pcre.cmake +++ b/cmake/pcre.cmake @@ -54,8 +54,8 @@ MACRO(BUNDLE_PCRE2) ExternalProject_Add( pcre2 PREFIX "${dir}" - URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.zip" - URL_MD5 dfab8313154b3377a6959c3b6377841e + URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.45/pcre2-10.45.zip" + URL_MD5 873da56c6469ec207ca5c5ae9688b83a INSTALL_COMMAND "" CMAKE_ARGS "-DCMAKE_WARN_DEPRECATED=FALSE" diff --git a/mysql-test/main/func_regexp_pcre.result b/mysql-test/main/func_regexp_pcre.result index 57490009be3..d9254008378 100644 --- a/mysql-test/main/func_regexp_pcre.result +++ b/mysql-test/main/func_regexp_pcre.result @@ -60,7 +60,7 @@ INSERT INTO t1 VALUES ('1'),('௨'); INSERT INTO t2 VALUES ('\\p{Cyrillic}'),('\\p{Greek}'),('\\p{Latin}'); INSERT INTO t2 VALUES ('\\p{Han}'),('\\p{Hangul}'); INSERT INTO t2 VALUES ('\\p{Sinhala}'), ('\\p{Tamil}'); -INSERT INTO t2 VALUES ('\\p{L}'),('\\p{Ll}'),('\\p{Lu}'),('\\p{L&}'); +INSERT INTO t2 VALUES ('\\p{L}'), /* buggy before v10.45 ('\\p{Ll}'),('\\p{Lu}'),*/ ('\\p{L&}'); INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]'); SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY class, BINARY ch; class ch ch RLIKE class @@ -168,32 +168,6 @@ class ch ch RLIKE class \p{Latin} ප 0 \p{Latin} 㐗 0 \p{Latin} 갷 0 -\p{Ll} 1 0 -\p{Ll} A 0 -\p{Ll} a 1 -\p{Ll} À 0 -\p{Ll} à 1 -\p{Ll} Σ 0 -\p{Ll} σ 1 -\p{Ll} Я 0 -\p{Ll} я 1 -\p{Ll} ௨ 0 -\p{Ll} ප 0 -\p{Ll} 㐗 0 -\p{Ll} 갷 0 -\p{Lu} 1 0 -\p{Lu} A 1 -\p{Lu} a 0 -\p{Lu} À 1 -\p{Lu} à 0 -\p{Lu} Σ 1 -\p{Lu} σ 0 -\p{Lu} Я 1 -\p{Lu} я 0 -\p{Lu} ௨ 0 -\p{Lu} ප 0 -\p{Lu} 㐗 0 -\p{Lu} 갷 0 \p{L} 1 0 \p{L} A 1 \p{L} a 1 diff --git a/mysql-test/main/func_regexp_pcre.test b/mysql-test/main/func_regexp_pcre.test index c194e9aefd0..88baee071d1 100644 --- a/mysql-test/main/func_regexp_pcre.test +++ b/mysql-test/main/func_regexp_pcre.test @@ -41,7 +41,7 @@ INSERT INTO t1 VALUES ('1'),('௨'); INSERT INTO t2 VALUES ('\\p{Cyrillic}'),('\\p{Greek}'),('\\p{Latin}'); INSERT INTO t2 VALUES ('\\p{Han}'),('\\p{Hangul}'); INSERT INTO t2 VALUES ('\\p{Sinhala}'), ('\\p{Tamil}'); -INSERT INTO t2 VALUES ('\\p{L}'),('\\p{Ll}'),('\\p{Lu}'),('\\p{L&}'); +INSERT INTO t2 VALUES ('\\p{L}'), /* buggy before v10.45 ('\\p{Ll}'),('\\p{Lu}'),*/ ('\\p{L&}'); INSERT INTO t2 VALUES ('[[:alpha:]]'),('[[:digit:]]'); SELECT class, ch, ch RLIKE class FROM t1, t2 ORDER BY class, BINARY ch; DROP TABLE t1, t2; From da20e4d8a57f0fd957edcaa50299173ccc8cac86 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 26 Mar 2025 22:44:42 +0100 Subject: [PATCH 7/8] Fix PCRE2 10.45 build on Windows as an external project PCRE2 10.45 sets cmake_minimum_required to version 3.15. With that, on MSVC, compile flags for choosing C runtime (/MT, /MD, etc.) are ignored. Instead, CMAKE_MSVC_RUNTIME_LIBRARY must be passed when building an external project for consistent linkage, if it creates a static library. --- cmake/os/Windows.cmake | 19 +++++++++++++++++++ cmake/pcre.cmake | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 1a853349ae5..5edc214d613 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -129,6 +129,25 @@ IF(MSVC) MESSAGE(FATAL_ERROR "Invalid value ${MSVC_CRT_TYPE} for MSVC_CRT_TYPE, choose one of /MT,/MTd,/MD,/MDd ") ENDIF() + # CMake version 3.15 and later uses CMAKE_MSVC_RUNTIME_LIBRARY + # variable for our MSVC_CRT_TYPE. + # Set CMAKE_MSVC_RUNTIME_LIBRARY and pass to external projects + # it is important to keep the same CRT type when linking + # + # Translation rules MSVC_CRT_TYPE -> CMAKE_MSVC_RUNTIME_LIBRARY + # /MT -> MultiThreaded + # /MTd -> MultiThreadedDebug + # /MD -> MultiThreadedDLL + # /MDd -> MultiThreadedDebugDLL + + SET(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded) + IF(MSVC_CRT_TYPE MATCHES "d$") + STRING(APPEND CMAKE_MSVC_RUNTIME_LIBRARY Debug) + ENDIF() + IF(MSVC_CRT_TYPE MATCHES "D") + STRING(APPEND CMAKE_MSVC_RUNTIME_LIBRARY DLL) + ENDIF() + IF(MSVC_CRT_TYPE MATCHES "/MD") # Dynamic runtime (DLLs), need to install CRT libraries. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT VCCRT) diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake index 3d84fd145f6..c203444ee04 100644 --- a/cmake/pcre.cmake +++ b/cmake/pcre.cmake @@ -51,6 +51,13 @@ MACRO(BUNDLE_PCRE2) ENDIF() ENDFOREACH() + IF(CMAKE_MSVC_RUNTIME_LIBRARY) + SET(CMAKE_MSVC_RUNTIME_LIBRARY_ARG + "-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}") + ELSE() + SET(CMAKE_MSVC_RUNTIME_LIBRARY_ARG) + ENDIF() + ExternalProject_Add( pcre2 PREFIX "${dir}" @@ -69,6 +76,7 @@ MACRO(BUNDLE_PCRE2) "-DCMAKE_C_FLAGS_RELEASE=${pcre2_flags_RELEASE}" "-DCMAKE_C_FLAGS_MINSIZEREL=${pcre2_flags_MINSIZEREL}" "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}" + ${CMAKE_MSVC_RUNTIME_LIBRARY_ARG} ${stdlibs} ${byproducts} ) From 402595f138db92a3bf7e67f30e24f682e6c3ca82 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 31 Mar 2025 11:10:12 +0200 Subject: [PATCH 8/8] fix main.timezone test for DST --- mysql-test/main/timezone.result | 1 - mysql-test/main/timezone.test | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/mysql-test/main/timezone.result b/mysql-test/main/timezone.result index 67252038e72..3c3df8755c3 100644 --- a/mysql-test/main/timezone.result +++ b/mysql-test/main/timezone.result @@ -1,4 +1,3 @@ -DROP TABLE IF EXISTS t1; show variables like "system_time_zone"; Variable_name Value system_time_zone CET diff --git a/mysql-test/main/timezone.test b/mysql-test/main/timezone.test index cdc538540ba..91b4c83033e 100644 --- a/mysql-test/main/timezone.test +++ b/mysql-test/main/timezone.test @@ -7,13 +7,8 @@ disable_query_log; select FROM_UNIXTIME(24*3600); enable_query_log; -# Initialization ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - # The following is because of daylight saving time ---replace_result MEST CET MET CET +--replace_result MEST CET MET CET CEST CET show variables like "system_time_zone"; #