[Commits] cb5952b5060: Merge branch '10.0' into bb-10.1-merge-sanja
revision-id: cb5952b5060d089c021808fe1f1cf13f7eb88423 (mariadb-10.1.34-30-gcb5952b5060) parent(s): 57cde8ccd19675dc98e3cbacf0ef5c72cb188e49 9fbe360e9f7d41d169eb5abed22dc15f26f6c749 author: Oleksandr Byelkin committer: Oleksandr Byelkin timestamp: 2018-07-25 22:24:40 +0200 message: Merge branch '10.0' into bb-10.1-merge-sanja CMakeLists.txt | 6 ++ cmake/install_macros.cmake | 9 ++ cmake/mysql_add_executable.cmake | 3 + include/m_ctype.h | 28 +++--- mysql-test/include/ctype_mdev13118.inc | 15 ++++ mysql-test/r/ctype_binary.result | 23 +++++ mysql-test/r/ctype_eucjpms.result | 23 +++++ mysql-test/r/ctype_euckr.result | 29 ++++++ mysql-test/r/ctype_gbk.result | 23 +++++ mysql-test/r/ctype_latin1.result | 23 +++++ mysql-test/r/ctype_ucs.result | 23 +++++ mysql-test/r/ctype_ujis.result | 23 +++++ mysql-test/r/ctype_utf16.result | 23 +++++ mysql-test/r/ctype_utf16le.result | 29 ++++++ mysql-test/r/ctype_utf32.result | 23 +++++ mysql-test/r/ctype_utf8.result | 23 +++++ mysql-test/r/ctype_utf8mb4.result | 23 +++++ mysql-test/r/join_outer.result | 50 +++++++++++ mysql-test/r/join_outer_jcl6.result | 50 +++++++++++ mysql-test/r/rename.result | 4 + mysql-test/r/subselect_mat_cost_bugs.result | 2 +- mysql-test/suite/parts/r/truncate_locked.result | 7 ++ mysql-test/suite/parts/t/truncate_locked.test | 10 +++ mysql-test/suite/plugins/r/processlist.result | 4 +- mysql-test/suite/plugins/t/processlist.test | 8 +- mysql-test/t/bootstrap.test | 9 ++ mysql-test/t/ctype_binary.test | 3 + mysql-test/t/ctype_eucjpms.test | 2 + mysql-test/t/ctype_euckr.test | 11 +++ mysql-test/t/ctype_gbk.test | 3 + mysql-test/t/ctype_latin1.test | 3 + mysql-test/t/ctype_ucs.test | 4 + mysql-test/t/ctype_ujis.test | 4 + mysql-test/t/ctype_utf16.test | 5 ++ mysql-test/t/ctype_utf16le.test | 13 +++ mysql-test/t/ctype_utf32.test | 8 ++ mysql-test/t/ctype_utf8.test | 7 ++ mysql-test/t/ctype_utf8mb4.test | 8 ++ mysql-test/t/join_outer.test | 48 ++++++++++ mysql-test/t/rename.test | 7 ++ mysys/my_rename.c | 5 +- scripts/CMakeLists.txt | 2 + scripts/mysql_install_db.pl.in | 2 +- scripts/mysql_install_db.sh | 2 +- scripts/mysql_system_tables_fix.sql | 50 ++++++----- scripts/mysqld_multi.sh | 2 +- sql/item_strfunc.cc | 112 ++++++++++++------------ sql/share/CMakeLists.txt | 12 +-- sql/sql_select.cc | 4 +- sql/sql_table.cc | 2 + sql/sql_truncate.cc | 3 +- sql/tztime.cc | 2 +- storage/connect/filamvct.cpp | 5 -- strings/ctype-bin.c | 8 +- strings/ctype-euc_kr.c | 4 +- strings/ctype-mb.c | 100 +++------------------ strings/ctype-simple.c | 22 +++-- strings/ctype-ucs2.c | 78 +++++++++-------- strings/ctype-ujis.c | 8 +- strings/ctype-utf8.c | 20 +++-- support-files/CMakeLists.txt | 2 + 61 files changed, 799 insertions(+), 265 deletions(-) diff --cc CMakeLists.txt index 8d2efac89cb,5a9ec265de0..0b48ca20485 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@@ -177,11 -163,47 +177,17 @@@ IF(UNIX OPTION(WITH_VALGRIND "Valgrind instrumentation" OFF) ENDIF() OPTION (WITH_UNIT_TESTS "Compile MySQL with unit tests" ON) -MARK_AS_ADVANCED(CYBOZU BACKUP_TEST WITHOUT_SERVER DISABLE_SHARED) +MARK_AS_ADVANCED(CYBOZU) + IF (WITHOUT_SERVER) + SET (SKIP_COMPONENTS "Server|IniFiles|SuportFiles|Readme") + ELSE() + SET (SKIP_COMPONENTS "N-O-N-E") + ENDIF() + OPTION(NOT_FOR_DISTRIBUTION "Allow linking with GPLv2-incompatible system libraries. Only set it you never plan to distribute the resulting binaries" OFF) -include(CheckCSourceCompiles) -include(CheckCXXSourceCompiles) -# We need some extra FAIL_REGEX patterns -# Note that CHECK_C_SOURCE_COMPILES is a misnomer, it will also link. -MACRO (MY_CHECK_C_COMPILER_FLAG FLAG RESULT) - SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") - CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} - FAIL_REGEX "argument unused during compilation" - FAIL_REGEX "unsupported .*option" - FAIL_REGEX "unknown .*option" - FAIL_REGEX "unrecognized .*option" - FAIL_REGEX "ignoring unknown option" - FAIL_REGEX "[Ww]arning: [Oo]ption" - ) - SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") -ENDMACRO() - -MACRO (MY_CHECK_CXX_COMPILER_FLAG FLAG RESULT) - SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") - SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}") - CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} - FAIL_REGEX "argument unused during compilation" - FAIL_REGEX "unsupported .*option" - FAIL_REGEX "unknown .*option" - FAIL_REGEX "unrecognized .*option" - FAIL_REGEX "ignoring unknown option" - FAIL_REGEX "[Ww]arning: [Oo]ption" - ) - SET(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") -ENDMACRO() +INCLUDE(check_compiler_flag) OPTION(WITH_ASAN "Enable address sanitizer" OFF) IF (WITH_ASAN) diff --cc cmake/install_macros.cmake index 121825f8f3c,ff4ba593415..b0263e63b7a --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@@ -114,7 -115,17 +114,12 @@@ FUNCTION(INSTALL_SCRIPT SET(COMP) ENDIF() + IF (COMP MATCHES ${SKIP_COMPONENTS}) + RETURN() + ENDIF() + - INSTALL(FILES - ${script} - DESTINATION ${ARG_DESTINATION} - PERMISSIONS OWNER_READ OWNER_WRITE - OWNER_EXECUTE GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE ${COMP} - ) + INSTALL(PROGRAMS ${script} DESTINATION ${ARG_DESTINATION} ${COMP}) ++ INSTALL_MANPAGE(${script}) ENDFUNCTION() diff --cc include/m_ctype.h index ddb4c825e1b,eb2d760359b..74dd2a29984 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@@ -369,35 -365,8 +369,35 @@@ typedef int (*my_charset_conv_mb_wc)(CH typedef int (*my_charset_conv_wc_mb)(CHARSET_INFO *, my_wc_t, uchar *, uchar *); typedef size_t (*my_charset_conv_case)(CHARSET_INFO *, - char *, size_t, char *, size_t); + const char *, size_t, char *, size_t); +/* + A structure to return the statistics of a native string copying, + when no Unicode conversion is involved. + + The stucture is OK to be unitialized before calling a copying routine. + A copying routine must populate the structure as follows: + - m_source_end_pos must be set by to a non-NULL value + in the range of the input string. + - m_well_formed_error_pos must be set to NULL if the string was + well formed, or to the position of the leftmost bad byte sequence. +*/ +typedef struct +{ + const char *m_source_end_pos; /* Position where reading stopped */ + const char *m_well_formed_error_pos; /* Position where a bad byte was found*/ +} MY_STRCOPY_STATUS; + + +/* + A structure to return the statistics of a Unicode string conversion. +*/ +typedef struct +{ + MY_STRCOPY_STATUS m_native_copy_status; + const char *m_cannot_convert_error_pos; +} MY_STRCONV_STATUS; + /* See strings/CHARSET_INFO.txt about information on this structure */ struct my_charset_handler_st diff --cc mysql-test/r/ctype_binary.result index 512368a2d26,b28d9040547..627ba8a35a5 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@@ -3047,6 -3022,29 +3047,29 @@@ DROP TABLE t1 SELECT _binary 0x7E, _binary X'7E', _binary B'01111110'; _binary 0x7E _binary X'7E' _binary B'01111110' ~ ~ ~ + SET NAMES utf8, character_set_connection=binary; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varbinary(10) NOT NULL DEFAULT '' ++ `t` varbinary(10) NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + abcdefghi-abcdefghi + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_eucjpms.result index f9cb4f1eecc,1e2312638c9..160c4758122 --- a/mysql-test/r/ctype_eucjpms.result +++ b/mysql-test/r/ctype_eucjpms.result @@@ -33868,6 -33636,29 +33868,29 @@@ HEX(a) CHAR_LENGTH(a DROP TABLE t1; SELECT _eucjpms 0x8EA0; ERROR HY000: Invalid eucjpms character string: '8EA0' + SET NAMES eucjpms; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET eucjpms NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET eucjpms NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_euckr.result index 90353c6af2a,cea93b0c808..a23ced76df9 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@@ -25428,3 -25274,32 +25428,32 @@@ A1A1A1A1A1A1202020202020202020202020202 # # End of 5.6 tests # + # + # Start of 10.0 tests + # + SET NAMES utf8, character_set_connection=euckr; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET euckr NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET euckr NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; + # + # End of 10.0 tests + # diff --cc mysql-test/r/ctype_gbk.result index d10d5f4bf75,15f9bc6bfea..ac8de1e229c --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@@ -5099,6 -4943,29 +5099,29 @@@ E05C5 E05B DROP TABLE t1; # Start of ctype_E05C.inc + SET NAMES utf8, character_set_connection=gbk; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET gbk NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET gbk NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # MDEV-9886 Illegal mix of collations with a view comparing a field to a binary constant # diff --cc mysql-test/r/ctype_latin1.result index 66c5a37750d,8913c8082c8..3b9b2633480 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@@ -7989,6 -7939,29 +7989,29 @@@ 0 DROP VIEW v1; DROP TABLE t1; + SET NAMES latin1; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) NOT NULL DEFAULT '' ++ `t` varchar(10) NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_ucs.result index 55caabbaa12,58fd308c7e2..9c598780edf --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@@ -5705,6 -5629,29 +5705,29 @@@ c YWJjZGVmZ2hp-YWJjZGVmZ2hp DROP TABLE t1; SET optimizer_switch=@save_optimizer_switch; + SET NAMES utf8, character_set_connection=ucs2; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET ucs2 NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_ujis.result index 61541ec7678,d4589f62ae5..9146356b5f9 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@@ -26173,6 -25942,29 +26173,29 @@@ HEX(a) CHAR_LENGTH(a DROP TABLE t1; SELECT _ujis 0x8EA0; ERROR HY000: Invalid ujis character string: '8EA0' + SET NAMES ujis; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET ujis NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET ujis NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_utf16.result index c8ba1fedab8,e182432faec..ba72a859351 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@@ -2138,6 -2134,29 +2138,29 @@@ EXECUTE stmt USING @arg00 CONCAT(_utf16'a' COLLATE utf16_unicode_ci, ?) aÿ DEALLOCATE PREPARE stmt; + SET NAMES utf8, character_set_connection=utf16; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET utf16 NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET utf16 NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_utf16le.result index 93fce843dc8,f6a4d351ad4..c7c8c210014 --- a/mysql-test/r/ctype_utf16le.result +++ b/mysql-test/r/ctype_utf16le.result @@@ -2324,72 -2320,31 +2324,101 @@@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFF # End of 5.6 tests # # + # Start of 10.0 tests + # + SET NAMES utf8, character_set_connection=utf16le; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET utf16le NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET utf16le NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; + # + # Start of 10.0 tests + # ++# +# Start of 10.1 tests +# +# +# MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +# +CREATE TABLE t1 ( +id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +a VARCHAR(10) CHARACTER SET utf16le, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (_utf8mb4 0x61); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +id HEX(a) +1 6100 +2 8000 +3 FF07 +4 0008 +6 00D800DC +7 FFDBFFDF +5 FFFF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +5 FFFF +7 FFDBFFDF +6 00D800DC +4 0008 +3 FF07 +2 8000 +1 6100 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +6 +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16le COLLATE utf16le_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +id HEX(a) +1 6100 +2 8000 +3 FF07 +4 0008 +5 FFFF +6 00D800DC +7 FFDBFFDF +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +id HEX(a) +7 FFDBFFDF +6 00D800DC +5 FFFF +4 0008 +3 FF07 +2 8000 +1 6100 +SELECT COUNT(DISTINCT a) FROM t1; +COUNT(DISTINCT a) +7 +DROP TABLE t1; +# +# MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) +# +SET NAMES utf8; +SELECT CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED); +CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED) +1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '1IJ3' +# +# End of 10.1 tests +# diff --cc mysql-test/r/ctype_utf32.result index 22b0e9c0fc0,91277cd5108..024f8aa7875 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@@ -2237,6 -2231,29 +2237,29 @@@ EXECUTE stmt USING @arg00 CONCAT(_utf32'a' COLLATE utf32_unicode_ci, ?) aÿ DEALLOCATE PREPARE stmt; + SET NAMEs utf8, character_set_connection=utf32; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET utf32 NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET utf32 NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_utf8.result index 3da74d12877,6a4001597c4..7b486f0f443 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@@ -10278,6 -10127,29 +10278,29 @@@ SELECT * FROM v1 c ß DROP VIEW v1; + SET NAMES utf8; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET utf8 NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; # # End of 10.0 tests # diff --cc mysql-test/r/ctype_utf8mb4.result index 904f432af20,4d91c42cf51..de9ba321ad9 --- a/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-test/r/ctype_utf8mb4.result @@@ -3469,32 -3427,30 +3469,55 @@@ t1 CREATE TABLE `t1` ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; SET NAMES default; + SET NAMES utf8mb4; + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET @save_optimizer_switch=@@optimizer_switch; + SET optimizer_switch=_latin1'derived_merge=on'; + CREATE TABLE t1 AS SELECT REPEAT('a', 10) AS t LIMIT 0; + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( - `t` varchar(10) CHARACTER SET utf8mb4 NOT NULL DEFAULT '' ++ `t` varchar(10) CHARACTER SET utf8mb4 NOT NULL + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + INSERT INTO t1 VALUES ('abcdefghi'),('ABCDEFGHI'); + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT LOWER(t) t2 FROM t1) sub; + c2 + abcdefghi-abcdefghi + abcdefghi-abcdefghi + SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT UPPER(t) t2 FROM t1) sub; + c2 + ABCDEFGHI-ABCDEFGHI + ABCDEFGHI-ABCDEFGHI + DROP TABLE t1; + SET optimizer_switch=@save_optimizer_switch; +# # End of 10.0 tests # -# End of tests +# +# Start of 10.1 tests +# +# +# MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database +# +SET NAMES utf8mb4; +SELECT * FROM `test😁😁test`; +ERROR HY000: Invalid utf8mb4 character string: 'test\xF0\x9F\x98\x81\xF0\x9F\x98\x81test' +# +# MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside. +# +SET NAMES utf8mb4; +CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4 +RETURN CONCAT('😎','x😎','😎y','x😎y'); +SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1'; +ROUTINE_DEFINITION +RETURN CONCAT('?','x?','?y','x?y') +SELECT body_utf8 FROM mysql.proc WHERE name='f1'; +body_utf8 +RETURN CONCAT('?','x?','?y','x?y') +DROP FUNCTION f1; +# +# End of 10.1 tests # diff --cc mysql-test/t/ctype_utf16le.test index 42017f9a635,f5b89aa9dc4..5e29408cbd0 --- a/mysql-test/t/ctype_utf16le.test +++ b/mysql-test/t/ctype_utf16le.test @@@ -745,36 -745,15 +745,49 @@@ SET NAMES utf8, collation_connection=ut --echo # End of 5.6 tests --echo # + + --echo # + --echo # Start of 10.0 tests + --echo # + + + SET NAMES utf8, character_set_connection=utf16le; + --source include/ctype_mdev13118.inc + + --echo # + --echo # Start of 10.0 tests + --echo # ++ +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-8417 utf8mb4: compare broken bytes as "greater than any non-broken character" +--echo # +CREATE TABLE t1 ( + id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + a VARCHAR(10) CHARACTER SET utf16le, KEY(a,id) +); +INSERT INTO t1 (a) VALUES (_utf8mb4 0x61); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xC280),(_utf8mb4 0xDFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xE0A080),(_utf8mb4 0xEFBFBF); +INSERT INTO t1 (a) VALUES (_utf8mb4 0xF0908080),(_utf8mb4 0xF48FBFBF); +SELECT id,HEX(a) FROM t1 ORDER BY a,id; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET utf16le COLLATE utf16le_bin; +SELECT id,HEX(a) FROM t1 ORDER BY a; +SELECT id,HEX(a) FROM t1 ORDER BY a DESC,id DESC; +SELECT COUNT(DISTINCT a) FROM t1; +DROP TABLE t1; + +--echo # +--echo # MDEV-9178 Wrong result for CAST(CONVERT('1IJ3' USING ucs2) AS SIGNED) +--echo # +SET NAMES utf8; +SELECT CAST(CONVERT('1IJ3' USING utf16le) AS SIGNED); + +--echo # +--echo # End of 10.1 tests +--echo # diff --cc mysql-test/t/ctype_utf8mb4.test index af4c169091a,89007546492..ffc098ff938 --- a/mysql-test/t/ctype_utf8mb4.test +++ b/mysql-test/t/ctype_utf8mb4.test @@@ -1950,33 -1913,16 +1950,41 @@@ DROP TABLE t1 SET NAMES default; + + # + # MDEV-13118 Wrong results with LOWER and UPPER and subquery + # + SET NAMES utf8mb4; + --source include/ctype_mdev13118.inc + + +--echo # --echo # End of 10.0 tests +--echo # + +--echo # +--echo # Start of 10.1 tests +--echo # + +--echo # +--echo # MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database +--echo # +SET NAMES utf8mb4; +--error ER_INVALID_CHARACTER_STRING +SELECT * FROM `test😁😁test`; + +--echo # +--echo # MDEV-7231 Field ROUTINE_DEFINITION in INFORMATION_SCHEMA.`ROUTINES` contains broken procedure body when used shielding quotes inside. +--echo # +# Non-BMP characters should be replaced to '?' in ROUTINE_DEFINITION/body_utf8 +SET NAMES utf8mb4; +CREATE FUNCTION f1() RETURNS TEXT CHARACTER SET utf8mb4 +RETURN CONCAT('😎','x😎','😎y','x😎y'); +SELECT ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA='test' AND SPECIFIC_NAME ='f1'; +SELECT body_utf8 FROM mysql.proc WHERE name='f1'; +DROP FUNCTION f1; --echo # ---echo # End of tests +--echo # End of 10.1 tests --echo # diff --cc scripts/CMakeLists.txt index b994c9f67b5,24b48e1920e..9f320ce6aa4 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@@ -74,23 -74,7 +74,24 @@@ IF(UNIX ) ENDIF() +# Configure two scripts from one 'in' file. +# The maria_add_gis_sp.sql - to be sent to 'mysql' tool +# and the maria_add_gis_sp_bootstrap.sql, that can be sent to +# the server as a bootstrap command. + +SET(ADD_GIS_SP_SET_DELIMITER "delimiter |") +SET(ADD_GIS_SP_RESET_DELIMITER "delimiter ;") +SET(ADD_GIS_SP_EOL "|") +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/maria_add_gis_sp.sql.in + ${CMAKE_CURRENT_BINARY_DIR}/maria_add_gis_sp.sql ESCAPE_QUOTES @ONLY) + +SET(ADD_GIS_SP_SET_DELIMITER "") +SET(ADD_GIS_SP_RESET_DELIMITER "") +SET(ADD_GIS_SP_EOL ";") +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/maria_add_gis_sp.sql.in + ${CMAKE_CURRENT_BINARY_DIR}/maria_add_gis_sp_bootstrap.sql ESCAPE_QUOTES @ONLY) + + IF (NOT WITHOUT_SERVER) INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql diff --cc scripts/mysql_install_db.pl.in index 9d2c1f6874a,2103afc1e63..68d47fed2ea --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in @@@ -326,13 -323,12 +326,13 @@@ elsif ( $opt->{basedir} } else { - $opt->{basedir} = '@prefix@'; - $bindir = '@bindir@'; - $extra_bindir = $bindir; - $mysqld = '@sbindir@/mysqld'; - $pkgdatadir = '@pkgdatadir@'; - $scriptdir = '@scriptdir@'; + $opt->{basedir} = '@prefix@'; + $bindir = '@bindir@'; + $extra_bindir = $bindir; - $mysqld = '@libexecdir@/mysqld'; ++ $mysqld = '@sbindir@/mysqld'; + $srcpkgdatadir = '@pkgdatadir@'; + $buildpkgdatadir = '@pkgdatadir@'; + $scriptdir = '@scriptdir@'; } unless ( $opt->{ldata} ) diff --cc scripts/mysql_install_db.sh index b57ac8bc85e,43ff4191e08..40fdf798d71 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@@ -343,9 -313,8 +343,9 @@@ els basedir="@prefix@" bindir="@bindir@" resolveip="$bindir/resolveip" - mysqld="@libexecdir@/mysqld" + mysqld="@sbindir@/mysqld" - pkgdatadir="@pkgdatadir@" + srcpkgdatadir="@pkgdatadir@" + buildpkgdatadir="@pkgdatadir@" fi # Set up paths to SQL scripts required for bootstrap diff --cc scripts/mysql_system_tables_fix.sql index 47459d58bd2,194b1615c2b..a982fc87ec9 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@@ -26,9 -26,8 +26,9 @@@ set sql_mode=''; set storage_engine=MyISAM; +set enforce_storage_engine=NULL; - ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; # Detect whether or not we had the Grant_priv column SET @hadGrantPriv:=0; @@@ -633,12 -638,12 +641,14 @@@ ALTER TABLE user MODIFY Create_tablespa UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0; - ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; + ALTER TABLE user ADD plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, + ADD authentication_string TEXT NOT NULL; + ALTER TABLE user MODIFY plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, + MODIFY authentication_string TEXT NOT NULL; ALTER TABLE user ADD password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE user ADD is_role enum('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE user ADD default_role char(80) binary DEFAULT '' NOT NULL; +ALTER TABLE user ADD max_statement_time decimal(12,6) DEFAULT 0 NOT NULL; - ALTER TABLE user MODIFY plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, MODIFY authentication_string TEXT NOT NULL; -- Somewhere above, we ran ALTER TABLE user .... CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin. -- we want password_expired column to have collation utf8_general_ci. ALTER TABLE user MODIFY password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; diff --cc support-files/CMakeLists.txt index dff4610d490,cc9eed6c7be..4ad3810e082 --- a/support-files/CMakeLists.txt +++ b/support-files/CMakeLists.txt @@@ -41,116 -41,61 +41,118 @@@ ELSE( SET(inst_location ${INSTALL_SUPPORTFILESDIR}) ENDIF() + IF (NOT WITHOUT_SERVER) FOREACH(inifile my-huge my-innodb-heavy-4G my-large my-medium my-small) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${inifile}.cnf.sh + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${inifile}.cnf.sh ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} @ONLY) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${inifile}.${ini_file_extension} DESTINATION ${inst_location} COMPONENT IniFiles) ENDFOREACH() + ENDIF() +IF(WITH_WSREP) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/wsrep.cnf.sh + ${CMAKE_CURRENT_BINARY_DIR}/wsrep.${ini_file_extension} @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wsrep.${ini_file_extension} + DESTINATION ${inst_location} COMPONENT IniFiles) +ENDIF() + IF(UNIX) SET(prefix ${CMAKE_INSTALL_PREFIX}) - FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure) + FOREACH(script mysqld_multi.server mysql-log-rotate binary-configure wsrep_notify) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh ${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY ) - - IF(script MATCHES ".ini") - SET(comp IniFiles) - SET(permissions OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) - ELSE() - SET(comp Server_Scripts) - SET(permissions OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - ENDIF() - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${script} - DESTINATION ${inst_location} COMPONENT ${comp} - PERMISSIONS ${permissions}) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${script} + DESTINATION ${inst_location} COMPONENT Server_Scripts) ENDFOREACH() + IF(INSTALL_SUPPORTFILESDIR) INSTALL(FILES magic DESTINATION ${inst_location} COMPONENT SupportFiles) - ADD_SUBDIRECTORY(SELinux) + INSTALL(DIRECTORY policy DESTINATION ${inst_location} COMPONENT SupportFiles) + FIND_PROGRAM(CHECKMODULE checkmodule) + FIND_PROGRAM(SEMODULE_PACKAGE semodule_package) + MARK_AS_ADVANCED(CHECKMODULE SEMODULE_PACKAGE) + + # Build pp files in policy/selinux + IF(CHECKMODULE AND SEMODULE_PACKAGE) + FOREACH(pol mariadb) + SET(src ${CMAKE_CURRENT_SOURCE_DIR}/policy/selinux/${pol}.te) + SET(tmp ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${pol}-pp.dir/${pol}.mod) + SET(out ${CMAKE_CURRENT_BINARY_DIR}/${pol}.pp) + ADD_CUSTOM_COMMAND(OUTPUT ${out} + COMMAND ${CHECKMODULE} -M -m ${src} -o ${tmp} + COMMAND ${SEMODULE_PACKAGE} -m ${tmp} -o ${out} + DEPENDS ${src}) + ADD_CUSTOM_TARGET(${pol}-pp ALL DEPENDS ${out}) + INSTALL(FILES ${out} DESTINATION ${inst_location}/policy/selinux COMPONENT SupportFiles) + ENDFOREACH() + ENDIF() ENDIF() + CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development) + INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development) - CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY) - CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY) - - SET(SPECFILENAME "mysql.${VERSION}.spec") - IF("${VERSION}" MATCHES "-ndb-") - STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}") - SET(SPECFILENAME "mysql-cluster-${NDBVERSION}.spec") - ENDIF() - CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/${SPECFILENAME} @ONLY) - CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY) - - SET(bindir ${prefix}/${INSTALL_BINDIR}) - SET(sbindir ${prefix}/${INSTALL_SBINDIR}) - SET(scriptdir ${prefix}/${INSTALL_SCRIPTDIR}) - SET(libexecdir ${prefix}/${INSTALL_SBINDIR}) - SET(pkgdatadir ${prefix}/${INSTALL_MYSQLSHAREDIR}) + SET(bindir ${INSTALL_BINDIRABS}) + SET(sbindir ${INSTALL_SBINDIRABS}) + SET(scriptdir ${INSTALL_SCRIPTDIRABS}) + SET(libexecdir ${INSTALL_SBINDIRABS}) + SET(pkgdatadir ${INSTALL_MYSQLSHAREDIRABS}) + SET(sysconfdir ${INSTALL_SYSCONFDIR}) + SET(sysconf2dir ${INSTALL_SYSCONF2DIR}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql.server - DESTINATION ${inst_location} COMPONENT SupportFiles - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mysql.server + DESTINATION ${inst_location} COMPONENT SupportFiles) + + IF(HAVE_SYSTEMD) + CONFIGURE_FILE(mariadb.service.in + ${CMAKE_CURRENT_BINARY_DIR}/mariadb.service @ONLY) + INSTALL(FILES use_galera_new_cluster.conf + ${CMAKE_CURRENT_BINARY_DIR}/mariadb.service + DESTINATION ${inst_location}/systemd COMPONENT SupportFiles) + + IF(INSTALL_SYSTEMD_SYSUSERSDIR) + CONFIGURE_FILE(sysusers.conf.in + ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf + DESTINATION ${INSTALL_SYSTEMD_SYSUSERSDIR} COMPONENT Server) + ENDIF() + + IF(INSTALL_SYSTEMD_TMPFILESDIR) + get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY) + CONFIGURE_FILE(tmpfiles.conf.in + ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf + DESTINATION ${INSTALL_SYSTEMD_TMPFILESDIR} COMPONENT Server) + ENDIF() + + # @ in directory name broken between CMake version 2.8.12.2 and 3.3 + # http://public.kitware.com/Bug/view.php?id=14782 + IF(NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM) + CONFIGURE_FILE(mariadb@.service.in + ${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service @ONLY) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service + DESTINATION ${inst_location}/systemd COMPONENT SupportFiles) + ENDIF() + + IF(INSTALL_SYSTEMD_UNITDIR) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.service + DESTINATION ${INSTALL_SYSTEMD_UNITDIR} COMPONENT Server) + + # http://public.kitware.com/Bug/view.php?id=14782 + IF(NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM) + INSTALL(FILES use_galera_new_cluster.conf + DESTINATION + "${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d" + COMPONENT Server) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb@.service + DESTINATION ${INSTALL_SYSTEMD_UNITDIR} COMPONENT Server) + ENDIF() + + ENDIF() + ENDIF() IF (INSTALL_SYSCONFDIR) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql-log-rotate DESTINATION ${INSTALL_SYSCONFDIR}/logrotate.d
participants (1)
-
Oleksandr Byelkin