From 1ef22e28ad7744d436c694e970420c426fc7095a Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 16 Mar 2023 17:24:12 +0200 Subject: [PATCH 01/80] MDEV-26258 Various crashes/asserts/corruptions when Aria encryption is enabled/used, but the encryption plugin is not loaded The reason for the MDEV reported failures is that the tests are enabling encryption for Aria but not providing any encryption keys. Fixed by checking if encryption keys exists before creating the table. Other things: - maria.encrypt_wrong-key changed as we now get the error on CREATE instead during insert. --- include/handler_ername.h | 1 + include/my_base.h | 6 +- include/my_handler_errors.h | 3 +- .../include/wait_until_connected_again.inc | 6 +- mysql-test/suite/maria/encrypt-no-key.result | 36 ++++++++---- mysql-test/suite/maria/encrypt-no-key.test | 55 ++++++++++++++++--- .../suite/maria/encrypt-wrong-key.result | 12 ++-- mysql-test/suite/maria/encrypt-wrong-key.test | 7 ++- storage/maria/ha_maria.cc | 3 +- storage/maria/ma_create.c | 2 + storage/maria/ma_crypt.c | 35 ++++++++++-- storage/maria/ma_crypt.h | 3 +- storage/maria/ma_delete_table.c | 7 ++- storage/maria/ma_open.c | 3 +- 14 files changed, 135 insertions(+), 44 deletions(-) diff --git a/include/handler_ername.h b/include/handler_ername.h index fe55062e6fb..20e62487c2c 100644 --- a/include/handler_ername.h +++ b/include/handler_ername.h @@ -79,3 +79,4 @@ { "HA_ERR_ABORTED_BY_USER", HA_ERR_ABORTED_BY_USER, "" }, { "HA_ERR_DISK_FULL", HA_ERR_DISK_FULL, "" }, { "HA_ERR_INCOMPATIBLE_DEFINITION", HA_ERR_INCOMPATIBLE_DEFINITION, "" }, +{ "HA_ERR_NO_ENCRYPTION", HA_ERR_NO_ENCRYPTION, "" }, diff --git a/include/my_base.h b/include/my_base.h index 32ef6f7fe85..cc3d57cb0b1 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -48,6 +48,7 @@ #define HA_OPEN_NO_PSI_CALL 1024U /* Don't call/connect PSI */ #define HA_OPEN_MERGE_TABLE 2048U #define HA_OPEN_FOR_CREATE 4096U +#define HA_OPEN_FOR_DROP (1U << 13) /* Open part of drop */ /* Allow opening even if table is incompatible as this is for ALTER TABLE which @@ -516,14 +517,15 @@ enum ha_base_keytype { #define HA_ERR_DISK_FULL 189 #define HA_ERR_INCOMPATIBLE_DEFINITION 190 #define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191 /* Too many words in a phrase */ -#define HA_ERR_DECRYPTION_FAILED 192 /* Table encrypted but decypt failed */ +#define HA_ERR_DECRYPTION_FAILED 192 /* Table encrypted but decrypt failed */ #define HA_ERR_FK_DEPTH_EXCEEDED 193 /* FK cascade depth exceeded */ #define HA_ERR_TABLESPACE_MISSING 194 /* Missing Tablespace */ #define HA_ERR_SEQUENCE_INVALID_DATA 195 #define HA_ERR_SEQUENCE_RUN_OUT 196 #define HA_ERR_COMMIT_ERROR 197 #define HA_ERR_PARTITION_LIST 198 -#define HA_ERR_LAST 198 /* Copy of last error nr * */ +#define HA_ERR_NO_ENCRYPTION 199 +#define HA_ERR_LAST 199 /* Copy of last error nr * */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) diff --git a/include/my_handler_errors.h b/include/my_handler_errors.h index 4c3a02dd745..7eab185dd98 100644 --- a/include/my_handler_errors.h +++ b/include/my_handler_errors.h @@ -109,7 +109,8 @@ static const char *handler_error_messages[]= "Sequence has been run out", "Sequence values are conflicting", "Error during commit", - "Cannot select partitions" + "Cannot select partitions", + "Cannot initialize encryption. Check that all encryption parameters have been set" }; #endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */ diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc index 15a1e5bf847..f644ec8645f 100644 --- a/mysql-test/include/wait_until_connected_again.inc +++ b/mysql-test/include/wait_until_connected_again.inc @@ -11,7 +11,7 @@ let $counter= 5000; let $mysql_errno= 9999; while ($mysql_errno) { - --error 0,ER_ACCESS_DENIED_ERROR,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013 + --error 0,ER_ACCESS_DENIED_ERROR,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013,HA_ERR_NO_ENCRYPTION show status; dec $counter; @@ -30,6 +30,10 @@ while ($mysql_errno) { let $mysql_errno=0; } + if ($mysql_errno == 199) + { + let $mysql_errno=0; + } --sleep 0.1 } --enable_query_log diff --git a/mysql-test/suite/maria/encrypt-no-key.result b/mysql-test/suite/maria/encrypt-no-key.result index 6745670dfac..32a280d8cbc 100644 --- a/mysql-test/suite/maria/encrypt-no-key.result +++ b/mysql-test/suite/maria/encrypt-no-key.result @@ -1,15 +1,27 @@ -call mtr.add_suppression('Unknown key id 1. Can''t continue'); +call mtr.add_suppression("Initialization of encryption failed.*"); set global aria_encrypt_tables= 1; create table t1 (pk int primary key, a int, key(a)) engine=aria transactional=1; -alter table t1 disable keys; -insert into t1 values (1,1); -alter table t1 enable keys; -ERROR HY000: Unknown key id 1. Can't continue! -repair table t1 use_frm; -Table Op Msg_type Msg_text -test.t1 repair warning Number of rows changed from 0 to 1 -test.t1 repair Error Unknown key id 1. Can't continue! -test.t1 repair Error Unknown key id 1. Can't continue! -test.t1 repair status OK -drop table t1; +ERROR HY000: Initialization of encryption failed for ./test/t1 set global aria_encrypt_tables= default; +# +# MDEV-26258 Various crashes/asserts/corruptions when Aria encryption is +# enabled/used, but the encryption plugin is not loaded +# +SET GLOBAL aria_encrypt_tables=ON; +CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria; +ERROR HY000: Initialization of encryption failed for ./test/t1 +# Restart with encryption enabled +CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria; +INSERT INTO t1 VALUES (4,0); +LOAD INDEX INTO CACHE t1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +SELECT * FROM t1; +ERROR HY000: Initialization of encryption failed for ./test/t1.MAD +DROP TABLE t1; +Warnings: +Warning 199 Initialization of encryption failed for ./test/t1.MAD +Cleanup diff --git a/mysql-test/suite/maria/encrypt-no-key.test b/mysql-test/suite/maria/encrypt-no-key.test index 2d586c50695..b3f2f4b4bf3 100644 --- a/mysql-test/suite/maria/encrypt-no-key.test +++ b/mysql-test/suite/maria/encrypt-no-key.test @@ -1,14 +1,55 @@ # # MDEV-18496 Crash when Aria encryption is enabled but plugin not available # -call mtr.add_suppression('Unknown key id 1. Can''t continue'); +call mtr.add_suppression("Initialization of encryption failed.*"); set global aria_encrypt_tables= 1; +--error HA_ERR_NO_ENCRYPTION create table t1 (pk int primary key, a int, key(a)) engine=aria transactional=1; -alter table t1 disable keys; -insert into t1 values (1,1); -error 192; -alter table t1 enable keys; -repair table t1 use_frm; -drop table t1; set global aria_encrypt_tables= default; + +--echo # +--echo # MDEV-26258 Various crashes/asserts/corruptions when Aria encryption is +--echo # enabled/used, but the encryption plugin is not loaded +--echo # + +SET GLOBAL aria_encrypt_tables=ON; + +--write_file $MYSQLTEST_VARDIR/keys1.txt +1;770A8A65DA156D24EE2A093277530142 +EOF + +--replace_result \\ / +--error HA_ERR_NO_ENCRYPTION +CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria; + +--echo # Restart with encryption enabled + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc +--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +CREATE TABLE t1 (a INT KEY,b INT,KEY(b)) ENGINE=Aria; +INSERT INTO t1 VALUES (4,0); +LOAD INDEX INTO CACHE t1 IGNORE LEAVES; +LOAD INDEX INTO CACHE t1; + +# Restart without encryption. Above table should be unreadable + +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc +--exec echo "restart:--aria-encrypt-tables=0" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--replace_result \\ / +--error HA_ERR_NO_ENCRYPTION +SELECT * FROM t1; +DROP TABLE t1; + +--echo Cleanup +--remove_file $MYSQLTEST_VARDIR/keys1.txt diff --git a/mysql-test/suite/maria/encrypt-wrong-key.result b/mysql-test/suite/maria/encrypt-wrong-key.result index bc22481296d..4ff057957da 100644 --- a/mysql-test/suite/maria/encrypt-wrong-key.result +++ b/mysql-test/suite/maria/encrypt-wrong-key.result @@ -1,16 +1,16 @@ call mtr.add_suppression("file_key_management"); call mtr.add_suppression("System key id 1 is missing"); call mtr.add_suppression("Unknown key id 1"); -call mtr.add_suppression("Failed to decrypt"); +call mtr.add_suppression("Initialization of encryption failed.*"); CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria; INSERT INTO t1 VALUES (1); repair table t1; Table Op Msg_type Msg_text -test.t1 repair info Wrong CRC on datapage at 1 -test.t1 repair warning Number of rows changed from 1 to 0 -test.t1 repair status OK +test.t1 repair Error Initialization of encryption failed for ./test/t1.MAD +test.t1 repair error Corrupt INSERT INTO t1 VALUES (2); +ERROR HY000: Initialization of encryption failed for ./test/t1.MAD select * from t1; -ERROR HY000: failed to decrypt './test/t1' rc: -1 dstlen: 0 size: 8172 - +i +1 drop table t1; diff --git a/mysql-test/suite/maria/encrypt-wrong-key.test b/mysql-test/suite/maria/encrypt-wrong-key.test index ca65e1018d0..ac060c4e9dd 100644 --- a/mysql-test/suite/maria/encrypt-wrong-key.test +++ b/mysql-test/suite/maria/encrypt-wrong-key.test @@ -7,7 +7,7 @@ call mtr.add_suppression("file_key_management"); call mtr.add_suppression("System key id 1 is missing"); call mtr.add_suppression("Unknown key id 1"); -call mtr.add_suppression("Failed to decrypt"); +call mtr.add_suppression("Initialization of encryption failed.*"); --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --shutdown_server @@ -36,8 +36,11 @@ EOF --enable_reconnect --source include/wait_until_connected_again.inc +--replace_result \\ / repair table t1; +--replace_result \\ / +--error HA_ERR_NO_ENCRYPTION INSERT INTO t1 VALUES (2); --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect @@ -48,8 +51,6 @@ INSERT INTO t1 VALUES (2); --enable_reconnect --source include/wait_until_connected_again.inc ---replace_result \\ / ---error 192 select * from t1; drop table t1; --remove_file $MYSQLTEST_VARDIR/keys1.txt diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 2d6c8f85fe4..f25ba2aa0b3 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -292,7 +292,8 @@ static MYSQL_SYSVAR_BOOL(used_for_temp_tables, "Whether temporary tables should be MyISAM or Aria", 0, 0, 1); -static MYSQL_SYSVAR_BOOL(encrypt_tables, maria_encrypt_tables, PLUGIN_VAR_OPCMDARG, +static MYSQL_SYSVAR_BOOL(encrypt_tables, maria_encrypt_tables, + PLUGIN_VAR_OPCMDARG, "Encrypt tables (only for tables with ROW_FORMAT=PAGE (default) " "and not FIXED/DYNAMIC)", 0, 0, 0); diff --git a/storage/maria/ma_create.c b/storage/maria/ma_create.c index 8ef3249c2e4..3352a494d16 100644 --- a/storage/maria/ma_create.c +++ b/storage/maria/ma_create.c @@ -1062,6 +1062,8 @@ int maria_create(const char *name, enum data_file_type datafile_type, if (encrypted) { + DBUG_ASSERT(share.data_file_name.length == 0); + share.data_file_name.str= (char*) name; /* For error reporting */ if (ma_crypt_create(&share) || ma_crypt_write(&share, file)) goto err; diff --git a/storage/maria/ma_crypt.c b/storage/maria/ma_crypt.c index 33cf72b0b1e..8cc85d87d28 100644 --- a/storage/maria/ma_crypt.c +++ b/storage/maria/ma_crypt.c @@ -100,6 +100,7 @@ static void crypt_data_scheme_locker(struct st_encryption_scheme *scheme, int ma_crypt_create(MARIA_SHARE* share) { + uint key_version; MARIA_CRYPT_DATA *crypt_data= (MARIA_CRYPT_DATA*)my_malloc(sizeof(MARIA_CRYPT_DATA), MYF(MY_ZEROFILL)); crypt_data->scheme.type= CRYPT_SCHEME_1; @@ -110,6 +111,16 @@ ma_crypt_create(MARIA_SHARE* share) my_random_bytes((uchar*)&crypt_data->space, sizeof(crypt_data->space)); share->crypt_data= crypt_data; share->crypt_page_header_space= CRYPT_SCHEME_1_KEY_VERSION_SIZE; + + key_version = encryption_key_get_latest_version(crypt_data->scheme.key_id); + if (unlikely(key_version == ENCRYPTION_KEY_VERSION_INVALID)) + { + my_errno= HA_ERR_NO_ENCRYPTION; + my_printf_error(HA_ERR_NO_ENCRYPTION, + "Initialization of encryption failed for %s", MYF(0), + share->data_file_name.str); + return 1; + } return 0; } @@ -145,7 +156,7 @@ ma_crypt_write(MARIA_SHARE* share, File file) } uchar* -ma_crypt_read(MARIA_SHARE* share, uchar *buff) +ma_crypt_read(MARIA_SHARE* share, uchar *buff, my_bool silent) { uchar type= buff[0]; uchar iv_length= buff[1]; @@ -155,9 +166,9 @@ ma_crypt_read(MARIA_SHARE* share, uchar *buff) iv_length != sizeof(((MARIA_CRYPT_DATA*)1)->scheme.iv) + 4) { my_printf_error(HA_ERR_UNSUPPORTED, - "Unsupported crypt scheme! type: %d iv_length: %d\n", - MYF(ME_FATAL|ME_ERROR_LOG), - type, iv_length); + "Unsupported crypt scheme type: %d iv_length: %d\n", + MYF(ME_ERROR_LOG | (silent ? ME_WARNING : ME_FATAL)), + type, iv_length); return 0; } @@ -166,6 +177,7 @@ ma_crypt_read(MARIA_SHARE* share, uchar *buff) /* opening a table */ MARIA_CRYPT_DATA *crypt_data= (MARIA_CRYPT_DATA*)my_malloc(sizeof(MARIA_CRYPT_DATA), MYF(MY_ZEROFILL)); + uint key_version; crypt_data->scheme.type= type; mysql_mutex_init(key_CRYPT_DATA_lock, &crypt_data->lock, @@ -175,6 +187,17 @@ ma_crypt_read(MARIA_SHARE* share, uchar *buff) crypt_data->space= uint4korr(buff + 2); memcpy(crypt_data->scheme.iv, buff + 6, sizeof(crypt_data->scheme.iv)); share->crypt_data= crypt_data; + + key_version= encryption_key_get_latest_version(crypt_data->scheme.key_id); + if (unlikely(key_version == ENCRYPTION_KEY_VERSION_INVALID)) + { + my_errno= HA_ERR_NO_ENCRYPTION; + my_printf_error(HA_ERR_NO_ENCRYPTION, + "Initialization of encryption failed for %s", + MYF(ME_ERROR_LOG | (silent ? ME_WARNING : ME_FATAL)), + share->data_file_name.str); + return 0; + } } share->crypt_page_header_space= CRYPT_SCHEME_1_KEY_VERSION_SIZE; @@ -462,7 +485,7 @@ static int ma_encrypt(MARIA_SHARE *share, MARIA_CRYPT_DATA *crypt_data, uint32 dstlen= 0; /* Must be set because of error message */ *key_version = encryption_key_get_latest_version(crypt_data->scheme.key_id); - if (*key_version == ENCRYPTION_KEY_VERSION_INVALID) + if (unlikely(*key_version == ENCRYPTION_KEY_VERSION_INVALID)) { /* We use this error for both encryption and decryption, as in normal @@ -470,7 +493,7 @@ static int ma_encrypt(MARIA_SHARE *share, MARIA_CRYPT_DATA *crypt_data, */ my_errno= HA_ERR_DECRYPTION_FAILED; my_printf_error(HA_ERR_DECRYPTION_FAILED, - "Unknown key id %u. Can't continue!", + "Unknown encryption key id %u. Can't continue!", MYF(ME_FATAL|ME_ERROR_LOG), crypt_data->scheme.key_id); return 1; diff --git a/storage/maria/ma_crypt.h b/storage/maria/ma_crypt.h index 811b319bc0c..acaf36ee831 100644 --- a/storage/maria/ma_crypt.h +++ b/storage/maria/ma_crypt.h @@ -26,7 +26,8 @@ uint ma_crypt_get_index_page_header_space(struct st_maria_share *); uint ma_crypt_get_file_length(); /* bytes needed in file */ int ma_crypt_create(struct st_maria_share *); /* create encryption data */ int ma_crypt_write(struct st_maria_share *, File); /* write encryption data */ -uchar* ma_crypt_read(struct st_maria_share *, uchar *buff); /* read crypt data*/ +uchar* ma_crypt_read(struct st_maria_share *, uchar *buff, + my_bool silent); /* read crypt data*/ void ma_crypt_set_data_pagecache_callbacks(struct st_pagecache_file *file, struct st_maria_share *share); diff --git a/storage/maria/ma_delete_table.c b/storage/maria/ma_delete_table.c index 0c78476ad44..250ea9dff89 100644 --- a/storage/maria/ma_delete_table.c +++ b/storage/maria/ma_delete_table.c @@ -43,12 +43,13 @@ int maria_delete_table(const char *name) 'open_for_repair' to be able to open even a crashed table. */ my_errno= 0; - if (!(info= maria_open(name, O_RDONLY, HA_OPEN_FOR_REPAIR))) + if (!(info= maria_open(name, O_RDONLY, (HA_OPEN_FOR_DROP | HA_OPEN_FOR_REPAIR)))) { sync_dir= 0; /* Ignore not found errors and wrong symlink errors */ - if (my_errno != ENOENT && my_errno != HA_WRONG_CREATE_OPTION) - got_error= my_errno;; + if (my_errno != ENOENT && my_errno != HA_WRONG_CREATE_OPTION && + my_errno != HA_ERR_NO_ENCRYPTION) + got_error= my_errno; } else { diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 06183c72895..7b59351e24b 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -863,7 +863,8 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) if (MY_TEST(share->base.extra_options & MA_EXTRA_OPTIONS_ENCRYPTED)) { - if (!(disk_pos= ma_crypt_read(share, disk_pos))) + if (!(disk_pos= ma_crypt_read(share, disk_pos, + MY_TEST(open_flags & HA_OPEN_FOR_DROP)))) goto err; } From 4cb0d43ac63761174a39cea892c176b9cfa6edfc Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 17 Mar 2023 12:02:04 +0200 Subject: [PATCH 02/80] MDEV-28054 Various crashes upon INSERT/UPDATE after changing Aria settings The cause of the crash was that test was setting aria_sort_buffer_size to MAX_LONG_LONG, which caused an overflow in my_malloc() when trying to allocate the buffer + 8 bytes. Fixed by reducing max size of sort_buffer for Aria and MyISAM Other things: - Added code in maria_repair_parallell() to not allocate a big sort buffer for small files. - Updated size of minumim sort buffer in Aria --- mysql-test/suite/maria/maria.result | 17 +--- mysql-test/suite/maria/maria.test | 18 +---- mysql-test/suite/maria/repair-big-sort.result | 81 +++++++++++++++++++ mysql-test/suite/maria/repair-big-sort.test | 15 ++++ .../r/aria_sort_buffer_size_basic.result | 8 +- .../suite/sys_vars/r/sysvars_aria.result | 4 +- .../r/sysvars_server_embedded,32bit.rdiff | 8 +- .../sys_vars/r/sysvars_server_embedded.result | 6 +- .../r/sysvars_server_notembedded.result | 6 +- storage/maria/ha_maria.cc | 2 +- storage/maria/ma_check.c | 22 +++++ storage/maria/ma_sort.c | 26 +++--- storage/maria/maria_chk.c | 3 +- storage/maria/maria_def.h | 3 +- storage/myisam/ha_myisam.cc | 2 +- 15 files changed, 159 insertions(+), 62 deletions(-) create mode 100644 mysql-test/suite/maria/repair-big-sort.result create mode 100644 mysql-test/suite/maria/repair-big-sort.test diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 925c5121bfb..f8911bdde2b 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2814,7 +2814,7 @@ DROP TABLE t1; # cardinalities=1 # SET aria_repair_threads=2; -SET aria_sort_buffer_size=8192; +SET aria_sort_buffer_size=16384; CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); Warnings: Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release @@ -2839,19 +2839,8 @@ SET aria_repair_threads=@@global.aria_repair_threads; # low myisam_sort_buffer_size # CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); -INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), -(6,'0'),(7,'0'); -INSERT INTO t1 SELECT a+10,b FROM t1; -INSERT INTO t1 SELECT a+20,b FROM t1; -INSERT INTO t1 SELECT a+40,b FROM t1; -INSERT INTO t1 SELECT a+80,b FROM t1; -INSERT INTO t1 SELECT a+160,b FROM t1; -INSERT INTO t1 SELECT a+320,b FROM t1; -INSERT INTO t1 SELECT a+640,b FROM t1; -INSERT INTO t1 SELECT a+1280,b FROM t1; -INSERT INTO t1 SELECT a+2560,b FROM t1; -INSERT INTO t1 SELECT a+5120,b FROM t1; -SET aria_sort_buffer_size=4096; +INSERT INTO t1 select seq,'0' from seq_1_to_65536; +SET aria_sort_buffer_size=16384; REPAIR TABLE t1; Table Op Msg_type Msg_text test.t1 repair error aria_sort_buffer_size is too small. X diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index a326bb12d2a..f7a5b5c35b2 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -5,6 +5,7 @@ -- source include/have_maria.inc -- source include/have_partition.inc +-- source include/have_sequence.inc call mtr.add_suppression("Can't find record in '.*'"); @@ -2034,7 +2035,7 @@ DROP TABLE t1; --echo # cardinalities=1 --echo # SET aria_repair_threads=2; -SET aria_sort_buffer_size=8192; +SET aria_sort_buffer_size=16384; CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3); --replace_regex /Current aria_sort_buffer_size.*/X/ @@ -2050,19 +2051,8 @@ SET aria_repair_threads=@@global.aria_repair_threads; --echo # low myisam_sort_buffer_size --echo # CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); -INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), - (6,'0'),(7,'0'); -INSERT INTO t1 SELECT a+10,b FROM t1; -INSERT INTO t1 SELECT a+20,b FROM t1; -INSERT INTO t1 SELECT a+40,b FROM t1; -INSERT INTO t1 SELECT a+80,b FROM t1; -INSERT INTO t1 SELECT a+160,b FROM t1; -INSERT INTO t1 SELECT a+320,b FROM t1; -INSERT INTO t1 SELECT a+640,b FROM t1; -INSERT INTO t1 SELECT a+1280,b FROM t1; -INSERT INTO t1 SELECT a+2560,b FROM t1; -INSERT INTO t1 SELECT a+5120,b FROM t1; -SET aria_sort_buffer_size=4096; +INSERT INTO t1 select seq,'0' from seq_1_to_65536; +SET aria_sort_buffer_size=16384; --replace_regex /Current aria_sort_buffer_size.*/X/ REPAIR TABLE t1; CHECK TABLE t1; diff --git a/mysql-test/suite/maria/repair-big-sort.result b/mysql-test/suite/maria/repair-big-sort.result new file mode 100644 index 00000000000..d1dfe3f7c2f --- /dev/null +++ b/mysql-test/suite/maria/repair-big-sort.result @@ -0,0 +1,81 @@ +SET sql_mode=''; +CREATE TEMPORARY TABLE t1 (a tinyINT,b CHAR(1)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES (1,1),(3,3),(2,2); +SET SESSION tmp_table_size=True; +Warnings: +Warning 1292 Truncated incorrect tmp_table_size value: '1' +CREATE TABLE t2 (c INT, d DATE) ENGINE=InnoDB PARTITION BY RANGE (YEAR (d)) SUBPARTITION BY HASH (TO_DAYS (d)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0, SUBPARTITION s1), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s4, SUBPARTITION s5)); +SET SESSION aria_sort_buffer_size=CAST(-1 AS UNSIGNED INT); +Warnings: +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Note 1105 Cast to unsigned converted negative integer to it's positive complement +Warning 1292 Truncated incorrect aria_sort_buffer_size value: '18446744073709551615' +INSERT INTO t1 SELECT '', SEQ FROM seq_1_to_258; +Warnings: +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 1 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 2 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 3 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 4 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 5 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 6 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 7 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 8 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 9 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 10 +Warning 1265 Data truncated for column 'b' at row 10 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 11 +Warning 1265 Data truncated for column 'b' at row 11 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 12 +Warning 1265 Data truncated for column 'b' at row 12 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 13 +Warning 1265 Data truncated for column 'b' at row 13 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 14 +Warning 1265 Data truncated for column 'b' at row 14 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 15 +Warning 1265 Data truncated for column 'b' at row 15 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 16 +Warning 1265 Data truncated for column 'b' at row 16 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 17 +Warning 1265 Data truncated for column 'b' at row 17 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 18 +Warning 1265 Data truncated for column 'b' at row 18 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 19 +Warning 1265 Data truncated for column 'b' at row 19 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 20 +Warning 1265 Data truncated for column 'b' at row 20 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 21 +Warning 1265 Data truncated for column 'b' at row 21 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 22 +Warning 1265 Data truncated for column 'b' at row 22 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 23 +Warning 1265 Data truncated for column 'b' at row 23 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 24 +Warning 1265 Data truncated for column 'b' at row 24 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 25 +Warning 1265 Data truncated for column 'b' at row 25 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 26 +Warning 1265 Data truncated for column 'b' at row 26 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 27 +Warning 1265 Data truncated for column 'b' at row 27 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 28 +Warning 1265 Data truncated for column 'b' at row 28 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 29 +Warning 1265 Data truncated for column 'b' at row 29 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 30 +Warning 1265 Data truncated for column 'b' at row 30 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 31 +Warning 1265 Data truncated for column 'b' at row 31 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 32 +Warning 1265 Data truncated for column 'b' at row 32 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 33 +Warning 1265 Data truncated for column 'b' at row 33 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 34 +Warning 1265 Data truncated for column 'b' at row 34 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 35 +Warning 1265 Data truncated for column 'b' at row 35 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 36 +Warning 1265 Data truncated for column 'b' at row 36 +Warning 1366 Incorrect integer value: '' for column `test`.`t1`.`a` at row 37 +SET SESSION aria_repair_threads=4; +UPDATE t1 SET a=( (SELECT MAX(a) FROM t1)); +drop table t1,t2; diff --git a/mysql-test/suite/maria/repair-big-sort.test b/mysql-test/suite/maria/repair-big-sort.test new file mode 100644 index 00000000000..f2f4f84c29b --- /dev/null +++ b/mysql-test/suite/maria/repair-big-sort.test @@ -0,0 +1,15 @@ + +--source include/have_innodb.inc +--source include/have_partition.inc +--source include/have_sequence.inc + +SET sql_mode=''; +CREATE TEMPORARY TABLE t1 (a tinyINT,b CHAR(1)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES (1,1),(3,3),(2,2); +SET SESSION tmp_table_size=True; +CREATE TABLE t2 (c INT, d DATE) ENGINE=InnoDB PARTITION BY RANGE (YEAR (d)) SUBPARTITION BY HASH (TO_DAYS (d)) (PARTITION p0 VALUES LESS THAN (1990) (SUBPARTITION s0, SUBPARTITION s1), PARTITION p1 VALUES LESS THAN MAXVALUE (SUBPARTITION s4, SUBPARTITION s5)); +SET SESSION aria_sort_buffer_size=CAST(-1 AS UNSIGNED INT); +INSERT INTO t1 SELECT '', SEQ FROM seq_1_to_258; +SET SESSION aria_repair_threads=4; +UPDATE t1 SET a=( (SELECT MAX(a) FROM t1)); +drop table t1,t2; diff --git a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result index 56522566ec9..6da4c9bfe97 100644 --- a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic.result @@ -22,13 +22,13 @@ Warnings: Warning 1292 Truncated incorrect aria_sort_buffer_size value: '10' select @@global.aria_sort_buffer_size; @@global.aria_sort_buffer_size -4096 +16376 set session aria_sort_buffer_size=10; Warnings: Warning 1292 Truncated incorrect aria_sort_buffer_size value: '10' select @@session.aria_sort_buffer_size; @@session.aria_sort_buffer_size -4096 +16376 set global aria_sort_buffer_size=1.1; ERROR 42000: Incorrect argument type to variable 'aria_sort_buffer_size' set session aria_sort_buffer_size=1e1; @@ -40,9 +40,9 @@ Warnings: Warning 1292 Truncated incorrect aria_sort_buffer_size value: '0' select @@global.aria_sort_buffer_size; @@global.aria_sort_buffer_size -4096 +16376 set session aria_sort_buffer_size=cast(-1 as unsigned int); select @@session.aria_sort_buffer_size; @@session.aria_sort_buffer_size -18446744073709551615 +1152921504606846975 SET @@global.aria_sort_buffer_size = @start_global_value; diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria.result b/mysql-test/suite/sys_vars/r/sysvars_aria.result index 9f5585668b6..3e9130db9db 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_aria.result +++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result @@ -223,8 +223,8 @@ DEFAULT_VALUE 268434432 VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. -NUMERIC_MIN_VALUE 4096 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MIN_VALUE 16376 +NUMERIC_MAX_VALUE 1152921504606846975 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index e0aad7fa6d0..6fa25546ad1 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -97,9 +97,9 @@ @@ -207,7 +207,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. - NUMERIC_MIN_VALUE 4096 + NUMERIC_MIN_VALUE 16376 -NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 ++NUMERIC_MAX_VALUE 268435455 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -684,8 +684,8 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 +-NUMERIC_MAX_VALUE 1152921504606846975 ++NUMERIC_MAX_VALUE 268435455 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO 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 1ed5b5ce3bd..c03181d0c63 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -216,8 +216,8 @@ VARIABLE_NAME ARIA_SORT_BUFFER_SIZE VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. -NUMERIC_MIN_VALUE 4096 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MIN_VALUE 16376 +NUMERIC_MAX_VALUE 1152921504606846975 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -2127,7 +2127,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 1152921504606846975 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO 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 125d629ac87..48b481b200c 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -216,8 +216,8 @@ VARIABLE_NAME ARIA_SORT_BUFFER_SIZE VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. -NUMERIC_MIN_VALUE 4096 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MIN_VALUE 16376 +NUMERIC_MAX_VALUE 1152921504606846975 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO @@ -2287,7 +2287,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 -NUMERIC_MAX_VALUE 18446744073709551615 +NUMERIC_MAX_VALUE 1152921504606846975 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index f25ba2aa0b3..6639fc39caf 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -269,7 +269,7 @@ static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG, static MYSQL_THDVAR_ULONGLONG(sort_buffer_size, PLUGIN_VAR_RQCMDARG, "The buffer that is allocated when sorting the index when doing a " "REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.", NULL, NULL, - SORT_BUFFER_INIT, MIN_SORT_BUFFER, SIZE_T_MAX, 1); + SORT_BUFFER_INIT, MARIA_MIN_SORT_MEMORY, SIZE_T_MAX/16, 1); static MYSQL_THDVAR_ENUM(stats_method, PLUGIN_VAR_RQCMDARG, "Specifies how Aria index statistics collection code should treat " diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index fec443dfc56..6835af928ee 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -3903,6 +3903,16 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info, { sort_param.key_read= sort_key_read; sort_param.key_write= sort_key_write; + + /* + Limit usage of sort memory + We assume we don't need more memory than data file length * 2 + (There is a pointer overhead for each key, but this is hard to + estimae as we cannot be sure how many records we have in file to + be repaired). + */ + set_if_smaller(param->sort_buffer_length, sort_info.filelength*2); + set_if_bigger(param->sort_buffer_length, MARIA_MIN_SORT_MEMORY); } if (sort_info.new_info->s->data_file_type == BLOCK_RECORD) @@ -4505,6 +4515,16 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, DBUG_PRINT("io_cache_share", ("thread: %u read_cache: %p", i, &sort_param[i].read_cache)); + /* + Limit usage of sort memory + We assume we don't need more memory than data file length * 2 + (There is a pointer overhead for each key, but this is hard to + estimae as we cannot be sure how many records we have in file to + be repaired). + */ + set_if_smaller(param->sort_buffer_length, sort_info.filelength*2); + set_if_bigger(param->sort_buffer_length, MARIA_MIN_SORT_MEMORY); + /* two approaches: the same amount of memory for each thread or the memory for the same number of keys for each thread... @@ -4517,6 +4537,8 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, #else param->sort_buffer_length*sort_param[i].key_length/total_key_length; #endif + set_if_bigger(sort_param[i].sortbuff_size, MARIA_MIN_SORT_MEMORY); + if (mysql_thread_create(key_thread_find_all_keys, &sort_param[i].thr, &thr_attr, _ma_thr_find_all_keys, (void *) (sort_param+i))) diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index 4dc6472bd15..bd57cdb7727 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -29,12 +29,10 @@ /* static variables */ -#undef MIN_SORT_MEMORY #undef DISK_BUFFER_SIZE #define MERGEBUFF 15 #define MERGEBUFF2 31 -#define MIN_SORT_MEMORY (4096-MALLOC_OVERHEAD) #define DISK_BUFFER_SIZE (IO_SIZE*128) /* How many keys we can keep in memory */ @@ -145,11 +143,11 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, sort_keys= (uchar **) NULL; error= 1; maxbuffer=1; - memavl=MY_MAX(sortbuff_size,MIN_SORT_MEMORY); + memavl=MY_MAX(sortbuff_size,MARIA_MIN_SORT_MEMORY); records= info->sort_info->max_records; sort_length= info->key_length; - while (memavl >= MIN_SORT_MEMORY) + while (memavl >= MARIA_MIN_SORT_MEMORY) { /* Check if we can fit all keys into memory */ if (((ulonglong) (records + 1) * @@ -208,10 +206,10 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, break; } old_memavl=memavl; - if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY) - memavl=MIN_SORT_MEMORY; + if ((memavl=memavl/4*3) < MARIA_MIN_SORT_MEMORY && old_memavl > MARIA_MIN_SORT_MEMORY) + memavl=MARIA_MIN_SORT_MEMORY; } - if (memavl < MIN_SORT_MEMORY) + if (memavl < MARIA_MIN_SORT_MEMORY) { /* purecov: begin inspected */ _ma_check_print_error(info->sort_info->param, @@ -387,12 +385,12 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param) bzero((char*) &sort_param->unique, sizeof(sort_param->unique)); sortbuff_size= sort_param->sortbuff_size; - memavl= MY_MAX(sortbuff_size, MIN_SORT_MEMORY); + memavl= MY_MAX(sortbuff_size, MARIA_MIN_SORT_MEMORY); idx= (ha_keys) sort_param->sort_info->max_records; sort_length= sort_param->key_length; maxbuffer= 1; - while (memavl >= MIN_SORT_MEMORY) + while (memavl >= MARIA_MIN_SORT_MEMORY) { if ((my_off_t) (idx+1)*(sort_length+sizeof(char*)) <= (my_off_t) memavl) keys= idx+1; @@ -442,11 +440,11 @@ static my_bool _ma_thr_find_all_keys_exec(MARIA_SORT_PARAM* sort_param) break; } old_memavl= memavl; - if ((memavl= memavl/4*3) < MIN_SORT_MEMORY && - old_memavl > MIN_SORT_MEMORY) - memavl= MIN_SORT_MEMORY; + if ((memavl= memavl/4*3) < MARIA_MIN_SORT_MEMORY && + old_memavl > MARIA_MIN_SORT_MEMORY) + memavl= MARIA_MIN_SORT_MEMORY; } - if (memavl < MIN_SORT_MEMORY) + if (memavl < MARIA_MIN_SORT_MEMORY) { /* purecov: begin inspected */ _ma_check_print_error(sort_param->sort_info->param, @@ -626,7 +624,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) if (!mergebuf) { length=(size_t)param->sort_buffer_length; - while (length >= MIN_SORT_MEMORY) + while (length >= MARIA_MIN_SORT_MEMORY) { if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; diff --git a/storage/maria/maria_chk.c b/storage/maria/maria_chk.c index 2f130de1c7a..921751030a8 100644 --- a/storage/maria/maria_chk.c +++ b/storage/maria/maria_chk.c @@ -424,7 +424,8 @@ static struct my_option my_long_options[] = "Size of sort buffer. Used by --recover", &check_param.sort_buffer_length, &check_param.sort_buffer_length, 0, GET_ULL, REQUIRED_ARG, - SORT_BUFFER_INIT, MIN_SORT_BUFFER, SIZE_T_MAX, MALLOC_OVERHEAD, 1L, 0}, + SORT_BUFFER_INIT, MARIA_MIN_SORT_MEMORY, SIZE_T_MAX/10, MALLOC_OVERHEAD, + 1L, 0}, { "sort_key_blocks", OPT_SORT_KEY_BLOCKS, "Internal buffer for sorting keys; Don't touch :)", &check_param.sort_key_blocks, diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index 80c57ad9a0e..f4799eef379 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -45,6 +45,8 @@ #define MARIA_MAX_TREE_LEVELS 32 #define MARIA_MAX_RECORD_ON_STACK 16384 +#define MARIA_MIN_SORT_MEMORY (16384-MALLOC_OVERHEAD) + /* maria_open() flag, specific for maria_pack */ #define HA_OPEN_IGNORE_MOVED_STATE (1U << 30) @@ -1273,7 +1275,6 @@ typedef struct st_maria_block_info #define PAGE_BUFFER_INIT MY_ALIGN_DOWN(1024L*1024L*256L-MALLOC_OVERHEAD, 8192) #define READ_BUFFER_INIT MY_ALIGN_DOWN(1024L*256L-MALLOC_OVERHEAD, 1024) #define SORT_BUFFER_INIT MY_ALIGN_DOWN(1024L*1024L*256L-MALLOC_OVERHEAD, 1024) -#define MIN_SORT_BUFFER 4096U #define fast_ma_writeinfo(INFO) if (!(INFO)->s->tot_locks) (void) _ma_writeinfo((INFO),0) #define fast_ma_readinfo(INFO) ((INFO)->lock_type == F_UNLCK) && _ma_readinfo((INFO),F_RDLCK,1) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 4fef809f4f0..ddab8bcf741 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -80,7 +80,7 @@ static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG, static MYSQL_THDVAR_ULONGLONG(sort_buffer_size, PLUGIN_VAR_RQCMDARG, "The buffer that is allocated when sorting the index when doing " "a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE", NULL, NULL, - SORT_BUFFER_INIT, MIN_SORT_BUFFER, SIZE_T_MAX, 1); + SORT_BUFFER_INIT, MIN_SORT_BUFFER, SIZE_T_MAX/16, 1); static MYSQL_SYSVAR_BOOL(use_mmap, opt_myisam_use_mmap, PLUGIN_VAR_NOCMDARG, "Use memory mapping for reading and writing MyISAM tables", NULL, NULL, FALSE); From 4f7317579e700a8ac4375b3b85e5fb1a91a1a20f Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 29 Apr 2023 20:39:50 +0300 Subject: [PATCH 03/80] Fixed "Trying to lock uninitialized mutex' in parallel replication The problem was that mutex_init() was called after the worker was put into the domain_hash, which allowed other threads to access it before mutex was initialized. --- sql/rpl_parallel.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 746c923ba44..96b319c5f4a 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -2317,9 +2317,7 @@ rpl_parallel::find(uint32 domain_id) mysql_cond_init(key_COND_parallel_entry, &e->COND_parallel_entry, NULL); if (my_hash_insert(&domain_hash, (uchar *)e)) { - mysql_cond_destroy(&e->COND_parallel_entry); - mysql_mutex_destroy(&e->LOCK_parallel_entry); - my_free(e); + free_rpl_parallel_entry(e); return NULL; } } From 7f96dd50e25abc2a9a75d96cc1c711124b6be765 Mon Sep 17 00:00:00 2001 From: Monty Date: Tue, 2 May 2023 22:30:57 +0300 Subject: [PATCH 04/80] MDEV-6768 Wrong result with aggregate with join with no result set When a query does implicit grouping and join operation produces an empty result set, a NULL-complemented row combination is generated. However, constant table fields still show non-NULL values. What happens in the is that end_send_group() is called with a const row but without any rows matching the WHERE clause. This last part is shown by 'join->first_record' not being set. This causes item->no_rows_in_result() to be called for all items to reset all sum functions to their initial state. However fields are not set to NULL. The used fix is to produce NULL-complemented records for constant tables as well. Also, reset the constant table's records back in case we're in a subquery which may get re-executed. An alternative fix would have item->no_rows_in_result() also work with Item_field objects. There is some other issues with the code: - join->no_rows_in_result_called is used but never set. - Tables that are used with group functions are not properly marked as maybe_null, which is required if the table rows should be regarded as null-complemented (not existing). - The code that tries to detect if mixed_implicit_grouping should be set didn't take into account all usage of fields and sum functions. - Item_func::restore_to_before_no_rows_in_result() called the wrong function. - join->clear() does not use a table_map argument to clear_tables(), which caused it to ignore constant tables. - unclear_tables() does not correctly restore status to what is was before clear_tables(). Main bug fix was to always use a table_map argument to clear_tables() and always use join->clear() and clear_tables() together with unclear_tables(). Other fixes: - Fixed Item_func::restore_to_before_no_rows_in_result() - Set 'join->no_rows_in_result_called' when no_rows_in_result_set() is called. - Removed not used argument from setup_end_select_func(). - More code comments - Ensure that end_send_group() modifies the same fields as are in the result set. - Changed return_zero_rows() to use pointers instead of references, similar to the rest of the code. --- mysql-test/main/group_min_max.result | 113 +++++++++++ mysql-test/main/group_min_max.test | 115 +++++++++++ mysql-test/main/type_timestamp.result | 2 + mysql-test/main/type_timestamp.test | 1 + sql/item_func.h | 2 +- sql/sql_select.cc | 264 ++++++++++++++++---------- sql/sql_select.h | 5 +- sql/table.h | 10 +- 8 files changed, 405 insertions(+), 107 deletions(-) diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result index fd9b5be4260..4c2693e5e4c 100644 --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@ -4025,3 +4025,116 @@ drop table t1; # # End of 10.1 tests # +# +# MDEV-6768 Wrong result with agregate with join with no resultset +# +create table t1 +( +PARENT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, +PARENT_FIELD VARCHAR(10), +PRIMARY KEY (PARENT_ID) +) engine=innodb; +create table t2 +( +CHILD_ID INT NOT NULL AUTO_INCREMENT, +PARENT_ID INT NOT NULL, +CHILD_FIELD varchar(10), +PRIMARY KEY (CHILD_ID) +)engine=innodb; +INSERT INTO t1 (PARENT_FIELD) +SELECT 'AAAA'; +INSERT INTO t2 (PARENT_ID, CHILD_FIELD) +SELECT 1, 'BBBB'; +explain select +t1.PARENT_ID, +min(CHILD_FIELD) +from t1 straight_join t2 +where t1.PARENT_ID = 1 +and t1.PARENT_ID = t2.PARENT_ID +and t2.CHILD_FIELD = "ZZZZ"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where +select +t1.PARENT_ID, +min(CHILD_FIELD) +from t1 straight_join t2 +where t1.PARENT_ID = 1 +and t1.PARENT_ID = t2.PARENT_ID +and t2.CHILD_FIELD = "ZZZZ"; +PARENT_ID min(CHILD_FIELD) +NULL NULL +select +1, +min(CHILD_FIELD) +from t1 straight_join t2 +where t1.PARENT_ID = 1 +and t1.PARENT_ID = t2.PARENT_ID +and t2.CHILD_FIELD = "ZZZZ"; +1 min(CHILD_FIELD) +1 NULL +select +IFNULL(t1.PARENT_ID,1), +min(CHILD_FIELD) +from t1 straight_join t2 +where t1.PARENT_ID = 1 +and t1.PARENT_ID = t2.PARENT_ID +and t2.CHILD_FIELD = "ZZZZ"; +IFNULL(t1.PARENT_ID,1) min(CHILD_FIELD) +1 NULL +# Check that things works with MyISAM (which has different explain) +alter table t1 engine=myisam; +alter table t2 engine=myisam; +explain select +t1.PARENT_ID, +min(CHILD_FIELD) +from t1 straight_join t2 +where t1.PARENT_ID = 1 +and t1.PARENT_ID = t2.PARENT_ID +and t2.CHILD_FIELD = "ZZZZ"; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +select +t1.PARENT_ID, +min(CHILD_FIELD) +from t1 straight_join t2 +where t1.PARENT_ID = 1 +and t1.PARENT_ID = t2.PARENT_ID +and t2.CHILD_FIELD = "ZZZZ"; +PARENT_ID min(CHILD_FIELD) +NULL NULL +drop table t1,t2; +# Check that things works if sub queries are re-executed +create table t1 (a int primary key, b int); +create table t2 (a int primary key, b int); +create table t3 (a int primary key, b int); +insert into t1 values (1,1),(2,2),(3,3); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(3,3); +explain +select *, +(select +CONCAT('t2:', IFNULL(t2.a, 't2a-null'), ';', +'min_t3_b:', IFNULL(min(t3.b), 't3b-null')) +from t2,t3 +where t2.a=1 and t1.b = t3.a) as s1 +from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 +2 DEPENDENT SUBQUERY t2 const PRIMARY PRIMARY 4 const 1 Using index +2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 +select *, +(select +CONCAT('t2:', IFNULL(t2.a, 't2a-null'), ';', +'min_t3_b:', IFNULL(min(t3.b), 't3b-null')) +from t2,t3 +where t2.a=1 and t1.b = t3.a) as s1 +from t1; +a b s1 +1 1 t2:1;min_t3_b:1 +2 2 t2:t2a-null;min_t3_b:t3b-null +3 3 t2:1;min_t3_b:3 +drop table t1,t2,t3; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/group_min_max.test b/mysql-test/main/group_min_max.test index 506323599cb..3c5c1b5bb9b 100644 --- a/mysql-test/main/group_min_max.test +++ b/mysql-test/main/group_min_max.test @@ -5,6 +5,7 @@ --source include/no_valgrind_without_big.inc --source include/default_optimizer_switch.inc +--source include/have_innodb.inc # # TODO: @@ -1688,3 +1689,117 @@ drop table t1; --echo # --echo # End of 10.1 tests --echo # + +--echo # +--echo # MDEV-6768 Wrong result with agregate with join with no resultset +--echo # + +create table t1 +( + PARENT_ID int(10) unsigned NOT NULL AUTO_INCREMENT, + PARENT_FIELD VARCHAR(10), + PRIMARY KEY (PARENT_ID) +) engine=innodb; + +create table t2 +( + CHILD_ID INT NOT NULL AUTO_INCREMENT, + PARENT_ID INT NOT NULL, + CHILD_FIELD varchar(10), + PRIMARY KEY (CHILD_ID) +)engine=innodb; + +INSERT INTO t1 (PARENT_FIELD) +SELECT 'AAAA'; + +INSERT INTO t2 (PARENT_ID, CHILD_FIELD) +SELECT 1, 'BBBB'; + +explain select + t1.PARENT_ID, + min(CHILD_FIELD) + from t1 straight_join t2 + where t1.PARENT_ID = 1 + and t1.PARENT_ID = t2.PARENT_ID + and t2.CHILD_FIELD = "ZZZZ"; + +select + t1.PARENT_ID, + min(CHILD_FIELD) + from t1 straight_join t2 + where t1.PARENT_ID = 1 + and t1.PARENT_ID = t2.PARENT_ID + and t2.CHILD_FIELD = "ZZZZ"; + +select + 1, + min(CHILD_FIELD) + from t1 straight_join t2 + where t1.PARENT_ID = 1 + and t1.PARENT_ID = t2.PARENT_ID + and t2.CHILD_FIELD = "ZZZZ"; + +select + IFNULL(t1.PARENT_ID,1), + min(CHILD_FIELD) + from t1 straight_join t2 + where t1.PARENT_ID = 1 + and t1.PARENT_ID = t2.PARENT_ID + and t2.CHILD_FIELD = "ZZZZ"; + + +--echo # Check that things works with MyISAM (which has different explain) + +alter table t1 engine=myisam; +alter table t2 engine=myisam; + +explain select + t1.PARENT_ID, + min(CHILD_FIELD) + from t1 straight_join t2 + where t1.PARENT_ID = 1 + and t1.PARENT_ID = t2.PARENT_ID + and t2.CHILD_FIELD = "ZZZZ"; + +select + t1.PARENT_ID, + min(CHILD_FIELD) + from t1 straight_join t2 + where t1.PARENT_ID = 1 + and t1.PARENT_ID = t2.PARENT_ID + and t2.CHILD_FIELD = "ZZZZ"; + +drop table t1,t2; + +--echo # Check that things works if sub queries are re-executed + +create table t1 (a int primary key, b int); +create table t2 (a int primary key, b int); +create table t3 (a int primary key, b int); + +insert into t1 values (1,1),(2,2),(3,3); +insert into t2 values (1,1),(2,2),(3,3); +insert into t3 values (1,1),(3,3); + +explain +select *, + (select + CONCAT('t2:', IFNULL(t2.a, 't2a-null'), ';', + 'min_t3_b:', IFNULL(min(t3.b), 't3b-null')) + from t2,t3 + where t2.a=1 and t1.b = t3.a) as s1 +from t1; + +select *, + (select + CONCAT('t2:', IFNULL(t2.a, 't2a-null'), ';', + 'min_t3_b:', IFNULL(min(t3.b), 't3b-null')) + from t2,t3 + where t2.a=1 and t1.b = t3.a) as s1 +from t1; + +drop table t1,t2,t3; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/main/type_timestamp.result b/mysql-test/main/type_timestamp.result index 58cb12ae267..dbccee08ada 100644 --- a/mysql-test/main/type_timestamp.result +++ b/mysql-test/main/type_timestamp.result @@ -1230,6 +1230,8 @@ SELECT * FROM t1 HAVING MIN(t1.c1) >= ALL(SELECT 'a' UNION SELECT 'r'); c1 Warnings: Warning 1292 Truncated incorrect datetime value: 'r' +SELECT * FROM t1 HAVING MIN(t1.c1) > 0; +c1 DROP TABLE t1; CREATE TABLE t1 (c1 timestamp); INSERT INTO t1 VALUES ('2010-01-01 00:00:00'); diff --git a/mysql-test/main/type_timestamp.test b/mysql-test/main/type_timestamp.test index f12cc2a4bc3..c8517656071 100644 --- a/mysql-test/main/type_timestamp.test +++ b/mysql-test/main/type_timestamp.test @@ -810,6 +810,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 timestamp); SELECT MIN(t1.c1) AS k1 FROM t1 HAVING (k1 >= ALL(SELECT 'a' UNION SELECT 'r')); SELECT * FROM t1 HAVING MIN(t1.c1) >= ALL(SELECT 'a' UNION SELECT 'r'); +SELECT * FROM t1 HAVING MIN(t1.c1) > 0; DROP TABLE t1; CREATE TABLE t1 (c1 timestamp); diff --git a/sql/item_func.h b/sql/item_func.h index 41f2a52616d..3afe0d00661 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -381,7 +381,7 @@ public: { for (uint i= 0; i < arg_count; i++) { - args[i]->no_rows_in_result(); + args[i]->restore_to_before_no_rows_in_result(); } } void convert_const_compared_to_int_field(THD *thd); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 56a185acdd5..2be1fea9b03 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -142,10 +142,10 @@ static void update_depend_map_for_order(JOIN *join, ORDER *order); static ORDER *remove_const(JOIN *join,ORDER *first_order,COND *cond, bool change_list, bool *simple_order); static int return_zero_rows(JOIN *join, select_result *res, - List &tables, - List &fields, bool send_row, + List *tables, + List *fields, bool send_row, ulonglong select_options, const char *info, - Item *having, List &all_fields); + Item *having, List *all_fields); static COND *build_equal_items(JOIN *join, COND *cond, COND_EQUAL *inherited, List *join_list, @@ -1157,11 +1157,40 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables) DBUG_RETURN(0); } + /***************************************************************************** Check fields, find best join, do the select and output fields. mysql_select assumes that all tables are already opened *****************************************************************************/ +/* + Check if we have a field reference. If yes, we have to use + mixed_implicit_grouping. +*/ + +static bool check_list_for_field(List *items) +{ + List_iterator_fast select_it(*items); + Item *select_el; + + while ((select_el= select_it++)) + { + if (select_el->with_field) + return true; + } + return false; +} + +static bool check_list_for_field(ORDER *order) +{ + for (; order; order= order->next) + { + if (order->item[0]->with_field) + return true; + } + return false; +} + /** Prepare of whole select (including sub queries in future). @@ -1241,53 +1270,45 @@ JOIN::prepare(TABLE_LIST *tables_init, DBUG_RETURN(-1); /* - TRUE if the SELECT list mixes elements with and without grouping, - and there is no GROUP BY clause. Mixing non-aggregated fields with - aggregate functions in the SELECT list is a MySQL extenstion that - is allowed only if the ONLY_FULL_GROUP_BY sql mode is not set. + mixed_implicit_grouping will be set to TRUE if the SELECT list + mixes elements with and without grouping, and there is no GROUP BY + clause. + Mixing non-aggregated fields with aggregate functions in the + SELECT list or HAVING is a MySQL extension that is allowed only if + the ONLY_FULL_GROUP_BY sql mode is not set. */ mixed_implicit_grouping= false; if ((~thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY) && select_lex->with_sum_func && !group_list) { - List_iterator_fast select_it(fields_list); - Item *select_el; /* Element of the SELECT clause, can be an expression. */ - bool found_field_elem= false; - bool found_sum_func_elem= false; - - while ((select_el= select_it++)) + if (check_list_for_field(&fields_list) || + check_list_for_field(order)) { - if (select_el->with_sum_func()) - found_sum_func_elem= true; - if (select_el->with_field) - found_field_elem= true; - if (found_sum_func_elem && found_field_elem) + TABLE_LIST *tbl; + List_iterator_fast li(select_lex->leaf_tables); + + mixed_implicit_grouping= true; // mark for future + + while ((tbl= li++)) { - mixed_implicit_grouping= true; - break; + /* + If the query uses implicit grouping where the select list + contains both aggregate functions and non-aggregate fields, + any non-aggregated field may produce a NULL value. Set all + fields of each table as nullable before semantic analysis to + take into account this change of nullability. + + Note: this loop doesn't touch tables inside merged + semi-joins, because subquery-to-semijoin conversion has not + been done yet. This is intended. + */ + if (tbl->table) + tbl->table->maybe_null= 1; } } } - table_count= select_lex->leaf_tables.elements; - TABLE_LIST *tbl; - List_iterator_fast li(select_lex->leaf_tables); - while ((tbl= li++)) - { - /* - If the query uses implicit grouping where the select list contains both - aggregate functions and non-aggregate fields, any non-aggregated field - may produce a NULL value. Set all fields of each table as nullable before - semantic analysis to take into account this change of nullability. - - Note: this loop doesn't touch tables inside merged semi-joins, because - subquery-to-semijoin conversion has not been done yet. This is intended. - */ - if (mixed_implicit_grouping && tbl->table) - tbl->table->maybe_null= 1; - } - uint real_og_num= og_num; if (skip_order_by && select_lex != select_lex->master_unit()->global_parameters()) @@ -3838,7 +3859,7 @@ bool JOIN::make_aggr_tables_info() set_items_ref_array(items0); if (join_tab) join_tab[exec_join_tab_cnt() + aggr_tables - 1].next_select= - setup_end_select_func(this, NULL); + setup_end_select_func(this); group= has_group_by; DBUG_RETURN(false); @@ -4220,13 +4241,7 @@ JOIN::reinit() } } - /* Reset of sum functions */ - if (sum_funcs) - { - Item_sum *func, **func_ptr= sum_funcs; - while ((func= *(func_ptr++))) - func->clear(); - } + clear_sum_funcs(); if (no_rows_in_result_called) { @@ -4510,12 +4525,12 @@ void JOIN::exec_inner() } else { - (void) return_zero_rows(this, result, select_lex->leaf_tables, - *columns_list, + (void) return_zero_rows(this, result, &select_lex->leaf_tables, + columns_list, send_row_on_empty_set(), select_options, zero_result_cause, - having ? having : tmp_having, all_fields); + having ? having : tmp_having, &all_fields); DBUG_VOID_RETURN; } } @@ -14626,10 +14641,36 @@ ORDER *simple_remove_const(ORDER *order, COND *where) } +/* + Set all fields in the table to have a null value + + @param tables Table list +*/ + +static void make_tables_null_complemented(List *tables) +{ + List_iterator ti(*tables); + TABLE_LIST *table; + while ((table= ti++)) + { + /* + Don't touch semi-join materialization tables, as the a join_free() + call may have freed them (and HAVING clause can't have references to + them anyway). + */ + if (!table->is_jtbm()) + { + TABLE *tbl= table->table; + mark_as_null_row(tbl); // Set fields to NULL + } + } +} + + static int -return_zero_rows(JOIN *join, select_result *result, List &tables, - List &fields, bool send_row, ulonglong select_options, - const char *info, Item *having, List &all_fields) +return_zero_rows(JOIN *join, select_result *result, List *tables, + List *fields, bool send_row, ulonglong select_options, + const char *info, Item *having, List *all_fields) { DBUG_ENTER("return_zero_rows"); @@ -14645,24 +14686,15 @@ return_zero_rows(JOIN *join, select_result *result, List &tables, Set all tables to have NULL row. This is needed as we will be evaluating HAVING condition. */ - List_iterator ti(tables); - TABLE_LIST *table; - while ((table= ti++)) - { - /* - Don't touch semi-join materialization tables, as the above join_free() - call has freed them (and HAVING clause can't have references to them - anyway). - */ - if (!table->is_jtbm()) - mark_as_null_row(table->table); // All fields are NULL - } - List_iterator_fast it(all_fields); + make_tables_null_complemented(tables); + + List_iterator_fast it(*all_fields); Item *item; /* Inform all items (especially aggregating) to calculate HAVING correctly, also we will need it for sending results. */ + join->no_rows_in_result_called= 1; while ((item= it++)) item->no_rows_in_result(); if (having && having->val_int() == 0) @@ -14676,12 +14708,12 @@ return_zero_rows(JOIN *join, select_result *result, List &tables, join->thd->limit_found_rows= 0; } - if (!(result->send_result_set_metadata(fields, + if (!(result->send_result_set_metadata(*fields, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))) { bool send_error= FALSE; if (send_row) - send_error= result->send_data(fields) > 0; + send_error= result->send_data(*fields) > 0; if (likely(!send_error)) result->send_eof(); // Should be safe } @@ -14697,49 +14729,42 @@ return_zero_rows(JOIN *join, select_result *result, List &tables, } /** - used only in JOIN::clear (always) and in do_select() - (if there where no matching rows) + Reset table rows to contain a null-complement row (all fields are null) + + Used only in JOIN::clear() and in do_select() if there where no matching rows. @param join JOIN - @param cleared_tables If not null, clear also const tables and mark all - cleared tables in the map. cleared_tables is only - set when called from do_select() when there is a - group function and there where no matching rows. + @param cleared_tables Used to mark all cleared tables in the map. Needed for + unclear_tables() to know which tables to restore to + their original state. */ static void clear_tables(JOIN *join, table_map *cleared_tables) { - /* - must clear only the non-const tables as const tables are not re-calculated. - */ + DBUG_ASSERT(cleared_tables); for (uint i= 0 ; i < join->table_count ; i++) { TABLE *table= join->table[i]; if (table->null_row) continue; // Nothing more to do - if (!(table->map & join->const_table_map) || cleared_tables) + (*cleared_tables)|= (((table_map) 1) << i); + if (table->s->null_bytes) { - if (cleared_tables) - { - (*cleared_tables)|= (((table_map) 1) << i); - if (table->s->null_bytes) - { - /* - Remember null bits for the record so that we can restore the - original const record in unclear_tables() - */ - memcpy(table->record[1], table->null_flags, table->s->null_bytes); - } - } - mark_as_null_row(table); // All fields are NULL + /* + Remember null bits for the record so that we can restore the + original const record in unclear_tables() + */ + memcpy(table->record[1], table->null_flags, table->s->null_bytes); } + mark_as_null_row(table); // All fields are NULL } } /** Reverse null marking for tables and restore null bits. + This return the tables to the state of before clear_tables(). We have to do this because the tables may be re-used in a sub query and the subquery will assume that the const tables contains the original @@ -20216,9 +20241,9 @@ void set_postjoin_aggr_write_func(JOIN_TAB *tab) end_select function to use. This function can't fail. */ -Next_select_func setup_end_select_func(JOIN *join, JOIN_TAB *tab) +Next_select_func setup_end_select_func(JOIN *join) { - TMP_TABLE_PARAM *tmp_tbl= tab ? tab->tmp_table_param : &join->tmp_table_param; + TMP_TABLE_PARAM *tmp_tbl= &join->tmp_table_param; /* Choose method for presenting result to user. Use end_send_group @@ -20289,7 +20314,7 @@ do_select(JOIN *join, Procedure *procedure) join->duplicate_rows= join->send_records=0; if (join->only_const_tables() && !join->need_tmp) { - Next_select_func end_select= setup_end_select_func(join, NULL); + Next_select_func end_select= setup_end_select_func(join); /* HAVING will be checked after processing aggregate functions, @@ -20764,6 +20789,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records) { DBUG_ENTER("sub_select"); + /* Restore state if mark_as_null_row() have been called */ if (join_tab->last_inner) { JOIN_TAB *last_inner_tab= join_tab->last_inner; @@ -22126,11 +22152,18 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), { int idx= -1; enum_nested_loop_state ok_code= NESTED_LOOP_OK; + /* + join_tab can be 0 in the case all tables are const tables and we did not + need a temporary table to store the result. + In this case we use the original given fields, which is stored in + join->fields. + */ List *fields= join_tab ? (join_tab-1)->fields : join->fields; DBUG_ENTER("end_send_group"); if (!join->items3.is_null() && !join->set_group_rpa) { + /* Move ref_pointer_array to points to items3 */ join->set_group_rpa= true; join->set_items_ref_array(join->items3); } @@ -22138,10 +22171,12 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), if (!join->first_record || end_of_records || (idx=test_if_group_changed(join->group_fields)) >= 0) { + if (!join->group_sent && (join->first_record || (end_of_records && !join->group && !join->group_optimized_away))) { + table_map cleared_tables= (table_map) 0; if (join->procedure) join->procedure->end_group(); if (idx < (int) join->send_group_parts) @@ -22164,11 +22199,13 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), { if (!join->first_record) { - List_iterator_fast it(*join->fields); - Item *item; /* No matching rows for group function */ - join->clear(); + List_iterator_fast it(*fields); + Item *item; + join->no_rows_in_result_called= 1; + + join->clear(&cleared_tables); while ((item= it++)) item->no_rows_in_result(); } @@ -22194,7 +22231,14 @@ end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), if (join->rollup_send_data((uint) (idx+1))) error= 1; } - } + if (join->no_rows_in_result_called) + { + /* Restore null tables to original state */ + join->no_rows_in_result_called= 0; + if (cleared_tables) + unclear_tables(join, &cleared_tables); + } + } if (unlikely(error > 0)) DBUG_RETURN(NESTED_LOOP_ERROR); /* purecov: inspected */ if (end_of_records) @@ -22496,6 +22540,7 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), { if (join->first_record || (end_of_records && !join->group)) { + table_map cleared_tables= (table_map) 0; if (join->procedure) join->procedure->end_group(); int send_group_parts= join->send_group_parts; @@ -22504,7 +22549,7 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), if (!join->first_record) { /* No matching rows for group function */ - join->clear(); + join->clear(&cleared_tables); } copy_sum_funcs(join->sum_funcs, join->sum_funcs_end[send_group_parts]); @@ -22527,6 +22572,8 @@ end_write_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)), DBUG_RETURN(NESTED_LOOP_ERROR); } } + if (cleared_tables) + unclear_tables(join, &cleared_tables); if (end_of_records) goto end; } @@ -26629,11 +26676,8 @@ int JOIN::rollup_write_data(uint idx, TMP_TABLE_PARAM *tmp_table_param_arg, TABL (end_send_group/end_write_group) */ -void JOIN::clear() +void inline JOIN::clear_sum_funcs() { - clear_tables(this, 0); - copy_fields(&tmp_table_param); - if (sum_funcs) { Item_sum *func, **func_ptr= sum_funcs; @@ -26643,6 +26687,22 @@ void JOIN::clear() } +/* + Prepare for returning 'empty row' when there is no matching row. + + - Mark all tables with mark_as_null_row() + - Make a copy of of all simple SELECT items + - Reset all sum functions to NULL or 0. +*/ + +void JOIN::clear(table_map *cleared_tables) +{ + clear_tables(this, cleared_tables); + copy_fields(&tmp_table_param); + clear_sum_funcs(); +} + + /** Print an EXPLAIN line with all NULLs and given message in the 'Extra' column diff --git a/sql/sql_select.h b/sql/sql_select.h index 0dfecc98a48..4bac201c3b4 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -227,7 +227,7 @@ enum sj_strategy_enum typedef enum_nested_loop_state (*Next_select_func)(JOIN *, struct st_join_table *, bool); -Next_select_func setup_end_select_func(JOIN *join, JOIN_TAB *tab); +Next_select_func setup_end_select_func(JOIN *join); int rr_sequential(READ_RECORD *info); int rr_sequential_and_unpack(READ_RECORD *info); Item *remove_pushed_top_conjuncts(THD *thd, Item *cond); @@ -1730,7 +1730,8 @@ public: void join_free(); /** Cleanup this JOIN, possibly for reuse */ void cleanup(bool full); - void clear(); + void clear(table_map *cleared_tables); + void inline clear_sum_funcs(); bool send_row_on_empty_set() { return (do_send_rows && implicit_grouping && !group_optimized_away && diff --git a/sql/table.h b/sql/table.h index 6f7f4e63473..1414659b78f 100644 --- a/sql/table.h +++ b/sql/table.h @@ -3337,10 +3337,16 @@ inline void mark_as_null_row(TABLE *table) bfill(table->null_flags,table->s->null_bytes,255); } +/* + Restore table to state before mark_as_null_row() call. + This assumes that the caller has restored table->null_flags, + as is done in unclear_tables(). +*/ + inline void unmark_as_null_row(TABLE *table) { - table->null_row=0; - table->status= STATUS_NO_RECORD; + table->null_row= 0; + table->status&= ~STATUS_NULL_ROW; } bool is_simple_order(ORDER *order); From 9b6f87b62afb32ea238e39b362b8e761f53e541c Mon Sep 17 00:00:00 2001 From: sara Date: Wed, 3 May 2023 01:34:32 +0200 Subject: [PATCH 05/80] MDEV-30892 test galera.galera_log_bin is not deterministic galera.galera_log_bin test created the test tables and executed initial DML into node 2 Then connection is switched to node 1, where ALTER TABLE was attempted. But there is no guarantee that the table to alter was yet replicated to node 1. The fix in this commit, creates the test tables in node 1 instead, so it is guaranteed that they are available for the later ALTER Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/galera_log_bin.result | 4 ++-- mysql-test/suite/galera/r/galera_log_bin_ext.result | 4 ++-- .../suite/galera/r/galera_log_bin_ext_mariabackup.result | 4 ++-- mysql-test/suite/galera/r/galera_log_bin_opt.result | 4 ++-- mysql-test/suite/galera/t/galera_log_bin.inc | 4 ++-- mysql-test/suite/galera/t/galera_log_bin_sst.inc | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result index df7ace9d95a..31f953bfd36 100644 --- a/mysql-test/suite/galera/r/galera_log_bin.result +++ b/mysql-test/suite/galera/r/galera_log_bin.result @@ -1,10 +1,10 @@ connection node_2; connection node_1; -connection node_1; +connection node_2; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; -connection node_2; +connection node_1; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/r/galera_log_bin_ext.result b/mysql-test/suite/galera/r/galera_log_bin_ext.result index b110cb4dba3..9d7ea473241 100644 --- a/mysql-test/suite/galera/r/galera_log_bin_ext.result +++ b/mysql-test/suite/galera/r/galera_log_bin_ext.result @@ -2,11 +2,11 @@ connection node_2; connection node_1; connection node_1; connection node_2; -connection node_1; +connection node_2; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; -connection node_2; +connection node_1; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result b/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result index b110cb4dba3..9d7ea473241 100644 --- a/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result +++ b/mysql-test/suite/galera/r/galera_log_bin_ext_mariabackup.result @@ -2,11 +2,11 @@ connection node_2; connection node_1; connection node_1; connection node_2; -connection node_1; +connection node_2; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; -connection node_2; +connection node_1; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/r/galera_log_bin_opt.result b/mysql-test/suite/galera/r/galera_log_bin_opt.result index df7ace9d95a..31f953bfd36 100644 --- a/mysql-test/suite/galera/r/galera_log_bin_opt.result +++ b/mysql-test/suite/galera/r/galera_log_bin_opt.result @@ -1,10 +1,10 @@ connection node_2; connection node_1; -connection node_1; +connection node_2; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; -connection node_2; +connection node_1; set global wsrep_on=OFF; reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/t/galera_log_bin.inc b/mysql-test/suite/galera/t/galera_log_bin.inc index 4c245846752..3cac28047d4 100644 --- a/mysql-test/suite/galera/t/galera_log_bin.inc +++ b/mysql-test/suite/galera/t/galera_log_bin.inc @@ -1,11 +1,11 @@ --source include/galera_cluster.inc --source include/force_restart.inc ---connection node_1 +--connection node_2 set global wsrep_on=OFF; reset master; set global wsrep_on=ON; ---connection node_2 +--connection node_1 set global wsrep_on=OFF; reset master; set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/t/galera_log_bin_sst.inc b/mysql-test/suite/galera/t/galera_log_bin_sst.inc index 3d20add6d9e..87420ad539f 100644 --- a/mysql-test/suite/galera/t/galera_log_bin_sst.inc +++ b/mysql-test/suite/galera/t/galera_log_bin_sst.inc @@ -6,11 +6,11 @@ --let $node_2=node_2 --source include/auto_increment_offset_save.inc ---connection node_1 +--connection node_2 set global wsrep_on=OFF; reset master; set global wsrep_on=ON; ---connection node_2 +--connection node_1 set global wsrep_on=OFF; reset master; set global wsrep_on=ON; From 01ea779149a32f0dfd6fe8ea52c7ba51a69e1016 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 28 Apr 2023 14:41:27 +0400 Subject: [PATCH 06/80] MDEV-31174 New class Native_functions_hash --- plugin/versioning/versioning.cc | 6 +-- sql/item_create.cc | 82 ++++++++++++++++++++------------- sql/item_create.h | 57 ++++++++++++++++++----- sql/sql_lex.cc | 2 +- sql/sql_show.cc | 3 -- sql/sql_yacc.yy | 2 +- sql/sql_yacc_ora.yy | 2 +- 7 files changed, 101 insertions(+), 53 deletions(-) diff --git a/plugin/versioning/versioning.cc b/plugin/versioning/versioning.cc index e150e4e8465..8b9fb74e77b 100644 --- a/plugin/versioning/versioning.cc +++ b/plugin/versioning/versioning.cc @@ -140,7 +140,7 @@ Create_func_trt_trx_sees Create_func_trt_trx_sees::s_singleton; #define BUILDER(F) & F::s_singleton -static Native_func_registry func_array[] = +static const Native_func_registry func_array_vers[] = { { { C_STRING_WITH_LEN("TRT_BEGIN_TS") }, BUILDER(Create_func_trt)}, { { C_STRING_WITH_LEN("TRT_COMMIT_ID") }, BUILDER(Create_func_trt)}, @@ -164,7 +164,7 @@ static int versioning_plugin_init(void *p __attribute__ ((unused))) { DBUG_ENTER("versioning_plugin_init"); // No need in locking since we so far single-threaded - int res= item_create_append(func_array); + int res= native_functions_hash.append(func_array_vers); if (res) { my_message(ER_PLUGIN_IS_NOT_LOADED, "Can't append function array" , MYF(0)); @@ -177,7 +177,7 @@ static int versioning_plugin_init(void *p __attribute__ ((unused))) static int versioning_plugin_deinit(void *p __attribute__ ((unused))) { DBUG_ENTER("versioning_plugin_deinit"); - (void) item_create_remove(func_array); + (void) native_functions_hash.remove(func_array_vers); DBUG_RETURN(0); } diff --git a/sql/item_create.cc b/sql/item_create.cc index 616ba3a641a..a95d2ae4f9a 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -7249,7 +7249,7 @@ Create_func_year_week::create_native(THD *thd, const LEX_CSTRING *name, - keep 1 line per entry, it makes grep | sort easier */ -Native_func_registry func_array[] = +const Native_func_registry func_array[] = { { { STRING_WITH_LEN("ABS") }, BUILDER(Create_func_abs)}, { { STRING_WITH_LEN("ACOS") }, BUILDER(Create_func_acos)}, @@ -7609,9 +7609,10 @@ Native_func_registry func_array[] = { {0, 0}, NULL} }; -size_t func_array_length= sizeof(func_array) / sizeof(Native_func_registry) - 1; -static HASH native_functions_hash; +const size_t func_array_length= sizeof(func_array) / sizeof(Native_func_registry) - 1; + +Native_functions_hash native_functions_hash; extern "C" uchar* get_native_fct_hash_key(const uchar *buff, size_t *length, @@ -7628,85 +7629,89 @@ get_native_fct_hash_key(const uchar *buff, size_t *length, startup only (before going multi-threaded) */ -int item_create_init() +bool Native_functions_hash::init(size_t count) { - DBUG_ENTER("item_create_init"); + DBUG_ENTER("Native_functions_hash::init"); - if (my_hash_init(& native_functions_hash, + if (my_hash_init(this, system_charset_info, - array_elements(func_array), + (ulong) count, 0, 0, (my_hash_get_key) get_native_fct_hash_key, NULL, /* Nothing to free */ MYF(0))) - DBUG_RETURN(1); + DBUG_RETURN(true); - DBUG_RETURN(item_create_append(func_array)); + DBUG_RETURN(false); } -int item_create_append(Native_func_registry array[]) -{ - Native_func_registry *func; - DBUG_ENTER("item_create_append"); +bool Native_functions_hash::append(const Native_func_registry array[]) +{ + const Native_func_registry *func; + + DBUG_ENTER("Native_functions_hash::append"); for (func= array; func->builder != NULL; func++) { - if (my_hash_insert(& native_functions_hash, (uchar*) func)) - DBUG_RETURN(1); + if (my_hash_insert(this, (uchar*) func)) + DBUG_RETURN(true); } #ifndef DBUG_OFF - for (uint i=0 ; i < native_functions_hash.records ; i++) + for (uint i=0 ; i < records ; i++) { - func= (Native_func_registry*) my_hash_element(& native_functions_hash, i); + func= (Native_func_registry*) my_hash_element(this, i); DBUG_PRINT("info", ("native function: %s length: %u", func->name.str, (uint) func->name.length)); } #endif - DBUG_RETURN(0); + DBUG_RETURN(false); } -int item_create_remove(Native_func_registry array[]) -{ - Native_func_registry *func; - DBUG_ENTER("item_create_remove"); +bool Native_functions_hash::remove(const Native_func_registry array[]) +{ + const Native_func_registry *func; + + DBUG_ENTER("Native_functions_hash::remove"); for (func= array; func->builder != NULL; func++) { - if (my_hash_delete(& native_functions_hash, (uchar*) func)) - DBUG_RETURN(1); + if (my_hash_delete(this, (uchar*) func)) + DBUG_RETURN(true); } - DBUG_RETURN(0); + DBUG_RETURN(false); } + /* Empty the hash table for native functions. Note: this code is not thread safe, and is intended to be used at server shutdown only (after thread requests have been executed). */ -void item_create_cleanup() +void Native_functions_hash::cleanup() { - DBUG_ENTER("item_create_cleanup"); - my_hash_free(& native_functions_hash); + DBUG_ENTER("Native_functions_hash::cleanup"); + my_hash_free(this); DBUG_VOID_RETURN; } + Create_func * -find_native_function_builder(THD *thd, const LEX_CSTRING *name) +Native_functions_hash::find(THD *thd, const LEX_CSTRING &name) const { Native_func_registry *func; Create_func *builder= NULL; /* Thread safe */ - func= (Native_func_registry*) my_hash_search(&native_functions_hash, - (uchar*) name->str, - name->length); + func= (Native_func_registry*) my_hash_search(this, + (uchar*) name.str, + name.length); if (func) { @@ -7716,6 +7721,19 @@ find_native_function_builder(THD *thd, const LEX_CSTRING *name) return builder; } + +int item_create_init() +{ + return native_functions_hash.init(func_array, array_elements(func_array)); +} + + +void item_create_cleanup() +{ + native_functions_hash.cleanup(); +} + + Create_qfunc * find_qualified_function_builder(THD *thd) { diff --git a/sql/item_create.h b/sql/item_create.h index 8456644ff6d..60a757b95d8 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -144,16 +144,6 @@ protected: }; -/** - Find the native function builder associated with a given function name. - @param thd The current thread - @param name The native function name - @return The native function builder associated with the name, or NULL -*/ -extern Create_func *find_native_function_builder(THD *thd, - const LEX_CSTRING *name); - - /** Find the function builder for qualified functions. @param thd The current thread @@ -200,9 +190,52 @@ struct Native_func_registry Create_func *builder; }; + +class Native_functions_hash: public HASH +{ +public: + Native_functions_hash() + { + bzero(this, sizeof(*this)); + } + ~Native_functions_hash() + { + /* + No automatic free because objects of this type + are expected to be declared statically. + The code in cleanup() calls my_hash_free() which may not work correctly + at the very end of mariadbd shutdown. + The the upper level code should call cleanup() explicitly. + + Unfortunatelly, it's not possible to use DBUG_ASSERT(!records) here, + because the server terminates using exit() in some cases, + e.g. in the test main.named_pipe with the "Create named pipe failed" + error. + */ + } + bool init(size_t count); + bool init(const Native_func_registry array[], size_t count) + { + return init(count) || append(array); + } + bool append(const Native_func_registry array[]); + bool remove(const Native_func_registry array[]); + void cleanup(); + /** + Find the native function builder associated with a given function name. + @param thd The current thread + @param name The native function name + @return The native function builder associated with the name, or NULL + */ + Create_func *find(THD *thd, const LEX_CSTRING &name) const; +}; + +extern MYSQL_PLUGIN_IMPORT Native_functions_hash native_functions_hash; + +extern const Native_func_registry func_array[]; +extern const size_t func_array_length; + int item_create_init(); -int item_create_append(Native_func_registry array[]); -int item_create_remove(Native_func_registry array[]); void item_create_cleanup(); Item *create_func_dyncol_create(THD *thd, List &list); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index f77b98f04f1..019377061a0 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -943,7 +943,7 @@ bool is_lex_native_function(const LEX_CSTRING *name) bool is_native_function(THD *thd, const LEX_CSTRING *name) { - if (find_native_function_builder(thd, name)) + if (native_functions_hash.find(thd, *name)) return true; if (is_lex_native_function(name)) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1ad20ac7593..a621c1de29a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -76,9 +76,6 @@ extern size_t symbols_length; extern SYMBOL sql_functions[]; extern size_t sql_functions_length; -extern Native_func_registry func_array[]; -extern size_t func_array_length; - enum enum_i_s_events_fields { ISE_EVENT_CATALOG= 0, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index cf3927ac30c..cdc04d93708 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -11485,7 +11485,7 @@ function_call_generic: This will be revised with WL#2128 (SQL PATH) */ - builder= find_native_function_builder(thd, &$1); + builder= native_functions_hash.find(thd, $1); if (builder) { item= builder->create_func(thd, &$1, $4); diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 87f71d8332b..5b734a27f8c 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -11600,7 +11600,7 @@ function_call_generic: This will be revised with WL#2128 (SQL PATH) */ - builder= find_native_function_builder(thd, &$1); + builder= native_functions_hash.find(thd, $1); if (builder) { item= builder->create_func(thd, &$1, $4); From 08a4732860348bcdc16b4ad8ecfc2b4b2e644ae5 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 3 May 2023 21:27:30 +0300 Subject: [PATCH 07/80] MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size The problem was that join_buffer_size conflicted with join_buffer_space_limit, which caused the query to be run without join buffer. However this caused wrong results as the optimizer assumed that hash+join buffer would ensure that the equi-join condition would be satisfied, and didn't check it itself. Fixed by not using join_buffer_space_limit when optimize_join_buffer_size=off. This matches the documentation at https://mariadb.com/kb/en/block-based-join-algorithms Other things: - Removed not used variable JOIN_TAB::join_buffer_size_limit - Give an error if we cannot allocate a join buffer. This can only happen if the join_buffer variables are wrongly configured or we are running out of memory. In the future, instead of returning an error, we could properly convert the query plan that uses BNL-H join into one that doesn't use join buffering: make sure the equi-join condition is checked where appropriate. Reviewer: Sergei Petrunia --- mysql-test/main/join_cache.result | 33 ++++++++++++-- mysql-test/main/join_cache.test | 28 ++++++++++++ mysql-test/main/join_optimizer.test | 2 + sql/sql_join_cache.cc | 68 +++++++++++++++++++---------- sql/sql_select.h | 1 - 5 files changed, 104 insertions(+), 28 deletions(-) diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index 1837576e719..3b02740c67c 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -5655,13 +5655,13 @@ EXPLAIN SELECT * FROM t1, t2 LEFT JOIN t3 ON t2.b=t3.b WHERE t1.a=t2.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL NULL NULL NULL NULL 12 Using where -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (incremental, BNL join) SELECT * FROM t1, t2 LEFT JOIN t3 ON t2.b=t3.b WHERE t1.a=t2.a; a a b b c +3 3 32 32 302 3 3 30 30 300 3 3 31 NULL NULL -3 3 32 32 302 set join_buffer_space_limit=@save_join_buffer_space_limit; set join_buffer_size=@save_join_buffer_size; set join_cache_level=@save_join_cache_level; @@ -6229,6 +6229,33 @@ EXPLAIN } drop table t1,t2,t3; # End of 10.3 tests +# +# MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size +# +CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t1 VALUES (1332945389); +CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t2 VALUES (1180244875), (1951338178); +SET SESSION join_buffer_size= X; +Warnings: +Warning X Truncated incorrect join_buffer_size value: 'X' +SET SESSION join_cache_level = 4; +SET optimizer_switch='optimize_join_buffer_size=on'; +SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +i +SET optimizer_switch='optimize_join_buffer_size=off'; +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +ERROR HYX: Could not create a join buffer. Please check and adjust the value of the variables 'JOIN_BUFFER_SIZE (X)' and 'JOIN_BUFFER_SPACE_LIMIT (X)' +SET SESSION join_buffer_size= 10000000; +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +i i +SET SESSION optimizer_switch= default; +SET SESSION join_buffer_size= default; +SET SESSION join_cache_level= default; +drop table t1,t2; +# +# End of 10.4 tests +# set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index 07ac0b760cf..500fd9e1049 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4201,6 +4201,34 @@ drop table t1,t2,t3; --echo # End of 10.3 tests +--echo # +--echo # MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size +--echo # + +CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t1 VALUES (1332945389); +CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t2 VALUES (1180244875), (1951338178); +--replace_regex /[0-9][0-9]+/X/ +SET SESSION join_buffer_size= 5250229460064350213; +SET SESSION join_cache_level = 4; +SET optimizer_switch='optimize_join_buffer_size=on'; +SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +SET optimizer_switch='optimize_join_buffer_size=off'; +--replace_regex /[0-9][0-9]+/X/ +--error ER_OUTOFMEMORY +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +SET SESSION join_buffer_size= 10000000; +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +SET SESSION optimizer_switch= default; +SET SESSION join_buffer_size= default; +SET SESSION join_cache_level= default; +drop table t1,t2; + +--echo # +--echo # End of 10.4 tests +--echo # + # The following command must be the last one in the file set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/main/join_optimizer.test b/mysql-test/main/join_optimizer.test index 3afe82113b9..e5f6181944d 100644 --- a/mysql-test/main/join_optimizer.test +++ b/mysql-test/main/join_optimizer.test @@ -2,6 +2,8 @@ drop table if exists t0,t1,t2,t3; --enable_warnings +--source include/have_innodb.inc + --echo # --echo # BUG#38049 incorrect rows estimations with references from preceding table --echo # diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index beca5fc782a..6de76334908 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -805,20 +805,18 @@ size_t JOIN_CACHE::get_min_join_buffer_size() the estimated number of records in the partial join DESCRIPTION - At the first its invocation for the cache the function calculates the - maximum possible size of join buffer for the cache. If the parameter - optimize_buff_size true then this value does not exceed the size of the - space needed for the estimated number of records 'max_records' in the - partial join that joins tables from the first one through join_tab. This - value is also capped off by the value of join_tab->join_buffer_size_limit, - if it has been set a to non-zero value, and by the value of the system - parameter join_buffer_size - otherwise. After the calculation of the - interesting size the function saves the value in the field 'max_buff_size' - in order to use it directly at the next invocations of the function. - NOTES - Currently the value of join_tab->join_buffer_size_limit is initialized - to 0 and is never reset. + At the first its invocation for the cache the function calculates + the maximum possible size of join buffer for the cache. If the + parameter optimize_buff_size true then this value does not exceed + the size of the space needed for the estimated number of records + 'max_records' in the partial join that joins tables from the first + one through join_tab. This value is also capped off by the value + of the system parameter join_buffer_size. After the calculation of + the interesting size the function saves the value in the field + 'max_buff_size' in order to use it directly at the next + invocations of the function. + RETURN VALUE The maximum possible size of the join buffer of this cache @@ -842,8 +840,6 @@ size_t JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size) space_per_record= len; size_t limit_sz= (size_t)join->thd->variables.join_buff_size; - if (join_tab->join_buffer_size_limit) - set_if_smaller(limit_sz, join_tab->join_buffer_size_limit); if (!optimize_buff_size) max_sz= limit_sz; else @@ -923,13 +919,25 @@ int JOIN_CACHE::alloc_buffer() curr_min_buff_space_sz+= min_buff_size; curr_buff_space_sz+= buff_size; - if (curr_min_buff_space_sz > join_buff_space_limit || - (curr_buff_space_sz > join_buff_space_limit && - (!optimize_buff_size || + if (optimize_buff_size) + { + /* + optimize_join_buffer_size=on used. We should limit the join + buffer space to join_buff_space_limit if possible. + */ + if (curr_min_buff_space_sz > join_buff_space_limit) + { + /* + Increase buffer size to minimum needed, to be able to use the + join buffer. + */ + join_buff_space_limit= curr_min_buff_space_sz; + } + if (curr_buff_space_sz > join_buff_space_limit && join->shrink_join_buffers(join_tab, curr_buff_space_sz, - join_buff_space_limit)))) - goto fail; - + join_buff_space_limit)) + goto fail; // Fatal error + } if (for_explain_only) return 0; @@ -2766,7 +2774,6 @@ bool JOIN_CACHE_BKAH::save_explain_data(EXPLAIN_BKA_TYPE *explain) int JOIN_CACHE_HASHED::init(bool for_explain) { - int rc= 0; TABLE_REF *ref= &join_tab->ref; DBUG_ENTER("JOIN_CACHE_HASHED::init"); @@ -2776,8 +2783,21 @@ int JOIN_CACHE_HASHED::init(bool for_explain) key_length= ref->key_length; - if ((rc= JOIN_CACHE::init(for_explain)) || for_explain) - DBUG_RETURN (rc); + if (JOIN_CACHE::init(for_explain)) + { + THD *thd= join->thd; + const char *errmsg= + "Could not create a join buffer. Please check and " + "adjust the value of the variables 'JOIN_BUFFER_SIZE (%llu)' and " + "'JOIN_BUFFER_SPACE_LIMIT (%llu)'"; + my_printf_error(ER_OUTOFMEMORY, errmsg, MYF(0), + thd->variables.join_buff_size, + thd->variables.join_buff_space_limit); + DBUG_RETURN (1); + } + + if (for_explain) + DBUG_RETURN(0); if (!(key_buff= (uchar*) join->thd->alloc(key_length))) DBUG_RETURN(1); diff --git a/sql/sql_select.h b/sql/sql_select.h index 4bac201c3b4..f2b9d272701 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -395,7 +395,6 @@ typedef struct st_join_table { bool idx_cond_fact_out; bool use_join_cache; uint used_join_cache_level; - ulong join_buffer_size_limit; JOIN_CACHE *cache; /* Index condition for BKA access join From 5fd46be5a7da83e935c59796733d52906b59f14c Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 4 May 2023 12:43:18 +0300 Subject: [PATCH 08/80] Fixed calculation of JOIN_CACHE::max_records The old code did set max_records to either number_of_rows (partial_join_cardinality) or memory size (join_buffer_space_limit) which did not make sense. Fixed by setting max_records to number of rows that fits into join_buffer_size. Other things: - Initialize buffer cache values in JOIN_CACHE constructors (safety) Reviewer: Sergei Petrunia --- mysql-test/main/join_cache.result | 2 +- sql/sql_join_cache.cc | 24 +++++++++++++++--------- sql/sql_join_cache.h | 10 ++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index 3b02740c67c..f5ddbfea733 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -3781,9 +3781,9 @@ id1 num3 text1 id4 id3 dummy 228808822 6 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 228808822 18 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 228808822 1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 -228808822 3 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 228808822 17 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 228808822 50 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 +228808822 3 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 228808822 4 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 826928662 935693782 0 228808822 89 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 2381969632 2482416112 0 228808822 19 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 2381969632 2482416112 0 diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 6de76334908..eac03404240 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -634,7 +634,7 @@ void JOIN_CACHE::create_remaining_fields() /* - Calculate and set all cache constants + Calculate and set all cache constants SYNOPSIS set_constants() @@ -829,6 +829,12 @@ size_t JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size) size_t max_sz; size_t min_sz= get_min_join_buffer_size(); size_t len= 0; + double max_records, partial_join_cardinality= + (join_tab-1)->get_partial_join_cardinality(); + size_t limit_sz= (size_t) join->thd->variables.join_buff_size; + /* Expected join buffer space used for one record */ + size_t space_per_record; + for (JOIN_TAB *tab= start_tab; tab != join_tab; tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS)) { @@ -839,13 +845,17 @@ size_t JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size) len+= get_max_key_addon_space_per_record() + avg_aux_buffer_incr; space_per_record= len; - size_t limit_sz= (size_t)join->thd->variables.join_buff_size; + /* Note that space_per_record can be 0 if no table fields where used */ + max_records= (double) (limit_sz / MY_MAX(space_per_record, 1)); + set_if_smaller(max_records, partial_join_cardinality); + set_if_bigger(max_records, 10.0); + if (!optimize_buff_size) max_sz= limit_sz; else { - if (limit_sz / max_records > space_per_record) - max_sz= space_per_record * max_records; + if ((size_t) (limit_sz / max_records) > space_per_record) + max_sz= space_per_record * (size_t) max_records; else max_sz= limit_sz; max_sz+= pack_length_with_blob_ptrs; @@ -855,7 +865,7 @@ size_t JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size) max_buff_size= max_sz; } return max_buff_size; -} +} /* @@ -895,14 +905,10 @@ int JOIN_CACHE::alloc_buffer() join->thd->variables.join_buff_space_limit; bool optimize_buff_size= optimizer_flag(join->thd, OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE); - double partial_join_cardinality= (join_tab-1)->get_partial_join_cardinality(); buff= NULL; min_buff_size= 0; max_buff_size= 0; min_records= 1; - max_records= (size_t) (partial_join_cardinality <= join_buff_space_limit ? - (ulonglong) partial_join_cardinality : join_buff_space_limit); - set_if_bigger(max_records, 10); min_buff_size= get_min_join_buffer_size(); buff_size= get_max_join_buffer_size(optimize_buff_size); diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index f75e9fd380f..ad9cea744d7 100644 --- a/sql/sql_join_cache.h +++ b/sql/sql_join_cache.h @@ -248,9 +248,6 @@ protected: /* The expected size of the space per record in the auxiliary buffer */ size_t avg_aux_buffer_incr; - /* Expected join buffer space used for one record */ - size_t space_per_record; - /* Pointer to the beginning of the join buffer */ uchar *buff; /* @@ -272,11 +269,6 @@ protected: the minimal size equal to min_buff_size */ size_t min_records; - /* - The maximum expected number of records to be put in the join buffer - at one refill - */ - size_t max_records; /* Pointer to the current position in the join buffer. @@ -542,6 +534,7 @@ protected: join_tab= tab; prev_cache= next_cache= 0; buff= 0; + min_buff_size= max_buff_size= 0; // Caches } /* @@ -557,6 +550,7 @@ protected: next_cache= 0; prev_cache= prev; buff= 0; + min_buff_size= max_buff_size= 0; // Caches if (prev) prev->next_cache= this; } From e74390d94f81d0bc6d0b2b8999f7ee44fd2092e9 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 4 May 2023 13:06:39 +0300 Subject: [PATCH 09/80] Cleanup of sql_join_cache code (no logic changes) - Remove virtual from get_min_join_buffer_size() and get_max_join_buffer_size(). - Avoid some calls to get_min_buffer_size() - Simply cache usage in get_..._join_buffer_size() - Simplify get_max_join_buffer_size() when using optimize_buff_size - Reindented some long comments Reviewer: Sergei Petrunia --- sql/sql_join_cache.cc | 162 +++++++++++++++++++++--------------------- sql/sql_join_cache.h | 5 +- 2 files changed, 85 insertions(+), 82 deletions(-) diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index eac03404240..7d61ce31cca 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -694,16 +694,22 @@ void JOIN_CACHE::set_constants() (prev_cache ? prev_cache->get_size_of_rec_offset() : 0) + length + fields*sizeof(uint); pack_length_with_blob_ptrs= pack_length + blobs*sizeof(uchar *); - min_buff_size= 0; min_records= 1; + min_buff_size= get_min_join_buffer_size(); buff_size= (size_t)MY_MAX(join->thd->variables.join_buff_size, - get_min_join_buffer_size()); + min_buff_size); size_of_rec_ofs= offset_size(buff_size); size_of_rec_len= blobs ? size_of_rec_ofs : offset_size(len); size_of_fld_ofs= size_of_rec_len; base_prefix_length= (with_length ? size_of_rec_len : 0) + (prev_cache ? prev_cache->get_size_of_rec_offset() : 0); - /* + /* + Call ge_min_join_buffer_size() again as the size may have got smaller + if size_of_rec_ofs or some other variable changed since last call. + */ + min_buff_size= 0; + min_buff_size= get_min_join_buffer_size(); + /* The size of the offsets for referenced fields will be added later. The values of 'pack_length' and 'pack_length_with_blob_ptrs' are adjusted every time when the first reference to the referenced field is registered. @@ -767,30 +773,29 @@ uint JOIN_CACHE::get_record_max_affix_length() size_t JOIN_CACHE::get_min_join_buffer_size() { - if (!min_buff_size) + if (min_buff_size) + return min_buff_size; // use cached value + + size_t len= 0, len_last= 0, len_addon, min_sz, add_sz= 0; + + for (JOIN_TAB *tab= start_tab; tab != join_tab; + tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS)) { - size_t len= 0; - size_t len_last= 0; - for (JOIN_TAB *tab= start_tab; tab != join_tab; - tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS)) - { - len+= tab->get_max_used_fieldlength(); - len_last+= tab->get_used_fieldlength(); - } - size_t len_addon= get_record_max_affix_length() + - get_max_key_addon_space_per_record(); - len+= len_addon; - len_last+= len_addon; - size_t min_sz= len*(min_records-1) + len_last; - min_sz+= pack_length_with_blob_ptrs; - size_t add_sz= 0; - for (uint i=0; i < min_records; i++) - add_sz+= join_tab_scan->aux_buffer_incr(i+1); - avg_aux_buffer_incr= add_sz/min_records; - min_sz+= add_sz; - set_if_bigger(min_sz, 1); - min_buff_size= min_sz; + len+= tab->get_max_used_fieldlength(); + len_last+= tab->get_used_fieldlength(); } + len_addon= (get_record_max_affix_length() + + get_max_key_addon_space_per_record()); + len+= len_addon; + len_last+= len_addon; + min_sz= len*(min_records-1) + len_last; + min_sz+= pack_length_with_blob_ptrs; + for (uint i=0; i < min_records; i++) + add_sz+= join_tab_scan->aux_buffer_incr(i+1); + avg_aux_buffer_incr= add_sz/min_records; + min_sz+= add_sz; + set_if_bigger(min_sz, 1); + min_buff_size= min_sz; return min_buff_size; } @@ -822,48 +827,48 @@ size_t JOIN_CACHE::get_min_join_buffer_size() The maximum possible size of the join buffer of this cache */ -size_t JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size) +size_t JOIN_CACHE::get_max_join_buffer_size(bool optimize_buff_size, + size_t min_sz) { - if (!max_buff_size) + if (max_buff_size) + return max_buff_size; // use cached value + + size_t limit_sz= (size_t) join->thd->variables.join_buff_size; + + if (!optimize_buff_size) + return max_buff_size= limit_sz; + + size_t max_sz; + size_t len= 0; + double max_records, partial_join_cardinality= + (join_tab-1)->get_partial_join_cardinality(); + /* Expected join buffer space used for one record */ + size_t space_per_record; + + for (JOIN_TAB *tab= start_tab; tab != join_tab; + tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS)) { - size_t max_sz; - size_t min_sz= get_min_join_buffer_size(); - size_t len= 0; - double max_records, partial_join_cardinality= - (join_tab-1)->get_partial_join_cardinality(); - size_t limit_sz= (size_t) join->thd->variables.join_buff_size; - /* Expected join buffer space used for one record */ - size_t space_per_record; - - for (JOIN_TAB *tab= start_tab; tab != join_tab; - tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS)) - { - len+= tab->get_used_fieldlength(); - } - len+= get_record_max_affix_length(); - avg_record_length= len; - len+= get_max_key_addon_space_per_record() + avg_aux_buffer_incr; - space_per_record= len; - - /* Note that space_per_record can be 0 if no table fields where used */ - max_records= (double) (limit_sz / MY_MAX(space_per_record, 1)); - set_if_smaller(max_records, partial_join_cardinality); - set_if_bigger(max_records, 10.0); - - if (!optimize_buff_size) - max_sz= limit_sz; - else - { - if ((size_t) (limit_sz / max_records) > space_per_record) - max_sz= space_per_record * (size_t) max_records; - else - max_sz= limit_sz; - max_sz+= pack_length_with_blob_ptrs; - set_if_smaller(max_sz, limit_sz); - } - set_if_bigger(max_sz, min_sz); - max_buff_size= max_sz; + len+= tab->get_used_fieldlength(); } + len+= get_record_max_affix_length(); + avg_record_length= len; + len+= get_max_key_addon_space_per_record() + avg_aux_buffer_incr; + space_per_record= len; + + /* Note that space_per_record can be 0 if no table fields where used */ + max_records= (double) (limit_sz / MY_MAX(space_per_record, 1)); + set_if_smaller(max_records, partial_join_cardinality); + set_if_bigger(max_records, 10.0); + + if ((size_t) (limit_sz / max_records) > space_per_record) + max_sz= space_per_record * (size_t) max_records; + else + max_sz= limit_sz; + max_sz+= pack_length_with_blob_ptrs; + set_if_smaller(max_sz, limit_sz); + + set_if_bigger(max_sz, min_sz); + max_buff_size= max_sz; return max_buff_size; } @@ -906,11 +911,7 @@ int JOIN_CACHE::alloc_buffer() bool optimize_buff_size= optimizer_flag(join->thd, OPTIMIZER_SWITCH_OPTIMIZE_JOIN_BUFFER_SIZE); buff= NULL; - min_buff_size= 0; - max_buff_size= 0; - min_records= 1; - min_buff_size= get_min_join_buffer_size(); - buff_size= get_max_join_buffer_size(optimize_buff_size); + buff_size= get_max_join_buffer_size(optimize_buff_size, min_buff_size); for (tab= start_tab; tab!= join_tab; tab= next_linear_tab(join, tab, WITHOUT_BUSH_ROOTS)) @@ -1093,18 +1094,19 @@ int JOIN_CACHE::init(bool for_explain) /* - Check the possibility to read the access keys directly from the join buffer + Check the possibility to read the access keys directly from the join buffer SYNOPSIS check_emb_key_usage() DESCRIPTION - The function checks some conditions at which the key values can be read - directly from the join buffer. This is possible when the key values can be - composed by concatenation of the record fields stored in the join buffer. - Sometimes when the access key is multi-component the function has to re-order - the fields written into the join buffer to make keys embedded. If key - values for the key access are detected as embedded then 'use_emb_key' - is set to TRUE. + The function checks some conditions at which the key values can be + read directly from the join buffer. This is possible when the key + values can be composed by concatenation of the record fields + stored in the join buffer. Sometimes when the access key is + multi-component the function has to re-order the fields written + into the join buffer to make keys embedded. If key values for the + key access are detected as embedded then 'use_emb_key' is set to + TRUE. EXAMPLE Let table t2 has an index defined on the columns a,b . Let's assume also @@ -1257,7 +1259,7 @@ bool JOIN_CACHE::check_emb_key_usage() trailing spaces - significant part of fixed length fields that can have trailing spaces with the prepanded length - - data of non-blob variable length fields with the prepanded data length + - data of non-blob variable length fields with the prepanded data length - blob data from blob fields with the prepanded data length (5) record offset values for the data fields that are referred to from other caches @@ -1328,7 +1330,7 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full) Check whether we won't be able to add any new record into the cache after this one because the cache will be full. Set last_record to TRUE if it's so. The assume that the cache will be full after the record has been written - into it if either the remaining space of the cache is not big enough for the + into it if either the remaining space of the cache is not big enough for the record's blob values or if there is a chance that not all non-blob fields of the next record can be placed there. This function is called only in the case when there is enough space left in @@ -1350,7 +1352,7 @@ uint JOIN_CACHE::write_record_data(uchar * link, bool *is_full) /* Put a reference to the fields of the record that are stored in the previous - cache if there is any. This reference is passed by the 'link' parameter. + cache if there is any. This reference is passed by the 'link' parameter. */ if (prev_cache) { diff --git a/sql/sql_join_cache.h b/sql/sql_join_cache.h index ad9cea744d7..8bdce1bd592 100644 --- a/sql/sql_join_cache.h +++ b/sql/sql_join_cache.h @@ -602,9 +602,10 @@ public: void set_join_buffer_size(size_t sz) { buff_size= sz; } /* Get the minimum possible size of the cache join buffer */ - virtual size_t get_min_join_buffer_size(); + size_t get_min_join_buffer_size(); /* Get the maximum possible size of the cache join buffer */ - virtual size_t get_max_join_buffer_size(bool optimize_buff_size); + size_t get_max_join_buffer_size(bool optimize_buff_size, + size_t min_buffer_size_arg); /* Shrink the size if the cache join buffer in a given ratio */ bool shrink_join_buffer_in_ratio(ulonglong n, ulonglong d); From c874d5c68d24fb78bb6d59db1927ea5794891e38 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 4 May 2023 19:13:30 +0300 Subject: [PATCH 10/80] Added missing test file --- .../rpl/r/{rpl_loaddatalocal.result => rpl_loaddata_local.result} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mysql-test/suite/rpl/r/{rpl_loaddatalocal.result => rpl_loaddata_local.result} (100%) diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddata_local.result similarity index 100% rename from mysql-test/suite/rpl/r/rpl_loaddatalocal.result rename to mysql-test/suite/rpl/r/rpl_loaddata_local.result From 84b9fc25a29b94a37eb9d5ac2e2c0f75c0efafda Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 5 May 2023 11:31:35 +0300 Subject: [PATCH 11/80] Fixed wrong test cases (embedded and ASAN) - main.selectivity failed because one test produced different result with embedded (missing feature). Fixed by moving the failing part to selectivity_notembedded. - Disabled maria.encrypt-no-key for embedded as embedded does not support encryption - Moved test from join_cache to join_cache_notasan that tried to alloc() a buffer bigger than available memory. --- mysql-test/main/join_cache.result | 27 ----- mysql-test/main/join_cache.test | 28 ----- mysql-test/main/join_cache_notasan.result | 27 +++++ mysql-test/main/join_cache_notasan.test | 35 ++++++ mysql-test/main/selectivity.result | 69 ------------ mysql-test/main/selectivity.test | 79 -------------- mysql-test/main/selectivity_innodb.result | 67 ------------ .../main/selectivity_notembedded.result | 83 ++++++++++++++ mysql-test/main/selectivity_notembedded.test | 102 ++++++++++++++++++ mysql-test/suite/maria/encrypt-no-key.test | 1 + 10 files changed, 248 insertions(+), 270 deletions(-) create mode 100644 mysql-test/main/join_cache_notasan.result create mode 100644 mysql-test/main/join_cache_notasan.test create mode 100644 mysql-test/main/selectivity_notembedded.result create mode 100644 mysql-test/main/selectivity_notembedded.test diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index f5ddbfea733..6b39f936628 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -6229,33 +6229,6 @@ EXPLAIN } drop table t1,t2,t3; # End of 10.3 tests -# -# MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size -# -CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; -INSERT INTO t1 VALUES (1332945389); -CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; -INSERT INTO t2 VALUES (1180244875), (1951338178); -SET SESSION join_buffer_size= X; -Warnings: -Warning X Truncated incorrect join_buffer_size value: 'X' -SET SESSION join_cache_level = 4; -SET optimizer_switch='optimize_join_buffer_size=on'; -SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; -i -SET optimizer_switch='optimize_join_buffer_size=off'; -SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; -ERROR HYX: Could not create a join buffer. Please check and adjust the value of the variables 'JOIN_BUFFER_SIZE (X)' and 'JOIN_BUFFER_SPACE_LIMIT (X)' -SET SESSION join_buffer_size= 10000000; -SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; -i i -SET SESSION optimizer_switch= default; -SET SESSION join_buffer_size= default; -SET SESSION join_cache_level= default; -drop table t1,t2; -# -# End of 10.4 tests -# set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index 500fd9e1049..07ac0b760cf 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4201,34 +4201,6 @@ drop table t1,t2,t3; --echo # End of 10.3 tests ---echo # ---echo # MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size ---echo # - -CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; -INSERT INTO t1 VALUES (1332945389); -CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; -INSERT INTO t2 VALUES (1180244875), (1951338178); ---replace_regex /[0-9][0-9]+/X/ -SET SESSION join_buffer_size= 5250229460064350213; -SET SESSION join_cache_level = 4; -SET optimizer_switch='optimize_join_buffer_size=on'; -SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; -SET optimizer_switch='optimize_join_buffer_size=off'; ---replace_regex /[0-9][0-9]+/X/ ---error ER_OUTOFMEMORY -SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; -SET SESSION join_buffer_size= 10000000; -SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; -SET SESSION optimizer_switch= default; -SET SESSION join_buffer_size= default; -SET SESSION join_cache_level= default; -drop table t1,t2; - ---echo # ---echo # End of 10.4 tests ---echo # - # The following command must be the last one in the file set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/main/join_cache_notasan.result b/mysql-test/main/join_cache_notasan.result new file mode 100644 index 00000000000..3cec949f5c6 --- /dev/null +++ b/mysql-test/main/join_cache_notasan.result @@ -0,0 +1,27 @@ +# +# MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size +# +CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t1 VALUES (1332945389); +CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t2 VALUES (1180244875), (1951338178); +SET SESSION join_buffer_size= X; +Warnings: +Warning X Truncated incorrect join_buffer_size value: 'X' +SET SESSION join_cache_level = 4; +SET optimizer_switch='optimize_join_buffer_size=on'; +SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +i +SET optimizer_switch='optimize_join_buffer_size=off'; +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +ERROR HYX: Could not create a join buffer. Please check and adjust the value of the variables 'JOIN_BUFFER_SIZE (X)' and 'JOIN_BUFFER_SPACE_LIMIT (X)' +SET SESSION join_buffer_size= 10000000; +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +i i +SET SESSION optimizer_switch= default; +SET SESSION join_buffer_size= default; +SET SESSION join_cache_level= default; +drop table t1,t2; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/join_cache_notasan.test b/mysql-test/main/join_cache_notasan.test new file mode 100644 index 00000000000..7fd5e4e80b1 --- /dev/null +++ b/mysql-test/main/join_cache_notasan.test @@ -0,0 +1,35 @@ +# +# Tests that should be in join_cache but cannot be run with ASAN + +--source include/not_asan.inc +--source include/have_innodb.inc + +--echo # +--echo # MDEV-28217 Incorrect Join Execution When Controlling Join Buffer Size +--echo # + +# This test tries to allocate a too big bufffer, for which ASAN gives an error + +CREATE TABLE t1 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t1 VALUES (1332945389); +CREATE TABLE t2 (i int PRIMARY KEY)engine=innodb; +INSERT INTO t2 VALUES (1180244875), (1951338178); +--replace_regex /[0-9][0-9]+/X/ +SET SESSION join_buffer_size= 5250229460064350213; +SET SESSION join_cache_level = 4; +SET optimizer_switch='optimize_join_buffer_size=on'; +SELECT t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +SET optimizer_switch='optimize_join_buffer_size=off'; +--replace_regex /[0-9][0-9]+/X/ +--error ER_OUTOFMEMORY +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +SET SESSION join_buffer_size= 10000000; +SELECT t1.i,t2.i FROM t2 LEFT JOIN t1 ON t1.i = t2.i WHERE t1.i; +SET SESSION optimizer_switch= default; +SET SESSION join_buffer_size= default; +SET SESSION join_cache_level= default; +drop table t1,t2; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 7d7343847cd..a6866e55b13 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -1937,75 +1937,6 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 DROP TABLE t1; # End of 10.2 tests -# -# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram -# -create table t0(a int); -insert into t0 select 1 from seq_1_to_78; -create table t1(a int); -insert into t1 select 1 from seq_1_to_26; -create table t10 (a int); -insert into t10 select 0 from t0, seq_1_to_4; -insert into t10 select 8693 from t1; -insert into t10 select 8694 from t1; -insert into t10 select 8695 from t1; -insert into t10 select 34783 from t1; -insert into t10 select 34784 from t1; -insert into t10 select 34785 from t1; -insert into t10 select 34785 from t0, seq_1_to_8; -insert into t10 select 65214 from t1; -insert into t10 select 65215 from t1; -insert into t10 select 65216 from t1; -insert into t10 select 65216 from t0, seq_1_to_52; -insert into t10 select 65217 from t1; -insert into t10 select 65218 from t1; -insert into t10 select 65219 from t1; -insert into t10 select 65219 from t0; -insert into t10 select 73913 from t1; -insert into t10 select 73914 from t1; -insert into t10 select 73915 from t1; -insert into t10 select 73915 from t0, seq_1_to_40; -insert into t10 select 78257 from t1; -insert into t10 select 78258 from t1; -insert into t10 select 78259 from t1; -insert into t10 select 91300 from t1; -insert into t10 select 91301 from t1; -insert into t10 select 91302 from t1; -insert into t10 select 91302 from t0, seq_1_to_6; -insert into t10 select 91303 from t1; -insert into t10 select 91304 from t1; -insert into t10 select 91305 from t1; -insert into t10 select 91305 from t0, seq_1_to_8; -insert into t10 select 99998 from t1; -insert into t10 select 99999 from t1; -insert into t10 select 100000 from t1; -set use_stat_tables=preferably; -analyze table t10 persistent for all; -Table Op Msg_type Msg_text -test.t10 analyze status Engine-independent statistics collected -test.t10 analyze status OK -flush tables; -set @tmp=@@optimizer_trace; -set optimizer_trace=1; -explain select * from t10 where a in (91303); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where -# Must have selectivity_from_histogram <= 1.0: -select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -from information_schema.optimizer_trace; -json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.0357 - } - ] -] -set optimizer_trace=@tmp; -drop table t0,t1,t10; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test index 06a3e32da95..def74394ec5 100644 --- a/mysql-test/main/selectivity.test +++ b/mysql-test/main/selectivity.test @@ -1324,85 +1324,6 @@ DROP TABLE t1; --echo # End of 10.2 tests ---echo # ---echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram ---echo # -create table t0(a int); # This holds how many rows we hold in a bucket. -insert into t0 select 1 from seq_1_to_78; - -create table t1(a int); # one-third of a bucket -insert into t1 select 1 from seq_1_to_26; - -create table t10 (a int); -insert into t10 select 0 from t0, seq_1_to_4; - -insert into t10 select 8693 from t1; -insert into t10 select 8694 from t1; -insert into t10 select 8695 from t1; - - -insert into t10 select 34783 from t1; -insert into t10 select 34784 from t1; -insert into t10 select 34785 from t1; - - -insert into t10 select 34785 from t0, seq_1_to_8; - -insert into t10 select 65214 from t1; -insert into t10 select 65215 from t1; -insert into t10 select 65216 from t1; - -insert into t10 select 65216 from t0, seq_1_to_52; - -insert into t10 select 65217 from t1; -insert into t10 select 65218 from t1; -insert into t10 select 65219 from t1; - -insert into t10 select 65219 from t0; - - -insert into t10 select 73913 from t1; -insert into t10 select 73914 from t1; -insert into t10 select 73915 from t1; - -insert into t10 select 73915 from t0, seq_1_to_40; - - -insert into t10 select 78257 from t1; -insert into t10 select 78258 from t1; -insert into t10 select 78259 from t1; - -insert into t10 select 91300 from t1; -insert into t10 select 91301 from t1; -insert into t10 select 91302 from t1; - -insert into t10 select 91302 from t0, seq_1_to_6; - -insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple -insert into t10 select 91304 from t1; -insert into t10 select 91305 from t1; - -insert into t10 select 91305 from t0, seq_1_to_8; - -insert into t10 select 99998 from t1; -insert into t10 select 99999 from t1; -insert into t10 select 100000 from t1; - -set use_stat_tables=preferably; -analyze table t10 persistent for all; -flush tables; - -set @tmp=@@optimizer_trace; -set optimizer_trace=1; -explain select * from t10 where a in (91303); - ---echo # Must have selectivity_from_histogram <= 1.0: -select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -from information_schema.optimizer_trace; - -set optimizer_trace=@tmp; -drop table t0,t1,t10; - set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index dfba12f2b05..13816f8185c 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -1947,73 +1947,6 @@ Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2 DROP TABLE t1; # End of 10.2 tests -# -# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram -# -create table t0(a int); -insert into t0 select 1 from seq_1_to_78; -create table t1(a int); -insert into t1 select 1 from seq_1_to_26; -create table t10 (a int); -insert into t10 select 0 from t0, seq_1_to_4; -insert into t10 select 8693 from t1; -insert into t10 select 8694 from t1; -insert into t10 select 8695 from t1; -insert into t10 select 34783 from t1; -insert into t10 select 34784 from t1; -insert into t10 select 34785 from t1; -insert into t10 select 34785 from t0, seq_1_to_8; -insert into t10 select 65214 from t1; -insert into t10 select 65215 from t1; -insert into t10 select 65216 from t1; -insert into t10 select 65216 from t0, seq_1_to_52; -insert into t10 select 65217 from t1; -insert into t10 select 65218 from t1; -insert into t10 select 65219 from t1; -insert into t10 select 65219 from t0; -insert into t10 select 73913 from t1; -insert into t10 select 73914 from t1; -insert into t10 select 73915 from t1; -insert into t10 select 73915 from t0, seq_1_to_40; -insert into t10 select 78257 from t1; -insert into t10 select 78258 from t1; -insert into t10 select 78259 from t1; -insert into t10 select 91300 from t1; -insert into t10 select 91301 from t1; -insert into t10 select 91302 from t1; -insert into t10 select 91302 from t0, seq_1_to_6; -insert into t10 select 91303 from t1; -insert into t10 select 91304 from t1; -insert into t10 select 91305 from t1; -insert into t10 select 91305 from t0, seq_1_to_8; -insert into t10 select 99998 from t1; -insert into t10 select 99999 from t1; -insert into t10 select 100000 from t1; -set use_stat_tables=preferably; -analyze table t10 persistent for all; -Table Op Msg_type Msg_text -test.t10 analyze status Engine-independent statistics collected -test.t10 analyze status OK -flush tables; -set statement optimizer_trace=1 for -explain select * from t10 where a in (91303); -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where -# Must have selectivity_from_histogram <= 1.0: -select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -from information_schema.optimizer_trace; -json_detailed(json_extract(trace, '$**.selectivity_for_columns')) -[ - [ - { - "column_name": "a", - "ranges": - ["91303 <= a <= 91303"], - "selectivity_from_histogram": 0.035714283 - } - ] -] -drop table t0,t1,t10; set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity; set histogram_size=@save_histogram_size; set use_stat_tables= @save_use_stat_tables; diff --git a/mysql-test/main/selectivity_notembedded.result b/mysql-test/main/selectivity_notembedded.result new file mode 100644 index 00000000000..8b298a95801 --- /dev/null +++ b/mysql-test/main/selectivity_notembedded.result @@ -0,0 +1,83 @@ +# +# MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +# +set @save_histogram_size=@@histogram_size; +set @save_histogram_type=@@histogram_type; +set @save_use_stat_tables=@@use_stat_tables; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; +SET histogram_size= 255; +set histogram_type='DOUBLE_PREC_HB'; +set use_stat_tables=preferably; +SET optimizer_use_condition_selectivity=3; +create table t0(a int); +insert into t0 select 1 from seq_1_to_78; +create table t1(a int); +insert into t1 select 1 from seq_1_to_26; +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; +insert into t10 select 34785 from t0, seq_1_to_8; +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; +insert into t10 select 65216 from t0, seq_1_to_52; +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; +insert into t10 select 65219 from t0; +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; +insert into t10 select 73915 from t0, seq_1_to_40; +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; +insert into t10 select 91302 from t0, seq_1_to_6; +insert into t10 select 91303 from t1; +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; +insert into t10 select 91305 from t0, seq_1_to_8; +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; +analyze table t10 persistent for all; +Table Op Msg_type Msg_text +test.t10 analyze status Engine-independent statistics collected +test.t10 analyze status OK +flush tables; +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t10 ALL NULL NULL NULL NULL 9984 Using where +# Must have selectivity_from_histogram <= 1.0: +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +from information_schema.optimizer_trace; +json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +[ + [ + { + "column_name": "a", + "ranges": + ["91303 <= a <= 91303"], + "selectivity_from_histogram": 0.0357 + } + ] +] +drop table t0,t1,t10; +set optimizer_trace=@tmp; +set @@histogram_size=@save_histogram_size; +set @histogram_type=@save_histogram_type; +set @use_stat_tables=@save_use_stat_tables; +set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/selectivity_notembedded.test b/mysql-test/main/selectivity_notembedded.test new file mode 100644 index 00000000000..f79c370186f --- /dev/null +++ b/mysql-test/main/selectivity_notembedded.test @@ -0,0 +1,102 @@ +--source include/have_stat_tables.inc +--source include/have_sequence.inc +--source include/not_embedded.inc + +--echo # +--echo # MDEV-31067: selectivity_from_histogram >1.0 for a DOUBLE_PREC_HB histogram +--echo # + +set @save_histogram_size=@@histogram_size; +set @save_histogram_type=@@histogram_type; +set @save_use_stat_tables=@@use_stat_tables; +set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity; + +SET histogram_size= 255; +set histogram_type='DOUBLE_PREC_HB'; +set use_stat_tables=preferably; +SET optimizer_use_condition_selectivity=3; + +create table t0(a int); # This holds how many rows we hold in a bucket. +insert into t0 select 1 from seq_1_to_78; + +create table t1(a int); # one-third of a bucket +insert into t1 select 1 from seq_1_to_26; + +create table t10 (a int); +insert into t10 select 0 from t0, seq_1_to_4; + +insert into t10 select 8693 from t1; +insert into t10 select 8694 from t1; +insert into t10 select 8695 from t1; + + +insert into t10 select 34783 from t1; +insert into t10 select 34784 from t1; +insert into t10 select 34785 from t1; + + +insert into t10 select 34785 from t0, seq_1_to_8; + +insert into t10 select 65214 from t1; +insert into t10 select 65215 from t1; +insert into t10 select 65216 from t1; + +insert into t10 select 65216 from t0, seq_1_to_52; + +insert into t10 select 65217 from t1; +insert into t10 select 65218 from t1; +insert into t10 select 65219 from t1; + +insert into t10 select 65219 from t0; + + +insert into t10 select 73913 from t1; +insert into t10 select 73914 from t1; +insert into t10 select 73915 from t1; + +insert into t10 select 73915 from t0, seq_1_to_40; + + +insert into t10 select 78257 from t1; +insert into t10 select 78258 from t1; +insert into t10 select 78259 from t1; + +insert into t10 select 91300 from t1; +insert into t10 select 91301 from t1; +insert into t10 select 91302 from t1; + +insert into t10 select 91302 from t0, seq_1_to_6; + +insert into t10 select 91303 from t1; # Only 1/3rd of bucket matches the search tuple +insert into t10 select 91304 from t1; +insert into t10 select 91305 from t1; + +insert into t10 select 91305 from t0, seq_1_to_8; + +insert into t10 select 99998 from t1; +insert into t10 select 99999 from t1; +insert into t10 select 100000 from t1; + +analyze table t10 persistent for all; +flush tables; + +set @tmp=@@optimizer_trace; +set optimizer_trace=1; +explain select * from t10 where a in (91303); + +--echo # Must have selectivity_from_histogram <= 1.0: +--replace_result 0.035714283 0.0357 +select json_detailed(json_extract(trace, '$**.selectivity_for_columns')) +from information_schema.optimizer_trace; + +drop table t0,t1,t10; + +set optimizer_trace=@tmp; +set @@histogram_size=@save_histogram_size; +set @histogram_type=@save_histogram_type; +set @use_stat_tables=@save_use_stat_tables; +set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/mysql-test/suite/maria/encrypt-no-key.test b/mysql-test/suite/maria/encrypt-no-key.test index b3f2f4b4bf3..89c50d79a54 100644 --- a/mysql-test/suite/maria/encrypt-no-key.test +++ b/mysql-test/suite/maria/encrypt-no-key.test @@ -1,3 +1,4 @@ +--source include/not_embedded.inc # # MDEV-18496 Crash when Aria encryption is enabled but plugin not available # From a09f661f4392fc9574a5239972243eebc65fe7f2 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 8 May 2023 11:42:24 -0700 Subject: [PATCH 12/80] MDEV-31181 Crash with EXPLAIN EXTENDED for single-table DELETE using IN predicand This bug affected EXPLAIN EXTENDED command for single-table DELETE that used an IN subquery in its WHERE clause. A crash happened if the optimizer chose to employ index_subquery or unique_subquery access when processing such command. The crash happened when the command tried to print the transformed query. In the current code of 10.4 for single-table DELETE statements the output of any explain command is produced after the join structures of all used subqueries have been destroyed. JOIN::destroy() sets the field tab of the JOIN_TAB structures created for subquery tables to NULL. As a result subselect_indexsubquery_engine::print(), subselect_indexsubquery_engine() cannot use this field to get the alias name of the joined table. This patch suggests to use the field TABLE_LIST::TAB that can be accessed from JOIN_TAB::tab_list to get the alias name of the joined table. Approved by Oleksandr Byelkin --- mysql-test/main/explain_non_select.result | 32 +++++++++++++++++++++++ mysql-test/main/explain_non_select.test | 28 ++++++++++++++++++++ sql/item_subselect.cc | 18 ++++++++----- sql/opt_subselect.cc | 1 + 4 files changed, 72 insertions(+), 7 deletions(-) diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result index d60f10f85c8..d7ed3992572 100644 --- a/mysql-test/main/explain_non_select.result +++ b/mysql-test/main/explain_non_select.result @@ -277,3 +277,35 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 2 drop table t1,t2; +# +# MDEV-31181: EXPLAIN EXTENDED for single-table DELETE with IN predicand +# +create table t1 (a int); +insert into t1 values (3), (7), (1), (3), (4); +create table t2 (pk int primary key); +insert into t2 values (3), (5), (1); +create table t3 (a int, key(a)); +insert into t3 values (7), (5), (7), (3); +explain extended delete from t1 where a in (select pk from t2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where +2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index +Warnings: +Note 1003 /* select#1 */ delete from `test`.`t1` where (`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t2 on PRIMARY))) +delete from t1 where a in (select pk from t2); +select * from t1; +a +7 +4 +explain extended delete from t1 where a in (select a from t3); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +2 DEPENDENT SUBQUERY t3 index_subquery a a 5 func 2 100.00 Using index +Warnings: +Note 1003 /* select#1 */ delete from `test`.`t1` where (`test`.`t1`.`a`,(((`test`.`t1`.`a`) in t3 on a))) +delete from t1 where a in (select a from t3); +select * from t1; +a +4 +drop table t1,t2,t3; +# End of 10.4 tests diff --git a/mysql-test/main/explain_non_select.test b/mysql-test/main/explain_non_select.test index d9ff0fb7245..c0c543ad273 100644 --- a/mysql-test/main/explain_non_select.test +++ b/mysql-test/main/explain_non_select.test @@ -250,3 +250,31 @@ PREPARE stmt FROM 'EXPLAIN INSERT INTO t1 SELECT * FROM t2'; EXECUTE stmt; drop table t1,t2; +--echo # +--echo # MDEV-31181: EXPLAIN EXTENDED for single-table DELETE with IN predicand +--echo # + +create table t1 (a int); +insert into t1 values (3), (7), (1), (3), (4); +create table t2 (pk int primary key); +insert into t2 values (3), (5), (1); +create table t3 (a int, key(a)); +insert into t3 values (7), (5), (7), (3); + +let $q1= +delete from t1 where a in (select pk from t2); + +eval explain extended $q1; +eval $q1; +select * from t1; + +let $q2= +delete from t1 where a in (select a from t3); + +eval explain extended $q2; +eval $q2; +select * from t1; + +drop table t1,t2,t3; + +--echo # End of 10.4 tests diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index f88e1e7e101..ae0ab27ec31 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -4536,10 +4536,11 @@ void subselect_union_engine::print(String *str, enum_query_type query_type) void subselect_uniquesubquery_engine::print(String *str, enum_query_type query_type) { + TABLE *table= tab->tab_list ? tab->tab_list->table : tab->table; str->append(STRING_WITH_LEN("(")); tab->ref.items[0]->print(str, query_type); str->append(STRING_WITH_LEN(" in ")); - if (tab->table->s->table_category == TABLE_CATEGORY_TEMPORARY) + if (table->s->table_category == TABLE_CATEGORY_TEMPORARY) { /* Temporary tables' names change across runs, so they can't be used for @@ -4548,8 +4549,8 @@ void subselect_uniquesubquery_engine::print(String *str, str->append(STRING_WITH_LEN("")); } else - str->append(&tab->table->s->table_name); - KEY *key_info= tab->table->key_info+ tab->ref.key; + str->append(&table->s->table_name); + KEY *key_info= table->key_info+ tab->ref.key; str->append(STRING_WITH_LEN(" on ")); str->append(&key_info->name); if (cond) @@ -4567,12 +4568,13 @@ all other tests pass. void subselect_uniquesubquery_engine::print(String *str) { - KEY *key_info= tab->table->key_info + tab->ref.key; + TABLE *table= tab->tab_list ? tab->tab_list->table : tab->table; + KEY *key_info= table->key_info + tab->ref.key; str->append(STRING_WITH_LEN("(")); for (uint i= 0; i < key_info->user_defined_key_parts; i++) tab->ref.items[i]->print(str); str->append(STRING_WITH_LEN(" in ")); - str->append(&tab->table->s->table_name); + str->append(&table->s->table_name); str->append(STRING_WITH_LEN(" on ")); str->append(&key_info->name); if (cond) @@ -4587,11 +4589,12 @@ void subselect_uniquesubquery_engine::print(String *str) void subselect_indexsubquery_engine::print(String *str, enum_query_type query_type) { + TABLE *table= tab->tab_list ? tab->tab_list->table : tab->table; str->append(STRING_WITH_LEN("(")); tab->ref.items[0]->print(str, query_type); str->append(STRING_WITH_LEN(" in ")); - str->append(tab->table->s->table_name.str, tab->table->s->table_name.length); - KEY *key_info= tab->table->key_info+ tab->ref.key; + str->append(&table->s->table_name); + KEY *key_info= table->key_info+ tab->ref.key; str->append(STRING_WITH_LEN(" on ")); str->append(&key_info->name); if (check_null) @@ -5271,6 +5274,7 @@ subselect_hash_sj_engine::make_unique_engine() DBUG_RETURN(NULL); tab->table= tmp_table; + tab->tab_list= 0; tab->preread_init_done= FALSE; tab->ref.tmp_table_index_lookup_init(thd, tmp_key, it, FALSE); diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 1c03b0bb4a3..db7a4c0fc14 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4128,6 +4128,7 @@ bool setup_sj_materialization_part1(JOIN_TAB *sjm_tab) sjm->materialized= FALSE; sjm_tab->table= sjm->table; + sjm_tab->tab_list= emb_sj_nest; sjm->table->pos_in_table_list= emb_sj_nest; DBUG_RETURN(FALSE); From 6544d88ff5a7b2ec66153933a3a0531b9091c357 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 9 May 2023 21:20:10 -0700 Subject: [PATCH 13/80] MDEV-31224 Crash with EXPLAIN EXTENDED for multi-table update of system table EXPLAIN EXTENDED should always print the field item used in the left part of an equality expression from the SET clause of an update statement as a reference to table column. Approved by Oleksandr Byelkin --- mysql-test/main/explain_non_select.result | 18 ++++++++++++++++++ mysql-test/main/explain_non_select.test | 19 +++++++++++++++++++ .../main/myisam_explain_non_select_all.result | 4 ++-- sql/sql_select.cc | 2 +- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result index d7ed3992572..009a568e2c2 100644 --- a/mysql-test/main/explain_non_select.result +++ b/mysql-test/main/explain_non_select.result @@ -308,4 +308,22 @@ select * from t1; a 4 drop table t1,t2,t3; +# +# MDEV-31224: EXPLAIN EXTENDED for multi-table update of system table +# +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); +EXPLAIN EXTENDED UPDATE t1, t2 SET b = 4 WHERE a IN (6,2); +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00 +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 update `test`.`t1` set `test`.`t2`.`b` = 4 where `test`.`t1`.`a` in (6,2) +UPDATE t1, t2 SET b = 4 WHERE a IN (6,2); +SELECT * from t2; +b +4 +DROP TABLE t1, t2; # End of 10.4 tests diff --git a/mysql-test/main/explain_non_select.test b/mysql-test/main/explain_non_select.test index c0c543ad273..e861955b3f1 100644 --- a/mysql-test/main/explain_non_select.test +++ b/mysql-test/main/explain_non_select.test @@ -277,4 +277,23 @@ select * from t1; drop table t1,t2,t3; +--echo # +--echo # MDEV-31224: EXPLAIN EXTENDED for multi-table update of system table +--echo # + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2); + +CREATE TABLE t2 (b INT) ENGINE=MyISAM; +INSERT INTO t2 VALUES (3); + +let $q= +UPDATE t1, t2 SET b = 4 WHERE a IN (6,2); + +eval EXPLAIN EXTENDED $q; +eval $q; +SELECT * from t2; + +DROP TABLE t1, t2; + --echo # End of 10.4 tests diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result index 3ca9629d027..b515cb4fd83 100644 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@ -2689,7 +2689,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Warnings: -Note 1003 update `test`.`t1` set NULL = 10 +Note 1003 update `test`.`t1` set `test`.`t2`.`c2` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 @@ -2734,7 +2734,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 system NULL NULL NULL NULL 0 0.00 Const row not found 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: -Note 1003 update `test`.`t1` set NULL = 10 where `test`.`t1`.`c3` = 10 +Note 1003 update `test`.`t1` set `test`.`t2`.`c2` = 10 where `test`.`t1`.`c3` = 10 # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 7 diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2be1fea9b03..a5d6ca05a1e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -28169,7 +28169,7 @@ void st_select_lex::print_set_clause(THD *thd, String *str, else str->append(','); - item->print(str, query_type); + item->print(str, (enum_query_type) (query_type | QT_NO_DATA_EXPANSION)); str->append(STRING_WITH_LEN(" = ")); val->print(str, query_type); } From 8c6e314ba98cf2026d00aad764e1b9aa3c87ace2 Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Wed, 10 May 2023 08:11:15 -0400 Subject: [PATCH 14/80] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2abc1c05da3..91b253ca00c 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=4 -MYSQL_VERSION_PATCH=29 +MYSQL_VERSION_PATCH=30 SERVER_MATURITY=stable From 7e7e12e747a8284efea697518940f6a647ff915c Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Mon, 24 Apr 2023 18:38:42 +0700 Subject: [PATCH 15/80] MDEV-30765 SHOW TABLES not working properly with lower_case_table_names=2 lower_case_table_names=2 means "table names and database names are stored as declared, but they are compared in lowercase". But names of objects in grants are stored in lowercase for any value of lower_case_table_names. This caused an error when checking grants for objects containing uppercase letters since table_hash_search() didn't take into account lower_case_table_names value --- mysql-test/main/lowercase_table2.opt | 1 + mysql-test/main/lowercase_table2.result | 36 ++++++++++++++++++++----- mysql-test/main/lowercase_table2.test | 26 ++++++++++++++++++ sql/sql_acl.cc | 2 +- 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 mysql-test/main/lowercase_table2.opt diff --git a/mysql-test/main/lowercase_table2.opt b/mysql-test/main/lowercase_table2.opt new file mode 100644 index 00000000000..ac4d3211e89 --- /dev/null +++ b/mysql-test/main/lowercase_table2.opt @@ -0,0 +1 @@ +--lower-case-table-names=2 diff --git a/mysql-test/main/lowercase_table2.result b/mysql-test/main/lowercase_table2.result index 9194638a4d2..fe06fb671a2 100644 --- a/mysql-test/main/lowercase_table2.result +++ b/mysql-test/main/lowercase_table2.result @@ -14,7 +14,7 @@ SHOW CREATE TABLE T1; Table Create Table T1 CREATE TABLE `T1` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci RENAME TABLE T1 TO T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) @@ -70,7 +70,7 @@ SHOW CREATE TABLE T1; Table Create Table T1 CREATE TABLE `T1` ( `a` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci RENAME TABLE T1 TO T2; SHOW TABLES LIKE "T2"; Tables_in_test (T2) @@ -319,18 +319,42 @@ Database (mysql_t%) mysql_TEST show create database mysql_test; Database Create Database -mysql_test CREATE DATABASE `mysql_test` /*!40100 DEFAULT CHARACTER SET latin1 */ +mysql_test CREATE DATABASE `mysql_test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */ show create database mysql_TEST; Database Create Database -mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET latin1 */ +mysql_TEST CREATE DATABASE `mysql_TEST` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */ show create table mysql_TEST.T1; Table Create Table T1 CREATE TABLE `T1` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci show create table mysql_test.t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci drop database mysql_TEST; +# MDEV-30765 SHOW TABLES not working properly with +# lower_case_table_names=2 +# +create database db1; +use db1; +# lowercase table name +create table `a` (a int); +# uppercase table name +create table `B` (a int); +create user 'mysqltest_1'@'localhost' identified by 'password'; +grant select, show view on db1.`a` to 'mysqltest_1'@'localhost'; +grant select, show view on db1.`B` to 'mysqltest_1'@'localhost'; +connect conn1, localhost, mysqltest_1, password, test; +connection conn1; +use db1; +show tables; +Tables_in_db1 +B +a +connection default; +disconnect conn1; +drop user 'mysqltest_1'@'localhost'; +drop tables a, B; +drop database db1; diff --git a/mysql-test/main/lowercase_table2.test b/mysql-test/main/lowercase_table2.test index 601089ca760..82c07bf9345 100644 --- a/mysql-test/main/lowercase_table2.test +++ b/mysql-test/main/lowercase_table2.test @@ -288,3 +288,29 @@ show create database mysql_TEST; show create table mysql_TEST.T1; show create table mysql_test.t1; drop database mysql_TEST; + +--echo # MDEV-30765 SHOW TABLES not working properly with +--echo # lower_case_table_names=2 +--echo # +create database db1; +use db1; +--echo # lowercase table name +create table `a` (a int); +--echo # uppercase table name +create table `B` (a int); + +create user 'mysqltest_1'@'localhost' identified by 'password'; + +grant select, show view on db1.`a` to 'mysqltest_1'@'localhost'; +grant select, show view on db1.`B` to 'mysqltest_1'@'localhost'; + +connect (conn1, localhost, mysqltest_1, password, test); +connection conn1; +use db1; +show tables; + +connection default; +disconnect conn1; +drop user 'mysqltest_1'@'localhost'; +drop tables a, B; +drop database db1; \ No newline at end of file diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4bb16e3248d..c764d2fe2f7 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -5462,7 +5462,7 @@ table_hash_search(const char *host, const char *ip, const char *db, const char *user, const char *tname, bool exact) { return (GRANT_TABLE*) name_hash_search(&column_priv_hash, host, ip, db, - user, tname, exact, FALSE); + user, tname, exact, (lower_case_table_names > 0)); } static bool column_priv_insert(GRANT_TABLE *grant) From 28eaf66e18fbb2fc15c20c14f835c7c276c35cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 10 May 2023 08:42:37 +0300 Subject: [PATCH 16/80] MDEV-30388 : Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command == SQLCOM_CREATE_TABLE && !thd->is_current_stmt_binlog_format_row()) || thd->wsrep_cs().transaction().state() == wsrep::transaction::s_aborted' failed Problem for Galera is the fact that sequences are not really transactional. Sequence operation is committed immediately in sql_sequence.cd and later Galera could find out that we have changes but actual statement is not there anymore. Therefore, we must make some restrictions what kind of sequences Galera can support. (1) Galera cluster supports only sequences implemented by InnoDB storage engine. This is because Galera replication supports currently only InnoDB. (2) We do not allow LOCK TABLE on sequence object and we do not allow sequence creation under LOCK TABLE, instead lock is released and we issue warning. (3) We allow sequences with NOCACHE definition or with INCREMEMENT BY 0 CACHE=n definition. This makes sure that sequence values are unique accross Galera cluster. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/MDEV-18832.result | 7 +- mysql-test/suite/galera/r/MDEV-27862.result | 5 - .../suite/galera/r/galera_sequences.result | 186 +++++++++++++- mysql-test/suite/galera/t/MDEV-18832.test | 12 +- mysql-test/suite/galera/t/MDEV-27862.test | 11 - .../suite/galera/t/galera_sequences.cnf | 4 + .../suite/galera/t/galera_sequences.test | 236 +++++++++++++++++- sql/sql_parse.cc | 10 + sql/sql_sequence.cc | 28 +-- sql/sql_table.cc | 63 +++++ sql/sql_table.h | 4 + sql/wsrep_mysqld.cc | 13 +- sql/wsrep_trans_observer.h | 11 +- 13 files changed, 516 insertions(+), 74 deletions(-) diff --git a/mysql-test/suite/galera/r/MDEV-18832.result b/mysql-test/suite/galera/r/MDEV-18832.result index 2e0872b9f2e..676ee4bf337 100644 --- a/mysql-test/suite/galera/r/MDEV-18832.result +++ b/mysql-test/suite/galera/r/MDEV-18832.result @@ -1,17 +1,14 @@ connection node_2; connection node_1; -CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; CREATE TABLE t1 (Id int(11) NOT NULL, PRIMARY KEY (Id)); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); DROP SEQUENCE Seq1_1; -CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' DROP SEQUENCE Seq1_1; DROP TABLE t1; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -connection node_2; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); diff --git a/mysql-test/suite/galera/r/MDEV-27862.result b/mysql-test/suite/galera/r/MDEV-27862.result index 25b7bc6cfd2..d1aa9e2ca91 100644 --- a/mysql-test/suite/galera/r/MDEV-27862.result +++ b/mysql-test/suite/galera/r/MDEV-27862.result @@ -1,10 +1,5 @@ connection node_2; connection node_1; -CREATE SEQUENCE seq_nocache ENGINE=InnoDB; -DROP SEQUENCE seq_nocache; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -connection node_2; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); connection node_1; CREATE SEQUENCE seq NOCACHE ENGINE=InnoDB; SELECT NEXTVAL(seq) = 1; diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result index da669e6774e..ec3adec8924 100644 --- a/mysql-test/suite/galera/r/galera_sequences.result +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -1,11 +1,6 @@ connection node_2; connection node_1; connection node_1; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -CALL mtr.add_suppression("WSREP: CREATE TABLE isolation failure"); -connection node_2; -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -connection node_1; CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB; SHOW CREATE SEQUENCE seq; Table Create Table @@ -15,14 +10,14 @@ SHOW CREATE SEQUENCE seq; Table Create Table seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB connection node_1; -ALTER SEQUENCE seq MAXVALUE = 10000; +ALTER SEQUENCE seq MAXVALUE = 10000 NOCACHE; SHOW CREATE SEQUENCE seq; Table Create Table -seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 10000 increment by 0 cache 1000 nocycle ENGINE=InnoDB +seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 10000 increment by 0 nocache nocycle ENGINE=InnoDB connection node_2; SHOW CREATE SEQUENCE seq; Table Create Table -seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 10000 increment by 0 cache 1000 nocycle ENGINE=InnoDB +seq CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 10000 increment by 0 nocache nocycle ENGINE=InnoDB connection node_1; DROP SEQUENCE seq; SHOW CREATE SEQUENCE seq; @@ -31,25 +26,26 @@ connection node_2; SHOW CREATE SEQUENCE seq; ERROR 42S02: Table 'test.seq' doesn't exist connection node_1; -CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; select NEXT VALUE FOR Seq1_1; NEXT VALUE FOR Seq1_1 1 alter table Seq1_1 engine=myisam; +ERROR 42000: This version of MariaDB doesn't yet support 'Galera cluster does support only InnoDB sequences' select NEXT VALUE FOR Seq1_1; NEXT VALUE FOR Seq1_1 -1001 +2 alter table Seq1_1 engine=innodb; select NEXT VALUE FOR Seq1_1; NEXT VALUE FOR Seq1_1 -2001 +3 connection node_2; SHOW CREATE SEQUENCE Seq1_1; Table Create Table -Seq1_1 CREATE SEQUENCE `Seq1_1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB +Seq1_1 CREATE SEQUENCE `Seq1_1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB select NEXT VALUE FOR Seq1_1; NEXT VALUE FOR Seq1_1 -3001 +4 connection node_1; DROP SEQUENCE Seq1_1; connection node_1; @@ -107,3 +103,167 @@ DROP TABLE t1; DROP SEQUENCE sq1; DROP SEQUENCE sq2; SET SESSION wsrep_OSU_method='TOI'; +CREATE TABLE t (f INT) engine=innodb; +LOCK TABLE t WRITE; +CREATE OR REPLACE SEQUENCE t MAXVALUE=13 INCREMENT BY 1 NOCACHE engine=innodb; +Warnings: +Warning 138 Galera cluster does not support LOCK TABLE on SEQUENCES. Lock is released. +LOCK TABLE t WRITE; +ERROR 42000: This version of MariaDB doesn't yet support 'LOCK TABLE on SEQUENCES in Galera cluster' +INSERT INTO t VALUES (0,0,1,1,1,0,0,0); +SELECT * from t; +next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count +0 0 1 1 1 0 0 0 +SELECT NEXTVAL(t); +NEXTVAL(t) +0 +UNLOCK TABLES; +DROP TABLE t; +CREATE SEQUENCE t INCREMENT BY 0 NOCACHE ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), +b int) engine=innodb; +INSERT INTO t1(b) VALUES (1),(2),(3); +SELECT * FROM t1; +a b +1 1 +3 2 +5 3 +connection node_2; +SELECT * FROM t1; +a b +1 1 +3 2 +5 3 +INSERT INTO t1(b) VALUES (4),(5),(6); +SELECT * FROM t1; +a b +1 1 +3 2 +5 3 +8 4 +10 5 +12 6 +connection node_1; +SELECT * FROM t1; +a b +1 1 +3 2 +5 3 +8 4 +10 5 +12 6 +DROP TABLE t1; +DROP SEQUENCE t; +CREATE SEQUENCE t ENGINE=MYISAM; +ERROR 42000: This version of MariaDB doesn't yet support 'Galera cluster does support only InnoDB sequences' +CREATE SEQUENCE t INCREMENT BY 1 NOCACHE ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; +connection node_2; +# Wait DDL to replicate +connection node_1; +SELECT @@auto_increment_increment; +@@auto_increment_increment +2 +SELECT @@auto_increment_offset; +@@auto_increment_offset +1 +SET SESSION wsrep_sync_wait=0; +connection node_2; +SELECT @@auto_increment_increment; +@@auto_increment_increment +2 +SELECT @@auto_increment_offset; +@@auto_increment_offset +2 +SET SESSION wsrep_sync_wait=0; +connection node_1; +connection node_2; +connection node_1; +DROP SEQUENCE t; +DROP TABLE t1; +CREATE SEQUENCE t INCREMENT BY 0 NOCACHE ENGINE=INNODB; +DROP SEQUENCE t; +CREATE SEQUENCE t INCREMENT BY 1 CACHE=20 ENGINE=INNODB; +ERROR 42000: This version of MariaDB doesn't yet support 'In Galera if you use CACHE you should set INCREMENT BY 0 to behave correctly in a cluster' +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; +connection node_2; +# Wait DDL to replicate +connection node_1; +SET SESSION wsrep_sync_wait=0; +connection node_2; +SET SESSION wsrep_sync_wait=0; +connection node_1; +connection node_2; +connection node_1; +DROP SEQUENCE t; +DROP TABLE t1; +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +ALTER TABLE t ENGINE=MYISAM; +ERROR 42000: This version of MariaDB doesn't yet support 'Galera cluster does support only InnoDB sequences' +ALTER SEQUENCE t INCREMENT BY 1 CACHE=10; +ERROR 42000: This version of MariaDB doesn't yet support 'In Galera if you use CACHE you should set INCREMENT BY 0 to behave correctly in a cluster' +ALTER SEQUENCE t INCREMENT BY 1 NOCACHE; +ALTER SEQUENCE t INCREMENT BY 0 NOCACHE; +ALTER SEQUENCE t INCREMENT BY 0 CACHE=10; +DROP SEQUENCE t; +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; +BEGIN; +INSERT INTO t1(b) VALUES (1); +INSERT INTO t1(b) VALUES (2); +INSERT INTO t1(b) VALUES (3); +INSERT INTO t1(b) VALUES (4); +INSERT INTO t1(a,b) VALUES (2,2); +INSERT INTO t1(a,b) VALUES (3,2); +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +ROLLBACK; +SELECT * FROM t1; +a b +SELECT NEXTVAL(t); +NEXTVAL(t) +9 +connection node_2; +SELECT * FROM t1; +a b +SELECT NEXTVAL(t); +NEXTVAL(t) +2 +connection node_1; +DROP TABLE t1; +DROP SEQUENCE t; +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; +BEGIN; +INSERT INTO t1(b) VALUES (1); +INSERT INTO t1(b) VALUES (2); +INSERT INTO t1(b) VALUES (3); +INSERT INTO t1(b) VALUES (4); +INSERT INTO t1(a,b) VALUES (2,2); +INSERT INTO t1(a,b) VALUES (3,2); +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +COMMIT; +SELECT * FROM t1; +a b +1 1 +2 2 +3 2 +5 3 +7 4 +SELECT NEXTVAL(t); +NEXTVAL(t) +9 +connection node_2; +SELECT * FROM t1; +a b +1 1 +2 2 +3 2 +5 3 +7 4 +SELECT NEXTVAL(t); +NEXTVAL(t) +42 +connection node_1; +DROP TABLE t1; +DROP SEQUENCE t; diff --git a/mysql-test/suite/galera/t/MDEV-18832.test b/mysql-test/suite/galera/t/MDEV-18832.test index ba93761435a..d60be151142 100644 --- a/mysql-test/suite/galera/t/MDEV-18832.test +++ b/mysql-test/suite/galera/t/MDEV-18832.test @@ -1,23 +1,15 @@ --source include/galera_cluster.inc --source include/have_innodb.inc -CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; CREATE TABLE t1 (Id int(11) NOT NULL, PRIMARY KEY (Id)); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); DROP SEQUENCE Seq1_1; -CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; --error ER_DUP_ENTRY INSERT INTO t1 VALUES (NEXT VALUE FOR Seq1_1); DROP SEQUENCE Seq1_1; DROP TABLE t1; - -# Supress warning for SEQUENCES that are declared without `NOCACHE` introduced with MDEV-27862 - -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); - ---connection node_2 - -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); diff --git a/mysql-test/suite/galera/t/MDEV-27862.test b/mysql-test/suite/galera/t/MDEV-27862.test index 89d3465b91f..d23ce95d47e 100644 --- a/mysql-test/suite/galera/t/MDEV-27862.test +++ b/mysql-test/suite/galera/t/MDEV-27862.test @@ -1,17 +1,6 @@ --source include/galera_cluster.inc --source include/have_innodb.inc -# Report WARNING when SEQUENCE is created without `NOCACHE` - -CREATE SEQUENCE seq_nocache ENGINE=InnoDB; -DROP SEQUENCE seq_nocache; - -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); - ---connection node_2 - -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); - # NEXTVAL --connection node_1 diff --git a/mysql-test/suite/galera/t/galera_sequences.cnf b/mysql-test/suite/galera/t/galera_sequences.cnf index 98e724fb2d0..3a0543e3d34 100644 --- a/mysql-test/suite/galera/t/galera_sequences.cnf +++ b/mysql-test/suite/galera/t/galera_sequences.cnf @@ -3,7 +3,11 @@ [mysqld.1] log-bin log-slave-updates +auto-increment-increment=2 +auto-increment-offset=1 [mysqld.2] log-bin log-slave-updates +auto-increment-increment=2 +auto-increment-offset=2 diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index 613823d83e9..2582c204435 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -5,13 +5,6 @@ # MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster # ---connection node_1 -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -CALL mtr.add_suppression("WSREP: CREATE TABLE isolation failure"); ---connection node_2 - -CALL mtr.add_suppression("SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); - --connection node_1 CREATE SEQUENCE `seq` start with 1 minvalue 1 maxvalue 1000000 increment by 0 cache 1000 nocycle ENGINE=InnoDB; SHOW CREATE SEQUENCE seq; @@ -20,7 +13,7 @@ SHOW CREATE SEQUENCE seq; SHOW CREATE SEQUENCE seq; --connection node_1 -ALTER SEQUENCE seq MAXVALUE = 10000; +ALTER SEQUENCE seq MAXVALUE = 10000 NOCACHE; SHOW CREATE SEQUENCE seq; --connection node_2 @@ -39,8 +32,9 @@ SHOW CREATE SEQUENCE seq; # MDEV-18848 : Galera: 10.4 node crashed with Assertion `client_state.transaction().active()` after altering SEQUENCE table's engine to myisam and back to innodb # --connection node_1 -CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1; +CREATE SEQUENCE Seq1_1 START WITH 1 INCREMENT BY 1 NOCACHE; select NEXT VALUE FOR Seq1_1; +--error ER_NOT_SUPPORTED_YET alter table Seq1_1 engine=myisam; select NEXT VALUE FOR Seq1_1; alter table Seq1_1 engine=innodb; @@ -98,3 +92,227 @@ DROP TABLE t1; DROP SEQUENCE sq1; DROP SEQUENCE sq2; SET SESSION wsrep_OSU_method='TOI'; + +# +# MDEV-30388 Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command == SQLCOM_CREATE_TABLE +# && !thd->is_current_stmt_binlog_format_row()) || +# thd->wsrep_cs().transaction().state() == wsrep::transaction::s_aborted' failed +# + +CREATE TABLE t (f INT) engine=innodb; +LOCK TABLE t WRITE; +CREATE OR REPLACE SEQUENCE t MAXVALUE=13 INCREMENT BY 1 NOCACHE engine=innodb; +--error ER_NOT_SUPPORTED_YET +LOCK TABLE t WRITE; +INSERT INTO t VALUES (0,0,1,1,1,0,0,0); +SELECT * from t; +SELECT NEXTVAL(t); +UNLOCK TABLES; +DROP TABLE t; + +CREATE SEQUENCE t INCREMENT BY 0 NOCACHE ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), +b int) engine=innodb; +INSERT INTO t1(b) VALUES (1),(2),(3); +SELECT * FROM t1; + +--connection node_2 +SELECT * FROM t1; +INSERT INTO t1(b) VALUES (4),(5),(6); +SELECT * FROM t1; + +--connection node_1 +SELECT * FROM t1; +DROP TABLE t1; +DROP SEQUENCE t; + +# +# Test Galera SEQUENCE support +# +# +# No MyISAM SEQUENCES +# +--error ER_NOT_SUPPORTED_YET +CREATE SEQUENCE t ENGINE=MYISAM; +CREATE SEQUENCE t INCREMENT BY 1 NOCACHE ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; + +--connection node_2 +--echo # Wait DDL to replicate +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc + +# +# Below we do not care order of INSERTs we care only that values are unique +# +--connection node_1 +SELECT @@auto_increment_increment; +SELECT @@auto_increment_offset; +--let $wsrep_sync_wait_orig_1 = `SELECT @@wsrep_sync_wait` +SET SESSION wsrep_sync_wait=0; + +--connection node_2 +SELECT @@auto_increment_increment; +SELECT @@auto_increment_offset; +--let $wsrep_sync_wait_orig_2 = `SELECT @@wsrep_sync_wait` +SET SESSION wsrep_sync_wait=0; + +--let $count = 20 +--disable_query_log +while ($count) +{ +--connection node_1 +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (1); +--connection node_2 +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (2); +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (2); +--connection node_1 +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (1); +--dec $count +} +--enable_query_log + +--connection node_1 +--disable_query_log +--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig_1 +--enable_query_log + +--connection node_2 +--disable_query_log +--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig_2 +--enable_query_log + +--connection node_1 +DROP SEQUENCE t; +DROP TABLE t1; +CREATE SEQUENCE t INCREMENT BY 0 NOCACHE ENGINE=INNODB; +DROP SEQUENCE t; +--error ER_NOT_SUPPORTED_YET +CREATE SEQUENCE t INCREMENT BY 1 CACHE=20 ENGINE=INNODB; + +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; + +--connection node_2 +--echo # Wait DDL to replicate +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't' +--source include/wait_condition.inc +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' +--source include/wait_condition.inc + +# +# Below we do not care order of INSERTs we care only that values are unique +# +--connection node_1 +--let $wsrep_sync_wait_orig_1 = `SELECT @@wsrep_sync_wait` +SET SESSION wsrep_sync_wait=0; + +--connection node_2 +--let $wsrep_sync_wait_orig_2 = `SELECT @@wsrep_sync_wait` +SET SESSION wsrep_sync_wait=0; + +--let $count = 5 +--disable_query_log +while ($count) +{ +--connection node_1 +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (1),(2),(3),(4),(5),(6),(7),(8),(9); +--connection node_2 +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (21),(22),(23),(24),(25),(26),(27),(28),(29); +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (21),(22),(23),(24),(25),(26),(27),(28),(29); +--connection node_1 +--error 0,ER_LOCK_WAIT_TIMEOUT +INSERT INTO t1(b) values (1),(2),(3),(4),(5),(6),(7),(8),(9); +--dec $count +} +--enable_query_log + +--connection node_1 +--disable_query_log +--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig_1 +--enable_query_log + +--connection node_2 +--disable_query_log +--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig_2 +--enable_query_log + +--connection node_1 +DROP SEQUENCE t; +DROP TABLE t1; + +# +# Test ALTER table to sequence and ALTER SEQUENCE +# +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +--error ER_NOT_SUPPORTED_YET +ALTER TABLE t ENGINE=MYISAM; +--error ER_NOT_SUPPORTED_YET +ALTER SEQUENCE t INCREMENT BY 1 CACHE=10; +ALTER SEQUENCE t INCREMENT BY 1 NOCACHE; +ALTER SEQUENCE t INCREMENT BY 0 NOCACHE; +ALTER SEQUENCE t INCREMENT BY 0 CACHE=10; +DROP SEQUENCE t; + +# +# Test transactions +# +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; +# +# ROLLBACK TRX +# +BEGIN; +INSERT INTO t1(b) VALUES (1); +INSERT INTO t1(b) VALUES (2); +INSERT INTO t1(b) VALUES (3); +INSERT INTO t1(b) VALUES (4); +INSERT INTO t1(a,b) VALUES (2,2); +--error ER_DUP_ENTRY +INSERT INTO t1(a,b) VALUES (3,2); +ROLLBACK; +SELECT * FROM t1; +SELECT NEXTVAL(t); + +--connection node_2 +SELECT * FROM t1; +SELECT NEXTVAL(t); + +--connection node_1 +DROP TABLE t1; +DROP SEQUENCE t; + +CREATE SEQUENCE t INCREMENT BY 0 CACHE=20 ENGINE=INNODB; +CREATE TABLE t1(a int not null primary key default nextval(t), b int) engine=innodb; +# +# COMMIT TRX +# +BEGIN; +INSERT INTO t1(b) VALUES (1); +INSERT INTO t1(b) VALUES (2); +INSERT INTO t1(b) VALUES (3); +INSERT INTO t1(b) VALUES (4); +INSERT INTO t1(a,b) VALUES (2,2); +--error ER_DUP_ENTRY +INSERT INTO t1(a,b) VALUES (3,2); +COMMIT; + +SELECT * FROM t1; +SELECT NEXTVAL(t); + +--connection node_2 +SELECT * FROM t1; +SELECT NEXTVAL(t); + +--connection node_1 +DROP TABLE t1; +DROP SEQUENCE t; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c95993e1604..48d4f0cbd55 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2951,6 +2951,16 @@ retry: if (result) goto err; } + +#ifdef WITH_WSREP + if (WSREP(thd) && table->table->s->table_type == TABLE_TYPE_SEQUENCE) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "LOCK TABLE on SEQUENCES in Galera cluster"); + goto err; + } +#endif + } /* Check privileges of view tables here, after views were opened. diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index ce95d7baeeb..2904749d1e6 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -311,11 +311,6 @@ bool sequence_insert(THD *thd, LEX *lex, TABLE_LIST *org_table_list) DBUG_RETURN(TRUE); } -#ifdef WITH_WSREP - if (WSREP_ON && seq->cache != 0) - WSREP_WARN("CREATE SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -#endif - /* If not temporary table */ if (!temporary_table) { @@ -925,21 +920,24 @@ bool Sql_cmd_alter_sequence::execute(THD *thd) 0, 0)) DBUG_RETURN(TRUE); /* purecov: inspected */ -#ifdef WITH_WSREP - if (WSREP_ON && new_seq->cache != 0) - WSREP_WARN("ALTER SEQUENCES declared without `NOCACHE` will not behave correctly in galera cluster."); -#endif - if (check_grant(thd, ALTER_ACL, first_table, FALSE, 1, FALSE)) DBUG_RETURN(TRUE); /* purecov: inspected */ #ifdef WITH_WSREP - if (WSREP_ON && WSREP(thd) && - wsrep_to_isolation_begin(thd, first_table->db.str, - first_table->table_name.str, - first_table)) - DBUG_RETURN(TRUE); + if (WSREP(thd) && wsrep_thd_is_local(thd)) + { + if (wsrep_check_sequence(thd, new_seq)) + DBUG_RETURN(TRUE); + + if (wsrep_to_isolation_begin(thd, first_table->db.str, + first_table->table_name.str, + first_table)) + { + DBUG_RETURN(TRUE); + } + } #endif /* WITH_WSREP */ + if (if_exists()) thd->push_internal_handler(&no_such_table_handler); error= open_and_lock_tables(thd, first_table, FALSE, 0); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1e88e7722e3..b0f7d848068 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -5301,6 +5301,51 @@ int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *db, return res; } +#ifdef WITH_WSREP +/** Additional sequence checks for Galera cluster. + +@param thd thread handle +@param seq sequence definition +@retval 0 failure +@retval 1 success +*/ +bool wsrep_check_sequence(THD* thd, const sequence_definition *seq) +{ + enum legacy_db_type db_type; + if (thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE) + { + db_type= thd->lex->create_info.db_type->db_type; + } + else + { + const handlerton *hton= ha_default_handlerton(thd); + db_type= hton->db_type; + } + + // In Galera cluster we support only InnoDB sequences + if (db_type != DB_TYPE_INNODB) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "Galera cluster does support only InnoDB sequences"); + return(true); + } + + // In Galera cluster it is best to use INCREMENT BY 0 with CACHE + // or NOCACHE + if (seq && + seq->increment && + seq->cache) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "In Galera if you use CACHE you should set INCREMENT BY 0" + " to behave correctly in a cluster"); + return(true); + } + + return (false); +} +#endif /* WITH_WSREP */ + /** Implementation of SQLCOM_CREATE_TABLE. @@ -5356,6 +5401,15 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, if (!opt_explicit_defaults_for_timestamp) promote_first_timestamp_column(&alter_info->create_list); +#ifdef WITH_WSREP + if (thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE && + WSREP(thd) && wsrep_thd_is_local_toi(thd)) + { + if (wsrep_check_sequence(thd, create_info->seq_create_info)) + DBUG_RETURN(true); + } +#endif /* WITH_WSREP */ + /* We can abort create table for any table type */ thd->abort_on_warning= thd->is_strict_mode(); @@ -10143,6 +10197,15 @@ do_continue:; } #endif +#ifdef WITH_WSREP + if (table->s->sequence && WSREP(thd) && + wsrep_thd_is_local_toi(thd)) + { + if (wsrep_check_sequence(thd, create_info->seq_create_info)) + DBUG_RETURN(TRUE); + } +#endif /* WITH_WSREP */ + /* Use copy algorithm if: - old_alter_table system variable is set without in-place requested using diff --git a/sql/sql_table.h b/sql/sql_table.h index e51b5ec0f0f..2422f4dcb59 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -285,4 +285,8 @@ extern mysql_mutex_t LOCK_gdl; bool check_engine(THD *, const char *, const char *, HA_CREATE_INFO *); +#ifdef WITH_WSREP +bool wsrep_check_sequence(THD* thd, const sequence_definition *seq); +#endif + #endif /* SQL_TABLE_INCLUDED */ diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index a95cefc6f0f..a898b554a78 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2298,9 +2298,20 @@ int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_, return -1; } + /* If we are inside LOCK TABLE we release it and give warning. */ + if (thd->variables.option_bits & OPTION_TABLE_LOCK && + thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE) + { + thd->locked_tables_list.unlock_locked_tables(thd); + thd->variables.option_bits&= ~(OPTION_TABLE_LOCK); + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + HA_ERR_UNSUPPORTED, + "Galera cluster does not support LOCK TABLE on " + "SEQUENCES. Lock is released."); + } if (wsrep_debug && thd->mdl_context.has_locks()) { - WSREP_DEBUG("thread holds MDL locks at TI begin: %s %llu", + WSREP_DEBUG("thread holds MDL locks at TO begin: %s %llu", wsrep_thd_query(thd), thd->thread_id); } diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index 5f799d56c05..2d5e4d3a1f2 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -414,11 +414,12 @@ int wsrep_after_statement(THD* thd) { DBUG_ENTER("wsrep_after_statement"); WSREP_DEBUG("wsrep_after_statement for %lu client_state %s " - " client_mode %s trans_state %s", - thd_get_thread_id(thd), - wsrep::to_c_string(thd->wsrep_cs().state()), - wsrep::to_c_string(thd->wsrep_cs().mode()), - wsrep::to_c_string(thd->wsrep_cs().transaction().state())); + " client_mode %s trans_state %s query %s", + thd_get_thread_id(thd), + wsrep::to_c_string(thd->wsrep_cs().state()), + wsrep::to_c_string(thd->wsrep_cs().mode()), + wsrep::to_c_string(thd->wsrep_cs().transaction().state()), + wsrep_thd_query(thd)); DBUG_RETURN((thd->wsrep_cs().state() != wsrep::client_state::s_none && thd->wsrep_cs().mode() == Wsrep_client_state::m_local) ? thd->wsrep_cs().after_statement() : 0); From 3a7b3113505b317f8f1288d18dd0fa19a6ac360a Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Fri, 12 May 2023 02:46:42 +0200 Subject: [PATCH 17/80] MDEV-30388 correction: fix compilation error --- sql/sql_table.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_table.h b/sql/sql_table.h index 2422f4dcb59..cf61ad6a4fa 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -286,7 +286,7 @@ extern mysql_mutex_t LOCK_gdl; bool check_engine(THD *, const char *, const char *, HA_CREATE_INFO *); #ifdef WITH_WSREP -bool wsrep_check_sequence(THD* thd, const sequence_definition *seq); +bool wsrep_check_sequence(THD* thd, const class sequence_definition *seq); #endif #endif /* SQL_TABLE_INCLUDED */ From 7d55eb00f357e876fc81631919dd7f7defaf5bec Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Thu, 16 Mar 2023 09:29:10 +0100 Subject: [PATCH 18/80] MDEV-30473 Remove test galera.MDEV-27713 Remove test galera.MDEV-27713. This test relies on GET_LOCK() and has stopped working since commit 844ddb1 (see MDEV-30473). This commit disabled GET_LOCK() in combination with Galera. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/MDEV-27713.result | 46 -------------- mysql-test/suite/galera/t/MDEV-27713.test | 67 --------------------- 2 files changed, 113 deletions(-) delete mode 100644 mysql-test/suite/galera/r/MDEV-27713.result delete mode 100644 mysql-test/suite/galera/t/MDEV-27713.test diff --git a/mysql-test/suite/galera/r/MDEV-27713.result b/mysql-test/suite/galera/r/MDEV-27713.result deleted file mode 100644 index 14575cb484d..00000000000 --- a/mysql-test/suite/galera/r/MDEV-27713.result +++ /dev/null @@ -1,46 +0,0 @@ -connection node_2; -connection node_1; -CREATE TABLE t1 ( -f1 INT, -f2 VARCHAR(255) PRIMARY KEY -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO t1 VALUES(1, 'abc'); -connection node_1; -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 VALUES (2,'def'); -connection node_2; -SET GLOBAL event_scheduler=ON; -CREATE PROCEDURE update_table() -BEGIN -SET AUTOCOMMIT=OFF; -DO GET_LOCK('local_lock', 0); -SET DEBUG_SYNC = 'innodb_row_update_for_mysql_begin SIGNAL blocked WAIT_FOR continue'; -UPDATE t1 SET f2 = 'jkl' WHERE f1 != 2; -DO RELEASE_LOCK('local_lock'); -END| -CREATE DEFINER=current_user -EVENT event -ON SCHEDULE AT CURRENT_TIMESTAMP -ON COMPLETION PRESERVE -ENABLE -DO CALL update_table(); -connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; -SET DEBUG_SYNC = 'now WAIT_FOR blocked'; -connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2; -SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb"; -connection node_1; -COMMIT; -connection node_2b; -SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; -SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; -connection node_2a; -SET DEBUG_SYNC = 'now SIGNAL continue'; -connection node_2; -SET GLOBAL event_scheduler=default; -DROP PROCEDURE update_table; -DROP EVENT event; -SET DEBUG_SYNC='reset'; -SET GLOBAL debug_dbug = DEFAULT; -connection node_1; -DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-27713.test b/mysql-test/suite/galera/t/MDEV-27713.test deleted file mode 100644 index 4bfcd7e3d50..00000000000 --- a/mysql-test/suite/galera/t/MDEV-27713.test +++ /dev/null @@ -1,67 +0,0 @@ ---source include/galera_cluster.inc ---source include/have_innodb.inc ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/big_test.inc - -CREATE TABLE t1 ( - f1 INT, - f2 VARCHAR(255) PRIMARY KEY -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -INSERT INTO t1 VALUES(1, 'abc'); - ---connection node_1 -SET AUTOCOMMIT=OFF; -START TRANSACTION; -INSERT INTO t1 VALUES (2,'def'); - ---connection node_2 - -SET GLOBAL event_scheduler=ON; - -DELIMITER |; -CREATE PROCEDURE update_table() -BEGIN - SET AUTOCOMMIT=OFF; - DO GET_LOCK('local_lock', 0); - SET DEBUG_SYNC = 'innodb_row_update_for_mysql_begin SIGNAL blocked WAIT_FOR continue'; - UPDATE t1 SET f2 = 'jkl' WHERE f1 != 2; - DO RELEASE_LOCK('local_lock'); -END| -DELIMITER ;| - -CREATE DEFINER=current_user - EVENT event - ON SCHEDULE AT CURRENT_TIMESTAMP - ON COMPLETION PRESERVE - ENABLE - DO CALL update_table(); - ---connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 -SET DEBUG_SYNC = 'now WAIT_FOR blocked'; - -# Applier control thread ---connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2 -SET GLOBAL debug_dbug = "+d,sync.wsrep_apply_cb"; - ---connection node_1 -COMMIT; - -# Applier control thread ---connection node_2b -SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached"; -SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb"; - ---connection node_2a -SET DEBUG_SYNC = 'now SIGNAL continue'; - ---connection node_2 -SET GLOBAL event_scheduler=default; -DROP PROCEDURE update_table; -DROP EVENT event; -SET DEBUG_SYNC='reset'; -SET GLOBAL debug_dbug = DEFAULT; - ---connection node_1 -DROP TABLE t1; From f102b595e8a65d910e34ea943eb562dc16a4256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 3 May 2023 08:29:38 +0300 Subject: [PATCH 19/80] MDEV-28433 : Server crashes when wsrep_sst_donor and wsrep_cluster_address set to NULL Do not allow setting wsrep_sst_donor as NULL as it is incorrect value. User can use value '' (default) that represents same as NULL. Setting wsrep_cluster_address to NULL is already handled correctly. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/mdev-28433.result | 25 +++++++++++++ mysql-test/suite/galera/t/mdev-28433.test | 35 +++++++++++++++++++ .../sys_vars/r/wsrep_sst_donor_basic.result | 11 ++++-- .../sys_vars/t/wsrep_sst_donor_basic.test | 5 ++- sql/wsrep_sst.cc | 9 +++++ 5 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 mysql-test/suite/galera/r/mdev-28433.result create mode 100644 mysql-test/suite/galera/t/mdev-28433.test diff --git a/mysql-test/suite/galera/r/mdev-28433.result b/mysql-test/suite/galera/r/mdev-28433.result new file mode 100644 index 00000000000..c2dde6481f4 --- /dev/null +++ b/mysql-test/suite/galera/r/mdev-28433.result @@ -0,0 +1,25 @@ +connection node_2; +connection node_1; +connection node_1; +connection node_2; +connection node_2; +SET @@global.wsrep_sst_donor = NULL; +ERROR 42000: Variable 'wsrep_sst_donor' can't be set to the value of 'NULL' +SET @@global.wsrep_cluster_address='NULL'; +SET SESSION wsrep_sync_wait=0; +SELECT @@wsrep_sst_donor; +@@wsrep_sst_donor + +SELECT @@wsrep_cluster_address; +@@wsrep_cluster_address +NULL +SHOW STATUS LIKE 'wsrep_ready'; +Variable_name Value +wsrep_ready OFF +SHOW STATUS LIKE 'wsrep_cluster_status'; +Variable_name Value +wsrep_cluster_status Disconnected +call mtr.add_suppression("WSREP: .*Invalid backend URI.*"); +call mtr.add_suppression("WSREP: gcs connect failed: Invalid argument"); +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/t/mdev-28433.test b/mysql-test/suite/galera/t/mdev-28433.test new file mode 100644 index 00000000000..ddee3618fee --- /dev/null +++ b/mysql-test/suite/galera/t/mdev-28433.test @@ -0,0 +1,35 @@ +--source include/galera_cluster.inc + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--source include/auto_increment_offset_save.inc + +--connection node_2 +--let $wsrep_cluster_address_saved = `SELECT @@global.wsrep_cluster_address` + +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_sst_donor = NULL; +--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` +SET @@global.wsrep_cluster_address='NULL'; +SET SESSION wsrep_sync_wait=0; +SELECT @@wsrep_sst_donor; +SELECT @@wsrep_cluster_address; +# Must return 'OFF' +SHOW STATUS LIKE 'wsrep_ready'; + +# Must return 'Disconnected' +SHOW STATUS LIKE 'wsrep_cluster_status'; + +--disable_query_log +--eval SET @@global.wsrep_cluster_address = '$wsrep_cluster_address_orig' +--enable_query_log +--source include/wait_until_connected_again.inc +--source include/galera_wait_ready.inc +call mtr.add_suppression("WSREP: .*Invalid backend URI.*"); +call mtr.add_suppression("WSREP: gcs connect failed: Invalid argument"); + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc + +--source include/galera_end.inc diff --git a/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result b/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result index 3d4fc24df7f..dbe4cc23bf9 100644 --- a/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result +++ b/mysql-test/suite/sys_vars/r/wsrep_sst_donor_basic.result @@ -33,17 +33,22 @@ SET @@global.wsrep_sst_donor=default; SELECT @@global.wsrep_sst_donor; @@global.wsrep_sst_donor -SET @@global.wsrep_sst_donor=NULL; +SET @@global.wsrep_sst_donor=''; SELECT @@global.wsrep_sst_donor; @@global.wsrep_sst_donor -NULL + # invalid values SET @@global.wsrep_sst_donor=1; ERROR 42000: Incorrect argument type to variable 'wsrep_sst_donor' SELECT @@global.wsrep_sst_donor; @@global.wsrep_sst_donor -NULL + +SET @@global.wsrep_sst_donor=NULL; +ERROR 42000: Variable 'wsrep_sst_donor' can't be set to the value of 'NULL' +SELECT @@global.wsrep_sst_donor; +@@global.wsrep_sst_donor + # restore the initial value SET @@global.wsrep_sst_donor = @wsrep_sst_donor_global_saved; diff --git a/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test b/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test index 7d3d6598557..c4b32bb8af6 100644 --- a/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test +++ b/mysql-test/suite/sys_vars/t/wsrep_sst_donor_basic.test @@ -27,7 +27,7 @@ SET @@global.wsrep_sst_donor='hyphenated-donor-name'; SELECT @@global.wsrep_sst_donor; SET @@global.wsrep_sst_donor=default; SELECT @@global.wsrep_sst_donor; -SET @@global.wsrep_sst_donor=NULL; +SET @@global.wsrep_sst_donor=''; SELECT @@global.wsrep_sst_donor; --echo @@ -35,6 +35,9 @@ SELECT @@global.wsrep_sst_donor; --error ER_WRONG_TYPE_FOR_VAR SET @@global.wsrep_sst_donor=1; SELECT @@global.wsrep_sst_donor; +--error ER_WRONG_VALUE_FOR_VAR +SET @@global.wsrep_sst_donor=NULL; +SELECT @@global.wsrep_sst_donor; --echo --echo # restore the initial value diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc index 1fb1d6890e2..a0540744c96 100644 --- a/sql/wsrep_sst.cc +++ b/sql/wsrep_sst.cc @@ -299,6 +299,15 @@ void wsrep_sst_auth_init () bool wsrep_sst_donor_check (sys_var *self, THD* thd, set_var* var) { + if ((! var->save_result.string_value.str) || + (var->save_result.string_value.length > (FN_REFLEN -1))) // safety + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, + var->save_result.string_value.str ? + var->save_result.string_value.str : "NULL"); + return 1; + } + return 0; } From 0474466bc2c3e05a160677f1dbabea374e942736 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 11 May 2023 23:34:41 -0700 Subject: [PATCH 20/80] MDEV-31240 Crash with condition pushable into derived and containing outer reference This bug could affect queries containing a subquery over splittable derived tables and having an outer references in its WHERE clause. If such subquery contained an equality condition whose left part was a reference to a column of the derived table and the right part referred only to outer columns then the server crashed in the function st_join_table::choose_best_splitting() The crashing code was added in the commit ce7ffe61d836fe9f0cfc1087f058bc40d66e5cfb that made the code of the function sensitive to presence of the flag OUTER_REF_TABLE_BIT in the KEYUSE_EXT::needed_in_prefix fields. The field needed_in_prefix of the KEYUSE_EXT structure should not contain table maps with OUTER_REF_TABLE_BIT or RAND_TABLE_BIT. Note that this fix is quite conservative: for affected queries it just returns the query plans that were used before the above mentioned commit. In fact the equalities causing crashes should be pushed into derived tables without any usage of split optimization. Approved by Sergei Petrunia --- mysql-test/main/derived_cond_pushdown.result | 94 ++++++++++++++++++++ mysql-test/main/derived_cond_pushdown.test | 41 +++++++++ sql/opt_split.cc | 3 +- 3 files changed, 137 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 4b202ea7a12..a4fc7a7447d 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -18358,4 +18358,98 @@ a deallocate prepare stmt; drop view v1; drop table t1; +# +# MDEV-31240: condition pushed into splittable derived has reference to +# outer column and does not refer to any column of embedding +# select +# +create table t1 (a int); +insert into t1 select seq from seq_1_to_1000; +create table t2 (a int, b int, key (a)); +insert into t2 select mod(seq,100), rand(13) * mod(seq,500) from seq_1_to_1000; +create table t3 (a int); +insert into t3 values (3), (1); +analyze table t1, t2, t3 persistent for all; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +test.t3 analyze status Engine-independent statistics collected +test.t3 analyze status OK +explain select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY ref key0 key0 5 test.t1.a 2 +3 LATERAL DERIVED t2 ref a a 5 test.t1.a 10 +select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +a ( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +1 1=804 +2 1=1056 +3 1=846 +4 1=947 +5 1=973 +truncate table t2; +insert into t2 select mod(seq,10), rand(15) * mod(seq,500) from seq_1_to_1000; +analyze table t2 persistent for all; +Table Op Msg_type Msg_text +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status Table is already up to date +explain select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY ref key0 key0 5 test.t1.a 100 +3 DERIVED t2 ALL a NULL NULL NULL 1000 Using temporary; Using filesort +select +a, +( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +from t1 limit 5; +a ( select concat(t3.a,'=',dt.s) +from +(select a, sum(b) as s from t2 group by a) as dt, +t3 +where dt.a=t1.a and t3.a < 3 +) +1 1=11858 +2 1=11380 +3 1=11588 +4 1=11373 +5 1=11612 +drop table t1,t2,t3; # End of 10.4 tests diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index b4e131dbe79..7a4d9b4ad7d 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3972,4 +3972,45 @@ deallocate prepare stmt; drop view v1; drop table t1; +--echo # +--echo # MDEV-31240: condition pushed into splittable derived has reference to +--echo # outer column and does not refer to any column of embedding +--echo # select +--echo # + +create table t1 (a int); +insert into t1 select seq from seq_1_to_1000; + +create table t2 (a int, b int, key (a)); +insert into t2 select mod(seq,100), rand(13) * mod(seq,500) from seq_1_to_1000; + +create table t3 (a int); +insert into t3 values (3), (1); + +analyze table t1, t2, t3 persistent for all; + +let $q= +select + a, + ( select concat(t3.a,'=',dt.s) + from + (select a, sum(b) as s from t2 group by a) as dt, + t3 + where dt.a=t1.a and t3.a < 3 + ) +from t1 limit 5; + +eval explain $q; +eval $q; + +truncate table t2; +insert into t2 select mod(seq,10), rand(15) * mod(seq,500) from seq_1_to_1000; + +analyze table t2 persistent for all; + +eval explain $q; +eval $q; + +drop table t1,t2,t3; + --echo # End of 10.4 tests diff --git a/sql/opt_split.cc b/sql/opt_split.cc index bb3aec9ee8d..6d816552baf 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -664,7 +664,8 @@ add_ext_keyuse_for_splitting(Dynamic_array *ext_keyuses, keyuse_ext.cond_guard= added_key_field->cond_guard; keyuse_ext.sj_pred_no= added_key_field->sj_pred_no; keyuse_ext.validity_ref= 0; - keyuse_ext.needed_in_prefix= added_key_field->val->used_tables(); + keyuse_ext.needed_in_prefix= added_key_field->val->used_tables() & + ~(OUTER_REF_TABLE_BIT | RAND_TABLE_BIT); keyuse_ext.validity_var= false; return ext_keyuses->push(keyuse_ext); } From b3cdb612491de6070c376bd98d30c5ec9aaffa87 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 12 May 2023 11:51:58 +0400 Subject: [PATCH 21/80] MDEV-31250 ROW variables do not get assigned from subselects ROW variables did not get assigned from subselects in these contexts: BEGIN DECLARE r ROW TYPE OF t1; SET r=(SELECT * FROM t1 WHERE a=1); END; BEGIN DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1 WHERE a=1); END; All fields of the ROW variable remained NULL. --- .../main/sp-anchor-row-type-table.result | 44 +++++++++++++++ mysql-test/main/sp-anchor-row-type-table.test | 55 +++++++++++++++++++ sql/field.cc | 3 + 3 files changed, 102 insertions(+) diff --git a/mysql-test/main/sp-anchor-row-type-table.result b/mysql-test/main/sp-anchor-row-type-table.result index c28d26304db..5e3b655a75b 100644 --- a/mysql-test/main/sp-anchor-row-type-table.result +++ b/mysql-test/main/sp-anchor-row-type-table.result @@ -814,3 +814,47 @@ t2 CREATE TABLE `t2` ( `text0` text DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci DROP TABLE t1; +# +# End of 10.3 tests +# +# +# Start of 10.4 tests +# +# +# MDEV-31250 ROW variables do not get assigned from subselects +# +CREATE TABLE t1 (a INT, b TEXT); +INSERT INTO t1 VALUES (1,'b1'); +BEGIN NOT ATOMIC +DECLARE r ROW TYPE OF t1; +SELECT * INTO r FROM t1 WHERE a=1; +SELECT r.a, r.b; +END; +$$ +r.a r.b +1 b1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b TEXT); +INSERT INTO t1 VALUES (1,'b1'); +BEGIN NOT ATOMIC +DECLARE r ROW TYPE OF t1; +SET r=(SELECT * FROM t1 WHERE a=1); +SELECT r.a, r.b; +END; +$$ +r.a r.b +1 b1 +DROP TABLE t1; +CREATE TABLE t1 (a INT, b TEXT); +INSERT INTO t1 VALUES (1,'b1'); +BEGIN NOT ATOMIC +DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1 WHERE a=1); +SELECT r.a, r.b; +END; +$$ +r.a r.b +1 b1 +DROP TABLE t1; +# +# End of 10.4 tests +# diff --git a/mysql-test/main/sp-anchor-row-type-table.test b/mysql-test/main/sp-anchor-row-type-table.test index 3f04dc68586..213460ed38f 100644 --- a/mysql-test/main/sp-anchor-row-type-table.test +++ b/mysql-test/main/sp-anchor-row-type-table.test @@ -881,3 +881,58 @@ END; $$ DELIMITER ;$$ DROP TABLE t1; + +--echo # +--echo # End of 10.3 tests +--echo # + + +--echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-31250 ROW variables do not get assigned from subselects +--echo # + +CREATE TABLE t1 (a INT, b TEXT); +INSERT INTO t1 VALUES (1,'b1'); +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE r ROW TYPE OF t1; + SELECT * INTO r FROM t1 WHERE a=1; + SELECT r.a, r.b; +END; +$$ +DELIMITER ;$$ +DROP TABLE t1; + + +CREATE TABLE t1 (a INT, b TEXT); +INSERT INTO t1 VALUES (1,'b1'); +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE r ROW TYPE OF t1; + SET r=(SELECT * FROM t1 WHERE a=1); + SELECT r.a, r.b; +END; +$$ +DELIMITER ;$$ +DROP TABLE t1; + + +CREATE TABLE t1 (a INT, b TEXT); +INSERT INTO t1 VALUES (1,'b1'); +DELIMITER $$; +BEGIN NOT ATOMIC + DECLARE r ROW TYPE OF t1 DEFAULT (SELECT * FROM t1 WHERE a=1); + SELECT r.a, r.b; +END; +$$ +DELIMITER ;$$ +DROP TABLE t1; + + +--echo # +--echo # End of 10.4 tests +--echo # diff --git a/sql/field.cc b/sql/field.cc index 14252033a01..ff45b6c5de9 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2543,6 +2543,8 @@ bool Field_row::sp_prepare_and_store_item(THD *thd, Item **value) fixed underlying Item_field pointing to Field_row. - In case if we're assigning from a ROW() value, src and value[0] will point to the same Item_row. + - In case if we're assigning from a subselect, src and value[0] also + point to the same Item_singlerow_subselect. */ Item *src; if (!(src= thd->sp_fix_func_item(value)) || @@ -2554,6 +2556,7 @@ bool Field_row::sp_prepare_and_store_item(THD *thd, Item **value) DBUG_RETURN(true); } + src->bring_value(); DBUG_RETURN(m_table->sp_set_all_fields_from_item(thd, src)); } From 2ff01e763e9113af75fe73826cac029e84521b6d Mon Sep 17 00:00:00 2001 From: Mikhail Chalov Date: Fri, 10 Mar 2023 14:41:11 -0800 Subject: [PATCH 22/80] Fix insecure use of strcpy, strcat and sprintf in Connect Old style C functions `strcpy()`, `strcat()` and `sprintf()` are vulnerable to security issues due to lacking memory boundary checks. Replace these in the Connect storage engine with safe new and/or custom functions such as `snprintf()` `safe_strcpy()` and `safe_strcat()`. With this change FlawFinder and other static security analyzers report 287 fewer findings. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- storage/connect/bson.cpp | 30 ++++++++--------- storage/connect/bsonudf.cpp | 50 ++++++++++++++-------------- storage/connect/cmgoconn.cpp | 14 ++++---- storage/connect/filamgz.cpp | 16 ++++----- storage/connect/filamtxt.cpp | 30 ++++++++--------- storage/connect/filamvct.cpp | 20 +++++------ storage/connect/filamzip.cpp | 30 ++++++++--------- storage/connect/filter.cpp | 12 +++---- storage/connect/fmdlex.c | 2 +- storage/connect/ha_connect.cc | 62 +++++++++++++++++------------------ storage/connect/javaconn.cpp | 24 +++++++------- storage/connect/jdbconn.cpp | 24 +++++++------- storage/connect/jmgoconn.cpp | 6 ++-- storage/connect/json.cpp | 27 ++++++++------- storage/connect/jsonudf.cpp | 44 ++++++++++++------------- storage/connect/macutil.cpp | 7 ++-- storage/connect/odbconn.cpp | 28 ++++++++-------- storage/connect/osutil.c | 13 ++++---- storage/connect/plgdbutl.cpp | 6 ++-- storage/connect/plugutil.cpp | 8 +++-- storage/connect/tabjmg.cpp | 14 ++++---- storage/connect/tabmysql.cpp | 54 +++++++++++++++--------------- storage/connect/tabpivot.cpp | 32 +++++++++--------- storage/connect/tabsys.cpp | 16 ++++----- storage/connect/tabwmi.cpp | 32 ++++++++++-------- storage/connect/tabxml.cpp | 42 ++++++++++++------------ storage/connect/value.cpp | 22 ++++++------- storage/connect/xindex.cpp | 13 +++++--- 28 files changed, 348 insertions(+), 330 deletions(-) diff --git a/storage/connect/bson.cpp b/storage/connect/bson.cpp index 880b4a1ce23..058cef9e62e 100644 --- a/storage/connect/bson.cpp +++ b/storage/connect/bson.cpp @@ -215,7 +215,7 @@ OFFSET BDOC::ParseArray(size_t& i) switch (s[i]) { case ',': if (level < 2) { - sprintf(G->Message, "Unexpected ',' near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected ',' near %.*s", (int) ARGS); throw 1; } else level = 1; @@ -223,7 +223,7 @@ OFFSET BDOC::ParseArray(size_t& i) break; case ']': if (level == 1) { - sprintf(G->Message, "Unexpected ',]' near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected ',]' near %.*s", (int) ARGS); throw 1; } // endif level @@ -237,7 +237,7 @@ OFFSET BDOC::ParseArray(size_t& i) break; default: if (level == 2) { - sprintf(G->Message, "Unexpected value near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected value near %.*s", (int) ARGS); throw 1; } else if (lastvlp) { vlp = ParseValue(i, NewVal()); @@ -284,7 +284,7 @@ OFFSET BDOC::ParseObject(size_t& i) level = 2; } else { - sprintf(G->Message, "misplaced string near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "misplaced string near %.*s", (int) ARGS); throw 2; } // endif level @@ -294,14 +294,14 @@ OFFSET BDOC::ParseObject(size_t& i) ParseValue(++i, GetVlp(lastbpp)); level = 3; } else { - sprintf(G->Message, "Unexpected ':' near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected ':' near %.*s", (int) ARGS); throw 2; } // endif level break; case ',': if (level < 3) { - sprintf(G->Message, "Unexpected ',' near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected ',' near %.*s", (int) ARGS); throw 2; } else level = 1; @@ -309,7 +309,7 @@ OFFSET BDOC::ParseObject(size_t& i) break; case '}': if (!(level == 0 || level == 3)) { - sprintf(G->Message, "Unexpected '}' near %.*s", (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected '}' near %.*s", (int) ARGS); throw 2; } // endif level @@ -321,7 +321,7 @@ OFFSET BDOC::ParseObject(size_t& i) case '\t': break; default: - sprintf(G->Message, "Unexpected character '%c' near %.*s", + snprintf(G->Message, sizeof(G->Message), "Unexpected character '%c' near %.*s", s[i], (int) ARGS); throw 2; }; // endswitch s[i] @@ -399,7 +399,7 @@ suite: return bvp; err: - sprintf(G->Message, "Unexpected character '%c' near %.*s", s[i], (int) ARGS); + snprintf(G->Message, sizeof(G->Message), "Unexpected character '%c' near %.*s", s[i], (int) ARGS); throw 3; } // end of ParseValue @@ -758,16 +758,16 @@ bool BDOC::SerializeValue(PBVAL jvp, bool b) return jp->Escape(MZP(jvp->To_Val)); case TYPE_INTG: - sprintf(buf, "%d", jvp->N); + snprintf(buf, sizeof(buf), "%d", jvp->N); return jp->WriteStr(buf); case TYPE_BINT: - sprintf(buf, "%lld", *(longlong*)MakePtr(Base, jvp->To_Val)); + snprintf(buf, sizeof(buf), "%lld", *(longlong*)MakePtr(Base, jvp->To_Val)); return jp->WriteStr(buf); case TYPE_FLOAT: - sprintf(buf, "%.*f", jvp->Nd, jvp->F); + snprintf(buf, sizeof(buf), "%.*f", jvp->Nd, jvp->F); return jp->WriteStr(buf); case TYPE_DBL: - sprintf(buf, "%.*lf", jvp->Nd, *(double*)MakePtr(Base, jvp->To_Val)); + snprintf(buf, sizeof(buf), "%.*lf", jvp->Nd, *(double*)MakePtr(Base, jvp->To_Val)); return jp->WriteStr(buf); case TYPE_NULL: return jp->WriteStr("null"); @@ -797,7 +797,7 @@ void* BJSON::BsonSubAlloc(size_t size) memp, size, pph->To_Free, pph->FreeBlk); if (size > pph->FreeBlk) { /* Not enough memory left in pool */ - sprintf(G->Message, + snprintf(G->Message, sizeof(G->Message), "Not enough memory for request of %zd (used=%zd free=%zd)", size, pph->To_Free, pph->FreeBlk); xtrc(1, "BsonSubAlloc: %s\n", G->Message); @@ -1679,7 +1679,7 @@ PBVAL BJSON::SetValue(PBVAL vlp, PVAL valp) break; default: - sprintf(G->Message, "Unsupported typ %d\n", valp->GetType()); + snprintf(G->Message, sizeof(G->Message), "Unsupported typ %d\n", valp->GetType()); throw(777); } // endswitch Type diff --git a/storage/connect/bsonudf.cpp b/storage/connect/bsonudf.cpp index 8df04232277..f0e9b52fd1a 100644 --- a/storage/connect/bsonudf.cpp +++ b/storage/connect/bsonudf.cpp @@ -68,7 +68,7 @@ static PBSON BbinAlloc(PGLOBAL g, ulong len, PBVAL jsp) PBSON bsp = (PBSON)PlgDBSubAlloc(g, NULL, sizeof(BSON)); if (bsp) { - strcpy(bsp->Msg, "Binary Json"); + snprintf(bsp->Msg, sizeof(bsp->Msg), "Binary Json"); bsp->Msg[BMX] = 0; bsp->Filename = NULL; bsp->G = g; @@ -270,7 +270,7 @@ my_bool BJNX::SetArrayOptions(PGLOBAL g, char* p, int i, PSZ nm) } // endif n } else { - strcpy(g->Message, "Wrong array specification"); + snprintf(g->Message, sizeof(g->Message), "Wrong array specification"); return true; } // endif's @@ -565,7 +565,7 @@ PBVAL BJNX::GetRowValue(PGLOBAL g, PBVAL row, int i) vlp = row; // DupVal(g, row) ??? } else { - strcpy(g->Message, "Unexpected object"); + snprintf(g->Message, sizeof(g->Message), "Unexpected object"); vlp = NULL; } //endif Op @@ -610,7 +610,7 @@ PBVAL BJNX::GetRowValue(PGLOBAL g, PBVAL row, int i) /*********************************************************************************/ PVAL BJNX::ExpandArray(PGLOBAL g, PBVAL arp, int n) { - strcpy(g->Message, "Expand cannot be done by this function"); + snprintf(g->Message, sizeof(g->Message), "Expand cannot be done by this function"); return NULL; } // end of ExpandArray @@ -791,7 +791,7 @@ PVAL BJNX::CalculateArray(PGLOBAL g, PBVAL bap, int n) xtrc(1, "Exception %d: %s\n", n, g->Message); PUSH_WARNING(g->Message); } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch return vp; @@ -860,7 +860,7 @@ PBVAL BJNX::GetRow(PGLOBAL g) } else if (row->Type == TYPE_JAR) { AddArrayValue(row, MOF(nwr)); } else { - strcpy(g->Message, "Wrong type when writing new row"); + snprintf(g->Message, sizeof(g->Message), "Wrong type when writing new row"); nwr = NULL; } // endif's @@ -893,7 +893,7 @@ my_bool BJNX::WriteValue(PGLOBAL g, PBVAL jvalp) case TYPE_JAR: arp = row; break; case TYPE_JVAL: jvp = MVP(row->To_Val); break; default: - strcpy(g->Message, "Invalid target type"); + snprintf(g->Message, sizeof(g->Message), "Invalid target type"); return true; } // endswitch Type @@ -1067,7 +1067,7 @@ my_bool BJNX::CheckPath(PGLOBAL g, UDF_ARGS *args, PBVAL jsp, PBVAL& jvp, int n) return false; } else { - strcpy(g->Message, "Path argument is null"); + snprintf(g->Message, sizeof(g->Message), "Path argument is null"); return true; } // endif path @@ -1088,7 +1088,7 @@ PSZ BJNX::Locate(PGLOBAL g, PBVAL jsp, PBVAL jvp, int k) g->Message[0] = 0; if (!jsp) { - strcpy(g->Message, "Null json tree"); + snprintf(g->Message, sizeof(g->Message), "Null json tree"); return NULL; } // endif jsp @@ -1115,7 +1115,7 @@ PSZ BJNX::Locate(PGLOBAL g, PBVAL jsp, PBVAL jvp, int k) if (err) { if (!g->Message[0]) - strcpy(g->Message, "Invalid json tree"); + snprintf(g->Message, sizeof(g->Message), "Invalid json tree"); } else if (Found) { Jp->WriteChr('\0'); @@ -1127,7 +1127,7 @@ PSZ BJNX::Locate(PGLOBAL g, PBVAL jsp, PBVAL jvp, int k) xtrc(1, "Exception %d: %s\n", n, g->Message); PUSH_WARNING(g->Message); } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch return str; @@ -1208,7 +1208,7 @@ PSZ BJNX::LocateAll(PGLOBAL g, PBVAL jsp, PBVAL bvp, int mx) PJPN jnp; if (!jsp) { - strcpy(g->Message, "Null json tree"); + snprintf(g->Message, sizeof(g->Message), "Null json tree"); return NULL; } // endif jsp @@ -1247,13 +1247,13 @@ PSZ BJNX::LocateAll(PGLOBAL g, PBVAL jsp, PBVAL bvp, int mx) PlugSubAlloc(g, NULL, Jp->N); str = Jp->Strp; } else if (!g->Message[0]) - strcpy(g->Message, "Invalid json tree"); + snprintf(g->Message, sizeof(g->Message), "Invalid json tree"); } catch (int n) { xtrc(1, "Exception %d: %s\n", n, g->Message); PUSH_WARNING(g->Message); } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch return str; @@ -1744,7 +1744,7 @@ PBSON BJNX::MakeBinResult(UDF_ARGS *args, PBVAL top, ulong len, int n) if ((bnp = BbinAlloc(G, len, top))) { bnp->Filename = filename; bnp->Pretty = pretty; - strcpy(bnp->Msg, "Json Binary item"); + snprintf(bnp->Msg, sizeof(bnp->Msg), "Json Binary item"); } //endif bnp return bnp; @@ -3100,7 +3100,7 @@ char* bson_test(UDF_INIT* initid, UDF_ARGS* args, char* result, *error = 1; str = NULL; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); *error = 1; str = NULL; @@ -3221,7 +3221,7 @@ char* bsonlocate(UDF_INIT* initid, UDF_ARGS* args, char* result, *error = 1; path = NULL; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); *error = 1; path = NULL; @@ -3339,7 +3339,7 @@ char* bson_locate_all(UDF_INIT* initid, UDF_ARGS* args, char* result, *error = 1; path = NULL; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); *error = 1; path = NULL; @@ -3706,7 +3706,7 @@ char *bson_get_item(UDF_INIT *initid, UDF_ARGS *args, char *result, jvp = bnx.GetRowValue(g, jvp, 0); if (!bnx.IsJson(jvp)) { - strcpy(g->Message, "Not a Json item"); + snprintf(g->Message, sizeof(g->Message), "Not a Json item"); } else str = bnx.Serialize(g, jvp, NULL, 0); @@ -3838,7 +3838,7 @@ char *bsonget_string(UDF_INIT *initid, UDF_ARGS *args, char *result, PUSH_WARNING(g->Message); str = NULL; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); str = NULL; } // end catch @@ -4297,7 +4297,7 @@ static char *bson_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, PUSH_WARNING(g->Message); str = NULL; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); str = NULL; } // end catch @@ -4739,8 +4739,8 @@ char *bfile_bjson(UDF_INIT *initid, UDF_ARGS *args, char *result, PGLOBAL g = (PGLOBAL)initid->ptr; BDOC doc(g); - strcpy(fn, MakePSZ(g, args, 0)); - strcpy(ofn, MakePSZ(g, args, 1)); + snprintf(fn, sizeof(fn), "%s", MakePSZ(g, args, 0)); + snprintf(ofn, sizeof(ofn), "%s", MakePSZ(g, args, 1)); if (args->arg_count == 3) lrecl = (size_t)*(longlong*)args->args[2]; @@ -5866,7 +5866,7 @@ static char *bbin_handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, PUSH_WARNING(g->Message); } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); } // end catch @@ -6198,7 +6198,7 @@ char* bbin_locate_all(UDF_INIT* initid, UDF_ARGS* args, char* result, *error = 1; path = NULL; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); *error = 1; path = NULL; diff --git a/storage/connect/cmgoconn.cpp b/storage/connect/cmgoconn.cpp index 3ecdb02a813..e61806d42eb 100644 --- a/storage/connect/cmgoconn.cpp +++ b/storage/connect/cmgoconn.cpp @@ -156,7 +156,7 @@ bool CMgoConn::Connect(PGLOBAL g) { if (!Pcg->Db_name || !Pcg->Coll_name) { // This would crash in mongoc_client_get_collection - strcpy(g->Message, "Missing DB or collection name"); + snprintf(g->Message, sizeof(g->Message), "Missing DB or collection name"); return true; } // endif name @@ -165,7 +165,7 @@ bool CMgoConn::Connect(PGLOBAL g) __try { mongo_init(true); } __except (EXCEPTION_EXECUTE_HANDLER) { - strcpy(g->Message, "Cannot load MongoDB C driver"); + snprintf(g->Message, sizeof(g->Message), "Cannot load MongoDB C driver"); return true; } // end try/except #else // !_WIN32 @@ -379,7 +379,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g) p = strrchr(options, ']'); if (!p) { - strcpy(g->Message, "Missing ] in pipeline"); + snprintf(g->Message, sizeof(g->Message), "Missing ] in pipeline"); return true; } else *(char*)p = 0; @@ -390,7 +390,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g) s->Append(",{\"$match\":"); if (MakeSelector(g, filp, s)) { - strcpy(g->Message, "Failed making selector"); + snprintf(g->Message, sizeof(g->Message), "Failed making selector"); return true; } else s->Append('}'); @@ -454,7 +454,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g) s->Append(','); if (MakeSelector(g, filp, s)) { - strcpy(g->Message, "Failed making selector"); + snprintf(g->Message, sizeof(g->Message), "Failed making selector"); return true; } // endif Selector @@ -771,7 +771,7 @@ int CMgoConn::Write(PGLOBAL g) } // endif remove } else { - strcpy(g->Message, "Mongo update: cannot find _id"); + snprintf(g->Message, sizeof(g->Message), "Mongo update: cannot find _id"); rc = RC_FX; } // endif b @@ -1066,7 +1066,7 @@ bool CMgoConn::AddValue(PGLOBAL g, PCOL colp, bson_t *doc, char *key, bool upd) } // endswitch Buf_Type if (!rc) { - strcpy(g->Message, "Adding value failed"); + snprintf(g->Message, sizeof(g->Message), "Adding value failed"); return true; } else return false; diff --git a/storage/connect/filamgz.cpp b/storage/connect/filamgz.cpp index 3e5741d378c..c13e1b2ea38 100644 --- a/storage/connect/filamgz.cpp +++ b/storage/connect/filamgz.cpp @@ -88,7 +88,7 @@ int GZFAM::Zerror(PGLOBAL g) { int errnum; - strcpy(g->Message, gzerror(Zfile, &errnum)); + snprintf(g->Message, sizeof(g->Message), "%s", gzerror(Zfile, &errnum)); if (errnum == Z_ERRNO) #if defined(_WIN32) @@ -142,7 +142,7 @@ bool GZFAM::OpenTableFile(PGLOBAL g) /*****************************************************************/ /* Updating GZ files not implemented yet. */ /*****************************************************************/ - strcpy(g->Message, MSG(UPD_ZIP_NOT_IMP)); + snprintf(g->Message, sizeof(g->Message), MSG(UPD_ZIP_NOT_IMP)); return true; case MODE_DELETE: if (!Tdbp->GetNext()) { @@ -379,7 +379,7 @@ int GZFAM::WriteBuffer(PGLOBAL g) /***********************************************************************/ int GZFAM::DeleteRecords(PGLOBAL g, int) { - strcpy(g->Message, MSG(NO_ZIP_DELETE)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_ZIP_DELETE)); return RC_FX; } // end of DeleteRecords @@ -926,7 +926,7 @@ bool ZLBFAM::AllocateBuffer(PGLOBAL g) #if 0 if (!Optimized && Tdbp->NeedIndexing(g)) { - strcpy(g->Message, MSG(NOP_ZLIB_INDEX)); + snprintf(g->Message, sizeof(g->Message), MSG(NOP_ZLIB_INDEX)); return TRUE; } // endif indexing #endif // 0 @@ -993,7 +993,7 @@ bool ZLBFAM::AllocateBuffer(PGLOBAL g) CurBlk = Block - 1; CurNum = Last; - strcpy(g->Message, MSG(NO_PAR_BLK_INS)); + snprintf(g->Message, sizeof(g->Message), "%s",MSG(NO_PAR_BLK_INS)); return TRUE; } // endif Last @@ -1068,7 +1068,7 @@ bool ZLBFAM::SetPos(PGLOBAL g, int pos __attribute__((unused))) return true; #if 0 // All this must be checked if (pos < 0) { - strcpy(g->Message, MSG(INV_REC_POS)); + snprintf(g->Message, sizeof(g->Message), MSG(INV_REC_POS)); return true; } // endif recpos @@ -1156,7 +1156,7 @@ int ZLBFAM::ReadBuffer(PGLOBAL g) rdbuf = Zlenp; } else { // !Optimized if (CurBlk != OldBlk + 1) { - strcpy(g->Message, MSG(INV_RAND_ACC)); + snprintf(g->Message, sizeof(g->Message), MSG(INV_RAND_ACC)); return RC_FX; } else Fpos = ftell(Stream); // Used when optimizing @@ -1276,7 +1276,7 @@ int ZLBFAM::WriteBuffer(PGLOBAL g) #if defined(_DEBUG) if (Tdbp->GetFtype() == RECFM_FIX && (signed)strlen(CurLine) != Lrecl + (signed)strlen(CrLf)) { - strcpy(g->Message, MSG(BAD_LINE_LEN)); + snprintf(g->Message, sizeof(g->Message), MSG(BAD_LINE_LEN)); Closing = TRUE; return RC_FX; } // endif Lrecl diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp index f8168887e89..d449fc1d1c5 100644 --- a/storage/connect/filamtxt.cpp +++ b/storage/connect/filamtxt.cpp @@ -367,13 +367,13 @@ int TXTFAM::UpdateSortedRows(PGLOBAL g) // return RC_INFO; return RC_OK; // Nothing to do } else if (!(Sosar = MakeValueArray(g, To_Sos))) { - strcpy(g->Message, "Start position array is null"); + snprintf(g->Message, sizeof(g->Message), "Start position array is null"); goto err; } else if (!(Updar = MakeValueArray(g, To_Upd))) { - strcpy(g->Message, "Updated line array is null"); + snprintf(g->Message, sizeof(g->Message), "Updated line array is null"); goto err; } else if (!(ix = (int*)Posar->GetSortIndex(g))) { - strcpy(g->Message, "Error getting array sort index"); + snprintf(g->Message, sizeof(g->Message), "Error getting array sort index"); goto err; } // endif's @@ -419,10 +419,10 @@ int TXTFAM::DeleteSortedRows(PGLOBAL g) // return RC_INFO; return RC_OK; // Nothing to do } else if (!(Sosar = MakeValueArray(g, To_Sos))) { - strcpy(g->Message, "Start position array is null"); + snprintf(g->Message, sizeof(g->Message), "Start position array is null"); goto err; } else if (!(ix = (int*)Posar->GetSortIndex(g))) { - strcpy(g->Message, "Error getting array sort index"); + snprintf(g->Message, sizeof(g->Message), "Error getting array sort index"); goto err; } // endif's @@ -454,7 +454,7 @@ err: /***********************************************************************/ int TXTFAM::InitDelete(PGLOBAL g, int, int) { - strcpy(g->Message, "InitDelete should not be used by this table type"); + snprintf(g->Message, sizeof(g->Message), "InitDelete should not be used by this table type"); return RC_FX; } // end of InitDelete @@ -556,7 +556,7 @@ bool DOSFAM::OpenTableFile(PGLOBAL g) switch (mode) { case MODE_READ: - strcpy(opmode, "r"); + snprintf(opmode, sizeof(opmode), "r"); break; case MODE_DELETE: if (!Tdbp->Next) { @@ -570,7 +570,7 @@ bool DOSFAM::OpenTableFile(PGLOBAL g) } // endif blocked // This will erase the entire file - strcpy(opmode, "w"); + snprintf(opmode, sizeof(opmode), "w"); Tdbp->ResetSize(); break; } // endif @@ -580,14 +580,14 @@ bool DOSFAM::OpenTableFile(PGLOBAL g) /* fall through */ case MODE_UPDATE: if ((UseTemp = Tdbp->IsUsingTemp(g))) { - strcpy(opmode, "r"); + snprintf(opmode, sizeof(opmode), "r"); Bin = true; } else - strcpy(opmode, "r+"); + snprintf(opmode, sizeof(opmode), "r+"); break; case MODE_INSERT: - strcpy(opmode, "a+"); + snprintf(opmode, sizeof(opmode), "a+"); break; default: snprintf(g->Message, sizeof(g->Message), MSG(BAD_OPEN_MODE), mode); @@ -1364,7 +1364,7 @@ int BLKFAM::GetNextPos(void) /***********************************************************************/ bool BLKFAM::SetPos(PGLOBAL g, int) { - strcpy(g->Message, "Blocked variable tables cannot be used indexed"); + snprintf(g->Message, sizeof(g->Message), "Blocked variable tables cannot be used indexed"); return true; } // end of SetPos @@ -1708,10 +1708,10 @@ bool BINFAM::OpenTableFile(PGLOBAL g) { switch (mode) { case MODE_READ: - strcpy(opmode, "rb"); + snprintf(opmode, sizeof(opmode), "rb"); break; case MODE_WRITE: - strcpy(opmode, "wb"); + snprintf(opmode, sizeof(opmode), "wb"); break; default: snprintf(g->Message, sizeof(g->Message), MSG(BAD_OPEN_MODE), mode); @@ -1859,7 +1859,7 @@ int BINFAM::ReadBuffer(PGLOBAL g) // Read the prefix giving the row length if (!fread(&Recsize, sizeof(size_t), 1, Stream)) { if (!feof(Stream)) { - strcpy(g->Message, "Error reading line prefix\n"); + snprintf(g->Message, sizeof(g->Message), "Error reading line prefix\n"); return RC_FX; } else return RC_EF; diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 46dd7eba5ff..618e857f248 100644 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -429,7 +429,7 @@ bool VCTFAM::OpenTableFile(PGLOBAL g) /*********************************************************************/ switch (mode) { case MODE_READ: - strcpy(opmode, "rb"); + snprintf(opmode, sizeof(opmode), "rb"); break; case MODE_DELETE: if (!Tdbp->GetNext()) { @@ -437,7 +437,7 @@ bool VCTFAM::OpenTableFile(PGLOBAL g) DelRows = Cardinality(g); // This will delete the whole file - strcpy(opmode, "wb"); + snprintf(opmode, sizeof(opmode), "wb"); break; } // endif @@ -445,7 +445,7 @@ bool VCTFAM::OpenTableFile(PGLOBAL g) /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); - strcpy(opmode, (UseTemp) ? "rb" : "r+b"); + snprintf(opmode, sizeof(opmode), (UseTemp) ? "rb" : "r+b"); break; case MODE_INSERT: if (MaxBlk) { @@ -453,11 +453,11 @@ bool VCTFAM::OpenTableFile(PGLOBAL g) if (MakeEmptyFile(g, To_File)) return true; - strcpy(opmode, "r+b"); // Required to update empty blocks + snprintf(opmode, sizeof(opmode), "r+b"); // Required to update empty blocks } else if (!Block || Last == Nrec) - strcpy(opmode, "ab"); + snprintf(opmode, sizeof(opmode), "ab"); else - strcpy(opmode, "r+b"); // Required to update the last block + snprintf(opmode, sizeof(opmode), "r+b"); // Required to update the last block break; default: @@ -1912,7 +1912,7 @@ bool VECFAM::OpenTableFile(PGLOBAL g) /*********************************************************************/ switch (mode) { case MODE_READ: - strcpy(opmode, "rb"); + snprintf(opmode, sizeof(opmode), "rb"); break; case MODE_DELETE: if (!Tdbp->GetNext()) { @@ -1920,7 +1920,7 @@ bool VECFAM::OpenTableFile(PGLOBAL g) DelRows = Cardinality(g); // This will delete the whole file - strcpy(opmode, "wb"); + snprintf(opmode, sizeof(opmode), "wb"); // This will stop the process by causing GetProgMax to return 0. ResetTableSize(g, 0, Nrec); @@ -1931,10 +1931,10 @@ bool VECFAM::OpenTableFile(PGLOBAL g) /* fall through */ case MODE_UPDATE: UseTemp = Tdbp->IsUsingTemp(g); - strcpy(opmode, (UseTemp) ? "rb": "r+b"); + snprintf(opmode, sizeof(opmode), (UseTemp) ? "rb": "r+b"); break; case MODE_INSERT: - strcpy(opmode, "ab"); + snprintf(opmode, sizeof(opmode), "ab"); break; default: snprintf(g->Message, sizeof(g->Message), MSG(BAD_OPEN_MODE), mode); diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index 40926cd2ae7..7859e974294 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -152,7 +152,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) /*********************************************************************/ /* pat is a multiple file name with wildcard characters */ /*********************************************************************/ - strcpy(filename, pat); + snprintf(filename, sizeof(filename), "%s", pat); #if defined(_WIN32) int rc; @@ -174,7 +174,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) snprintf(g->Message, sizeof(g->Message), MSG(BAD_FILE_HANDLE), filename); return true; } else { - strcpy(g->Message, "Cannot find any file to load"); + snprintf(g->Message, sizeof(g->Message), "Cannot find any file to load"); return true; } // endif rc @@ -208,7 +208,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) // Close the search handle. if (!FindClose(hSearch)) { - strcpy(g->Message, MSG(SRCH_CLOSE_ERR)); + snprintf(g->Message, sizeof(g->Message), MSG(SRCH_CLOSE_ERR)); return true; } // endif FindClose @@ -402,7 +402,7 @@ bool ZIPUTIL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn, bool append) return true; } else { - strcpy(g->Message, "Only INSERT mode supported for ZIPPING files"); + snprintf(g->Message, sizeof(g->Message), "Only INSERT mode supported for ZIPPING files"); return true; } // endif mode @@ -610,7 +610,7 @@ int UNZIPUTL::findEntry(PGLOBAL g, bool next) next = true; } while (true); - strcpy(g->Message, "FindNext logical error"); + snprintf(g->Message, sizeof(g->Message), "FindNext logical error"); return RC_FX; } // end of FindEntry @@ -703,7 +703,7 @@ bool UNZIPUTL::OpenTable(PGLOBAL g, MODE mode, PCSZ fn) return true; } else { - strcpy(g->Message, "Only READ mode supported for ZIPPED tables"); + snprintf(g->Message, sizeof(g->Message), "Only READ mode supported for ZIPPED tables"); return true; } // endif mode @@ -755,7 +755,7 @@ bool UNZIPUTL::openEntry(PGLOBAL g) try { memory = new char[size + 1]; } catch (...) { - strcpy(g->Message, "Out of memory"); + snprintf(g->Message, sizeof(g->Message), "Out of memory"); return true; } // end try/catch @@ -1130,16 +1130,16 @@ int UZDFAM::dbfhead(PGLOBAL g, void* buf) // Check first byte to be sure of .dbf type if ((hdrp->Version & 0x03) != DBFTYPE) { - strcpy(g->Message, MSG(NOT_A_DBF_FILE)); + snprintf(g->Message, sizeof(g->Message), MSG(NOT_A_DBF_FILE)); rc = RC_INFO; if ((hdrp->Version & 0x30) == 0x30) { - strcpy(g->Message, MSG(FOXPRO_FILE)); + snprintf(g->Message, sizeof(g->Message), MSG(FOXPRO_FILE)); dbc = 264; // FoxPro database container } // endif Version } else - strcpy(g->Message, MSG(DBASE_FILE)); + snprintf(g->Message, sizeof(g->Message), MSG(DBASE_FILE)); // Check last byte(s) of header endmark = (char*)hdrp + hdrp->Headlen() - dbc; @@ -1304,13 +1304,13 @@ bool ZIPFAM::OpenTableFile(PGLOBAL g) if (len < 0) return true; else if (!append && len > 0) { - strcpy(g->Message, "No insert into existing zip file"); + snprintf(g->Message, sizeof(g->Message), "No insert into existing zip file"); return true; } else if (append && len > 0) { UNZIPUTL *zutp = new(g) UNZIPUTL(target, NULL, false); if (!zutp->IsInsertOk(g, filename)) { - strcpy(g->Message, "No insert into existing entry"); + snprintf(g->Message, sizeof(g->Message), "No insert into existing entry"); return true; } // endif Ok @@ -1337,7 +1337,7 @@ bool ZIPFAM::OpenTableFile(PGLOBAL g) /***********************************************************************/ int ZIPFAM::ReadBuffer(PGLOBAL g) { - strcpy(g->Message, "ReadBuffer should not been called when zipping"); + snprintf(g->Message, sizeof(g->Message), "ReadBuffer should not been called when zipping"); return RC_FX; } // end of ReadBuffer @@ -1388,13 +1388,13 @@ bool ZPXFAM::OpenTableFile(PGLOBAL g) if (len < 0) return true; else if (!append && len > 0) { - strcpy(g->Message, "No insert into existing zip file"); + snprintf(g->Message, sizeof(g->Message), "No insert into existing zip file"); return true; } else if (append && len > 0) { UNZIPUTL *zutp = new(g) UNZIPUTL(target, NULL, false); if (!zutp->IsInsertOk(g, filename)) { - strcpy(g->Message, "No insert into existing entry"); + snprintf(g->Message, sizeof(g->Message), "No insert into existing entry"); return true; } // endif Ok diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp index a3f75304a47..82d879ab082 100644 --- a/storage/connect/filter.cpp +++ b/storage/connect/filter.cpp @@ -386,7 +386,7 @@ int FILTER::CheckColumn(PGLOBAL g, PSQL sqlp, PXOB &p, int &ag) } // endfor i if (*errmsg) { - strcpy(g->Message, errmsg); + snprintf(g->Message, sizeof(g->Message), errmsg); return -1; } else return n; @@ -993,7 +993,7 @@ bool FILTER::Convert(PGLOBAL g, bool having) break; case TYPE_ARRAY: if ((Opc != OP_IN && !Opm) || i == 0) { - strcpy(g->Message, MSG(BAD_ARRAY_OPER)); + snprintf(g->Message, sizeof(g->Message), MSG(BAD_ARRAY_OPER)); return TRUE; } // endif @@ -1007,7 +1007,7 @@ bool FILTER::Convert(PGLOBAL g, bool having) goto TEST; // Filter has only one argument } // endif i - strcpy(g->Message, MSG(VOID_FIRST_ARG)); + snprintf(g->Message, sizeof(g->Message), MSG(VOID_FIRST_ARG)); return TRUE; } // endswitch @@ -1052,7 +1052,7 @@ bool FILTER::Convert(PGLOBAL g, bool having) } // endif Opc if (comtype == TYPE_ERROR) { - strcpy(g->Message, MSG(ILL_FILTER_CONV)); + snprintf(g->Message, sizeof(g->Message), MSG(ILL_FILTER_CONV)); return TRUE; } // endif @@ -1101,7 +1101,7 @@ bool FILTER::Convert(PGLOBAL g, bool having) break; case TYPE_FILTER: - strcpy(g->Message, MSG(UNMATCH_FIL_ARG)); + snprintf(g->Message, sizeof(g->Message), MSG(UNMATCH_FIL_ARG)); return TRUE; default: // Conversion from Column, Select/Func, Expr, Scalfnc... @@ -1270,7 +1270,7 @@ bool FILTER::Eval(PGLOBAL g) ap = (PARRAY)Arg(1); break; default: - strcpy(g->Message, MSG(IN_WITHOUT_SUB)); + snprintf(g->Message, sizeof(g->Message), MSG(IN_WITHOUT_SUB)); goto FilterError; } // endswitch Type diff --git a/storage/connect/fmdlex.c b/storage/connect/fmdlex.c index 1bca2d4ec18..165913a9698 100644 --- a/storage/connect/fmdlex.c +++ b/storage/connect/fmdlex.c @@ -1480,7 +1480,7 @@ void MakeAMPM(int n) n, pp->Num, pp->InFmt, pp->OutFmt); #endif pp->Index[pp->Num++] = -n; - sprintf(buf, "%%%ds", m); + snprintf(buf, sizeof(buf), "%%%ds", m); MakeIn(buf); if (pp->OutFmt) { diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 0a0a206c9c8..0e91742b1fa 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1868,7 +1868,7 @@ bool ha_connect::CheckVirtualIndex(TABLE_SHARE *s) rid= (fp->option_struct) ? fp->option_struct->special : NULL; if (!rid || (stricmp(rid, "ROWID") && stricmp(rid, "ROWNUM"))) { - strcpy(g->Message, "Invalid virtual index"); + snprintf(g->Message, sizeof(g->Message), "Invalid virtual index"); return true; } // endif rowid @@ -2014,7 +2014,7 @@ int ha_connect::OpenTable(PGLOBAL g, bool del) case MODE_INSERT: case MODE_UPDATE: case MODE_DELETE: - strcpy(g->Message, MSG(READ_ONLY)); + snprintf(g->Message, sizeof(g->Message), MSG(READ_ONLY)); return HA_ERR_TABLE_READONLY; default: break; @@ -2143,7 +2143,7 @@ bool ha_connect::CheckColumnList(PGLOBAL g) htrc("Exception %d: %s\n", n, g->Message); brc= true; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); brc= true; } // end catch @@ -2512,7 +2512,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q, ranges[1]= (end_range && !eq_range) ? &save_end_range : NULL; if (!ranges[0] && !ranges[1]) { - strcpy(g->Message, "MakeKeyWhere: No key"); + snprintf(g->Message, sizeof(g->Message), "MakeKeyWhere: No key"); return true; } else both= ranges[0] && ranges[1]; @@ -2611,7 +2611,7 @@ bool ha_connect::MakeKeyWhere(PGLOBAL g, PSTRG qry, OPVAL vop, char q, qry->Append(')'); if ((oom= qry->IsTruncated())) - strcpy(g->Message, "Out of memory"); + snprintf(g->Message, sizeof(g->Message), "Out of memory"); dbug_tmp_restore_column_map(&table->write_set, old_map); return oom; @@ -3385,7 +3385,7 @@ const COND *ha_connect::cond_push(const COND *cond) if (trace(1)) htrc("Exception %d: %s\n", n, g->Message); } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch fin:; @@ -3611,7 +3611,7 @@ int ha_connect::optimize(THD* thd, HA_CHECK_OPT*) htrc("Exception %d: %s\n", n, g->Message); rc= HA_ERR_INTERNAL_ERROR; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); rc= HA_ERR_INTERNAL_ERROR; } // end catch @@ -4711,7 +4711,7 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, break; default: htrc("Unsupported sql_command=%d\n", thd_sql_command(thd)); - strcpy(g->Message, "CONNECT Unsupported command"); + snprintf(g->Message, sizeof(g->Message), "CONNECT Unsupported command"); my_message(ER_NOT_ALLOWED_COMMAND, g->Message, MYF(0)); newmode= MODE_ERROR; break; @@ -4769,7 +4769,7 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd, break; default: htrc("Unsupported sql_command=%d\n", thd_sql_command(thd)); - strcpy(g->Message, "CONNECT Unsupported command"); + snprintf(g->Message, sizeof(g->Message), "CONNECT Unsupported command"); my_message(ER_NOT_ALLOWED_COMMAND, g->Message, MYF(0)); newmode= MODE_ERROR; break; @@ -5024,7 +5024,7 @@ int ha_connect::external_lock(THD *thd, int lock_type) xmod= MODE_ANY; // For info commands DBUG_RETURN(rc); } else if (check_privileges(thd, options, table->s->db.str)) { - strcpy(g->Message, "This operation requires the FILE privilege"); + snprintf(g->Message, sizeof(g->Message), "This operation requires the FILE privilege"); htrc("%s\n", g->Message); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } // endif check_privileges @@ -5378,7 +5378,7 @@ bool CheckSelf(PGLOBAL g, TABLE_SHARE *s, PCSZ host, else if (port && port != (signed)GetDefaultPort()) return false; - strcpy(g->Message, "This MySQL table is defined on itself"); + snprintf(g->Message, sizeof(g->Message), "This MySQL table is defined on itself"); return true; } // end of CheckSelf @@ -5721,7 +5721,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } else if (topt->http) { if (ttp == TAB_UNDEF) { ttr= TAB_JSON; - strcpy(g->Message, "No table_type. Was set to JSON"); + snprintf(g->Message, sizeof(g->Message), "No table_type. Was set to JSON"); push_warning(thd, Sql_condition::WARN_LEVEL_NOTE, 0, g->Message); } else ttr= ttp; @@ -5754,7 +5754,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_BSON: #endif // BSON_SUPPORT if (checkPrivileges(thd, ttp, topt, db)) { - strcpy(g->Message, "This operation requires the FILE privilege"); + snprintf(g->Message, sizeof(g->Message), "This operation requires the FILE privilege"); rc= HA_ERR_INTERNAL_ERROR; goto err; } // endif check_privileges @@ -5770,7 +5770,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, char *p; if (!tbl) { - strcpy(g->Message, "Missing table list"); + snprintf(g->Message, sizeof(g->Message), "Missing table list"); rc= HA_ERR_INTERNAL_ERROR; goto err; } // endif tbl @@ -5828,7 +5828,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, if (fnc & FNC_DRIVER) { ok= true; } else if (!(url= strz(g, create_info->connect_string))) { - strcpy(g->Message, "Missing URL"); + snprintf(g->Message, sizeof(g->Message), "Missing URL"); } else { // Store JDBC additional parameters int rc; @@ -5932,7 +5932,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, if (topt->module && topt->subtype) ok= true; else - strcpy(g->Message, "Missing OEM module or subtype"); + snprintf(g->Message, sizeof(g->Message), "Missing OEM module or subtype"); break; #if defined(LIBXML2_SUPPORT) || defined(DOMDOC_SUPPORT) @@ -5984,7 +5984,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } // endif supfnc if (src && fnc != FNC_NO) { - strcpy(g->Message, "Cannot make catalog table from srcdef"); + snprintf(g->Message, sizeof(g->Message), "Cannot make catalog table from srcdef"); ok= false; } // endif src @@ -6136,7 +6136,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, qrp= OEMColumns(g, topt, tab, (char*)db, fnc == FNC_COL); break; default: - strcpy(g->Message, "System error during assisted discovery"); + snprintf(g->Message, sizeof(g->Message), "System error during assisted discovery"); break; } // endswitch ttp @@ -6380,7 +6380,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, htrc("Exception %d: %s\n", n, g->Message); rc= HA_ERR_INTERNAL_ERROR; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); rc= HA_ERR_INTERNAL_ERROR; } // end catch @@ -6538,7 +6538,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, case TAB_PIVOT: case TAB_OCCUR: if (options->srcdef) { - strcpy(g->Message, "Cannot check looping reference"); + snprintf(g->Message, sizeof(g->Message), "Cannot check looping reference"); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message); } else if (options->tabname) { if (!stricmp(options->tabname, create_info->alias.str) && @@ -6551,7 +6551,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, } // endif tab } else { - strcpy(g->Message, "Missing object table name or definition"); + snprintf(g->Message, sizeof(g->Message), "Missing object table name or definition"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } // endif tabname @@ -6629,14 +6629,14 @@ int ha_connect::create(const char *name, TABLE *table_arg, #if !defined(DOMDOC_SUPPORT) if (dom) { - strcpy(g->Message, "MS-DOM not supported by this version"); + snprintf(g->Message, sizeof(g->Message), "MS-DOM not supported by this version"); xsup= NULL; } // endif DomDoc #endif // !DOMDOC_SUPPORT #if !defined(LIBXML2_SUPPORT) if (!dom) { - strcpy(g->Message, "libxml2 not supported by this version"); + snprintf(g->Message, sizeof(g->Message), "libxml2 not supported by this version"); xsup= NULL; } // endif Libxml2 #endif // !LIBXML2_SUPPORT @@ -6681,7 +6681,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, continue; // This is a virtual column if (fp->flags & AUTO_INCREMENT_FLAG) { - strcpy(g->Message, "Auto_increment is not supported yet"); + snprintf(g->Message, sizeof(g->Message), "Auto_increment is not supported yet"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); rc= HA_ERR_INTERNAL_ERROR; DBUG_RETURN(rc); @@ -6697,7 +6697,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, if (type == TAB_VIR) if (!fp->option_struct || !fp->option_struct->special) { - strcpy(g->Message, "Virtual tables accept only special or virtual columns"); + snprintf(g->Message, sizeof(g->Message), "Virtual tables accept only special or virtual columns"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); rc= HA_ERR_INTERNAL_ERROR; DBUG_RETURN(rc); @@ -6915,7 +6915,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, // This is an ALTER to CONNECT from another engine. // It cannot be accepted because the table data would be modified // except when the target file does not exist. - strcpy(g->Message, "Operation denied. Table data would be modified."); + snprintf(g->Message, sizeof(g->Message), "Operation denied. Table data would be modified."); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); DBUG_RETURN(HA_ERR_INTERNAL_ERROR); } // endif part_info @@ -6925,11 +6925,11 @@ int ha_connect::create(const char *name, TABLE *table_arg, // Get the index definitions if ((xdp= GetIndexInfo()) || sqlcom == SQLCOM_DROP_INDEX) { if (options->multiple) { - strcpy(g->Message, "Multiple tables are not indexable"); + snprintf(g->Message, sizeof(g->Message), "Multiple tables are not indexable"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); rc= HA_ERR_UNSUPPORTED; } else if (options->compressed) { - strcpy(g->Message, "Compressed tables are not indexable"); + snprintf(g->Message, sizeof(g->Message), "Compressed tables are not indexable"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); rc= HA_ERR_UNSUPPORTED; } else if (GetIndexType(type) == 1) { @@ -7210,11 +7210,11 @@ ha_connect::check_if_supported_inplace_alter(TABLE *altered_table, !SameString(altered_table, "optname") || !SameBool(altered_table, "sepindex")) { if (newopt->multiple) { - strcpy(g->Message, "Multiple tables are not indexable"); + snprintf(g->Message, sizeof(g->Message), "Multiple tables are not indexable"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); DBUG_RETURN(HA_ALTER_ERROR); } else if (newopt->compressed) { - strcpy(g->Message, "Compressed tables are not indexable"); + snprintf(g->Message, sizeof(g->Message), "Compressed tables are not indexable"); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); DBUG_RETURN(HA_ALTER_ERROR); } else if (GetIndexType(type) == 1) { @@ -7265,7 +7265,7 @@ ha_connect::check_if_supported_inplace_alter(TABLE *altered_table, tshp= NULL; if (FileExists(fn, false)) { - strcpy(g->Message, "Operation denied. Table data would be lost."); + snprintf(g->Message, sizeof(g->Message), "Operation denied. Table data would be lost."); my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); DBUG_RETURN(HA_ALTER_ERROR); } else diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp index 3d1dfbc3f26..6078d51517f 100644 --- a/storage/connect/javaconn.cpp +++ b/storage/connect/javaconn.cpp @@ -167,7 +167,7 @@ bool JAVAConn::gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig mid = env->GetMethodID(jdi, name, sig); if (Check()) { - strcpy(g->Message, Msg); + snprintf(g->Message, sizeof(g->Message), Msg); return true; } else return false; @@ -372,7 +372,7 @@ bool JAVAConn::Open(PGLOBAL g) rc = jvm->AttachCurrentThread((void**)&env, nullptr); if (rc != JNI_OK) { - strcpy(g->Message, "Cannot attach jvm to the current thread"); + snprintf(g->Message, sizeof(g->Message), "Cannot attach jvm to the current thread"); return true; } // endif rc @@ -456,26 +456,26 @@ bool JAVAConn::Open(PGLOBAL g) switch (rc) { case JNI_OK: - strcpy(g->Message, "VM successfully created"); + snprintf(g->Message, sizeof(g->Message), "VM successfully created"); brc = false; break; case JNI_ERR: - strcpy(g->Message, "Initialising JVM failed: unknown error"); + snprintf(g->Message, sizeof(g->Message), "Initialising JVM failed: unknown error"); break; case JNI_EDETACHED: - strcpy(g->Message, "Thread detached from the VM"); + snprintf(g->Message, sizeof(g->Message), "Thread detached from the VM"); break; case JNI_EVERSION: - strcpy(g->Message, "JNI version error"); + snprintf(g->Message, sizeof(g->Message), "JNI version error"); break; case JNI_ENOMEM: - strcpy(g->Message, "Not enough memory"); + snprintf(g->Message, sizeof(g->Message), "Not enough memory"); break; case JNI_EEXIST: - strcpy(g->Message, "VM already created"); + snprintf(g->Message, sizeof(g->Message), "VM already created"); break; case JNI_EINVAL: - strcpy(g->Message, "Invalid arguments"); + snprintf(g->Message, sizeof(g->Message), "Invalid arguments"); break; default: snprintf(g->Message, sizeof(g->Message), "Unknown return code %d", (int)rc); @@ -516,7 +516,7 @@ bool JAVAConn::Open(PGLOBAL g) rc = env->CallStaticIntMethod(jdi, alp, path); if ((msg = Check(rc))) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), msg); env->DeleteLocalRef(path); return RC_FX; } else switch (rc) { @@ -528,7 +528,7 @@ bool JAVAConn::Open(PGLOBAL g) break; case JNI_ERR: default: - strcpy(g->Message, "Error adding jpath"); + snprintf(g->Message, sizeof(g->Message), "Error adding jpath"); env->DeleteLocalRef(path); return RC_FX; } // endswitch rc @@ -559,7 +559,7 @@ bool JAVAConn::Open(PGLOBAL g) errid = env->GetMethodID(jdi, "GetErrmsg", "()Ljava/lang/String;"); if (env->ExceptionCheck()) { - strcpy(g->Message, "ERROR: method GetErrmsg() not found!"); + snprintf(g->Message, sizeof(g->Message), "ERROR: method GetErrmsg() not found!"); env->ExceptionDescribe(); env->ExceptionClear(); return true; diff --git a/storage/connect/jdbconn.cpp b/storage/connect/jdbconn.cpp index 09786f28beb..b1cffa0a77e 100644 --- a/storage/connect/jdbconn.cpp +++ b/storage/connect/jdbconn.cpp @@ -879,11 +879,11 @@ int JDBConn::ExecuteCommand(PCSZ sql) snprintf(g->Message, sizeof(g->Message), "GetResult: %s", Msg); rc = RC_FX; } else if (m_Ncol) { - strcpy(g->Message, "Result set column number"); + snprintf(g->Message, sizeof(g->Message), "Result set column number"); rc = RC_OK; // A result set was returned } else { m_Aff = (int)n; // Affected rows - strcpy(g->Message, "Affected rows"); + snprintf(g->Message, sizeof(g->Message), "Affected rows"); rc = RC_NF; } // endif ncol @@ -903,7 +903,7 @@ int JDBConn::Fetch(int pos) if (pos) { if (!m_Scrollable) { - strcpy(g->Message, "Cannot fetch(pos) if FORWARD ONLY"); + snprintf(g->Message, sizeof(g->Message), "Cannot fetch(pos) if FORWARD ONLY"); return rc; } else if (gmID(m_G, fetchid, "Fetch", "(I)Z")) return rc; @@ -1232,7 +1232,7 @@ int JDBConn::ExecuteSQL(void) jint n = env->CallIntMethod(job, xpid); if (n == -3) - strcpy(g->Message, "SQL statement is not prepared"); + snprintf(g->Message, sizeof(g->Message), "SQL statement is not prepared"); else if (Check(n)) snprintf(g->Message, sizeof(g->Message), "ExecutePrep: %s", Msg); else { @@ -1315,17 +1315,17 @@ bool JDBConn::SetParam(JDBCCOL *colp) break; case TYPE_DATE: if ((dat = env->FindClass("java/sql/Timestamp")) == nullptr) { - strcpy(g->Message, "Cannot find Timestamp class"); + snprintf(g->Message, sizeof(g->Message), "Cannot find Timestamp class"); return true; } else if (!(dtc = env->GetMethodID(dat, "", "(J)V"))) { - strcpy(g->Message, "Cannot find Timestamp class constructor"); + snprintf(g->Message, sizeof(g->Message), "Cannot find Timestamp class constructor"); return true; } // endif's lg = (jlong)val->GetBigintValue() * 1000; if ((datobj = env->NewObject(dat, dtc, lg)) == nullptr) { - strcpy(g->Message, "Cannot make Timestamp object"); + snprintf(g->Message, sizeof(g->Message), "Cannot make Timestamp object"); return true; } else if (gmID(g, setid, "SetTimestampParm", "(ILjava/sql/Timestamp;)V")) return true; @@ -1416,12 +1416,12 @@ bool JDBConn::SetParam(JDBCCOL *colp) int rc = ExecuteCommand(src); if (rc == RC_NF) { - strcpy(g->Message, "Srcdef is not returning a result set"); + snprintf(g->Message, sizeof(g->Message), "Srcdef is not returning a result set"); return NULL; } else if ((rc) == RC_FX) { return NULL; } else if (m_Ncol == 0) { - strcpy(g->Message, "Invalid Srcdef"); + snprintf(g->Message, sizeof(g->Message), "Invalid Srcdef"); return NULL; } // endif's @@ -1463,7 +1463,7 @@ bool JDBConn::SetParam(JDBCCOL *colp) if (Check()) snprintf(g->Message, sizeof(g->Message), "ColumnDesc: %s", Msg); else - strcpy(g->Message, "No result metadata"); + snprintf(g->Message, sizeof(g->Message), "No result metadata"); env->ReleaseIntArrayElements(val, n, 0); return NULL; @@ -1568,7 +1568,7 @@ bool JDBConn::SetParam(JDBCCOL *colp) // n because we no more ignore the first column if ((n = qrp->Nbcol) > (uint)ncol) { - strcpy(g->Message, MSG(COL_NUM_MISM)); + snprintf(g->Message, sizeof(g->Message), MSG(COL_NUM_MISM)); return -1; } // endif n @@ -1638,7 +1638,7 @@ bool JDBConn::SetParam(JDBCCOL *colp) PQRYRES qrp; if (!m_Rows) { - strcpy(g->Message, "Void result"); + snprintf(g->Message, sizeof(g->Message), "Void result"); return NULL; } // endif m_Rows diff --git a/storage/connect/jmgoconn.cpp b/storage/connect/jmgoconn.cpp index f527eb83dfe..16f472ea084 100644 --- a/storage/connect/jmgoconn.cpp +++ b/storage/connect/jmgoconn.cpp @@ -264,7 +264,7 @@ bool JMgoConn::MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, p = strrchr(Options, ']'); if (!p) { - strcpy(g->Message, "Missing ] in pipeline"); + snprintf(g->Message, sizeof(g->Message), "Missing ] in pipeline"); return true; } else *(char*)p = 0; @@ -275,7 +275,7 @@ bool JMgoConn::MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, s->Append(",{\"$match\":"); if (MakeSelector(g, filp, s)) { - strcpy(g->Message, "Failed making selector"); + snprintf(g->Message, sizeof(g->Message), "Failed making selector"); return true; } else s->Append('}'); @@ -343,7 +343,7 @@ bool JMgoConn::MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options, s->Append(','); if (MakeSelector(g, filp, s)) { - strcpy(g->Message, "Failed making selector"); + snprintf(g->Message, sizeof(g->Message), "Failed making selector"); return true; } // endif Selector diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp index 6b1da3af628..f4338a146bf 100644 --- a/storage/connect/json.cpp +++ b/storage/connect/json.cpp @@ -164,7 +164,7 @@ PJSON ParseJson(PGLOBAL g, char* s, size_t len, int* ptyp, bool* comma) htrc("ParseJson: s=%.10s len=%zd\n", s, len); if (!s || !len) { - strcpy(g->Message, "Void JSON object"); + snprintf(g->Message, sizeof(g->Message), "Void JSON object"); return NULL; } else if (comma) *comma = false; @@ -247,7 +247,7 @@ PJSON ParseJson(PGLOBAL g, char* s, size_t len, int* ptyp, bool* comma) htrc("Exception %d: %s\n", n, g->Message); jsp = NULL; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); jsp = NULL; } // end catch @@ -271,7 +271,7 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char* fn, int pretty) { jdp->dfp = GetDefaultPrec(); if (!jsp) { - safe_strcpy(g->Message, sizeof(g->Message), "Null json tree"); + snprintf(g->Message, sizeof(g->Message), "Null json tree"); throw 1; } else if (!fn) { // Serialize to a string @@ -307,20 +307,25 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char* fn, int pretty) { err = jdp->SerializeValue((PJVAL)jsp); break; default: - strcpy(g->Message, "Invalid json tree"); + snprintf(g->Message, sizeof(g->Message), "Invalid json tree"); } // endswitch Type if (fs) { fputs(EL, fs); fclose(fs); - str = (err) ? NULL : strcpy(g->Message, "Ok"); + if(err) { + str = NULL; + } else { + snprintf(g->Message, sizeof(g->Message), "Ok"); + str = g->Message; + } } else if (!err) { str = ((JOUTSTR*)jp)->Strp; jp->WriteChr('\0'); PlugSubAlloc(g, NULL, ((JOUTSTR*)jp)->N); } else { if (!g->Message[0]) - strcpy(g->Message, "Error in Serialize"); + snprintf(g->Message, sizeof(g->Message), "Error in Serialize"); } // endif's @@ -329,7 +334,7 @@ PSZ Serialize(PGLOBAL g, PJSON jsp, char* fn, int pretty) { htrc("Exception %d: %s\n", n, g->Message); str = NULL; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); str = NULL; } // end catch @@ -553,7 +558,7 @@ PJAR JDOC::ParseAsArray(PGLOBAL g, int& i, int pretty, int *ptyp) return jsp; } else - strcpy(g->Message, "More than one item in file"); + snprintf(g->Message, sizeof(g->Message), "More than one item in file"); return NULL; } // end of ParseAsArray @@ -672,7 +677,7 @@ PJOB JDOC::ParseObject(PGLOBAL g, int& i) throw 2; }; // endswitch s[i] - strcpy(g->Message, "Unexpected EOF in Object"); + snprintf(g->Message, sizeof(g->Message), "Unexpected EOF in Object"); throw 2; } // end of ParseObject @@ -1179,7 +1184,7 @@ PSZ JOBJECT::GetText(PGLOBAL g, PSTRG text) bool JOBJECT::Merge(PGLOBAL g, PJSON jsp) { if (jsp->GetType() != TYPE_JOB) { - strcpy(g->Message, "Second argument is not an object"); + snprintf(g->Message, sizeof(g->Message), "Second argument is not an object"); return true; } // endif Type @@ -1353,7 +1358,7 @@ PJVAL JARRAY::AddArrayValue(PGLOBAL g, PJVAL jvp, int *x) bool JARRAY::Merge(PGLOBAL g, PJSON jsp) { if (jsp->GetType() != TYPE_JAR) { - strcpy(g->Message, "Second argument is not an array"); + snprintf(g->Message, sizeof(g->Message), "Second argument is not an array"); return true; } // endif Type diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index bc75f80bcc5..26f3688fc15 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -172,7 +172,7 @@ my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) case '!': jnp->Op = OP_SEP; break; // Average case '#': jnp->Op = OP_NUM; break; case '*': // Expand this array - strcpy(g->Message, "Expand not supported by this function"); + snprintf(g->Message, sizeof(g->Message), "Expand not supported by this function"); return true; default: snprintf(g->Message, sizeof(g->Message), "Invalid function specification %c", *p); @@ -194,7 +194,7 @@ my_bool JSNX::SetArrayOptions(PGLOBAL g, char *p, int i, PSZ nm) } // endif n } else { - strcpy(g->Message, "Wrong array specification"); + snprintf(g->Message, sizeof(g->Message), "Wrong array specification"); return true; } // endif's @@ -355,10 +355,10 @@ PJVAL JSNX::MakeJson(PGLOBAL g, PJSON jsp, int n) Jb = false; if (Value->IsTypeNum()) { - strcpy(g->Message, "Cannot make Json for a numeric value"); + snprintf(g->Message, sizeof(g->Message), "Cannot make Json for a numeric value"); return NULL; } else if (jsp->GetType() != TYPE_JAR && jsp->GetType() != TYPE_JOB) { - strcpy(g->Message, "Target is not an array or object"); + snprintf(g->Message, sizeof(g->Message), "Target is not an array or object"); return NULL; } else if (n < Nod -1) { if (jsp->GetType() == TYPE_JAR) { @@ -447,7 +447,7 @@ PJVAL JSNX::GetRowValue(PGLOBAL g, PJSON row, int i, my_bool b) val = new(g)JVALUE(row); } else { - strcpy(g->Message, "Unexpected object"); + snprintf(g->Message, sizeof(g->Message), "Unexpected object"); val = NULL; } //endif Op @@ -497,7 +497,7 @@ PJVAL JSNX::GetRowValue(PGLOBAL g, PJSON row, int i, my_bool b) /*********************************************************************************/ PVAL JSNX::ExpandArray(PGLOBAL g, PJAR arp, int n) { - strcpy(g->Message, "Expand cannot be done by this function"); + snprintf(g->Message, sizeof(g->Message), "Expand cannot be done by this function"); return NULL; } // end of ExpandArray @@ -783,7 +783,7 @@ PJSON JSNX::GetRow(PGLOBAL g) ((PJAR)row)->AddArrayValue(g, new(g)JVALUE(nwr)); ((PJAR)row)->InitArray(g); } else { - strcpy(g->Message, "Wrong type when writing new row"); + snprintf(g->Message, sizeof(g->Message), "Wrong type when writing new row"); nwr = NULL; } // endif's @@ -816,7 +816,7 @@ my_bool JSNX::WriteValue(PGLOBAL g, PJVAL jvalp) case TYPE_JAR: arp = (PJAR)row; break; case TYPE_JVAL: jvp = (PJVAL)row; break; default: - strcpy(g->Message, "Invalid target type"); + snprintf(g->Message, sizeof(g->Message), "Invalid target type"); return true; } // endswitch Type @@ -851,7 +851,7 @@ PSZ JSNX::Locate(PGLOBAL g, PJSON jsp, PJVAL jvp, int k) g->Message[0] = 0; if (!jsp) { - strcpy(g->Message, "Null json tree"); + snprintf(g->Message, sizeof(g->Message), "Null json tree"); return NULL; } // endif jsp @@ -878,7 +878,7 @@ PSZ JSNX::Locate(PGLOBAL g, PJSON jsp, PJVAL jvp, int k) if (err) { if (!g->Message[0]) - strcpy(g->Message, "Invalid json tree"); + snprintf(g->Message, sizeof(g->Message), "Invalid json tree"); } else if (Found) { Jp->WriteChr('\0'); @@ -892,7 +892,7 @@ PSZ JSNX::Locate(PGLOBAL g, PJSON jsp, PJVAL jvp, int k) PUSH_WARNING(g->Message); } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch return str; @@ -972,7 +972,7 @@ PSZ JSNX::LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx) PJPN jnp; if (!jsp) { - strcpy(g->Message, "Null json tree"); + snprintf(g->Message, sizeof(g->Message), "Null json tree"); return NULL; } // endif jsp @@ -1011,7 +1011,7 @@ PSZ JSNX::LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx) PlugSubAlloc(g, NULL, Jp->N); str = Jp->Strp; } else if (!g->Message[0]) - strcpy(g->Message, "Invalid json tree"); + snprintf(g->Message, sizeof(g->Message), "Invalid json tree"); } catch (int n) { if (trace(1)) @@ -1019,7 +1019,7 @@ PSZ JSNX::LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx) PUSH_WARNING(g->Message); } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch return str; @@ -1402,7 +1402,7 @@ static my_bool CheckPath(PGLOBAL g, UDF_ARGS *args, PJSON jsp, PJVAL& jvp, int n } // endif jvp } else { - strcpy(g->Message, "Path argument is null"); + snprintf(g->Message, sizeof(g->Message), "Path argument is null"); return true; } // endif path @@ -1750,7 +1750,7 @@ my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n, char errmsg[MAX_STR]; snprintf(errmsg, sizeof(errmsg) - 1, MSG(WORK_AREA), g->Message); - strcpy(g->Message, errmsg); + snprintf(g->Message, sizeof(g->Message), "%s", errmsg); return true; } // endif SareaAlloc @@ -3620,7 +3620,7 @@ char *jsonget_string(UDF_INIT *initid, UDF_ARGS *args, char *result, PUSH_WARNING(g->Message); str = NULL; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); str = NULL; } // end catch @@ -3980,7 +3980,7 @@ char *jsonlocate(UDF_INIT *initid, UDF_ARGS *args, char *result, *error = 1; path = NULL; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); *error = 1; path = NULL; @@ -4106,7 +4106,7 @@ char *json_locate_all(UDF_INIT *initid, UDF_ARGS *args, char *result, *error = 1; path = NULL; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); *error = 1; path = NULL; @@ -4379,7 +4379,7 @@ char *handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result, PUSH_WARNING(g->Message); str = NULL; } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); PUSH_WARNING(g->Message); str = NULL; } // end catch @@ -6187,7 +6187,7 @@ bool JUP::unPretty(PGLOBAL g, int lrecl) { htrc("UnPretty: s=%.10s len=%zd lrecl=%d\n", s, len, lrecl); if (!s || !len) { - strcpy(g->Message, "Void JSON file"); + snprintf(g->Message, sizeof(g->Message), "Void JSON file"); return true; } else if (*s != '[') { // strcpy(g->Message, "JSON file is not an array"); @@ -6250,7 +6250,7 @@ bool JUP::unPretty(PGLOBAL g, int lrecl) { htrc("Exception %d: %s\n", n, g->Message); rc = true; } catch (const char* msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); rc = true; } // end catch diff --git a/storage/connect/macutil.cpp b/storage/connect/macutil.cpp index fd85210ac91..99b2cce8ade 100644 --- a/storage/connect/macutil.cpp +++ b/storage/connect/macutil.cpp @@ -57,12 +57,11 @@ void MACINFO::MakeErrorMsg(PGLOBAL g, DWORD drc) "GetAdaptersInfo: Buffer Overflow buflen=%d nbofadap=%d", Buflen, N); else if (drc == ERROR_INVALID_PARAMETER) - strcpy(g->Message, "GetAdaptersInfo: Invalid parameters"); + snprintf(g->Message, sizeof(g->Message), "GetAdaptersInfo: Invalid parameters"); else if (drc == ERROR_NO_DATA) - strcpy(g->Message, - "No adapter information exists for the local computer"); + snprintf(g->Message, sizeof(g->Message), "No adapter information exists for the local computer"); else if (drc == ERROR_NOT_SUPPORTED) - strcpy(g->Message, "GetAdaptersInfo is not supported"); + snprintf(g->Message, sizeof(g->Message), "GetAdaptersInfo is not supported"); else FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp index e83f1b5f04c..9f23ace8ade 100644 --- a/storage/connect/odbconn.cpp +++ b/storage/connect/odbconn.cpp @@ -1155,7 +1155,7 @@ int ODBConn::Open(PCSZ ConnectString, POPARM sop, DWORD options) if (!m_UseCnc) { if (DriverConnect(options)) { - strcpy(g->Message, MSG(CONNECT_CANCEL)); + snprintf(g->Message, sizeof(g->Message), MSG(CONNECT_CANCEL)); return 0; } // endif @@ -1480,7 +1480,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) ThrowDBX(rc, "SQLNumResultCols", hstmt); if (ncol == 0) { - strcpy(g->Message, "This Srcdef does not return a result set"); + snprintf(g->Message, sizeof(g->Message), "This Srcdef does not return a result set"); return -1; } // endif ncol @@ -1523,7 +1523,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) tp = GetSQLCType(colp->GetResultType()); if (tp == SQL_TYPE_NULL) { - sprintf(m_G->Message, MSG(INV_COLUMN_TYPE), + snprintf(m_G->Message, sizeof(m_G->Message), MSG(INV_COLUMN_TYPE), colp->GetResultType(), SVP(colp->GetName())); ThrowDBX(m_G->Message); } // endif tp @@ -1549,7 +1549,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols) for (int i = 0; i < MAX_NUM_OF_MSG && x->m_ErrMsg[i]; i++) htrc(x->m_ErrMsg[i]); - sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + snprintf(m_G->Message, sizeof(m_G->Message), "%s: %s", x->m_Msg, x->GetErrorMessage(0)); if (b) SQLCancel(hstmt); @@ -1777,7 +1777,7 @@ int ODBConn::ExecuteSQL(void) if (ncol) { // This should never happen while inserting - strcpy(g->Message, "Logical error while inserting"); + snprintf(g->Message, sizeof(g->Message), "Logical error while inserting"); } else { // Insert, Update or Delete statement if (!Check(rc = SQLRowCount(m_hstmt, &afrw))) @@ -1786,7 +1786,7 @@ int ODBConn::ExecuteSQL(void) } // endif ncol } catch(DBX *x) { - sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + snprintf(m_G->Message, sizeof(m_G->Message), "%s: %s", x->m_Msg, x->GetErrorMessage(0)); SQLCancel(m_hstmt); rc = SQLFreeStmt(m_hstmt, SQL_DROP); m_hstmt = NULL; @@ -1825,7 +1825,7 @@ bool ODBConn::BindParam(ODBCCOL *colp) ThrowDBX(rc, "SQLDescribeParam", m_hstmt); } catch(DBX *x) { - sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + snprintf(m_G->Message, sizeof(m_G->Message), "%s: %s", x->m_Msg, x->GetErrorMessage(0)); #endif // 0 colsize = colp->GetPrecision(); sqlt = GetSQLType(buftype); @@ -1923,10 +1923,10 @@ bool ODBConn::ExecSQLcommand(char *sql) ThrowDBX(rc, "SQLRowCount", hstmt); m_Tdb->AftRows = (int)afrw; - strcpy(g->Message, "Affected rows"); + snprintf(g->Message, sizeof(g->Message), "Affected rows"); } else { m_Tdb->AftRows = (int)ncol; - strcpy(g->Message, "Result set column number"); + snprintf(g->Message, sizeof(g->Message), "Result set column number"); } // endif ncol } catch(DBX *x) { @@ -2024,7 +2024,7 @@ PQRYRES ODBConn::GetMetaData(PGLOBAL g, PCSZ dsn, PCSZ src) } // end try/catch if (!ncol) { - strcpy(g->Message, "Invalid Srcdef"); + snprintf(g->Message, sizeof(g->Message), "Invalid Srcdef"); goto err; } // endif ncol @@ -2122,7 +2122,7 @@ bool ODBConn::GetDataSources(PQRYRES qrp) } // endfor i } catch(DBX *x) { - sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + snprintf(m_G->Message, sizeof(m_G->Message), "%s: %s", x->m_Msg, x->GetErrorMessage(0)); rv = true; } // end try/catch @@ -2173,7 +2173,7 @@ bool ODBConn::GetDrivers(PQRYRES qrp) } // endfor n } catch(DBX *x) { - sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + snprintf(m_G->Message, sizeof(m_G->Message), "%s: %s", x->m_Msg, x->GetErrorMessage(0)); rv = true; } // end try/catch @@ -2517,7 +2517,7 @@ PQRYRES ODBConn::AllocateResult(PGLOBAL g) PQRYRES qrp; if (!m_Rows) { - strcpy(g->Message, "Void result"); + snprintf(g->Message, sizeof(g->Message), "Void result"); return NULL; } // endif m_Res @@ -2596,7 +2596,7 @@ int ODBConn::Rewind(char *sql, ODBCCOL *tocols) rbuf = (int)crow; } catch(DBX *x) { - sprintf(m_G->Message, "%s: %s", x->m_Msg, x->GetErrorMessage(0)); + snprintf(m_G->Message, sizeof(m_G->Message), "%s: %s", x->m_Msg, x->GetErrorMessage(0)); rbuf = -1; } // end try/catch diff --git a/storage/connect/osutil.c b/storage/connect/osutil.c index 278023f55a2..9b1771be105 100644 --- a/storage/connect/osutil.c +++ b/storage/connect/osutil.c @@ -4,6 +4,7 @@ #include #include #include "osutil.h" +#include "m_string.h" #ifdef _WIN32 my_bool CloseFileHandle(HANDLE h) @@ -140,25 +141,25 @@ char *_fullpath(char *absPath, const char *relPath, size_t maxLength) char *p; if ( *relPath == '\\' || *relPath == '/' ) { - strncpy(absPath, relPath, maxLength); + snprintf(absPath, maxLength, "%s", relPath); } else if (*relPath == '~') { // get the path to the home directory struct passwd *pw = getpwuid(getuid()); const char *homedir = pw->pw_dir; if (homedir) - strcat(strncpy(absPath, homedir, maxLength), relPath + 1); + snprintf(absPath, maxLength, "%s%s", homedir, relPath + 1); else - strncpy(absPath, relPath, maxLength); + snprintf(absPath, maxLength, "%s", relPath); } else { char buff[2*_MAX_PATH]; p= getcwd(buff, _MAX_PATH); assert(p); - strcat(buff,"/"); - strcat(buff, relPath); - strncpy(absPath, buff, maxLength); + safe_strcat(buff, sizeof(buff), "/"); + safe_strcat(buff, sizeof(buff), relPath); + snprintf(absPath, maxLength, "%s", buff); } /* endif's relPath */ p = absPath; diff --git a/storage/connect/plgdbutl.cpp b/storage/connect/plgdbutl.cpp index c1534eb6c2a..647d011065e 100644 --- a/storage/connect/plgdbutl.cpp +++ b/storage/connect/plgdbutl.cpp @@ -381,7 +381,7 @@ char *SetPath(PGLOBAL g, const char *path) return NULL; if (PlugIsAbsolutePath(path)) { - strcpy(buf, path); + snprintf(buf, len, "%s", path); return buf; } // endif path @@ -391,9 +391,9 @@ char *SetPath(PGLOBAL g, const char *path) #else // !_WIN32 const char *s = "/"; #endif // !_WIN32 - strcat(strcat(strcat(strcpy(buf, "."), s), path), s); + snprintf(buf, len, ".%s%s%s", s, path, s); } else - strcpy(buf, path); + snprintf(buf, len, "%s", path); } // endif path diff --git a/storage/connect/plugutil.cpp b/storage/connect/plugutil.cpp index 6fb40c92a1b..a39c5846225 100644 --- a/storage/connect/plugutil.cpp +++ b/storage/connect/plugutil.cpp @@ -74,6 +74,7 @@ /***********************************************************************/ #define STORAGE /* Initialize global variables */ +#include "m_string.h" #include "osutil.h" #include "global.h" #include "plgdbsem.h" @@ -329,14 +330,15 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath) switch (*direc) { case '\0': - strcpy(direc, defdir); + snprintf(direc, sizeof(direc), "%s", defdir); break; case '\\': case '/': break; default: // This supposes that defdir ends with a SLASH - strcpy(direc, strcat(defdir, direc)); + safe_strcat(defdir, sizeof(defdir), direc); + snprintf(direc, sizeof(direc), "%s", defdir); } // endswitch _makepath(newname, drive, direc, fname, ftype); @@ -607,7 +609,7 @@ char *PlugDup(PGLOBAL g, const char *str) if (str) { char *sm = (char*)PlugSubAlloc(g, NULL, strlen(str) + 1); - strcpy(sm, str); + snprintf(sm, strlen(str) + 1, "%s", str); return sm; } else return NULL; diff --git a/storage/connect/tabjmg.cpp b/storage/connect/tabjmg.cpp index 06a91f57dea..ab1ed102971 100644 --- a/storage/connect/tabjmg.cpp +++ b/storage/connect/tabjmg.cpp @@ -48,7 +48,7 @@ JMGDISC::JMGDISC(PGLOBAL g, int *lg) : MGODISC(g, lg) bool JMGDISC::Init(PGLOBAL g) { if (!(Jcp = ((TDBJMG*)tmgp)->Jcp)) { - strcpy(g->Message, "Init: Jcp is NULL"); + snprintf(g->Message, sizeof(g->Message), "Init: Jcp is NULL"); return true; } else if (Jcp->gmID(g, columnid, "ColumnDesc", "(Ljava/lang/Object;I[II)Ljava/lang/Object;")) @@ -86,7 +86,7 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, jintArray val = Jcp->env->NewIntArray(5); if (val == nullptr) { - strcpy(g->Message, "Cannot allocate jint array"); + snprintf(g->Message, sizeof(g->Message), "Cannot allocate jint array"); return true; } else if (!ncol) n = Jcp->env->GetIntArrayElements(val, 0); @@ -113,7 +113,7 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, z = 65 - strlen(colname); strncat(strncat(colname, "_", z), key, z - 1); } else - strcpy(colname, key); + snprintf(colname, sizeof(colname), key); if (pfmt) { strncpy(fmt, pfmt, 128); @@ -121,7 +121,7 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, z = 129 - strlen(fmt); strncat(strncat(fmt, ".", z), key, z - 1); } else - strcpy(fmt, key); + snprintf(fmt, sizeof(fmt), key); if (!jres) { bcol.Type = n[0]; @@ -318,7 +318,7 @@ bool TDBJMG::OpenDB(PGLOBAL g) /* First opening. */ /*********************************************************************/ if (Pipe && Mode != MODE_READ) { - strcpy(g->Message, "Pipeline tables are read only"); + snprintf(g->Message, sizeof(g->Message), "Pipeline tables are read only"); return true; } // endif Pipe @@ -353,7 +353,7 @@ bool TDBJMG::OpenDB(PGLOBAL g) /***********************************************************************/ bool TDBJMG::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) { - strcpy(g->Message, "MONGO tables are not indexable"); + snprintf(g->Message, sizeof(g->Message), "MONGO tables are not indexable"); return true; } // end of ReadKey @@ -601,7 +601,7 @@ bool JMGCOL::AddValue(PGLOBAL g, bson_t *doc, char *key, bool upd) } // endswitch Buf_Type if (!rc) { - strcpy(g->Message, "Adding value failed"); + snprintf(g->Message, sizeof(g->Message), "Adding value failed"); return true; } else return false; diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 26381e347ae..f9ac029acdb 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -112,7 +112,7 @@ bool MYSQLDEF::GetServerInfo(PGLOBAL g, const char *server_name) if (!server_name || !strlen(server_name)) { DBUG_PRINT("info", ("server_name not defined!")); - strcpy(g->Message, "server_name not defined!"); + snprintf(g->Message, sizeof(g->Message), "server_name not defined!"); DBUG_RETURN(true); } // endif server_name @@ -121,7 +121,7 @@ bool MYSQLDEF::GetServerInfo(PGLOBAL g, const char *server_name) if (!(server= get_server_by_name(mem, server_name, &server_buffer))) { DBUG_PRINT("info", ("get_server_by_name returned > 0 error condition!")); /* need to come up with error handling */ - strcpy(g->Message, "get_server_by_name returned > 0 error condition!"); + snprintf(g->Message, sizeof(g->Message), "get_server_by_name returned > 0 error condition!"); DBUG_RETURN(true); } // endif server @@ -214,21 +214,21 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) char *sport, *scheme = url; if (!(Username = strstr(url, "://"))) { - strcpy(g->Message, "Connection is not an URL"); + snprintf(g->Message, sizeof(g->Message), "Connection is not an URL"); return true; } // endif User scheme[Username - scheme] = 0; if (stricmp(scheme, "mysql")) { - strcpy(g->Message, "scheme must be mysql"); + snprintf(g->Message, sizeof(g->Message), "scheme must be mysql"); return true; } // endif scheme Username += 3; if (!(Hostname = (char*)strchr(Username, '@'))) { - strcpy(g->Message, "No host specified in URL"); + snprintf(g->Message, sizeof(g->Message), "No host specified in URL"); return true; } else { *Hostname++ = 0; // End Username @@ -240,7 +240,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) // Make sure there isn't an extra / if (strchr(pwd, '/')) { - strcpy(g->Message, "Syntax error in URL"); + snprintf(g->Message, sizeof(g->Message), "Syntax error in URL"); return true; } // endif @@ -256,7 +256,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) // Make sure there isn't an extra / or @ */ if ((strchr(Username, '/')) || (strchr(Hostname, '@'))) { - strcpy(g->Message, "Syntax error in URL"); + snprintf(g->Message, sizeof(g->Message), "Syntax error in URL"); return true; } // endif @@ -268,7 +268,7 @@ bool MYSQLDEF::ParseURL(PGLOBAL g, char *url, bool b) // Make sure there's not an extra / if ((strchr(tabn, '/'))) { - strcpy(g->Message, "Syntax error in URL"); + snprintf(g->Message, sizeof(g->Message), "Syntax error in URL"); return true; } // endif / @@ -574,7 +574,7 @@ bool TDBMYSQL::MakeSelect(PGLOBAL g, bool mx) len += (mx ? 256 : 1); if (Query->IsTruncated() || Query->Resize(len)) { - strcpy(g->Message, "MakeSelect: Out of memory"); + snprintf(g->Message, sizeof(g->Message), "MakeSelect: Out of memory"); return true; } // endif Query @@ -599,7 +599,7 @@ bool TDBMYSQL::MakeInsert(PGLOBAL g) if (Prep) { #if !defined(MYSQL_PREPARED_STATEMENTS) - strcpy(g->Message, "Prepared statements not used (not supported)"); + snprintf(g->Message, sizeof(g->Message), "Prepared statements not used (not supported)"); PushWarning(g, this); Prep = false; #endif // !MYSQL_PREPARED_STATEMENTS @@ -607,7 +607,7 @@ bool TDBMYSQL::MakeInsert(PGLOBAL g) for (colp = Columns; colp; colp = colp->GetNext()) if (colp->IsSpecial()) { - strcpy(g->Message, MSG(NO_SPEC_COL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_SPEC_COL)); return true; } else { len += (strlen(colp->GetName()) + 4); @@ -664,7 +664,7 @@ bool TDBMYSQL::MakeInsert(PGLOBAL g) #endif // MYSQL_PREPARED_STATEMENTS if ((oom = Query->IsTruncated())) - strcpy(g->Message, "MakeInsert: Out of memory"); + snprintf(g->Message, sizeof(g->Message), "MakeInsert: Out of memory"); return oom; } // end of MakeInsert @@ -706,7 +706,7 @@ bool TDBMYSQL::MakeCommand(PGLOBAL g) Query->Append(Qrystr + (p - qrystr) + strlen(name)); if (Query->IsTruncated()) { - strcpy(g->Message, "MakeCommand: Out of memory"); + snprintf(g->Message, sizeof(g->Message), "MakeCommand: Out of memory"); return true; } else strlwr(strcpy(qrystr, Query->GetStr())); @@ -742,7 +742,7 @@ int TDBMYSQL::MakeUpdate(PGLOBAL g) && !stricmp(tab, Name)) qc = (Quoted) ? "`" : ""; else { - strcpy(g->Message, "Cannot use this UPDATE command"); + snprintf(g->Message, sizeof(g->Message), "Cannot use this UPDATE command"); return RC_FX; } // endif sscanf @@ -769,7 +769,7 @@ int TDBMYSQL::MakeDelete(PGLOBAL g) else if (sscanf(Qrystr, "%s %s %s%511c", cmd, from, tab, end) > 2) qc = (Quoted) ? "`" : ""; else { - strcpy(g->Message, "Cannot use this DELETE command"); + snprintf(g->Message, sizeof(g->Message), "Cannot use this DELETE command"); return RC_FX; } // endif sscanf @@ -934,7 +934,7 @@ bool TDBMYSQL::OpenDB(PGLOBAL g) } else if (Mode == MODE_INSERT) { if (Srcdef) { - strcpy(g->Message, "No insert into anonym views"); + snprintf(g->Message, sizeof(g->Message), "No insert into anonym views"); Myc.Close(); return true; } // endif Srcdef @@ -946,7 +946,7 @@ bool TDBMYSQL::OpenDB(PGLOBAL g) if (Nparm != n) { if (n >= 0) // Other errors return negative values - strcpy(g->Message, MSG(BAD_PARM_COUNT)); + snprintf(g->Message, sizeof(g->Message), MSG(BAD_PARM_COUNT)); } else #endif // MYSQL_PREPARED_STATEMENTS @@ -1109,7 +1109,7 @@ bool TDBMYSQL::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr) if (To_CondFil) if (Query->Append(" AND ") || Query->Append(To_CondFil->Body)) { - strcpy(g->Message, "Readkey: Out of memory"); + snprintf(g->Message, sizeof(g->Message), "Readkey: Out of memory"); return true; } // endif Append @@ -1184,7 +1184,7 @@ int TDBMYSQL::WriteDB(PGLOBAL g) } // endfor colp if (unlikely(Query->IsTruncated())) { - strcpy(g->Message, "WriteDB: Out of memory"); + snprintf(g->Message, sizeof(g->Message), "WriteDB: Out of memory"); rc = RC_FX; } else { Query->RepLast(')'); @@ -1530,13 +1530,13 @@ PCMD TDBMYEXC::MakeCMD(PGLOBAL g) (To_CondFil->Op == OP_EQ || To_CondFil->Op == OP_IN)) { xcmd = To_CondFil->Cmds; } else - strcpy(g->Message, "Invalid command specification filter"); + snprintf(g->Message, sizeof(g->Message), "Invalid command specification filter"); } else - strcpy(g->Message, "No command column in select list"); + snprintf(g->Message, sizeof(g->Message), "No command column in select list"); } else if (!Srcdef) - strcpy(g->Message, "No Srcdef default command"); + snprintf(g->Message, sizeof(g->Message), "No Srcdef default command"); else xcmd = new(g) CMD(g, Srcdef); @@ -1561,7 +1561,7 @@ int TDBMYEXC::GetMaxSize(PGLOBAL) bool TDBMYEXC::OpenDB(PGLOBAL g) { if (Use == USE_OPEN) { - strcpy(g->Message, "Multiple execution is not allowed"); + snprintf(g->Message, sizeof(g->Message), "Multiple execution is not allowed"); return true; } // endif use @@ -1579,7 +1579,7 @@ bool TDBMYEXC::OpenDB(PGLOBAL g) Use = USE_OPEN; // Do it now in case we are recursively called if (Mode != MODE_READ && Mode != MODE_READX) { - strcpy(g->Message, "No INSERT/DELETE/UPDATE of MYSQL EXEC tables"); + snprintf(g->Message, sizeof(g->Message), "No INSERT/DELETE/UPDATE of MYSQL EXEC tables"); return true; } // endif Mode @@ -1626,11 +1626,11 @@ int TDBMYEXC::ReadDB(PGLOBAL g) switch (rc = Myc.ExecSQLcmd(g, Query->GetStr(), &Warnings)) { case RC_NF: AftRows = Myc.m_Afrw; - strcpy(g->Message, "Affected rows"); + snprintf(g->Message, sizeof(g->Message), "Affected rows"); break; case RC_OK: AftRows = Myc.m_Fields; - strcpy(g->Message, "Result set columns"); + snprintf(g->Message, sizeof(g->Message), "Result set columns"); break; case RC_FX: AftRows = Myc.m_Afrw; @@ -1660,7 +1660,7 @@ int TDBMYEXC::ReadDB(PGLOBAL g) /***********************************************************************/ int TDBMYEXC::WriteDB(PGLOBAL g) { - strcpy(g->Message, "EXEC MYSQL tables are read only"); + snprintf(g->Message, sizeof(g->Message), "EXEC MYSQL tables are read only"); return RC_FX; } // end of WriteDB diff --git a/storage/connect/tabpivot.cpp b/storage/connect/tabpivot.cpp index d700cff0e41..f217c8fc158 100644 --- a/storage/connect/tabpivot.cpp +++ b/storage/connect/tabpivot.cpp @@ -120,7 +120,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) uint n = strlen(Skcol); skc = (char*)PlugSubAlloc(g, NULL, n + 2); - strcpy(skc, Skcol); + snprintf(skc, n + 2, "%s", Skcol); skc[n + 1] = 0; // Replace ; by nulls in skc @@ -133,9 +133,9 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) if (!Tabsrc && Tabname) { // Locate the query query = (char*)PlugSubAlloc(g, NULL, strlen(Tabname) + 26); - sprintf(query, "SELECT * FROM `%s` LIMIT 1", Tabname); + snprintf(query, strlen(Tabname) + 26, "SELECT * FROM `%s` LIMIT 1", Tabname); } else if (!Tabsrc) { - strcpy(g->Message, MSG(SRC_TABLE_UNDEF)); + snprintf(g->Message, sizeof(g->Message), MSG(SRC_TABLE_UNDEF)); goto err; } else query = (char*)Tabsrc; @@ -167,7 +167,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) Fncol = crp->Name; if (!Fncol) { - strcpy(g->Message, MSG(NO_DEF_FNCCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_FNCCOL)); goto err; } // endif Fncol @@ -180,7 +180,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) Picol = crp->Name; if (!Picol) { - strcpy(g->Message, MSG(NO_DEF_PIVOTCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_PIVOTCOL)); goto err; } // endif Picol @@ -206,10 +206,10 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) pcrp = &crp->Next; if (!Rblkp) { - strcpy(g->Message, MSG(NO_DEF_PIVOTCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_PIVOTCOL)); goto err; } else if (!fncrp) { - strcpy(g->Message, MSG(NO_DEF_FNCCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_FNCCOL)); goto err; } // endif @@ -302,7 +302,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g) if (trace(1)) htrc("Exception %d: %s\n", n, g->Message); } catch (const char *msg) { - strcpy(g->Message, msg); + snprintf(g->Message, sizeof(g->Message), "%s", msg); } // end catch err: @@ -443,7 +443,7 @@ bool TDBPIVOT::FindDefaultColumns(PGLOBAL g) Fncol = cdp->GetName(); if (!Fncol) { - strcpy(g->Message, MSG(NO_DEF_FNCCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_FNCCOL)); return true; } // endif Fncol @@ -456,7 +456,7 @@ bool TDBPIVOT::FindDefaultColumns(PGLOBAL g) Picol = cdp->GetName(); if (!Picol) { - strcpy(g->Message, MSG(NO_DEF_PIVOTCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_PIVOTCOL)); return true; } // endif Picol @@ -519,7 +519,7 @@ bool TDBPIVOT::GetSourceTable(PGLOBAL g) } // endif !GBdone } else if (!Tabsrc) { - strcpy(g->Message, MSG(SRC_TABLE_UNDEF)); + snprintf(g->Message, sizeof(g->Message), MSG(SRC_TABLE_UNDEF)); return true; } // endif @@ -588,18 +588,18 @@ bool TDBPIVOT::MakeViewColumns(PGLOBAL g) PTDBMY tdbp; if (Tdbp->GetAmType() != TYPE_AM_MYSQL) { - strcpy(g->Message, "View is not MySQL"); + snprintf(g->Message, sizeof(g->Message),"View is not MySQL"); return true; } else tdbp = (PTDBMY)Tdbp; if (!Fncol && !(Fncol = tdbp->FindFieldColumn(Picol))) { - strcpy(g->Message, MSG(NO_DEF_FNCCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_FNCCOL)); return true; } // endif Fncol if (!Picol && !(Picol = tdbp->FindFieldColumn(Fncol))) { - strcpy(g->Message, MSG(NO_DEF_PIVOTCOL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_DEF_PIVOTCOL)); return true; } // endif Picol @@ -679,7 +679,7 @@ bool TDBPIVOT::OpenDB(PGLOBAL g) /*******************************************************************/ /* Direct access of PIVOT tables is not implemented yet. */ /*******************************************************************/ - strcpy(g->Message, MSG(NO_PIV_DIR_ACC)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_PIV_DIR_ACC)); return TRUE; } // endif To_Key_Col @@ -780,7 +780,7 @@ int TDBPIVOT::ReadDB(PGLOBAL g) if (!colp && !(colp = Dcolp)) { if (!Accept) { - strcpy(g->Message, MSG(NO_MATCH_COL)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_MATCH_COL)); return RC_FX; } else continue; diff --git a/storage/connect/tabsys.cpp b/storage/connect/tabsys.cpp index 7d90b467276..9e8a7d9dbfd 100644 --- a/storage/connect/tabsys.cpp +++ b/storage/connect/tabsys.cpp @@ -84,7 +84,7 @@ bool INIDEF::DefineAM(PGLOBAL g, LPCSTR, int) PlugSetPath(p, Fn, GetPath()); Fn = p; } else { - strcpy(g->Message, MSG(MISSING_FNAME)); + snprintf(g->Message, sizeof(g->Message), MSG(MISSING_FNAME)); return true; } // endif Fn @@ -326,7 +326,7 @@ int TDBINI::DeleteDB(PGLOBAL g, int irc) break; default: if (!Section) { - strcpy(g->Message, MSG(NO_SECTION_NAME)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_SECTION_NAME)); return RC_FX; } else if (!WritePrivateProfileString(Section, NULL, NULL, Ifile)) { @@ -514,7 +514,7 @@ void INICOL::WriteColumn(PGLOBAL g) throw 31; } else if (Flag == 1) { if (tdbp->Mode == MODE_UPDATE) { - strcpy(g->Message, MSG(NO_SEC_UPDATE)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_SEC_UPDATE)); throw 31; } else if (*p) { tdbp->Section = p; @@ -523,7 +523,7 @@ void INICOL::WriteColumn(PGLOBAL g) return; } else if (!tdbp->Section) { - strcpy(g->Message, MSG(SEC_NAME_FIRST)); + snprintf(g->Message, sizeof(g->Message), MSG(SEC_NAME_FIRST)); throw 31; } // endif's @@ -752,7 +752,7 @@ int TDBXIN::DeleteDB(PGLOBAL g, int irc) } // endif } else if (!Section) { - strcpy(g->Message, MSG(NO_SECTION_NAME)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_SECTION_NAME)); return RC_FX; } else if (!WritePrivateProfileString(Section, Keycur, NULL, Ifile)) { @@ -840,7 +840,7 @@ void XINCOL::WriteColumn(PGLOBAL g) throw 31; } else if (Flag == 1) { if (tdbp->Mode == MODE_UPDATE) { - strcpy(g->Message, MSG(NO_SEC_UPDATE)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_SEC_UPDATE)); throw 31; } else if (*p) { tdbp->Section = p; @@ -850,7 +850,7 @@ void XINCOL::WriteColumn(PGLOBAL g) return; } else if (Flag == 2) { if (tdbp->Mode == MODE_UPDATE) { - strcpy(g->Message, MSG(NO_KEY_UPDATE)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_KEY_UPDATE)); throw 31; } else if (*p) { tdbp->Keycur = p; @@ -859,7 +859,7 @@ void XINCOL::WriteColumn(PGLOBAL g) return; } else if (!tdbp->Section || !tdbp->Keycur) { - strcpy(g->Message, MSG(SEC_KEY_FIRST)); + snprintf(g->Message, sizeof(g->Message), MSG(SEC_KEY_FIRST)); throw 31; } // endif's diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp index 935d21c59c9..1cd46a7442c 100644 --- a/storage/connect/tabwmi.cpp +++ b/storage/connect/tabwmi.cpp @@ -6,6 +6,7 @@ #error This is a WINDOWS only table type #endif // !_WIN32 #include "my_global.h" +#include "m_string.h" #include #include "global.h" @@ -49,7 +50,7 @@ PWMIUT InitWMI(PGLOBAL g, PCSZ nsp, PCSZ classname) else if (!stricmp(nsp, "root\\cli")) classname = "Msft_CliAlias"; else { - strcpy(g->Message, "Missing class name"); + safe_strcpy(g->Message, sizeof(g->Message), "Missing class name"); return NULL; } // endif classname @@ -512,7 +513,8 @@ char *TDBWMI::MakeWQL(PGLOBAL g) ncol++; if (ncol) { - colist = (char*)PlugSubAlloc(g, NULL, (NAM_LEN + 4) * ncol); + size_t colist_sz = (NAM_LEN + 4) * ncol; + colist = (char*)PlugSubAlloc(g, NULL, colist_sz); for (colp = Columns; colp; colp = colp->GetNext()) if (!colp->IsSpecial()) { @@ -521,10 +523,13 @@ char *TDBWMI::MakeWQL(PGLOBAL g) if (colp->GetColUse(U_P | U_J_EXT) || noloc) { if (first) { - strcpy(colist, colp->GetName()); + snprintf(colist, colist_sz, colp->GetName()); first = false; - } else + } else { strcat(strcat(colist, ", "), colp->GetName()); + safe_strcat(colist, colist_sz, ", "); + safe_strcat(colist, colist_sz, colp->GetName()); + } } // endif ColUse @@ -534,18 +539,19 @@ char *TDBWMI::MakeWQL(PGLOBAL g) // ncol == 0 can occur for queries such that sql count(*) from... // for which we will count the rows from sql * from... colist = (char*)PlugSubAlloc(g, NULL, 2); - strcpy(colist, "*"); + snprintf(colist, 2, "*"); } // endif ncol // Below 14 is length of 'select ' + length of ' from ' + 1 len = (strlen(colist) + strlen(Wclass) + 14); len += (To_CondFil ? strlen(To_CondFil->Body) + 7 : 0); wql = (char*)PlugSubAlloc(g, NULL, len); - strcat(strcat(strcpy(wql, "SELECT "), colist), " FROM "); - strcat(wql, Wclass); + snprintf(wql, len, "SELECT %s FROM %s", colist, Wclass); - if (To_CondFil) - strcat(strcat(wql, " WHERE "), To_CondFil->Body); + if (To_CondFil) { + safe_strcat(wql, len, " WHERE "); + safe_strcat(wql, len, To_CondFil->Body); + } return wql; } // end of MakeWQL @@ -654,13 +660,13 @@ bool TDBWMI::OpenDB(PGLOBAL g) /*******************************************************************/ /* WMI tables cannot be modified. */ /*******************************************************************/ - strcpy(g->Message, "WMI tables are read only"); + safe_strcpy(g->Message, sizeof(g->Message), "WMI tables are read only"); return true; } // endif Mode if (!To_CondFil && !stricmp(Wclass, "CIM_Datafile") && !stricmp(Nspace, "root\\cimv2")) { - strcpy(g->Message, + safe_strcpy(g->Message, sizeof(g->Message), "Would last forever when not filtered, use DIR table instead"); return true; } else @@ -697,7 +703,7 @@ int TDBWMI::ReadDB(PGLOBAL g) /***********************************************************************/ int TDBWMI::WriteDB(PGLOBAL g) { - strcpy(g->Message, "WMI tables are read only"); + safe_strcpy(g->Message, sizeof(g->Message), "WMI tables are read only"); return RC_FX; } // end of WriteDB @@ -706,7 +712,7 @@ int TDBWMI::WriteDB(PGLOBAL g) /***********************************************************************/ int TDBWMI::DeleteDB(PGLOBAL g, int irc) { - strcpy(g->Message, "Delete not enabled for WMI tables"); + safe_strcpy(g->Message, sizeof(g->Message), "Delete not enabled for WMI tables"); return RC_FX; } // end of DeleteDB diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 6bc3209da59..bc8e3651e0c 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -140,7 +140,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) } // endif info if (GetIntegerTableOption(g, topt, "Multiple", 0)) { - strcpy(g->Message, "Cannot find column definition for multiple table"); + snprintf(g->Message, sizeof(g->Message), "Cannot find column definition for multiple table"); return NULL; } // endif Multiple @@ -152,7 +152,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) fn = GetStringTableOption(g, topt, "Subtype", NULL); if (!fn) { - strcpy(g->Message, MSG(MISSING_FNAME)); + snprintf(g->Message, sizeof(g->Message), MSG(MISSING_FNAME)); return NULL; } else topt->subtype = NULL; @@ -483,12 +483,12 @@ bool XMLDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) Encoding = GetStringCatInfo(g, "Encoding", "UTF-8"); if (*Fn == '?') { - strcpy(g->Message, MSG(MISSING_FNAME)); + snprintf(g->Message, sizeof(g->Message), MSG(MISSING_FNAME)); return true; } // endif fn if ((signed)GetIntCatInfo("Flag", -1) != -1) { - strcpy(g->Message, MSG(DEPREC_FLAG)); + snprintf(g->Message, sizeof(g->Message), MSG(DEPREC_FLAG)); return true; } // endif flag @@ -567,7 +567,7 @@ PTDB XMLDEF::GetTable(PGLOBAL g, MODE m) return new(g) TDBXCT(this); if (Zipped && !(m == MODE_READ || m == MODE_ANY)) { - strcpy(g->Message, "ZIpped XML tables are read only"); + snprintf(g->Message, sizeof(g->Message), "ZIpped XML tables are read only"); return NULL; } // endif Zipped @@ -857,16 +857,16 @@ bool TDBXML::Initialize(PGLOBAL g) // Get root node if (!(Root = Docp->GetRoot(g))) { // This should never happen as load should have failed - strcpy(g->Message, MSG(EMPTY_DOC)); + snprintf(g->Message, sizeof(g->Message), MSG(EMPTY_DOC)); goto error; } // endif Root // If tabname is not an Xpath, // construct one that will find it anywhere if (!strchr(Tabname, '/')) - strcat(strcpy(tabpath, "//"), Tabname); + snprintf(tabpath, sizeof(tabpath), "//%s", Tabname); else - strcpy(tabpath, Tabname); + snprintf(tabpath, sizeof(tabpath), "%s", Tabname); // Evaluate table xpath if ((TabNode = Root->SelectSingleNode(g, tabpath))) { @@ -911,7 +911,7 @@ bool TDBXML::Initialize(PGLOBAL g) // Create the XML node if (Docp->NewDoc(g, "1.0")) { - strcpy(g->Message, MSG(NEW_DOC_FAILED)); + snprintf(g->Message, sizeof(g->Message), MSG(NEW_DOC_FAILED)); goto error; } // endif NewDoc @@ -919,7 +919,7 @@ bool TDBXML::Initialize(PGLOBAL g) To_Xb = Docp->LinkXblock(g, Mode, rc, filename); // Add a CONNECT comment node - strcpy(buf, " Created by the MariaDB CONNECT Storage Engine"); + snprintf(buf, sizeof(buf), " Created by the MariaDB CONNECT Storage Engine"); Docp->AddComment(g, buf); if (XmlDB) { @@ -932,7 +932,7 @@ bool TDBXML::Initialize(PGLOBAL g) TabNode = Root = Docp->NewRoot(g, Tabname); if (TabNode == NULL || Root == NULL) { - strcpy(g->Message, MSG(XML_INIT_ERROR)); + snprintf(g->Message, sizeof(g->Message), MSG(XML_INIT_ERROR)); goto error; } else if (SetTabNode(g)) goto error; @@ -992,7 +992,7 @@ bool TDBXML::Initialize(PGLOBAL g) #if !defined(UNIX) } catch(...) { // Other errors - strcpy(g->Message, MSG(XMLTAB_INIT_ERR)); + snprintf(g->Message, sizeof(g->Message), MSG(XMLTAB_INIT_ERR)); goto error; #endif } // end of try-catches @@ -1037,7 +1037,7 @@ bool TDBXML::SetTabNode(PGLOBAL g) TabNode->AddText(g, "\n\t"); rn = TabNode->AddChildNode(g, Rowname, NULL); } else { - strcpy(g->Message, MSG(NO_ROW_NODE)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_ROW_NODE)); return true; } // endif Rowname @@ -1293,7 +1293,7 @@ bool TDBXML::CheckRow(PGLOBAL g, bool b) TabNode->AddText(g, "\n\t"); RowNode = TabNode->AddChildNode(g, Rowname, RowNode); } else { - strcpy(g->Message, MSG(NO_ROW_NODE)); + snprintf(g->Message, sizeof(g->Message), MSG(NO_ROW_NODE)); return true; } // endif Rowname } @@ -1550,7 +1550,7 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode) if (Tdbp->Mulnode && !strncmp(p, Tdbp->Mulnode, p2 - p)) { if (!Tdbp->Xpand && mode) { - strcpy(g->Message, MSG(CONCAT_SUBNODE)); + snprintf(g->Message, sizeof(g->Message), MSG(CONCAT_SUBNODE)); return true; } else Inod = i; // Index of multiple node @@ -1843,7 +1843,7 @@ void XMLCOL::WriteColumn(PGLOBAL g) } // endfor k if (ColNode == NULL) { - strcpy(g->Message, MSG(COL_ALLOC_ERR)); + snprintf(g->Message, sizeof(g->Message), MSG(COL_ALLOC_ERR)); throw (int)TYPE_AM_XML; } // endif ColNode @@ -1862,7 +1862,7 @@ void XMLCOL::WriteColumn(PGLOBAL g) AttNode = ColNode->AddProperty(g, Xname, Vxap); if (ValNode == NULL && AttNode == NULL) { - strcpy(g->Message, MSG(VAL_ALLOC_ERR)); + snprintf(g->Message, sizeof(g->Message), MSG(VAL_ALLOC_ERR)); throw (int)TYPE_AM_XML; } // endif ValNode @@ -2104,7 +2104,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) } // endfor k if (ColNode == NULL) { - strcpy(g->Message, MSG(COL_ALLOC_ERR)); + snprintf(g->Message, sizeof(g->Message), MSG(COL_ALLOC_ERR)); throw (int)TYPE_AM_XML; } // endif ColNode @@ -2123,7 +2123,7 @@ void XMULCOL::WriteColumn(PGLOBAL g) AttNode = ColNode->AddProperty(g, Xname, Vxap); if (ValNode == NULL && AttNode == NULL) { - strcpy(g->Message, MSG(VAL_ALLOC_ERR)); + snprintf(g->Message, sizeof(g->Message), MSG(VAL_ALLOC_ERR)); throw (int)TYPE_AM_XML; } // endif ValNode @@ -2165,7 +2165,7 @@ void XPOSCOL::ReadColumn(PGLOBAL g) return; // Same row than the last read if (Tdbp->Clist == NULL) { - strcpy(g->Message, MSG(MIS_TAG_LIST)); + snprintf(g->Message, sizeof(g->Message), MSG(MIS_TAG_LIST)); throw (int)TYPE_AM_XML; } // endif Clist @@ -2235,7 +2235,7 @@ void XPOSCOL::WriteColumn(PGLOBAL g) /* Find the column and value nodes to update or insert. */ /*********************************************************************/ if (Tdbp->Clist == NULL) { - strcpy(g->Message, MSG(MIS_TAG_LIST)); + snprintf(g->Message, sizeof(g->Message), MSG(MIS_TAG_LIST)); throw (int)TYPE_AM_XML; } // endif Clist diff --git a/storage/connect/value.cpp b/storage/connect/value.cpp index 7265b2ed0ca..344b0dea50f 100644 --- a/storage/connect/value.cpp +++ b/storage/connect/value.cpp @@ -59,7 +59,7 @@ #if defined(_DEBUG) #define CheckType(V) if (Type != V->GetType()) { \ PGLOBAL& g = Global; \ - strcpy(g->Message, MSG(VALTYPE_NOMATCH)); \ + snprintf(g->Message, sizeof(g->Message), MSG(VALTYPE_NOMATCH)); \ throw Type; #else #define CheckType(V) @@ -556,7 +556,7 @@ BYTE VALUE::TestValue(PVAL vp) /***********************************************************************/ bool VALUE::Compute(PGLOBAL g, PVAL *, int, OPVAL) { - strcpy(g->Message, "Compute not implemented for this value type"); + snprintf(g->Message, sizeof(g->Message), "Compute not implemented for this value type"); return true; } // end of Compute @@ -1051,11 +1051,11 @@ TYPE TYPVAL::SafeAdd(TYPE n1, TYPE n2) if ((n2 > 0) && (n < n1)) { // Overflow - strcpy(g->Message, MSG(FIX_OVFLW_ADD)); + snprintf(g->Message, sizeof(g->Message), MSG(FIX_OVFLW_ADD)); throw 138; } else if ((n2 < 0) && (n > n1)) { // Underflow - strcpy(g->Message, MSG(FIX_UNFLW_ADD)); + snprintf(g->Message, sizeof(g->Message), MSG(FIX_UNFLW_ADD)); throw 138; } // endif's n2 @@ -1079,11 +1079,11 @@ TYPE TYPVAL::SafeMult(TYPE n1, TYPE n2) if (n > MinMaxVal(true)) { // Overflow - strcpy(g->Message, MSG(FIX_OVFLW_TIMES)); + snprintf(g->Message, sizeof(g->Message), MSG(FIX_OVFLW_TIMES)); throw 138; } else if (n < MinMaxVal(false)) { // Underflow - strcpy(g->Message, MSG(FIX_UNFLW_TIMES)); + snprintf(g->Message, sizeof(g->Message), MSG(FIX_UNFLW_TIMES)); throw 138; } // endif's n2 @@ -1119,7 +1119,7 @@ bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) break; case OP_DIV: if (!val[1]) { - strcpy(g->Message, MSG(ZERO_DIVIDE)); + snprintf(g->Message, sizeof(g->Message),MSG(ZERO_DIVIDE)); return true; } // endif @@ -1173,7 +1173,7 @@ bool TYPVAL::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op) case OP_DIV: if (val[0]) { if (!val[1]) { - strcpy(g->Message, MSG(ZERO_DIVIDE)); + snprintf(g->Message, sizeof(g->Message), MSG(ZERO_DIVIDE)); return true; } // endif @@ -1190,7 +1190,7 @@ bool TYPVAL::Compall(PGLOBAL g, PVAL *vp, int np, OPVAL op) break; default: // snprintf(g->Message, sizeof(g->Message), MSG(BAD_EXP_OPER), op); - strcpy(g->Message, "Function not supported"); + snprintf(g->Message, sizeof(g->Message), "Function not supported"); return true; } // endswitch op @@ -1701,7 +1701,7 @@ bool TYPVAL::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op) break; default: // snprintf(g->Message, sizeof(g->Message), MSG(BAD_EXP_OPER), op); - strcpy(g->Message, "Function not supported"); + snprintf(g->Message, sizeof(g->Message), "Function not supported"); return true; } // endswitch op @@ -2616,7 +2616,7 @@ bool DTVAL::MakeDate(PGLOBAL g, int *val, int nval) if (MakeTime(&datm)) { if (g) { - strcpy(g->Message, MSG(BAD_DATETIME)); + snprintf(g->Message, sizeof(g->Message), MSG(BAD_DATETIME)); rc = true; } else Tval = 0; diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index ac76b42083e..6496c4dbce2 100644 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -45,6 +45,7 @@ //nclude "array.h" #include "filamtxt.h" #include "tabdos.h" +#include "m_string.h" #if defined(VCT_SUPPORT) #include "tabvct.h" #endif // VCT_SUPPORT @@ -857,7 +858,8 @@ bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp) char fname[_MAX_FNAME]; _splitpath(defp->GetOfn(), drive, direc, fname, NULL); - strcat(strcat(fname, "_"), Xdp->GetName()); + safe_strcat(fname, sizeof(fname), "_"); + safe_strcat(fname, sizeof(fname), Xdp->GetName()); _makepath(fn, drive, direc, fname, ftype); sxp = NULL; } else { @@ -1011,7 +1013,8 @@ bool XINDEX::Init(PGLOBAL g) char fname[_MAX_FNAME]; _splitpath(defp->GetOfn(), drive, direc, fname, NULL); - strcat(strcat(fname, "_"), Xdp->GetName()); + safe_strcat(fname, sizeof(fname), "_"); + safe_strcat(fname, sizeof(fname), Xdp->GetName()); _makepath(fn, drive, direc, fname, ftype); } else { id = ID; @@ -1265,7 +1268,8 @@ bool XINDEX::MapInit(PGLOBAL g) char fname[_MAX_FNAME]; _splitpath(defp->GetOfn(), drive, direc, fname, NULL); - strcat(strcat(fname, "_"), Xdp->GetName()); + safe_strcat(fname, sizeof(fname), "_"); + safe_strcat(fname, sizeof(fname), Xdp->GetName()); _makepath(fn, drive, direc, fname, ftype); } else { id = ID; @@ -1480,7 +1484,8 @@ bool XINDEX::GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk) char fname[_MAX_FNAME]; _splitpath(defp->GetOfn(), drive, direc, fname, NULL); - strcat(strcat(fname, "_"), Xdp->GetName()); + safe_strcat(fname, sizeof(fname), "_"); + safe_strcat(fname, sizeof(fname), Xdp->GetName()); _makepath(fn, drive, direc, fname, ftype); } else { id = ID; From 8810b1ecf109088963df98e30980f6ab6a85c6cb Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Sat, 13 May 2023 17:09:57 +0100 Subject: [PATCH 23/80] Fix Connect compile issue --- storage/connect/javaconn.cpp | 2 +- storage/connect/tabjmg.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp index 6078d51517f..95b008a13c1 100644 --- a/storage/connect/javaconn.cpp +++ b/storage/connect/javaconn.cpp @@ -167,7 +167,7 @@ bool JAVAConn::gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig mid = env->GetMethodID(jdi, name, sig); if (Check()) { - snprintf(g->Message, sizeof(g->Message), Msg); + snprintf(g->Message, sizeof(g->Message), "%s", Msg); return true; } else return false; diff --git a/storage/connect/tabjmg.cpp b/storage/connect/tabjmg.cpp index ab1ed102971..cf0fa73b5d5 100644 --- a/storage/connect/tabjmg.cpp +++ b/storage/connect/tabjmg.cpp @@ -113,7 +113,7 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, z = 65 - strlen(colname); strncat(strncat(colname, "_", z), key, z - 1); } else - snprintf(colname, sizeof(colname), key); + snprintf(colname, sizeof(colname), "%s", key); if (pfmt) { strncpy(fmt, pfmt, 128); @@ -121,7 +121,7 @@ bool JMGDISC::ColDesc(PGLOBAL g, jobject obj, char *pcn, char *pfmt, z = 129 - strlen(fmt); strncat(strncat(fmt, ".", z), key, z - 1); } else - snprintf(fmt, sizeof(fmt), key); + snprintf(fmt, sizeof(fmt), "%s", key); if (!jres) { bcol.Type = n[0]; From 996b040f9384cf03e814182053b12945d3df5732 Mon Sep 17 00:00:00 2001 From: Angelique Date: Fri, 12 May 2023 22:30:47 +0000 Subject: [PATCH 24/80] MDEV-30232: Increase timeouts to fix sporadic fails --- mysql-test/suite/rpl/r/rpl_gtid_crash.result | 6 +++--- mysql-test/suite/rpl/t/rpl_gtid_crash.test | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result index 153081d9ca5..4e74a3b25ac 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result @@ -168,7 +168,7 @@ SELECT * from t1 WHERE a > 10 ORDER BY a; a gtid_check Binlog pos ok -# Wait 30 seconds for SQL thread to catch up with IO thread +# Wait 60 seconds for SQL thread to catch up with IO thread connection server_2; SELECT * from t1 WHERE a > 10 ORDER BY a; a @@ -224,7 +224,7 @@ gtid_check Binlog pos ok gtid_check Current pos ok -# Wait 30 seconds for SQL thread to catch up with IO thread +# Wait 60 seconds for SQL thread to catch up with IO thread connection server_2; SELECT * from t1 WHERE a > 10 ORDER BY a; a @@ -275,7 +275,7 @@ COMMIT; Got one of the listed errors connection server_1; connection server_2; -# Wait 30 seconds for IO thread to connect and SQL thread to catch up +# Wait 60 seconds for IO thread to connect and SQL thread to catch up # with IO thread. include/stop_slave.inc connection server_1; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test index d0af69a65ed..f2167911101 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test @@ -345,9 +345,9 @@ SELECT * from t1 WHERE a > 10 ORDER BY a; eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT("Unexpected binlog pos: ", @@gtid_binlog_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; --enable_query_log ---echo # Wait 30 seconds for SQL thread to catch up with IO thread +--echo # Wait 60 seconds for SQL thread to catch up with IO thread --connection server_2 ---let $wait_timeout= 300 +--let $wait_timeout= 600 while ($wait_timeout != 0) { --let $read_log_pos= query_get_value('SHOW SLAVE STATUS', Read_Master_Log_Pos, 1) @@ -442,9 +442,9 @@ eval SELECT IF(INSTR(@@gtid_binlog_pos, '$saved_gtid'), "Binlog pos ok", CONCAT( eval SELECT IF(INSTR(@@gtid_current_pos, '$saved_gtid'), "Current pos ok", CONCAT("Unexpected current pos: ", @@gtid_current_pos, "; does not contain the GTID $saved_gtid.")) AS gtid_check; --enable_query_log ---echo # Wait 30 seconds for SQL thread to catch up with IO thread +--echo # Wait 60 seconds for SQL thread to catch up with IO thread --connection server_2 ---let $wait_timeout= 300 +--let $wait_timeout= 600 while ($wait_timeout != 0) { --let $read_log_pos= query_get_value('SHOW SLAVE STATUS', Read_Master_Log_Pos, 1) @@ -533,9 +533,9 @@ EOF --source include/wait_until_connected_again.inc --connection server_2 ---echo # Wait 30 seconds for IO thread to connect and SQL thread to catch up +--echo # Wait 60 seconds for IO thread to connect and SQL thread to catch up --echo # with IO thread. ---let $wait_timeout= 300 +--let $wait_timeout= 600 while ($wait_timeout != 0) { --let $connected=`SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE State = 'Waiting for master to send event'` From b7b8a9ee439f8d3c9457a6eb480001cae37307b8 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Thu, 13 Apr 2023 16:43:30 +0530 Subject: [PATCH 25/80] MDEV-23187: Assorted assertion failures in json_find_path with certain collations Fix by Alexey Botchkov The 'value_len' is calculated wrong for the multibyte charsets. In the read_strn() function we get the length of the string with the final ' " ' character. So have to subtract it's length from the value_len. And the length of '1' isn't correct for the ucs2 charset (must be 2). --- include/json_lib.h | 3 ++- mysql-test/main/func_json.result | 8 +++++--- mysql-test/main/func_json.test | 11 ++++++----- strings/json_lib.c | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/json_lib.h b/include/json_lib.h index 2ec3e9de8f8..71e5d578855 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -35,6 +35,7 @@ typedef struct st_json_string_t const uchar *c_str; /* Current position in JSON string */ const uchar *str_end; /* The end on the string. */ my_wc_t c_next; /* UNICODE of the last read character */ + int c_next_len; /* character lenght of the last read character. */ int error; /* error code. */ CHARSET_INFO *cs; /* Character set of the JSON string. */ @@ -48,7 +49,7 @@ void json_string_set_cs(json_string_t *s, CHARSET_INFO *i_cs); void json_string_set_str(json_string_t *s, const uchar *str, const uchar *end); #define json_next_char(j) \ - (j)->wc((j)->cs, &(j)->c_next, (j)->c_str, (j)->str_end) + ((j)->c_next_len= (j)->wc((j)->cs, &(j)->c_next, (j)->c_str, (j)->str_end)) #define json_eos(j) ((j)->c_str >= (j)->str_end) /* read_string_const_chr() reads the next character of the string constant diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 415e367f455..ed719e7b453 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -1043,9 +1043,6 @@ SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a'); JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a') null # -# End of 10.3 tests -# -# # Start of 10.4 tests # # @@ -1295,6 +1292,11 @@ SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo'); ERROR 42000: Incorrect parameter count in the call to native function 'json_length' SELECT JSON_LENGTH(); ERROR 42000: Incorrect parameter count in the call to native function 'JSON_LENGTH' +# MDEV-23187: Assorted assertion failures in json_find_path with certain collations +SET COLLATION_CONNECTION= ucs2_unicode_ci; +SELECT JSON_VALUE('["foo"]', '$**[0]') AS f; +f +foo # # End of 10.4 tests # diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index 56d90e93936..9cfde5489e7 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -665,11 +665,6 @@ SELECT 1 + JSON_VALUE('{"nulltest": null}', '$.nulltest'); SELECT NULL; SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a'); - ---echo # ---echo # End of 10.3 tests ---echo # - --echo # --echo # Start of 10.4 tests --echo # @@ -825,6 +820,12 @@ SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo'); --error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT SELECT JSON_LENGTH(); +--echo # MDEV-23187: Assorted assertion failures in json_find_path with certain collations + + +SET COLLATION_CONNECTION= ucs2_unicode_ci; +SELECT JSON_VALUE('["foo"]', '$**[0]') AS f; + --echo # --echo # End of 10.4 tests --echo # diff --git a/strings/json_lib.c b/strings/json_lib.c index 5c7747617e9..781172f0340 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -401,7 +401,7 @@ static int read_strn(json_engine_t *j) return 1; j->state= j->stack[j->stack_p]; - j->value_len= (int)(j->s.c_str - j->value) - 1; + j->value_len= (int)(j->s.c_str - j->value) - j->s.c_next_len; return 0; } From ffd5d74c4f0e0812b461b5c6990abdf99ed038bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 11 May 2023 07:46:57 +0300 Subject: [PATCH 26/80] MDEV-30013 : Assertion `state() == s_aborting || state() == s_must_replay' failed in int wsrep::transaction::after_rollback() This must be some kind of merge error because at ha_check_engine we just find out used engine or default engine. There is no need to roll-back transaction here even if engine is not supported as it will be handled later. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/mdev-30013.result | 17 +++++++++++++++++ mysql-test/suite/galera/t/mdev-30013.test | 15 +++++++++++++++ sql/handler.cc | 3 --- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/galera/r/mdev-30013.result create mode 100644 mysql-test/suite/galera/t/mdev-30013.test diff --git a/mysql-test/suite/galera/r/mdev-30013.result b/mysql-test/suite/galera/r/mdev-30013.result new file mode 100644 index 00000000000..86016b09ca6 --- /dev/null +++ b/mysql-test/suite/galera/r/mdev-30013.result @@ -0,0 +1,17 @@ +connection node_2; +connection node_1; +INSTALL PLUGIN ARCHIVE SONAME 'ha_archive.so'; +CREATE TABLE t (a CHAR(1)) ENGINE=ARCHIVE; +SHOW CREATE TABLE t; +Table Create Table +t CREATE TABLE `t` ( + `a` char(1) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +INSERT INTO t VALUES ('A'); +UNINSTALL SONAME 'ha_archive'; +Warnings: +Warning 1620 Plugin is busy and will be uninstalled on shutdown +ALTER TABLE t CHANGE COLUMN a a CHAR(2); +INSERT INTO t (a) VALUES ('AB'); +ERROR 42000: Unknown storage engine 'ARCHIVE' +DROP TABLE t; diff --git a/mysql-test/suite/galera/t/mdev-30013.test b/mysql-test/suite/galera/t/mdev-30013.test new file mode 100644 index 00000000000..038b66600ce --- /dev/null +++ b/mysql-test/suite/galera/t/mdev-30013.test @@ -0,0 +1,15 @@ +--source include/galera_cluster.inc + +if (!$HA_ARCHIVE_SO) { + skip Needs Archive loadable plugin; +} + +INSTALL PLUGIN ARCHIVE SONAME 'ha_archive.so'; +CREATE TABLE t (a CHAR(1)) ENGINE=ARCHIVE; +SHOW CREATE TABLE t; +INSERT INTO t VALUES ('A'); +UNINSTALL SONAME 'ha_archive'; +ALTER TABLE t CHANGE COLUMN a a CHAR(2); +--error ER_UNKNOWN_STORAGE_ENGINE +INSERT INTO t (a) VALUES ('AB'); +DROP TABLE t; diff --git a/sql/handler.cc b/sql/handler.cc index 7eaaaf63f00..455a5e509c8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -299,9 +299,6 @@ handlerton *ha_checktype(THD *thd, handlerton *hton, bool no_substitute) if (no_substitute) return NULL; -#ifdef WITH_WSREP - (void)wsrep_after_rollback(thd, false); -#endif /* WITH_WSREP */ return ha_default_handlerton(thd); } /* ha_checktype */ From 956d6c4af9e353299cce6d2ccbd7c400a1d00d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 20 Apr 2023 13:26:09 +0300 Subject: [PATCH 27/80] MDEV-21479 : Galera 4 unable to query cluster state if not primary component Set mysql.wsrep_cluster and mysql.wsrep_cluster_members as TABLE_CATEGORY_INFORMATION as mysql.wsrep_streaming_log so that they can be queried even if node is not primary component. Signed-off-by: Julius Goryavsky --- mysql-test/suite/galera/r/MDEV-21479.result | 95 ++++++++++++++++++++ mysql-test/suite/galera/t/MDEV-21479.test | 99 +++++++++++++++++++++ sql/table.cc | 13 ++- sql/wsrep_schema.cc | 5 -- sql/wsrep_schema.h | 5 ++ 5 files changed, 209 insertions(+), 8 deletions(-) create mode 100644 mysql-test/suite/galera/r/MDEV-21479.result create mode 100644 mysql-test/suite/galera/t/MDEV-21479.test diff --git a/mysql-test/suite/galera/r/MDEV-21479.result b/mysql-test/suite/galera/r/MDEV-21479.result new file mode 100644 index 00000000000..7d1220a038b --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-21479.result @@ -0,0 +1,95 @@ +connection node_2; +connection node_1; +# Lets first see that we can access wsrep schema tables +# Node1 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_1 from mysql.wsrep_cluster; +EXPECT_1 +1 +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; +EXPECT_2 +2 +connection node_2; +# Node2 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +EXPECT_1 +1 +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; +EXPECT_2 +2 +connection node_1; +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; +SET GLOBAL wsrep_provider_options = 'pc.weight=2'; +connection node_2; +# Desync and disconnect node_2 +SET @@global.wsrep_desync = 1; +SET SESSION wsrep_dirty_reads=1; +SET SESSION wsrep_sync_wait=0; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +VARIABLE_VALUE +non-Primary +connection node_1; +# Waiting until node_2 is not part of cluster anymore +# Verify that we can access wsrep schema tables +# Node1 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +EXPECT_1 +1 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster_members; +EXPECT_1 +1 +connection node_2; +# Node2 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +EXPECT_1 +1 +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; +EXPECT_2 +2 +connection node_2; +# Reconnect node_2 back to cluster +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; +SET wsrep_dirty_reads=0; +SHOW STATUS LIKE 'wsrep_desync_count'; +Variable_name Value +wsrep_desync_count 0 +SET @@global.wsrep_desync = 0; +CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored."); +connection node_1; +# Wait until both nodes are back to cluster +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false'; +SET GLOBAL wsrep_provider_options = 'pc.weight=1'; +# Verify that we can access wsrep schema tables +# Node1 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +EXPECT_1 +1 +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; +EXPECT_2 +2 +connection node_2; +# Node2 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +EXPECT_0 +0 +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +EXPECT_1 +1 +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; +EXPECT_2 +2 diff --git a/mysql-test/suite/galera/t/MDEV-21479.test b/mysql-test/suite/galera/t/MDEV-21479.test new file mode 100644 index 00000000000..86de97ea77c --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-21479.test @@ -0,0 +1,99 @@ +# +# MDEV-21479 : Galera 4 unable to query cluster state if not primary component +# +--source include/galera_cluster.inc +--source include/have_innodb.inc + + +--echo # Lets first see that we can access wsrep schema tables +--echo # Node1 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) AS EXPECT_1 from mysql.wsrep_cluster; +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; + +--connection node_2 +--echo # Node2 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; + +--connection node_1 +# Make node 1 tolerate split-brain +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; +SET GLOBAL wsrep_provider_options = 'pc.weight=2'; + +# Desync and disconnect node 2 from the PC: +--connection node_2 +--echo # Desync and disconnect node_2 +SET @@global.wsrep_desync = 1; +SET SESSION wsrep_dirty_reads=1; +SET SESSION wsrep_sync_wait=0; +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1'; +--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; + +# Wait until node 2 disappears from the PC: +--connection node_1 +--echo # Waiting until node_2 is not part of cluster anymore +--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc + +--echo # Verify that we can access wsrep schema tables +--echo # Node1 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster_members; + +--connection node_2 +# +# Here node2 remembers old configuration even when we are non-Primary +# +--echo # Node2 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; + +# Reconnect node 2 to the PC: +--connection node_2 +--echo # Reconnect node_2 back to cluster +SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0'; +SET wsrep_dirty_reads=0; +--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +--source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc + +# Must return 0: +SHOW STATUS LIKE 'wsrep_desync_count'; + +# Resync node_2, should pass: +SET @@global.wsrep_desync = 0; + +--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; +--source include/wait_condition.inc + +CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored."); + +--connection node_1 +--echo # Wait until both nodes are back to cluster +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false'; +SET GLOBAL wsrep_provider_options = 'pc.weight=1'; + +--echo # Verify that we can access wsrep schema tables +--echo # Node1 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; + +--connection node_2 +--echo # Node2 +SELECT COUNT(*) AS EXPECT_0 FROM mysql.wsrep_streaming_log; +SELECT COUNT(*) AS EXPECT_1 FROM mysql.wsrep_cluster; +SELECT COUNT(*) AS EXPECT_2 FROM mysql.wsrep_cluster_members; diff --git a/sql/table.cc b/sql/table.cc index 0f296a85e58..44d639e27a4 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -45,6 +45,9 @@ #include "ha_sequence.h" #include "sql_show.h" #include "opt_trace.h" +#ifdef WITH_WSREP +#include "wsrep_schema.h" +#endif /* For MySQL 5.7 virtual fields */ #define MYSQL57_GENERATED_FIELD 128 @@ -264,10 +267,14 @@ TABLE_CATEGORY get_table_category(const LEX_CSTRING *db, DBUG_ASSERT(name != NULL); #ifdef WITH_WSREP - if (my_strcasecmp(system_charset_info, db->str, "mysql") == 0 && - my_strcasecmp(system_charset_info, name->str, "wsrep_streaming_log") == 0) + if (my_strcasecmp(system_charset_info, db->str, WSREP_SCHEMA) == 0) { - return TABLE_CATEGORY_INFORMATION; + if ((my_strcasecmp(system_charset_info, name->str, WSREP_STREAMING_TABLE) == 0 || + my_strcasecmp(system_charset_info, name->str, WSREP_CLUSTER_TABLE) == 0 || + my_strcasecmp(system_charset_info, name->str, WSREP_MEMBERS_TABLE) == 0)) + { + return TABLE_CATEGORY_INFORMATION; + } } #endif /* WITH_WSREP */ if (is_infoschema_db(db)) diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc index 1bc8dd5c98f..94eef413dc5 100644 --- a/sql/wsrep_schema.cc +++ b/sql/wsrep_schema.cc @@ -35,11 +35,6 @@ #include #include -#define WSREP_SCHEMA "mysql" -#define WSREP_STREAMING_TABLE "wsrep_streaming_log" -#define WSREP_CLUSTER_TABLE "wsrep_cluster" -#define WSREP_MEMBERS_TABLE "wsrep_cluster_members" - const char* wsrep_sr_table_name_full= WSREP_SCHEMA "/" WSREP_STREAMING_TABLE; static const std::string wsrep_schema_str= WSREP_SCHEMA; diff --git a/sql/wsrep_schema.h b/sql/wsrep_schema.h index 36e23998d19..979b175481c 100644 --- a/sql/wsrep_schema.h +++ b/sql/wsrep_schema.h @@ -33,6 +33,11 @@ struct TABLE_LIST; struct st_mysql_lex_string; typedef struct st_mysql_lex_string LEX_STRING; +#define WSREP_SCHEMA "mysql" +#define WSREP_STREAMING_TABLE "wsrep_streaming_log" +#define WSREP_CLUSTER_TABLE "wsrep_cluster" +#define WSREP_MEMBERS_TABLE "wsrep_cluster_members" + /** Name of the table in `wsrep_schema_str` used for storing streaming replication data. In an InnoDB full format, e.g. "database/tablename". */ extern const char* wsrep_sr_table_name_full; From c205f6c127195753bc20ab0a2e3b45633c51f134 Mon Sep 17 00:00:00 2001 From: anson1014 <56494179+anson1014@users.noreply.github.com> Date: Fri, 2 Sep 2022 05:40:33 -0400 Subject: [PATCH 28/80] Remove unused French translations in Connect engine (#2252) These files are currently not being used nor compiled in MariaDB. The use of large lists of 'case' statements in these source files are also not a great way to represent translated strings. This git history can be referred to when a better translation interface can be implemented in the future. Therefore, these files can be removed to cleanup the MariaDB codebase. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- storage/connect/frcas.h | 320 ----------- storage/connect/frids.h | 46 -- storage/connect/frmsg.h | 320 ----------- storage/connect/frmsg1.h | 1013 --------------------------------- storage/connect/frmsg2.h | 1013 --------------------------------- storage/connect/ha_connect.cc | 4 - storage/connect/messages.h | 8 - storage/connect/plgdbsem.h | 4 - storage/connect/rcmsg.c | 11 - 9 files changed, 2739 deletions(-) delete mode 100644 storage/connect/frcas.h delete mode 100644 storage/connect/frids.h delete mode 100644 storage/connect/frmsg.h delete mode 100644 storage/connect/frmsg1.h delete mode 100644 storage/connect/frmsg2.h diff --git a/storage/connect/frcas.h b/storage/connect/frcas.h deleted file mode 100644 index e9401d475ae..00000000000 --- a/storage/connect/frcas.h +++ /dev/null @@ -1,320 +0,0 @@ - case MSG_ACCESS_VIOLATN: p = "Violation accs mmoire"; break; - case MSG_ADD_BAD_TYPE: p = "Ajout d'une valeur de type %s non conforme dans un tableau %s"; break; - case MSG_ALLOC_ERROR: p = "Erreur d'allocation de %s"; break; - case MSG_ANSWER_TYPE: p = "Rponse de type"; break; - case MSG_API_CONF_ERROR: p = "Erreur SQL: API_CONFORMANCE"; break; - case MSG_APPL_NOT_INIT: p = "Application non initialise"; break; - case MSG_ARRAY_BNDS_EXCD: p = "Hors limite de tableau"; break; - case MSG_BAD_ARRAY_OPER: p = "Les tableaux doivent utiliser l'oprateur IN"; break; - case MSG_BAD_ARRAY_TYPE: p = "Type=%d invalide pour un tableau"; break; - case MSG_BAD_ARRAY_VAL: p = "Les tableaux doivent avoir le mme nombre de valeurs"; break; - case MSG_BAD_BIN_FMT: p = "Format invalide %c pour la colonne BIN %s"; break; - case MSG_BAD_BLK_ESTIM: p = "Nombre de blocs suprieur l'estimation"; break; - case MSG_BAD_BLK_SIZE: p = "Taille du bloc %d non conforme"; break; - case MSG_BAD_BYTE_NUM: p = "Le nombre d'octets crits est faux"; break; - case MSG_BAD_BYTE_READ: p = "Le nombre d'octets lus est faux"; break; - case MSG_BAD_COL_TYPE: p = "Type invalide %s pour la colonne %s"; break; - case MSG_BAD_COL_XPATH: p = "Xpath invalide colonne %s de la table HTML %s"; break; - case MSG_BAD_CONST_TYPE: p = "Type=%d invalide pour une constante"; break; - case MSG_BAD_CONV_TYPE: p = "Convertion de type invalide %d"; break; - case MSG_BAD_DATETIME: p = "Valeur date/temps invalide"; break; - case MSG_BAD_DBF_FILE: p = "Le fichier DBF %s est altr"; break; - case MSG_BAD_DBF_REC: p = "Fichier DBF %s altr enregistrement %d"; break; - case MSG_BAD_DBF_TYPE: p = "Type DBF %c non support colonne %s"; break; - case MSG_BAD_DIRECTORY: p = "Rpertoire invalide %s: %s"; break; - case MSG_BAD_FIELD_RANK: p = "Rang %d invalide pour la colonne %s"; break; - case MSG_BAD_FIELD_TYPE: p = "Mauvais type de champ %s"; break; - case MSG_BAD_FILE_HANDLE: p = "Handle de fichier invalide: %s"; break; - case MSG_BAD_FILTER: p = "Mauvais filtre: Opc=%d B_T=%d %d Type=%d %d"; break; - case MSG_BAD_FILTER_CONV: p = "Conversion filtre incorrecte, B_T=%d,%d"; break; - case MSG_BAD_FILTER_OP: p = "Oprateur de filtre invalide %d"; break; - case MSG_BAD_FLD_FORMAT: p = "Format invalide pour le champs %d de %s"; break; - case MSG_BAD_FLD_LENGTH: p = "Champs %s trop long (%s --> %d) ligne %d de %s"; break; - case MSG_BAD_FREQ_SET: p = "Spcification erronne de Freq pour la colonne %s"; break; - case MSG_BAD_FUNC_MODE: p = "%s: mode invalide %d"; break; - case MSG_BAD_HANDLE_VAL: p = "Valeur Handle invalide"; break; - case MSG_BAD_HEADER: p = "Fichier %s: bloc en-tte altr"; break; - case MSG_BAD_HEAD_END: p = "Lecture fin d'en-tte impossible"; break; - case MSG_BAD_INDEX_FILE: p = "Fichier index %s corrompu"; break; - case MSG_BAD_LINEFLD_FMT: p = "Format invalide ligne %d champs %d de %s"; break; - case MSG_BAD_LINE_LEN: p = "Longueur ligne non gale Lrecl"; break; - case MSG_BAD_LRECL: p = "Disparit lrecl table/fichier (%d,%hd)"; break; - case MSG_BAD_NODE_TYPE: p = "Type noeud erron pour la table"; break; - case MSG_BAD_OFFSET_VAL: p = "Nul offset invalide pour une table CSV"; break; - case MSG_BAD_OPEN_MODE: p = "Mode d'ouverture invalide %d"; break; - case MSG_BAD_PARAM_TYPE: p = "%.8s: Paramtre de type=%d invalide"; break; - case MSG_BAD_PARM_COUNT: p = "Nombre de paramtres incohrent"; break; - case MSG_BAD_QUOTE_FIELD: p = "Quote manquante dans %s champs %d ligne %d"; break; - case MSG_BAD_READ_NUMBER: p = "Mauvais nombre %d de valeurs lues dans %s"; break; - case MSG_BAD_RECFM: p = "Recfm type %d invalide pour DOSCOL"; break; - case MSG_BAD_RECFM_VAL: p = "Valeur invalide %d de Recfm"; break; - case MSG_BAD_SET_CASE: p = "La casse d'un tableau ne peut pas passer de non respect respecter"; break; - case MSG_BAD_SET_STRING: p = "SetValue: appel invalide pour STRING"; break; - case MSG_BAD_SPECIAL_COL: p = "Colonne spciale invalide %s"; break; - case MSG_BAD_SPEC_COLUMN: p = "Colonne spciale invalide pour ce type de table"; break; - case MSG_BAD_TABLE_TYPE: p = "Type invalide %s pour la table %s"; break; - case MSG_BAD_TYPE_LIKE: p = "Type(%d)= %d invalide pour LIKE"; break; - case MSG_BAD_VALBLK_INDX: p = "Valeur hors limites de l'index du bloc de valeurs"; break; - case MSG_BAD_VALBLK_TYPE: p = "Type=%d invalide pour un bloc de valeurs"; break; - case MSG_BAD_VALNODE: p = "Type %d invalide pour le noeud valeur colonne %s"; break; - case MSG_BAD_VALUE_TYPE: p = "Type de valeur invalide %d"; break; - case MSG_BAD_VAL_UPDATE: p = "Impossible de dterminer quelle valeur %s doit tre mise jour"; break; - case MSG_BAS_NS_LIST: p = "Format invalide de la liste des espace-noms"; break; - case MSG_BIN_F_TOO_LONG: p = "Valeur trop longue pour le champ %s (%d --> %d)"; break; - case MSG_BIN_MODE_FAIL: p = "Echec mode binaire: %s"; break; - case MSG_BLKTYPLEN_MISM: p = "Disparit types/longueurs de bloc dans SetValue"; break; - case MSG_BLK_IS_NULL: p = "Blk est nul"; break; - case MSG_BREAKPOINT: p = "Point de contrle"; break; - case MSG_BUILD_INDEX: p = "Construction index %s sur %s"; break; - case MSG_CANNOT_OPEN: p = "Ouverture impossible de %s"; break; - case MSG_CHSIZE_ERROR: p = "Erreur dans chsize: %s"; break; - case MSG_COL_ALLOC_ERR: p = "Allocation impossible du noeud colonne"; break; - case MSG_COL_ISNOT_TABLE: p = "La colonne %s n'est pas dans la table %s"; break; - case MSG_COL_NOT_SORTED: p = "La colonne %s de la table %s n'est pas trie"; break; - case MSG_COL_NUM_MISM: p = "Disparit du nombre de colonnes"; break; - case MSG_COM_ERROR: p = "Erreur Com"; break; - case MSG_CONCAT_SUBNODE: p = "Concatnation de sous-noeuds impossible"; break; - case MSG_CONNECT_CANCEL: p = "Connection interrompue par l'utilisateur"; break; - case MSG_CONTROL_C_EXIT: p = "Exit par Ctrl-C"; break; - case MSG_DATABASE_LOADED: p = "Base de donnes %s charge"; break; - case MSG_DATA_MISALIGN: p = "Mauvais alignement pour ce type de donnes"; break; - case MSG_DBASE_FILE: p = "Fichier dBASE dbf: "; break; - case MSG_DEF_ALLOC_ERROR: p = "Erreur d'allocation de la classe DEF %s"; break; - case MSG_DEL_FILE_ERR: p = "Erreur l'effacement de %s"; break; - case MSG_DEL_READ_ERROR: p = "Delete: erreur en lecture req=%d len=%d"; break; - case MSG_DEL_WRITE_ERROR: p = "Delete: erreur en criture: %s"; break; - case MSG_DEPREC_FLAG: p = "Option Flag prime, utiliser Coltype"; break; - case MSG_DLL_LOAD_ERROR: p = "Erreur %d au chargement du module %s"; break; - case MSG_DOM_NOT_SUPP: p = "MS-DOM non support par cette version"; break; - case MSG_DVAL_NOTIN_LIST: p = "Valeur %s non trouve dans la liste des valeurs distinctes de la colonne %s"; break; - case MSG_EMPTY_DOC: p = "Document vide"; break; - case MSG_EMPTY_FILE: p = "%s du fichier vide %s: "; break; - case MSG_EOF_AFTER_LINE: p = "Fin de fichier aprs la ligne %d"; break; - case MSG_EOF_INDEX_FILE: p = "EOF lisant le fichier index"; break; - case MSG_ERROR_IN_LSK: p = "Erreur %d dans lseek64"; break; - case MSG_ERROR_IN_SFP: p = "Erreur %d dans SetFilePointer"; break; - case MSG_ERR_READING_REC: p = "Erreur lisant l'enregistrement %d de %s"; break; - case MSG_FAIL_ADD_NODE: p = "L'ajout du noeud %s dans la table a chou"; break; - case MSG_FETCH_NO_RES: p = "Fetch: Pas de Rsultats"; break; - case MSG_FIELD_TOO_LONG: p = "Valeur trop longue pour le champs %d ligne %d"; break; - case MSG_FILELEN_ERROR: p = "Erreur dans %s pour %s"; break; - case MSG_FILE_IS_EMPTY: p = "Le fichier %s est vide"; break; - case MSG_FILE_MAP_ERR: p = "Erreur de File mapping"; break; - case MSG_FILE_MAP_ERROR: p = "CreateFileMapping %s erreur rc=%d"; break; - case MSG_FILE_OPEN_YET: p = "Fichier %s dj ouvert"; break; - case MSG_FILE_UNFOUND: p = "Fichier %s non trouv"; break; - case MSG_FLD_TOO_LNG_FOR: p = "Champs %d trop long pour %s ligne %d de %s"; break; - case MSG_FLT_BAD_RESULT: p = "Virgule flottante: rsultat inexacte"; break; - case MSG_FLT_DENORMAL_OP: p = "Oprande virgule flottante non normalis"; break; - case MSG_FLT_INVALID_OP: p = "Opration virgule flottante invalide"; break; - case MSG_FLT_OVERFLOW: p = "Dpassement de capacit virgule flottante"; break; - case MSG_FLT_STACK_CHECK: p = "Virgule flottante: Erreur de la pile"; break; - case MSG_FLT_UNDERFLOW: p = "Sous-dpassement de capacit virgule flottante"; break; - case MSG_FLT_ZERO_DIVIDE: p = "Virgule flottante: division par zro"; break; - case MSG_FMT_WRITE_NIY: p = "L'criture des fichiers %s n'est pas encore implmente"; break; - case MSG_FOXPRO_FILE: p = "Fichier FoxPro: "; break; - case MSG_FPUTS_ERROR: p = "Erreur dans fputs: %s"; break; - case MSG_FSEEK_ERROR: p = "Erreur dans fseek: %s"; break; - case MSG_FSETPOS_ERROR: p = "Erreur dans fseek pour i=%d"; break; - case MSG_FTELL_ERROR: p = "Erreur dans ftell enregistrement=%d: %s"; break; - case MSG_FUNCTION_ERROR: p = "Erreur dans %s: %d"; break; - case MSG_FUNC_ERRNO: p = "Erreur %d dans %s"; break; - case MSG_FUNC_ERROR: p = "Erreur dans %s"; break; - case MSG_FUNC_ERR_S: p = "Erreur dans %s: %s"; break; - case MSG_FWRITE_ERROR: p = "Erreur dans fwrite: %s"; break; - case MSG_GET_DIST_VALS: p = "Rcupration des valeurs distinctes de "; break; - case MSG_GET_FUNC_ERR: p = "Erreur en recherche de la fonction %s: %s"; break; - case MSG_GLOBAL_ERROR: p = "Erreur d'allocation de Global (taille=%d)\n"; break; - case MSG_GUARD_PAGE: p = "Violation de page de garde"; break; - case MSG_GZOPEN_ERROR: p = "gzopen %s: erreur %d sur %s"; break; - case MSG_ILLEGAL_INSTR: p = "Instruction illgale"; break; - case MSG_ILL_FILTER_CONV: p = "Conversion implicite illgale dans un filtre"; break; - case MSG_INDEX_NOT_UNIQ: p = "L'index n'est pas Unique"; break; - case MSG_INDEX_YET_ON: p = "L'index %s existe dj sur %s"; break; - case MSG_INDX_COL_NOTIN: p = "La colonne index %s n'existe pas dans la table %s"; break; - case MSG_INDX_EXIST_YET: p = "L'entre index existe dj"; break; - case MSG_INIT_FAILED: p = "L'initialisation de %s a chou"; break; - case MSG_INT_COL_ERROR: p = "Erreur interne sur la colonne index %s"; break; - case MSG_INT_OVERFLOW: p = "Dpassement de capacit sur entier"; break; - case MSG_INT_ZERO_DIVIDE: p = "Division entire par zro"; break; - case MSG_INVALID_DISP: p = "Disposition invalide"; break; - case MSG_INVALID_FTYPE: p = "SBV: Ftype %d invalide"; break; - case MSG_INVALID_HANDLE: p = "Poigne invalide"; break; - case MSG_INVALID_OPER: p = "Oprateur invalide %d pour %s"; break; - case MSG_INV_COLUMN_TYPE: p = "Type %d Invalide pour la colonne %s"; break; - case MSG_INV_COL_TYPE: p = "Type de colonne %s invalide"; break; - case MSG_INV_DEF_READ: p = "Lecture diffre invalide rc=%d"; break; - case MSG_INV_DIRCOL_OFST: p = "Offset invalide pour une colonne DIR"; break; - case MSG_INV_MAP_POS: p = "Position mmoire invalide"; break; - case MSG_INV_RAND_ACC: p = "L'accs alatoire d'une table non optimise est impossible"; break; - case MSG_INV_REC_POS: p = "Position d'enregistrement invalide"; break; - case MSG_INV_RESULT_TYPE: p = "Type de rsultat invalide %s"; break; - case MSG_INV_UPDT_TABLE: p = "Table %s invalide pour Update"; break; - case MSG_IN_WITHOUT_SUB: p = "IN ou EXISTS sans tableau ou subquery"; break; - case MSG_KEY_ALLOC_ERR: p = "Erreur d'allocation d'un bloc offset cl"; break; - case MSG_KEY_ALLOC_ERROR: p = "Erreur d'allocation mmoire, Klen=%d n=%d"; break; - case MSG_LINE_TOO_LONG: p = "La nouvelle ligne est trop longue"; break; - case MSG_LIST: p = "--Liste--"; break; - case MSG_LOADING_FAILED: p = "Le chargement de %s a chou"; break; - case MSG_LRECL_TOO_SMALL: p = "Lrecl trop petit (longueur en-tte = %d)"; break; - case MSG_MAKE_EMPTY_FILE: p = "Gnration du fichier vide %s: %s"; break; - case MSG_MAKING: p = "Gnration"; break; - case MSG_MALLOC_ERROR: p = "Allocation mmoire impossible par %s"; break; - case MSG_MAP_VIEW_ERROR: p = "MapViewOfFile %s erreur rc=%d"; break; - case MSG_MAXSIZE_ERROR: p = "Maxsize incalculable sur table ouverte"; break; - case MSG_MEM_ALLOC_ERR: p = "Erreur d'allocation mmoire, taille %s = %d"; break; - case MSG_MEM_ALLOC_ERROR: p = "Erreur d'allocation mmoire"; break; - case MSG_MISPLACED_QUOTE: p = "Appostrophe mal place ligne %d"; break; - case MSG_MISSING_ARG: p = "Argument manquant pour l'oprateur %d"; break; - case MSG_MISSING_FIELD: p = "Champs %d manquant dans %s ligne %d"; break; - case MSG_MISSING_FNAME: p = "Nom du fichier manquant"; break; - case MSG_MISSING_NODE: p = "Noeud %s manquant dans %s"; break; - case MSG_MISSING_ROWNODE: p = "Impossible de trouver le noeud de la ligne %d"; break; - case MSG_MIS_TAG_LIST: p = "Liste des balises colonne manquante"; break; - case MSG_MUL_MAKECOL_ERR: p = "Erreur logique dans TABMUL::MakeCol"; break; - case MSG_NAME_CONV_ERR: p = "Erreur de convertion du nom de noeud"; break; - case MSG_NEW_DOC_FAILED: p = "Impossible de crer le nouveau document"; break; - case MSG_NEW_RETURN_NULL: p = "NULL renvoy par New dans PlugEvalLike"; break; - case MSG_NEXT_FILE_ERROR: p = "Erreur en recherche du fichier suivant. rc=%s"; break; - case MSG_NONCONT_EXCEPT: p = "Exception non-continuable"; break; - case MSG_NOP_ZLIB_INDEX: p = "L'indexage d'une table zlib non optimise est impossible"; break; - case MSG_NOT_A_DBF_FILE: p = "Le fichier n'a pas le format dBASE dbf "; break; - case MSG_NOT_FIXED_LEN: p = "Fichier %s non fixe, len=%d lrecl=%d"; break; - case MSG_NO_0DH_HEAD: p = "0DH manquant en fin d'en-tte (dbc=%d)"; break; - case MSG_NO_ACTIVE_DB: p = "Pas de base de donnes active"; break; - case MSG_NO_CHAR_FROM: p = "Conversion de type %d en caractres impossible"; break; - case MSG_NO_DATE_FMT: p = "Pas de format date pour le valblock de type %d"; break; - case MSG_NO_DEF_FNCCOL: p = "Colonne fonction par dfaut introuvable"; break; - case MSG_NO_DEF_PIVOTCOL: p = "Colonne pivot par dfaut introuvable"; break; - case MSG_NO_DIR_INDX_RD: p = "Pas d'accs directe des tables %s"; break; - case MSG_NO_FEAT_SUPPORT: p = "%s non support dans cette version"; break; - case MSG_NO_FLD_FORMAT: p = "Format absent pour le champs %d de %s"; break; - case MSG_NO_FORMAT_COL: p = "Type COLUMN informattable"; break; - case MSG_NO_FORMAT_TYPE: p = "Le format ne peut pas tre dfini partir du type %d"; break; - case MSG_NO_INDEX_READ: p = "Pas d'accs directe des tables multiples"; break; - case MSG_NO_KEY_COL: p = "Pas de colonne cl trouve"; break; - case MSG_NO_KEY_UPDATE: p = "Le nom des cls ne peut pas tre modifi"; break; - case MSG_NO_MAP_INSERT: p = "MAP incompatible avec Insert"; break; - case MSG_NO_MATCHING_COL: p = "Pas de colonne correspondant %s dans %s"; break; - case MSG_NO_MATCH_COL: p = "Colonne correspondante introuvable"; break; - case MSG_NO_MEMORY: p = "Mmoire pleine"; break; - case MSG_NO_MODE_PADDED: p = "Mode non support pour les fichiers 'padded'"; break; - case MSG_NO_MUL_VCT: p = "Les tables VCT ne peuvent pas tre multiples"; break; - case MSG_NO_ODBC_DELETE: p = "Delete ne devrait pas tre appel pour les tables ODBC"; break; - case MSG_NO_ODBC_DIRECT: p = "Accs directe des tables ODBC non encore implment"; break; - case MSG_NO_ODBC_MUL: p = "Multiple(2) non support pour les tables ODBC"; break; - case MSG_NO_ODBC_SPECOL: p = "Pas de colonne spciale ODBC"; break; - case MSG_NO_PART_DEL: p = "Delete partiel des fichier %s impossible"; break; - case MSG_NO_PART_MAP: p = "Mapping partiel non implment pour cet OS"; break; - case MSG_NO_PAR_BLK_INS: p = "Insertion de bloc partiel impossible"; break; - case MSG_NO_PIV_DIR_ACC: p = "Pas d'accs directe aux tables PIVOT"; break; - case MSG_NO_READ_32: p = "Lecture de 32 octets impossible"; break; - case MSG_NO_RECOV_SPACE: p = "Espace non recouvrable dans le fichier index"; break; - case MSG_NO_ROWID_FOR_AM: p = "Accs direct impossible de ROWID pour les tables de type %s"; break; - case MSG_NO_ROW_NODE: p = "Le nom du Rownode n'est pas dfini"; break; - case MSG_NO_SECTION_NAME: p = "Nom de section manquant"; break; - case MSG_NO_SEC_UPDATE: p = "Les noms de section ne peuvent pas tre modifis"; break; - case MSG_NO_SETPOS_YET: p = "SetPos pas encore implment pour les fichier %s"; break; - case MSG_NO_SPEC_COL: p = "Pas de colonne spciales MYSQL"; break; - case MSG_NO_SUB_VAL: p = "Pas de sous-value d'un tableau de type %d"; break; - case MSG_NO_TABCOL_DATA: p = "Pas de donnes pour la table %s colonne %s"; break; - case MSG_NO_TABLE_DEL: p = "Delete non autoris pour les tables %s "; break; - case MSG_NO_TAB_DATA: p = "Pas de donnes pour la table %s"; break; - case MSG_NO_VCT_DELETE: p = "Dltion Partielle non implmente pour les fichiers VCT"; break; - case MSG_NO_ZIP_DELETE: p = "Delete sur fichier Zip non encore implement"; break; - case MSG_OPENING: p = "Ouverture"; break; - case MSG_OPEN_EMPTY_FILE: p = "Ouverture du fichier vide %s: %s"; break; - case MSG_OPEN_ERROR: p = "Erreur d'ouverture %d en mode %d sur %s: "; break; - case MSG_OPEN_ERROR_IS: p = "Erreur l'ouverture de %s: %s"; break; - case MSG_OPEN_MODE_ERROR: p = "Erreur d'ouverture(%s) %d sur %s"; break; - case MSG_OPEN_STRERROR: p = "Erreur l'ouverture: %s"; break; - case MSG_OPTBLK_RD_ERR: p = "Erreur la lecture d'un bloc optimisation: %s"; break; - case MSG_OPTBLK_WR_ERR: p = "Erreur l'criture d'un bloc optimisation: %s"; break; - case MSG_OPTIMIZING: p = "Optimisation de "; break; - case MSG_OPT_BMAP_RD_ERR: p = "Erreur en lecture des bitmaps d'optimisation: %s"; break; - case MSG_OPT_BMAP_WR_ERR: p = "Erreur en criture des bitmaps d'optimisation: %s"; break; - case MSG_OPT_CANCELLED: p = "Optimisation interrompue par l'utilisateur"; break; - case MSG_OPT_DVAL_RD_ERR: p = "Erreur en lecture des valeurs distinctes: %s"; break; - case MSG_OPT_DVAL_WR_ERR: p = "Erreur en criture des valeurs distinctes: %s"; break; - case MSG_OPT_HEAD_RD_ERR: p = "Erreur en lecture de l'entte du fichier opt: %s"; break; - case MSG_OPT_HEAD_WR_ERR: p = "Erreur en criture de l'entte du fichier opt: %s"; break; - case MSG_OPT_LOGIC_ERR: p = "Erreur logique dans SetBitmap, i=%d"; break; - case MSG_OPT_MAX_RD_ERR: p = "Erreur en lecture des valeurs maxi: %s"; break; - case MSG_OPT_MAX_WR_ERR: p = "Erreur en criture des valeurs maxi: %s"; break; - case MSG_OPT_MIN_RD_ERR: p = "Erreur en lecture des valeurs mini: %s"; break; - case MSG_OPT_MIN_WR_ERR: p = "Erreur en criture des valeurs mini: %s"; break; - case MSG_OPT_NOT_MATCH: p = "Le fichier opt %s n'est pas jour"; break; - case MSG_PAGE_ERROR: p = "Erreur de pagination"; break; - case MSG_PARM_CNT_MISS: p = "Disparit du nombre de Paramtres"; break; - case MSG_PREC_VBLP_NULL: p = "ARRAY SetPrecision: Vblp est NULL"; break; - case MSG_PRIV_INSTR: p = "Instruction privilgie"; break; - case MSG_PROCADD_ERROR: p = "Erreur %d sur l'adresse de %s"; break; - case MSG_QUERY_CANCELLED: p = "Requte interrompue par l'utilisateur"; break; - case MSG_RANGE_NO_JOIN: p = "Range non compatible avec les index de jointure"; break; - case MSG_RC_READING: p = "rc=%d en lecture de la table %s"; break; - case MSG_READY: p = "Prt"; break; - case MSG_READ_ERROR: p = "Erreur en lecture sur %s: %s"; break; - case MSG_READ_ONLY: p = "Cette table protge en lecture seule ne peut tre modifie"; break; - case MSG_READ_SEEK_ERROR: p = "Erreur de recherche en lecture: %s"; break; - case MSG_REGISTER_ERR: p = "Enregistrement NS impossible, prfix='%s' et href='%s'"; break; - case MSG_REMOVE_ERROR: p = "Erreur en supprimant %s: %s"; break; - case MSG_RENAME_ERROR: p = "Erreur renommant %s en %s: %s"; break; - case MSG_ROWID_NOT_IMPL: p = "RowNumber non implment pour les tables de type %s"; break; - case MSG_SEC_KEY_FIRST: p = "Les sections et cls doivent tre insres en premier"; break; - case MSG_SEC_NAME_FIRST: p = "Le nom de section doit tre en tte de liste en insertion"; break; - case MSG_SEP_IN_FIELD: p = "Le champ %d contient le caractre sparateur"; break; - case MSG_SEQUENCE_ERROR: p = "HSTMT: Allocation hors squence"; break; - case MSG_SETEOF_ERROR: p = "Erreur %d dans SetEndOfFile"; break; - case MSG_SETRECPOS_NIY: p = "SetRecpos non implment pour ce type de table"; break; - case MSG_SET_STR_TRUNC: p = "SetValue: Chane de caractres tronque"; break; - case MSG_SFP_ERROR: p = "Erreur sur SetFilePointer: %s"; break; - case MSG_SHARED_LIB_ERR: p = "Erreur au chargement de la librairie partage %s: %s"; break; - case MSG_SINGLE_STEP: p = "Pas pas"; break; - case MSG_SORTING_VAL: p = "Tri de %d valeurs"; break; - case MSG_SPCOL_READONLY: p = "La colonne spciale %s est en lecture seulement"; break; - case MSG_SQL_CONF_ERROR: p = "Erreur SQL: SQL_CONFORMANCE"; break; - case MSG_SRCH_CLOSE_ERR: p = "Erreur la fermeture de l'Handle de recherche"; break; - case MSG_SRC_TABLE_UNDEF: p = "La table source n'est pas dfinie"; break; - case MSG_STACK_OVERFLOW: p = "Dpassement de capacit de la pile"; break; - case MSG_TABDIR_READONLY: p = "Les tables DIR sont en lecture seulement"; break; - case MSG_TABLE_NOT_OPT: p = "Table non optimisable"; break; - case MSG_TABLE_NO_INDEX: p = "La table %s n'est pas indexable"; break; - case MSG_TABLE_READ_ONLY: p = "Les tables %s sont en lecture seulement "; break; - case MSG_TABMUL_READONLY: p = "Les tables multiples sont en lecture seulement"; break; - case MSG_TOO_MANY_FIELDS: p = "Trop de champs ligne %d de %s"; break; - case MSG_TOO_MANY_JUMPS: p = "Trop de niveaux de saut"; break; - case MSG_TOO_MANY_KEYS: p = "Trop de cls (%d)"; break; - case MSG_TO_BLK_IS_NULL: p = "To Blk est nul"; break; - case MSG_TRUNCATE_ERROR: p = "Erreur en troncation: %s"; break; - case MSG_TRUNC_BY_ESTIM: p = "Tronqu par l'option Estimate"; break; - case MSG_TYPE_MISMATCH: p = "Cl et source ne sont pas du mme type"; break; - case MSG_TYPE_VALUE_ERR: p = "Colonne %s: disparit type(%s)/valeur(%s)"; break; - case MSG_UNBALANCE_QUOTE: p = "Appostrophe en trop ligne %d"; break; - case MSG_UNDEFINED_AM: p = "COLBLK %s: mthode d'accs indfinie"; break; - case MSG_UNKNOWN_EXCPT: p = "Exception non rpertorie"; break; - case MSG_UNMATCH_FIL_ARG: p = "Argument de filtre dpareill"; break; - case MSG_UPDATE_ERROR: p = "Erreur en Update sur %s"; break; - case MSG_UPD_ZIP_NOT_IMP: p = "Mise jour des tables ZDOS non encore implement"; break; - case MSG_VALSTR_TOO_LONG: p = "Valeur %s trop longue pour une chane de longueur %d"; break; - case MSG_VALTYPE_NOMATCH: p = "Disparit types de valeur"; break; - case MSG_VALUE_ERROR: p = "Colonne %s: bloc valeur nul"; break; - case MSG_VALUE_TOO_BIG: p = "Valeur %lld trop grande pour la colonne %s"; break; - case MSG_VALUE_TOO_LONG: p = "Valeur %s trop longue pour la colonne %s de longueur %d"; break; - case MSG_VAL_ALLOC_ERR: p = "Allocation impossible du noeud valeur"; break; - case MSG_VIR_NO_DELETE: p = "Delete impossible sur les tables %s"; break; - case MSG_VIR_READ_ONLY: p = "Les tables virtuelles %s sont en lecture seulement"; break; - case MSG_VOID_FIRST_ARG: p = "Le premier argument ne doit pas tre vide"; break; - case MSG_WORK_AREA: p = "Espace de travail: %s"; break; - case MSG_WRITE_SEEK_ERR: p = "Erreur de recherche en criture: %s"; break; - case MSG_WRITE_STRERROR: p = "Erreur en criture sur %s: %s"; break; - case MSG_WRITING: p = "Ecriture"; break; - case MSG_WRITING_ERROR: p = "Erreur l'criture de %s: %s"; break; - case MSG_WS_CONV_ERR: p = "Erreur de convertion de %s en WS"; break; - case MSG_XCOL_MISMATCH: p = "La colonne %s ne correspond pas l'index"; break; - case MSG_XFILE_READERR: p = "Erreur %d en lisant le fichier index"; break; - case MSG_XFILE_WRITERR: p = "Erreur en crivant le fichier index: %s"; break; - case MSG_XMLTAB_INIT_ERR: p = "Erreur d'initialisation de la table XML"; break; - case MSG_XML_INIT_ERROR: p = "Erreur d'initialisation du nouveau fichier XML"; break; - case MSG_XPATH_CNTX_ERR: p = "Le nouveau contexte XPath ne peut tre cr"; break; - case MSG_XPATH_EVAL_ERR: p = "Impossible d'valuer l'emplacement xpath '%s'"; break; - case MSG_XPATH_NOT_SUPP: p = "Xpath non support colonne %s"; break; diff --git a/storage/connect/frids.h b/storage/connect/frids.h deleted file mode 100644 index 561dbb68837..00000000000 --- a/storage/connect/frids.h +++ /dev/null @@ -1,46 +0,0 @@ - case IDS_TABLES: p = "Table Enttes"; break; - case IDS_TAB_01: p = "Catalogue"; break; - case IDS_TAB_02: p = "Schma"; break; - case IDS_TAB_03: p = "Nom"; break; - case IDS_TAB_04: p = "Type"; break; - case IDS_TAB_05: p = "Remarque"; break; - case IDS_COLUMNS: p = "Colonne Enttes"; break; - case IDS_COL_01: p = "Cat_Table"; break; - case IDS_COL_02: p = "Schem_Table"; break; - case IDS_COL_03: p = "Nom_Table"; break; - case IDS_COL_04: p = "Nom_Colonne"; break; - case IDS_COL_05: p = "Type_Donnes"; break; - case IDS_COL_06: p = "Nom_Type"; break; - case IDS_COL_07: p = "Prcision"; break; - case IDS_COL_08: p = "Longueur"; break; - case IDS_COL_09: p = "Echelle"; break; - case IDS_COL_10: p = "Base"; break; - case IDS_COL_11: p = "Nullifiable"; break; - case IDS_COL_12: p = "Remarques"; break; - case IDS_PKEY: p = "Cl Enttes"; break; - case IDS_PKY_01: p = "Cat_Table"; break; - case IDS_PKY_02: p = "Schem_Table"; break; - case IDS_PKY_03: p = "Nom_Table"; break; - case IDS_PKY_04: p = "Nom_Colonne"; break; - case IDS_PKY_05: p = "Numro_Cl"; break; - case IDS_PKY_06: p = "Nom_Cl"; break; - case IDS_STAT: p = "Stat Enttes"; break; - case IDS_STA_01: p = "Table_Catalog"; break; - case IDS_STA_02: p = "Table_Schema"; break; - case IDS_STA_03: p = "Table_Name"; break; - case IDS_STA_04: p = "Non_Unique"; break; - case IDS_STA_05: p = "Index_Qualifier"; break; - case IDS_STA_06: p = "Index_Name"; break; - case IDS_STA_07: p = "Type"; break; - case IDS_STA_08: p = "Seq_in_Index"; break; - case IDS_STA_09: p = "Column_Name"; break; - case IDS_STA_10: p = "Collation"; break; - case IDS_STA_11: p = "Cardinality"; break; - case IDS_STA_12: p = "Pages"; break; - case IDS_STA_13: p = "Filter_Condition"; break; - case IDS_DRIVER: p = "Driver Enttes"; break; - case IDS_DRV_01: p = "Description"; break; - case IDS_DRV_02: p = "Attributs"; break; - case IDS_DSRC: p = "DataSrc Enttes"; break; - case IDS_DSC_01: p = "Nom"; break; - case IDS_DSC_02: p = "Description"; break; diff --git a/storage/connect/frmsg.h b/storage/connect/frmsg.h deleted file mode 100644 index d58779b948f..00000000000 --- a/storage/connect/frmsg.h +++ /dev/null @@ -1,320 +0,0 @@ -#define MSG_ACCESS_VIOLATN "Violation accs mmoire" -#define MSG_ADD_BAD_TYPE "Ajout d'une valeur de type %s non conforme dans un tableau %s" -#define MSG_ALLOC_ERROR "Erreur d'allocation de %s" -#define MSG_ANSWER_TYPE "Rponse de type" -#define MSG_API_CONF_ERROR "Erreur SQL: API_CONFORMANCE" -#define MSG_APPL_NOT_INIT "Application non initialise" -#define MSG_ARRAY_BNDS_EXCD "Hors limite de tableau" -#define MSG_BAD_ARRAY_OPER "Les tableaux doivent utiliser l'oprateur IN" -#define MSG_BAD_ARRAY_TYPE "Type=%d invalide pour un tableau" -#define MSG_BAD_ARRAY_VAL "Les tableaux doivent avoir le mme nombre de valeurs" -#define MSG_BAD_BIN_FMT "Format invalide %c pour la colonne BIN %s" -#define MSG_BAD_BLK_ESTIM "Nombre de blocs suprieur l'estimation" -#define MSG_BAD_BLK_SIZE "Taille du bloc %d non conforme" -#define MSG_BAD_BYTE_NUM "Le nombre d'octets crits est faux" -#define MSG_BAD_BYTE_READ "Le nombre d'octets lus est faux" -#define MSG_BAD_COL_TYPE "Type invalide %s pour la colonne %s" -#define MSG_BAD_COL_XPATH "Xpath invalide colonne %s de la table HTML %s" -#define MSG_BAD_CONST_TYPE "Type=%d invalide pour une constante" -#define MSG_BAD_CONV_TYPE "Convertion de type invalide %d" -#define MSG_BAD_DATETIME "Valeur date/temps invalide" -#define MSG_BAD_DBF_FILE "Le fichier DBF %s est altr" -#define MSG_BAD_DBF_REC "Fichier DBF %s altr enregistrement %d" -#define MSG_BAD_DBF_TYPE "Type DBF %c non support colonne %s" -#define MSG_BAD_DIRECTORY "Rpertoire invalide %s: %s" -#define MSG_BAD_FIELD_RANK "Rang %d invalide pour la colonne %s" -#define MSG_BAD_FIELD_TYPE "Mauvais type de champ %s" -#define MSG_BAD_FILE_HANDLE "Handle de fichier invalide: %s" -#define MSG_BAD_FILTER "Mauvais filtre: Opc=%d B_T=%d %d Type=%d %d" -#define MSG_BAD_FILTER_CONV "Conversion filtre incorrecte, B_T=%d,%d" -#define MSG_BAD_FILTER_OP "Oprateur de filtre invalide %d" -#define MSG_BAD_FLD_FORMAT "Format invalide pour le champs %d de %s" -#define MSG_BAD_FLD_LENGTH "Champs %s trop long (%s --> %d) ligne %d de %s" -#define MSG_BAD_FREQ_SET "Spcification erronne de Freq pour la colonne %s" -#define MSG_BAD_FUNC_MODE "%s: mode invalide %d" -#define MSG_BAD_HANDLE_VAL "Valeur Handle invalide" -#define MSG_BAD_HEADER "Fichier %s: bloc en-tte altr" -#define MSG_BAD_HEAD_END "Lecture fin d'en-tte impossible" -#define MSG_BAD_INDEX_FILE "Fichier index %s corrompu" -#define MSG_BAD_LINEFLD_FMT "Format invalide ligne %d champs %d de %s" -#define MSG_BAD_LINE_LEN "Longueur ligne non gale Lrecl" -#define MSG_BAD_LRECL "Disparit lrecl table/fichier (%d,%hd)" -#define MSG_BAD_NODE_TYPE "Type noeud erron pour la table" -#define MSG_BAD_OFFSET_VAL "Nul offset invalide pour une table CSV" -#define MSG_BAD_OPEN_MODE "Mode d'ouverture invalide %d" -#define MSG_BAD_PARAM_TYPE "%.8s: Paramtre de type=%d invalide" -#define MSG_BAD_PARM_COUNT "Nombre de paramtres incohrent" -#define MSG_BAD_QUOTE_FIELD "Quote manquante dans %s champs %d ligne %d" -#define MSG_BAD_READ_NUMBER "Mauvais nombre %d de valeurs lues dans %s" -#define MSG_BAD_RECFM "Recfm type %d invalide pour DOSCOL" -#define MSG_BAD_RECFM_VAL "Valeur invalide %d de Recfm" -#define MSG_BAD_SET_CASE "La casse d'un tableau ne peut pas passer de non respect respecter" -#define MSG_BAD_SET_STRING "SetValue: appel invalide pour STRING" -#define MSG_BAD_SPECIAL_COL "Colonne spciale invalide %s" -#define MSG_BAD_SPEC_COLUMN "Colonne spciale invalide pour ce type de table" -#define MSG_BAD_TABLE_TYPE "Type invalide %s pour la table %s" -#define MSG_BAD_TYPE_LIKE "Type(%d)= %d invalide pour LIKE" -#define MSG_BAD_VALBLK_INDX "Valeur hors limites de l'index du bloc de valeurs" -#define MSG_BAD_VALBLK_TYPE "Type=%d invalide pour un bloc de valeurs" -#define MSG_BAD_VALNODE "Type %d invalide pour le noeud valeur colonne %s" -#define MSG_BAD_VALUE_TYPE "Type de valeur invalide %d" -#define MSG_BAD_VAL_UPDATE "Impossible de dterminer quelle valeur %s doit tre mise jour" -#define MSG_BAS_NS_LIST "Format invalide de la liste des espace-noms" -#define MSG_BIN_F_TOO_LONG "Valeur trop longue pour le champ %s (%d --> %d)" -#define MSG_BIN_MODE_FAIL "Echec mode binaire: %s" -#define MSG_BLKTYPLEN_MISM "Disparit types/longueurs de bloc dans SetValue" -#define MSG_BLK_IS_NULL "Blk est nul" -#define MSG_BREAKPOINT "Point de contrle" -#define MSG_BUILD_INDEX "Construction index %s sur %s" -#define MSG_CANNOT_OPEN "Ouverture impossible de %s" -#define MSG_CHSIZE_ERROR "Erreur dans chsize: %s" -#define MSG_COL_ALLOC_ERR "Allocation impossible du noeud colonne" -#define MSG_COL_ISNOT_TABLE "La colonne %s n'est pas dans la table %s" -#define MSG_COL_NOT_SORTED "La colonne %s de la table %s n'est pas trie" -#define MSG_COL_NUM_MISM "Disparit du nombre de colonnes" -#define MSG_COM_ERROR "Erreur Com" -#define MSG_CONCAT_SUBNODE "Concatnation de sous-noeuds impossible" -#define MSG_CONNECT_CANCEL "Connection interrompue par l'utilisateur" -#define MSG_CONTROL_C_EXIT "Exit par Ctrl-C" -#define MSG_DATABASE_LOADED "Base de donnes %s charge" -#define MSG_DATA_MISALIGN "Mauvais alignement pour ce type de donnes" -#define MSG_DBASE_FILE "Fichier dBASE dbf: " -#define MSG_DEF_ALLOC_ERROR "Erreur d'allocation de la classe DEF %s" -#define MSG_DEL_FILE_ERR "Erreur l'effacement de %s" -#define MSG_DEL_READ_ERROR "Delete: erreur en lecture req=%d len=%d" -#define MSG_DEL_WRITE_ERROR "Delete: erreur en criture: %s" -#define MSG_DEPREC_FLAG "Option Flag prime, utiliser Coltype" -#define MSG_DLL_LOAD_ERROR "Erreur %d au chargement du module %s" -#define MSG_DOM_NOT_SUPP "MS-DOM non support par cette version" -#define MSG_DVAL_NOTIN_LIST "Valeur %s non trouve dans la liste des valeurs distinctes de la colonne %s" -#define MSG_EMPTY_DOC "Document vide" -#define MSG_EMPTY_FILE "%s du fichier vide %s: " -#define MSG_EOF_AFTER_LINE "Fin de fichier aprs la ligne %d" -#define MSG_EOF_INDEX_FILE "EOF lisant le fichier index" -#define MSG_ERROR_IN_LSK "Erreur %d dans lseek64" -#define MSG_ERROR_IN_SFP "Erreur %d dans SetFilePointer" -#define MSG_ERR_READING_REC "Erreur lisant l'enregistrement %d de %s" -#define MSG_FAIL_ADD_NODE "L'ajout du noeud %s dans la table a chou" -#define MSG_FETCH_NO_RES "Fetch: Pas de Rsultats" -#define MSG_FIELD_TOO_LONG "Valeur trop longue pour le champs %d ligne %d" -#define MSG_FILELEN_ERROR "Erreur dans %s pour %s" -#define MSG_FILE_IS_EMPTY "Le fichier %s est vide" -#define MSG_FILE_MAP_ERR "Erreur de File mapping" -#define MSG_FILE_MAP_ERROR "CreateFileMapping %s erreur rc=%d" -#define MSG_FILE_OPEN_YET "Fichier %s dj ouvert" -#define MSG_FILE_UNFOUND "Fichier %s non trouv" -#define MSG_FLD_TOO_LNG_FOR "Champs %d trop long pour %s ligne %d de %s" -#define MSG_FLT_BAD_RESULT "Virgule flottante: rsultat inexacte" -#define MSG_FLT_DENORMAL_OP "Oprande virgule flottante non normalis" -#define MSG_FLT_INVALID_OP "Opration virgule flottante invalide" -#define MSG_FLT_OVERFLOW "Dpassement de capacit virgule flottante" -#define MSG_FLT_STACK_CHECK "Virgule flottante: Erreur de la pile" -#define MSG_FLT_UNDERFLOW "Sous-dpassement de capacit virgule flottante" -#define MSG_FLT_ZERO_DIVIDE "Virgule flottante: division par zro" -#define MSG_FMT_WRITE_NIY "L'criture des fichiers %s n'est pas encore implmente" -#define MSG_FOXPRO_FILE "Fichier FoxPro: " -#define MSG_FPUTS_ERROR "Erreur dans fputs: %s" -#define MSG_FSEEK_ERROR "Erreur dans fseek: %s" -#define MSG_FSETPOS_ERROR "Erreur dans fseek pour i=%d" -#define MSG_FTELL_ERROR "Erreur dans ftell enregistrement=%d: %s" -#define MSG_FUNCTION_ERROR "Erreur dans %s: %d" -#define MSG_FUNC_ERRNO "Erreur %d dans %s" -#define MSG_FUNC_ERROR "Erreur dans %s" -#define MSG_FUNC_ERR_S "Erreur dans %s: %s" -#define MSG_FWRITE_ERROR "Erreur dans fwrite: %s" -#define MSG_GET_DIST_VALS "Rcupration des valeurs distinctes de " -#define MSG_GET_FUNC_ERR "Erreur en recherche de la fonction %s: %s" -#define MSG_GLOBAL_ERROR "Erreur d'allocation de Global (taille=%d)\n" -#define MSG_GUARD_PAGE "Violation de page de garde" -#define MSG_GZOPEN_ERROR "gzopen %s: erreur %d sur %s" -#define MSG_ILLEGAL_INSTR "Instruction illgale" -#define MSG_ILL_FILTER_CONV "Conversion implicite illgale dans un filtre" -#define MSG_INDEX_NOT_UNIQ "L'index n'est pas Unique" -#define MSG_INDEX_YET_ON "L'index %s existe dj sur %s" -#define MSG_INDX_COL_NOTIN "La colonne index %s n'existe pas dans la table %s" -#define MSG_INDX_EXIST_YET "L'entre index existe dj" -#define MSG_INIT_FAILED "L'initialisation de %s a chou" -#define MSG_INT_COL_ERROR "Erreur interne sur la colonne index %s" -#define MSG_INT_OVERFLOW "Dpassement de capacit sur entier" -#define MSG_INT_ZERO_DIVIDE "Division entire par zro" -#define MSG_INVALID_DISP "Disposition invalide" -#define MSG_INVALID_FTYPE "SBV: Ftype %d invalide" -#define MSG_INVALID_HANDLE "Poigne invalide" -#define MSG_INVALID_OPER "Oprateur invalide %d pour %s" -#define MSG_INV_COLUMN_TYPE "Type %d Invalide pour la colonne %s" -#define MSG_INV_COL_TYPE "Type de colonne %s invalide" -#define MSG_INV_DEF_READ "Lecture diffre invalide rc=%d" -#define MSG_INV_DIRCOL_OFST "Offset invalide pour une colonne DIR" -#define MSG_INV_MAP_POS "Position mmoire invalide" -#define MSG_INV_RAND_ACC "L'accs alatoire d'une table non optimise est impossible" -#define MSG_INV_REC_POS "Position d'enregistrement invalide" -#define MSG_INV_RESULT_TYPE "Type de rsultat invalide %s" -#define MSG_INV_UPDT_TABLE "Table %s invalide pour Update" -#define MSG_IN_WITHOUT_SUB "IN ou EXISTS sans tableau ou subquery" -#define MSG_KEY_ALLOC_ERR "Erreur d'allocation d'un bloc offset cl" -#define MSG_KEY_ALLOC_ERROR "Erreur d'allocation mmoire, Klen=%d n=%d" -#define MSG_LINE_TOO_LONG "La nouvelle ligne est trop longue" -#define MSG_LIST "--Liste--" -#define MSG_LOADING_FAILED "Le chargement de %s a chou" -#define MSG_LRECL_TOO_SMALL "Lrecl trop petit (longueur en-tte = %d)" -#define MSG_MAKE_EMPTY_FILE "Gnration du fichier vide %s: %s" -#define MSG_MAKING "Gnration" -#define MSG_MALLOC_ERROR "Allocation mmoire impossible par %s" -#define MSG_MAP_VIEW_ERROR "MapViewOfFile %s erreur rc=%d" -#define MSG_MAXSIZE_ERROR "Maxsize incalculable sur table ouverte" -#define MSG_MEM_ALLOC_ERR "Erreur d'allocation mmoire, taille %s = %d" -#define MSG_MEM_ALLOC_ERROR "Erreur d'allocation mmoire" -#define MSG_MISPLACED_QUOTE "Appostrophe mal place ligne %d" -#define MSG_MISSING_ARG "Argument manquant pour l'oprateur %d" -#define MSG_MISSING_FIELD "Champs %d manquant dans %s ligne %d" -#define MSG_MISSING_FNAME "Nom du fichier manquant" -#define MSG_MISSING_NODE "Noeud %s manquant dans %s" -#define MSG_MISSING_ROWNODE "Impossible de trouver le noeud de la ligne %d" -#define MSG_MIS_TAG_LIST "Liste des balises colonne manquante" -#define MSG_MUL_MAKECOL_ERR "Erreur logique dans TABMUL::MakeCol" -#define MSG_NAME_CONV_ERR "Erreur de convertion du nom de noeud" -#define MSG_NEW_DOC_FAILED "Impossible de crer le nouveau document" -#define MSG_NEW_RETURN_NULL "NULL renvoy par New dans PlugEvalLike" -#define MSG_NEXT_FILE_ERROR "Erreur en recherche du fichier suivant. rc=%s" -#define MSG_NONCONT_EXCEPT "Exception non-continuable" -#define MSG_NOP_ZLIB_INDEX "L'indexage d'une table zlib non optimise est impossible" -#define MSG_NOT_A_DBF_FILE "Le fichier n'a pas le format dBASE dbf " -#define MSG_NOT_FIXED_LEN "Fichier %s non fixe, len=%d lrecl=%d" -#define MSG_NO_0DH_HEAD "0DH manquant en fin d'en-tte (dbc=%d)" -#define MSG_NO_ACTIVE_DB "Pas de base de donnes active" -#define MSG_NO_CHAR_FROM "Conversion de type %d en caractres impossible" -#define MSG_NO_DATE_FMT "Pas de format date pour le valblock de type %d" -#define MSG_NO_DEF_FNCCOL "Colonne fonction par dfaut introuvable" -#define MSG_NO_DEF_PIVOTCOL "Colonne pivot par dfaut introuvable" -#define MSG_NO_DIR_INDX_RD "Pas d'accs directe des tables %s" -#define MSG_NO_FEAT_SUPPORT "%s non support dans cette version" -#define MSG_NO_FLD_FORMAT "Format absent pour le champs %d de %s" -#define MSG_NO_FORMAT_COL "Type COLUMN informattable" -#define MSG_NO_FORMAT_TYPE "Le format ne peut pas tre dfini partir du type %d" -#define MSG_NO_INDEX_READ "Pas d'accs directe des tables multiples" -#define MSG_NO_KEY_COL "Pas de colonne cl trouve" -#define MSG_NO_KEY_UPDATE "Le nom des cls ne peut pas tre modifi" -#define MSG_NO_MAP_INSERT "MAP incompatible avec Insert" -#define MSG_NO_MATCHING_COL "Pas de colonne correspondant %s dans %s" -#define MSG_NO_MATCH_COL "Colonne correspondante introuvable" -#define MSG_NO_MEMORY "Mmoire pleine" -#define MSG_NO_MODE_PADDED "Mode non support pour les fichiers 'padded'" -#define MSG_NO_MUL_VCT "Les tables VCT ne peuvent pas tre multiples" -#define MSG_NO_ODBC_DELETE "Delete ne devrait pas tre appel pour les tables ODBC" -#define MSG_NO_ODBC_DIRECT "Accs directe des tables ODBC non encore implment" -#define MSG_NO_ODBC_MUL "Multiple(2) non support pour les tables ODBC" -#define MSG_NO_ODBC_SPECOL "Pas de colonne spciale ODBC" -#define MSG_NO_PART_DEL "Delete partiel des fichier %s impossible" -#define MSG_NO_PART_MAP "Mapping partiel non implment pour cet OS" -#define MSG_NO_PAR_BLK_INS "Insertion de bloc partiel impossible" -#define MSG_NO_PIV_DIR_ACC "Pas d'accs directe aux tables PIVOT" -#define MSG_NO_READ_32 "Lecture de 32 octets impossible" -#define MSG_NO_RECOV_SPACE "Espace non recouvrable dans le fichier index" -#define MSG_NO_ROWID_FOR_AM "Accs direct impossible de ROWID pour les tables de type %s" -#define MSG_NO_ROW_NODE "Le nom du Rownode n'est pas dfini" -#define MSG_NO_SECTION_NAME "Nom de section manquant" -#define MSG_NO_SEC_UPDATE "Les noms de section ne peuvent pas tre modifis" -#define MSG_NO_SETPOS_YET "SetPos pas encore implment pour les fichier %s" -#define MSG_NO_SPEC_COL "Pas de colonne spciales MYSQL" -#define MSG_NO_SUB_VAL "Pas de sous-value d'un tableau de type %d" -#define MSG_NO_TABCOL_DATA "Pas de donnes pour la table %s colonne %s" -#define MSG_NO_TABLE_DEL "Delete non autoris pour les tables %s " -#define MSG_NO_TAB_DATA "Pas de donnes pour la table %s" -#define MSG_NO_VCT_DELETE "Dltion Partielle non implmente pour les fichiers VCT" -#define MSG_NO_ZIP_DELETE "Delete sur fichier Zip non encore implement" -#define MSG_OPENING "Ouverture" -#define MSG_OPEN_EMPTY_FILE "Ouverture du fichier vide %s: %s" -#define MSG_OPEN_ERROR "Erreur d'ouverture %d en mode %d sur %s: " -#define MSG_OPEN_ERROR_IS "Erreur l'ouverture de %s: %s" -#define MSG_OPEN_MODE_ERROR "Erreur d'ouverture(%s) %d sur %s" -#define MSG_OPEN_STRERROR "Erreur l'ouverture: %s" -#define MSG_OPTBLK_RD_ERR "Erreur la lecture d'un bloc optimisation: %s" -#define MSG_OPTBLK_WR_ERR "Erreur l'criture d'un bloc optimisation: %s" -#define MSG_OPTIMIZING "Optimisation de " -#define MSG_OPT_BMAP_RD_ERR "Erreur en lecture des bitmaps d'optimisation: %s" -#define MSG_OPT_BMAP_WR_ERR "Erreur en criture des bitmaps d'optimisation: %s" -#define MSG_OPT_CANCELLED "Optimisation interrompue par l'utilisateur" -#define MSG_OPT_DVAL_RD_ERR "Erreur en lecture des valeurs distinctes: %s" -#define MSG_OPT_DVAL_WR_ERR "Erreur en criture des valeurs distinctes: %s" -#define MSG_OPT_HEAD_RD_ERR "Erreur en lecture de l'entte du fichier opt: %s" -#define MSG_OPT_HEAD_WR_ERR "Erreur en criture de l'entte du fichier opt: %s" -#define MSG_OPT_LOGIC_ERR "Erreur logique dans SetBitmap, i=%d" -#define MSG_OPT_MAX_RD_ERR "Erreur en lecture des valeurs maxi: %s" -#define MSG_OPT_MAX_WR_ERR "Erreur en criture des valeurs maxi: %s" -#define MSG_OPT_MIN_RD_ERR "Erreur en lecture des valeurs mini: %s" -#define MSG_OPT_MIN_WR_ERR "Erreur en criture des valeurs mini: %s" -#define MSG_OPT_NOT_MATCH "Le fichier opt %s n'est pas jour" -#define MSG_PAGE_ERROR "Erreur de pagination" -#define MSG_PARM_CNT_MISS "Disparit du nombre de Paramtres" -#define MSG_PREC_VBLP_NULL "ARRAY SetPrecision: Vblp est NULL" -#define MSG_PRIV_INSTR "Instruction privilgie" -#define MSG_PROCADD_ERROR "Erreur %d sur l'adresse de %s" -#define MSG_QUERY_CANCELLED "Requte interrompue par l'utilisateur" -#define MSG_RANGE_NO_JOIN "Range non compatible avec les index de jointure" -#define MSG_RC_READING "rc=%d en lecture de la table %s" -#define MSG_READY "Prt" -#define MSG_READ_ERROR "Erreur en lecture sur %s: %s" -#define MSG_READ_ONLY "Cette table protge en lecture seule ne peut tre modifie" -#define MSG_READ_SEEK_ERROR "Erreur de recherche en lecture: %s" -#define MSG_REGISTER_ERR "Enregistrement NS impossible, prfix='%s' et href='%s'" -#define MSG_REMOVE_ERROR "Erreur en supprimant %s: %s" -#define MSG_RENAME_ERROR "Erreur renommant %s en %s: %s" -#define MSG_ROWID_NOT_IMPL "RowNumber non implment pour les tables de type %s" -#define MSG_SEC_KEY_FIRST "Les sections et cls doivent tre insres en premier" -#define MSG_SEC_NAME_FIRST "Le nom de section doit tre en tte de liste en insertion" -#define MSG_SEP_IN_FIELD "Le champ %d contient le caractre sparateur" -#define MSG_SEQUENCE_ERROR "HSTMT: Allocation hors squence" -#define MSG_SETEOF_ERROR "Erreur %d dans SetEndOfFile" -#define MSG_SETRECPOS_NIY "SetRecpos non implment pour ce type de table" -#define MSG_SET_STR_TRUNC "SetValue: Chane de caractres tronque" -#define MSG_SFP_ERROR "Erreur sur SetFilePointer: %s" -#define MSG_SHARED_LIB_ERR "Erreur au chargement de la librairie partage %s: %s" -#define MSG_SINGLE_STEP "Pas pas" -#define MSG_SORTING_VAL "Tri de %d valeurs" -#define MSG_SPCOL_READONLY "La colonne spciale %s est en lecture seulement" -#define MSG_SQL_CONF_ERROR "Erreur SQL: SQL_CONFORMANCE" -#define MSG_SRCH_CLOSE_ERR "Erreur la fermeture de l'Handle de recherche" -#define MSG_SRC_TABLE_UNDEF "La table source n'est pas dfinie" -#define MSG_STACK_OVERFLOW "Dpassement de capacit de la pile" -#define MSG_TABDIR_READONLY "Les tables DIR sont en lecture seulement" -#define MSG_TABLE_NOT_OPT "Table non optimisable" -#define MSG_TABLE_NO_INDEX "La table %s n'est pas indexable" -#define MSG_TABLE_READ_ONLY "Les tables %s sont en lecture seulement " -#define MSG_TABMUL_READONLY "Les tables multiples sont en lecture seulement" -#define MSG_TOO_MANY_FIELDS "Trop de champs ligne %d de %s" -#define MSG_TOO_MANY_JUMPS "Trop de niveaux de saut" -#define MSG_TOO_MANY_KEYS "Trop de cls (%d)" -#define MSG_TO_BLK_IS_NULL "To Blk est nul" -#define MSG_TRUNCATE_ERROR "Erreur en troncation: %s" -#define MSG_TRUNC_BY_ESTIM "Tronqu par l'option Estimate" -#define MSG_TYPE_MISMATCH "Cl et source ne sont pas du mme type" -#define MSG_TYPE_VALUE_ERR "Colonne %s: disparit type(%s)/valeur(%s)" -#define MSG_UNBALANCE_QUOTE "Appostrophe en trop ligne %d" -#define MSG_UNDEFINED_AM "COLBLK %s: mthode d'accs indfinie" -#define MSG_UNKNOWN_EXCPT "Exception non rpertorie" -#define MSG_UNMATCH_FIL_ARG "Argument de filtre dpareill" -#define MSG_UPDATE_ERROR "Erreur en Update sur %s" -#define MSG_UPD_ZIP_NOT_IMP "Mise jour des tables ZDOS non encore implement" -#define MSG_VALSTR_TOO_LONG "Valeur %s trop longue pour une chane de longueur %d" -#define MSG_VALTYPE_NOMATCH "Disparit types de valeur" -#define MSG_VALUE_ERROR "Colonne %s: bloc valeur nul" -#define MSG_VALUE_TOO_BIG "Valeur %lld trop grande pour la colonne %s" -#define MSG_VALUE_TOO_LONG "Valeur %s trop longue pour la colonne %s de longueur %d" -#define MSG_VAL_ALLOC_ERR "Allocation impossible du noeud valeur" -#define MSG_VIR_NO_DELETE "Delete impossible sur les tables %s" -#define MSG_VIR_READ_ONLY "Les tables virtuelles %s sont en lecture seulement" -#define MSG_VOID_FIRST_ARG "Le premier argument ne doit pas tre vide" -#define MSG_WORK_AREA "Espace de travail: %s" -#define MSG_WRITE_SEEK_ERR "Erreur de recherche en criture: %s" -#define MSG_WRITE_STRERROR "Erreur en criture sur %s: %s" -#define MSG_WRITING "Ecriture" -#define MSG_WRITING_ERROR "Erreur l'criture de %s: %s" -#define MSG_WS_CONV_ERR "Erreur de convertion de %s en WS" -#define MSG_XCOL_MISMATCH "La colonne %s ne correspond pas l'index" -#define MSG_XFILE_READERR "Erreur %d en lisant le fichier index" -#define MSG_XFILE_WRITERR "Erreur en crivant le fichier index: %s" -#define MSG_XMLTAB_INIT_ERR "Erreur d'initialisation de la table XML" -#define MSG_XML_INIT_ERROR "Erreur d'initialisation du nouveau fichier XML" -#define MSG_XPATH_CNTX_ERR "Le nouveau contexte XPath ne peut tre cr" -#define MSG_XPATH_EVAL_ERR "Impossible d'valuer l'emplacement xpath '%s'" -#define MSG_XPATH_NOT_SUPP "Xpath non support colonne %s" diff --git a/storage/connect/frmsg1.h b/storage/connect/frmsg1.h deleted file mode 100644 index e88440a3a9c..00000000000 --- a/storage/connect/frmsg1.h +++ /dev/null @@ -1,1013 +0,0 @@ -#define MSG_ACCESS_VIOLATN "Violation accs mmoire" -#define MSG_ACT_ALLOC_FAIL "PlugInitLang: Erreur d'allocation du bloc Activity" -#define MSG_ADDVAL_ERROR "Erreur %d dans AddValue" -#define MSG_ADD_BAD_TYPE "Ajout d'une valeur de type %s non conforme dans un tableau %s" -#define MSG_ADD_NULL_DOM "Ajout de la chane %s un domaine nul" -#define MSG_ADPOS_IN_DICTP "ADPOS au travail dans User_Dictp" -#define MSG_AFTER " aprs: " -#define MSG_ALG_CHOICE_AUTO "Le choix du meilleur algorithme est automatique" -#define MSG_ALG_CHOICE_BAD "Choix d'algorithme invalide, remis AUTO" -#define MSG_ALG_CHOICE_QRY "Utilise l'algorithme 'Query'" -#define MSG_ALG_CURLY_BRK "Le choix de l'algorithme dpend des accolades externes" -#define MSG_ALLOC_ERROR "Erreur d'allocation de %s" -#define MSG_ALL_DELETED "Toutes les lignes enleves en %.2lf sec" -#define MSG_ALTER_DB_ERR "Impossible de dterminer la base de donnes modifier" -#define MSG_AMBIG_COL_QUAL "Qualificateur ambigu %s pour la colonne %s" -#define MSG_AMBIG_CORREL "Select %s.* corrlation ambigue" -#define MSG_AMBIG_SPEC_COL "Colonne spciale ambigu %s" -#define MSG_ANSWER_TYPE "Rponse de type" -#define MSG_API_CONF_ERROR "Erreur SQL: API_CONFORMANCE" -#define MSG_APPL_ACCESSIBLE "Application %s accessible" -#define MSG_APPL_ACTIVE "Application %s encore active" -#define MSG_APPL_BAD_SAVE "Application %s partiellement sauvegarde" -#define MSG_APPL_CREATED "Application %s cre" -#define MSG_APPL_IS_ACTIVE "Application dj active" -#define MSG_APPL_NOT_INIT "Application non initialise" -#define MSG_APPL_NOT_LOADED "Application non charge" -#define MSG_APPL_QUIT "Fin de l'application %s" -#define MSG_APPL_SAVED "Application %s sauvegarde" -#define MSG_APP_STILL_ACTIV "Application du langage %s encore active (non librable)" -#define MSG_AREAFILE_NOTFND "Fichier Area introuvable" -#define MSG_ARGS_SYNTAX_ERR "?SetArgs erreur de syntaxe: %s inattendu aprs %s" -#define MSG_ARG_ALREADY_SET "Argument %d dj allou" -#define MSG_ARG_NOT_AN_ATTR "L'argument n'est pas un attribut (type %d erron)" -#define MSG_ARG_OUT_CONTEXT "Argument de type @ utilis hors contexte" -#define MSG_ARG_OUT_RANGE "Argument de phrase valant %d hors limite" -#define MSG_ARG_PTR_NOSEM "Argument valant %d pointe sur un noeud sans Sem" -#define MSG_ARG_PTR_NOSEMS "Argument valant %d pointe sur un noeud sans smantique" -#define MSG_ARG_REF_LOOP "?Bouclage entre rfrences croises des arguments" -#define MSG_ARG_TWO_CONST "Le 2me argument de %s doit tre constant" -#define MSG_ARRAY_ALLOC_ERR "Erreur d'allocation mmoire dans ARRAY" -#define MSG_ARRAY_BNDS_EXCD "Hors limite de tableau" -#define MSG_ARRAY_ERROR "Erreur de fonctionnement k=%d n=%d" -#define MSG_ATTRIBUTE_ERROR "Erreur rgle %u attribut %s: " -#define MSG_ATT_NOT_CASE "Mauvaise valeur %d pour attribut (pas une CaseValue)" -#define MSG_ATT_POSCODE_BIG "Code attribut %d trop grand (max=%d)" -#define MSG_AVGLEN_ERROR "avglen doit tre entre %d et %d" -#define MSG_BAD_AGGREG_FUNC "Fonction aggrge %d non supporte" -#define MSG_BAD_ARGTYPES "Argument de type invalide pour %s" -#define MSG_BAD_ARGUMENTS "Argument not attachs pour %s" -#define MSG_BAD_ARG_NUM "Nombre d'arguments invalide %d" -#define MSG_BAD_ARG_TYPE "Type d'argument %d invalide" -#define MSG_BAD_ARRAY_OPER "Les tableaux doivent utiliser l'oprateur IN" -#define MSG_BAD_ARRAY_TYPE "Type=%d invalide pour un tableau" -#define MSG_BAD_ARRAY_VAL "Les tableaux doivent avoir le mme nombre de valeurs" -#define MSG_BAD_BIN_FMT "Format invalide %c pour la colonne BIN %s" -#define MSG_BAD_BLK_ESTIM "Nombre de blocs suprieur l'estimation" -#define MSG_BAD_BLK_SIZE "Taille du bloc %d non conforme" -#define MSG_BAD_BYTE_NUM "Le nombre d'octets crits est faux" -#define MSG_BAD_BYTE_READ "Le nombre d'octets lus est faux" -#define MSG_BAD_CARDINALITY "Appel invalide de Cardinality pour une table multiple" -#define MSG_BAD_CASE_SPEC "Min/Maj: spcification %c incorrecte, recommencez: " -#define MSG_BAD_CHAR_SPEC "Spcification '%s' invalide pour caractre" -#define MSG_BAD_CHECK_TYPE "Sous-type %d invalide pour CheckColumn" -#define MSG_BAD_CHECK_VAL "Valeur pour Check invalide '%s'" -#define MSG_BAD_COLCRT_ARG "COLCRT: Arg invalide (type=%hd, domain=%hd)" -#define MSG_BAD_COLDEF_TYPE "Coldefs: type illgal %d" -#define MSG_BAD_COLIST_ITEM "Elment invalide dans une Colist" -#define MSG_BAD_COLIST_TYPE "Mauvais type=%d pour une Colist" -#define MSG_BAD_COLSIZE "Colsize %d trop petit pour cette base de donnes" -#define MSG_BAD_COL_ENTRY "Entre invalide pour la colonne %s" -#define MSG_BAD_COL_FORMAT "Type de formattage %d invalide pour une colonne" -#define MSG_BAD_COL_IN_FILT "Colonne incorrecte dans un filtre" -#define MSG_BAD_COL_QUALIF "Qualificateur invalide %s pour la colonne %s" -#define MSG_BAD_COL_TYPE "Type invalide %s pour la colonne %s" -#define MSG_BAD_COL_XPATH "Xpath invalide colonne %s de la table HTML %s" -#define MSG_BAD_COMPARE_OP "Oprateur de comparaison %d invalide" -#define MSG_BAD_CONST_TYPE "Type=%d invalide pour une constante" -#define MSG_BAD_CONV_TYPE "Convertion de type invalide %d" -#define MSG_BAD_CORREL "Select %s.* corrlation absente" -#define MSG_BAD_DATETIME "Valeur date/temps invalide" -#define MSG_BAD_DATE_OPER "Oprateur de date inattendu %d" -#define MSG_BAD_DBF_FILE "Le fichier DBF %s est altr" -#define MSG_BAD_DBF_REC "Fichier DBF %s altr enregistrement %d" -#define MSG_BAD_DBF_TYPE "Type DBF %c non support" -#define MSG_BAD_DEF_ARG "Argument invalide pour INDEXDEF (type=%hd, domain=%hd)" -#define MSG_BAD_DEF_READ "EOF inattendue en lecture diffre" -#define MSG_BAD_DEF_TYPE "Type de colonne invalide" -#define MSG_BAD_DIRECTORY "Rpertoire invalide %s: %s" -#define MSG_BAD_DIST_JN_FIL "Filtre de jointure distincte invalide" -#define MSG_BAD_DIST_JOIN "Spcification invalide de jointure distincte" -#define MSG_BAD_DOM_COL_DEF "Dfinition de colonnes invalide pour un domaine" -#define MSG_BAD_DOM_VALUE "La valeur %d n'appartient pas au domaine" -#define MSG_BAD_EDIT_INIT "Coparm: dition %s initialise improprement" -#define MSG_BAD_EVAL_TYPE "Fonction scalaire de type=%d invalide" -#define MSG_BAD_EXEC_MODE "Mode d'excution invalide '%s'" -#define MSG_BAD_EXP_ARGTYPE "Argument de type %d invalide pour une expression" -#define MSG_BAD_EXP_OPER "Oprateur=%d invalide pour expression" -#define MSG_BAD_FETCH_RC "Code retour inattendu de Fetch %d" -#define MSG_BAD_FIELD_FMT "Format de champ invalide %c pour %s" -#define MSG_BAD_FIELD_RANK "Rang %d invalide pour la colonne %s" -#define MSG_BAD_FIELD_TYPE "Mauvais type de champ %s" -#define MSG_BAD_FILE_HANDLE "Handle de fichier invalide: %s" -#define MSG_BAD_FILE_LIST "La section liste de fichiers est errone" -#define MSG_BAD_FILTER "Mauvais filtre: Opc=%d B_T=%d %d Type=%d %d" -#define MSG_BAD_FILTER_CONV "Conversion filtre incorrecte, B_T=%d,%d" -#define MSG_BAD_FILTER_LINK "Oprateur de chanage illgal %d" -#define MSG_BAD_FILTER_OP "Oprateur de filtre invalide %d" -#define MSG_BAD_FILTEST_OP "Oprateur invalide %d %d pour FilTest" -#define MSG_BAD_FLD_FORMAT "Format invalide pour le champs %d de %s" -#define MSG_BAD_FLD_LENGTH "Champs %s trop long (%s --> %d) ligne %d de %s" -#define MSG_BAD_FLOAT_CONV "Convertion invalide d'un tableau flottant" -#define MSG_BAD_FPARM_NEXT "Coparm: FPARM avec Next non nul" -#define MSG_BAD_FREQ_SET "Spcification erronne de Freq pour la colonne %s" -#define MSG_BAD_FUNC_ARG "Funcarg de type %d non implment" -#define MSG_BAD_FUNC_ARGTYP "Mauvais type d'argument=%d pour une fonction" -#define MSG_BAD_FUNC_MODE "%s: mode invalide %d" -#define MSG_BAD_GENRE "Genre est invalide" -#define MSG_BAD_GETVIEW_RET "GetView: type de retour %d invalide" -#define MSG_BAD_HANDLE_VAL "Valeur Handle invalide" -#define MSG_BAD_HAV_FILTER "Filtre Having sur une requte non groupe" -#define MSG_BAD_HAV_FILTYPE "Filtre invalide pour clause Having" -#define MSG_BAD_HEADER "Fichier %s: bloc en-tte altr" -#define MSG_BAD_HEADER_VAL "Valeur invalide pour Header" -#define MSG_BAD_HEAD_END "Lecture fin d'en-tte impossible" -#define MSG_BAD_INDEX_COL "Colonne %s invalide pour index %s" -#define MSG_BAD_INDEX_DEF "Dfinition invalide pour index %s" -#define MSG_BAD_INDEX_FILE "Fichier index %s corrompu" -#define MSG_BAD_INDEX_PART "Dfinition colonne invalide pour index %s" -#define MSG_BAD_INPUT "Entre incorrecte" -#define MSG_BAD_IN_ARGTYPE "Argument de type invalide pour l'oprateur IN" -#define MSG_BAD_IN_ENDING "Erreur: fin de chane IN invalide" -#define MSG_BAD_IN_STRING "La chane IN commence ou finie par des caractres invalides %c ... %c" -#define MSG_BAD_JCOL_TYPE "Erreur logique JCT: disparit des types colonnes" -#define MSG_BAD_JOIN_EXP "Expression invalide pour une jointure" -#define MSG_BAD_JOIN_FILTER "Filtre de jointure invalide" -#define MSG_BAD_JOIN_OP "Oprateur de joint invalide %d" -#define MSG_BAD_LANG_SIZE "Le fichier langage a une mauvaise taille %d" -#define MSG_BAD_LINEFLD_FMT "Format invalide ligne %d champs %d de %s" -#define MSG_BAD_LINE_LEN "Longueur ligne non gale Lrecl" -#define MSG_BAD_LIST_TYPE "Type de liste invalide %d" -#define MSG_BAD_LOCALE "Locale invalide %s" -#define MSG_BAD_LOCDFON_ARG "Mauvais paramtre pour LOCDFON" -#define MSG_BAD_LOCNODE_USE "Usage inattendu de LOCNODE" -#define MSG_BAD_LRECL "Disparit lrecl table/fichier (%d,%hd)" -#define MSG_BAD_MAX_HAVING "MAXTMP trop petit pour Having" -#define MSG_BAD_MAX_NREC "MaxRec=%d ne correspond pas MaxBlk=%d Nrec=%d" -#define MSG_BAD_MAX_PARAM "Mauvais paramtres pour spcifier une valeur maximum" -#define MSG_BAD_MAX_SETTING "Mauvaise valeur '%c' pour max" -#define MSG_BAD_MERGE_TYPE "Le type %d ne pas tre intercall" -#define MSG_BAD_NODE_TYPE "Type noeud erron pour la table" -#define MSG_BAD_OFFSET_VAL "Nul offset invalide pour une table CSV" -#define MSG_BAD_OPEN_MODE "Mode d'ouverture invalide %d" -#define MSG_BAD_OPERATOR "Oprateur invalide %s" -#define MSG_BAD_ORDER_MODE "Mode de tri %c invalide" -#define MSG_BAD_ORDER_TYPE "Tri sur objet de type=%d invalide" -#define MSG_BAD_OUTER_JOIN "Jointure externe invalide sur table enfant" -#define MSG_BAD_PAD_ARGTYP "Argument de type invalide pour Pad ou Justify" -#define MSG_BAD_PARAMETERS "%.8s: Mauvais paramtres" -#define MSG_BAD_PARAM_TYPE "%.8s: Paramtre de type=%d invalide" -#define MSG_BAD_PARM_COUNT "Nombre de paramtres incohrent" -#define MSG_BAD_PHASE_NUM "Numro de phrase %d hors limite" -#define MSG_BAD_PHRASE_NB "numro de phrase hors limite %d rc=%d\n" -#define MSG_BAD_POS_CODE "POS_code invalide %d" -#define MSG_BAD_POS_TYPE "Type de POS_code invalide %d" -#define MSG_BAD_PROJNUM "Mauvais projnum %d pour la colonne %s" -#define MSG_BAD_QUERY_OPEN "Mode invalide %d pour l'ouverture d'une requte" -#define MSG_BAD_QUERY_TYPE "Type de requte %d invalide pour %s" -#define MSG_BAD_QUOTE_FIELD "Quote manquante dans %s champs %d ligne %d" -#define MSG_BAD_READ_NUMBER "Mauvais nombre %d de valeurs lues dans %s" -#define MSG_BAD_RECFM "Recfm type %d invalide pour DOSCOL" -#define MSG_BAD_RECFM_VAL "Valeur invalide %d de Recfm" -#define MSG_BAD_RESULT_TYPE "Mauvais type de rsultat %d pour %s" -#define MSG_BAD_RETURN_TYPE "Type de retour %d incorrect" -#define MSG_BAD_ROW_VALIST "Liste de valeurs invalide pour ROW" -#define MSG_BAD_ROW_VALNB "Nombre de valeurs ingal dans la liste" -#define MSG_BAD_SCF_ARGTYPE "Argument %d de type=%s invalide pour %s" -#define MSG_BAD_SEM_DOMAIN "Domain .%d invalide" -#define MSG_BAD_SETTINGS "Certaines spcifications sont incompatibles avec le type de la table" -#define MSG_BAD_SET_CASE "La casse d'un tableau ne peut pas passer de non respect respecter" -#define MSG_BAD_SET_STRING "SetValue: appel invalide pour STRING" -#define MSG_BAD_SET_TYPE "Set type %hd invalide" -#define MSG_BAD_SPECIAL_CMD "Commande spciale invalide" -#define MSG_BAD_SPECIAL_COL "Colonne spciale invalide %s" -#define MSG_BAD_SPEC_COLUMN "Colonne spciale invalide pour ce type de table" -#define MSG_BAD_SQL_PARAM "Paramtre SQL invalide pour FindColblk" -#define MSG_BAD_SUBLST_TYPE "Coparm: type %d de sous-liste invalide" -#define MSG_BAD_SUBSEL_IN_X "Sub-select invalide pour une expression" -#define MSG_BAD_SUBSEL_TYPE "Type %d invalide retourn de Sub-Select" -#define MSG_BAD_SUB_RESULT "Rsultat indfini de fonction Sub-Select" -#define MSG_BAD_SUB_SELECT "Sub-select invalide comme argument de fonction" -#define MSG_BAD_TABLE_LINE "Ligne '%s' illgale ou tronque dans la section Tables" -#define MSG_BAD_TABLE_LIST "Table %s absente de la liste des tables" -#define MSG_BAD_TABLE_TYPE "Type invalide %s pour la table %s" -#define MSG_BAD_TEST_TYPE "BlockTest sur tableau: types dpareills %s %s" -#define MSG_BAD_TRIM_ARGTYP "Argument de type invalide pour Trim" -#define MSG_BAD_TYPE_FOR_IN "Types d'argument incompatibles pour la fonction IN" -#define MSG_BAD_TYPE_FOR_S "Type incorrecte %d pour %s(%d)" -#define MSG_BAD_TYPE_LIKE "Type(%d)= %d invalide pour LIKE" -#define MSG_BAD_UPD_COR "Le qualificateur %s de la colonne %s ne se refre pas la table mise jour %s" -#define MSG_BAD_USERBLK_LEN "Mauvaise longueur l'criture du bloc utilisateur" -#define MSG_BAD_USETEMP "Usetemp invalide '%s'" -#define MSG_BAD_USETEMP_VAL "Valeur pour Usetemp invalide %d" -#define MSG_BAD_VALBLK_INDX "Valeur hors limites de l'index du bloc de valeurs" -#define MSG_BAD_VALBLK_TYPE "Type=%d invalide pour un bloc de valeurs" -#define MSG_BAD_VALNODE "Type %d invalide pour le noeud valeur colonne %s" -#define MSG_BAD_VALUE_TYPE "Type de valeur invalide %d" -#define MSG_BAD_VAL_UPDATE "Impossible de dterminer quelle valeur %s doit tre mise jour" -#define MSG_BAD_VIEW_OPEN "Mode invalide %d pour l'ouverture d'une View" -#define MSG_BAD_XMODE_VAL "Mode d'excution %d invalide" -#define MSG_BAD_XOBJ_TYPE "Mauvais type de Xobject %d" -#define MSG_BAS_NS_LIST "Format invalide de la liste des espace-noms" -#define MSG_BIN_F_TOO_LONG "Valeur trop longue pour le champ %s (%d --> %d)" -#define MSG_BIN_MODE_FAIL "Echec mode binaire: %s" -#define MSG_BLKTYPLEN_MISM "Disparit types/longueurs de bloc dans SetValue" -#define MSG_BLK_IS_NULL "Blk est nul" -#define MSG_BLOCK_NO_MATCH "Bloc non correspondant" -#define MSG_BREAKPOINT "Point de contrle" -#define MSG_BUFF_TOO_SMALL "GetColData: Buffer trop petit" -#define MSG_BUFSIZE_ERROR "Erreur en recherchant la taille du buffer" -#define MSG_BUILDING_GROUPS "Formation des groupes" -#define MSG_BUILD_DIST_GRPS "Formation des groupes distinctes" -#define MSG_BUILD_INDEX "Construction index %s sur %s" -#define MSG_BXP_NULL "Bxp nul dans PUTFON" -#define MSG_CANNOT_OPEN "Ouverture impossible de %s" -#define MSG_CD_ONE_STEP "Count Distinct doit tre excut en une seule tape" -#define MSG_CD_ORDER_ERROR "Erreur de tri dans Count Distinct" -#define MSG_CHECKING_ROWS "Test des lignes mettre jour" -#define MSG_CHECK_LEVEL "Niveau de vrification fix %u" -#define MSG_CHSIZE_ERROR "Erreur dans chsize: %s" -#define MSG_CLN_NOT_IN_JOIN "La colonne C%d n'est pas dans le join" -#define MSG_CNTDIS_COL_LOST "Colonne du Count Distinct perdue" -#define MSG_COLIST_BAD_TYPE "Type=%d invalide pour Colist" -#define MSG_COLNAM_TOO_LONG "Nom de colonne trop long" -#define MSG_COLSEC_TOO_BIG "Section colonne trop grande, table %s (%d)" -#define MSG_COLS_REDUCED " (rduit par Maxcol)" -#define MSG_COLUMN_ERROR "Erreur de colonne" -#define MSG_COLUMN_MISMATCH "Colonne %s dpareille" -#define MSG_COLUMN_NOT_KEY "La colonne jointe R%d.%s n'est pas une cl" -#define MSG_COL_ALLOC_ERR "Allocation impossible du noeud colonne" -#define MSG_COL_ALLOC_ERROR "Erreur d'allocation mmoire pour la colonne %d" -#define MSG_COL_HAS_NO_DEF "La colonne %s n'est pas dfinie" -#define MSG_COL_INVAL_TABLE "La colonne %s.%s n'existe pas dans la table %s alias %s" -#define MSG_COL_ISNOT_TABLE "La colonne %s n'est pas dans la table %s" -#define MSG_COL_NB_MISM "Le nombre de colonnes ne correspond pas" -#define MSG_COL_NOTIN_GRPBY "La colonne %s n'est pas dans la liste de Group By" -#define MSG_COL_NOTIN_TABLE "La colonne %s n'est dans aucune table" -#define MSG_COL_NOTIN_UPDT "%s n'appartient pas la table mise jour %s" -#define MSG_COL_NOT_CODED "La colonne %s n'est pas codifie" -#define MSG_COL_NOT_EXIST "La colonne %s n'existe pas dans %s" -#define MSG_COL_NOT_FOUND "La colonne %s n'est pas dans la table %s" -#define MSG_COL_NOT_IN_DB "La colonne %s de la table %s n'est pas dans la base de donnes" -#define MSG_COL_NOT_IN_JOIN "La colonne %s n'est pas dans le join" -#define MSG_COL_NOT_SORTED "La colonne %s de la table %s n'est pas trie" -#define MSG_COL_NUM_MISM "Disparit du nombre de colonnes" -#define MSG_COL_USED_TWICE "Colonne %s utilise deux fois ???" -#define MSG_COMPUTE_ERROR "Erreur dans Compute, op=%d" -#define MSG_COMPUTE_NIY "Compute non implment pour TOKEN" -#define MSG_COMPUTING "Calculs en cours" -#define MSG_COMPUTING_DIST "Comptage des valeurs distinctes" -#define MSG_COMPUTING_FUNC "Calcul de(s) fonction(s)" -#define MSG_COM_ERROR "Erreur Com" -#define MSG_CONCAT_SUBNODE "Concatnation de sous-noeuds impossible" -#define MSG_CONNECTED "Connect" -#define MSG_CONNECT_CANCEL "Connection interrompue par l'utilisateur" -#define MSG_CONNECT_ERROR "Erreur %d se connectant %s" -#define MSG_CONN_CLOSED "%s(%d) ferme" -#define MSG_CONN_CREATED "Connexion %s cre" -#define MSG_CONN_DROPPED "Connexion %s supprime" -#define MSG_CONN_OPEN "%s(%d) ouverte (%s)" -#define MSG_CONN_SUC_OPEN "%s(%d) ouverte avec succs" -#define MSG_CONTROL_C_EXIT "Exit par Ctrl-C" -#define MSG_COPY_BAD_PHASE "Copie de liste invalide en phase %d" -#define MSG_COPY_INV_TYPE "Coparm: type non support %d" -#define MSG_CORREL_NO_QRY "Les sous-requtes corrles ne peuvent pas tre de type QRY" -#define MSG_CREATED_PLUGDB " Cr par PlugDB %s " -#define MSG_CURSOR_SET "Curseur remis %d" -#define MSG_DATABASE_ACTIVE "Base de donnes %s active" -#define MSG_DATABASE_LOADED "Base de donnes %s charge" -#define MSG_DATA_IS_NULL "ExecSpecialCmd: data est NULL" -#define MSG_DATA_MISALIGN "Mauvais alignement pour ce type de donnes" -#define MSG_DBASE_FILE "Fichier dBASE dbf: " -#define MSG_DB_ALREADY_DEF "Base de donnes %s dj dfinie" -#define MSG_DB_ALTERED "Base de donnes modifie" -#define MSG_DB_CREATED "Base de donnes %s cre" -#define MSG_DB_NOT_SPEC "Base de donnes non spcifie" -#define MSG_DB_REMOVED "Base de donnes %s retire de la liste" -#define MSG_DB_SORT_ERROR "Erreur de tri DB" -#define MSG_DB_STOPPED "Arrt de la base de donnes %s" -#define MSG_DEBUG_NOT_ACTIV "Mode Debug inactif" -#define MSG_DEBUG_SET_INV "Invalide pour Debug: %c" -#define MSG_DEF_ALLOC_ERROR "Erreur d'allocation de la classe DEF %s" -#define MSG_DELETING_ROWS "Suppression des lignes" -#define MSG_DEL_FILE_ERR "Erreur l'effacement de %s" -#define MSG_DEL_READ_ERROR "Delete: erreur en lecture req=%d len=%d" -#define MSG_DEL_WRITE_ERROR "Delete: erreur en criture: %s" -#define MSG_DEPREC_FLAG "Option Flag prime, utiliser Coltype" -#define MSG_DICTIONARY "Dictionnaire " -#define MSG_DIRECT_VARTOK "Accs direct aux rgles du Variable Token non implment" -#define MSG_DISCONNECTED "Dconnect" -#define MSG_DISTINCT_ERROR "Plus d'un lment fonctionel DISTINCT" -#define MSG_DISTINCT_ROWS "Slection des lignes distinctes" -#define MSG_DISTINCT_VALUES "Extraction des valeurs distinctes" -#define MSG_DIS_NOHEAD_JOIN "Jointure distincte sur une table non en tte" -#define MSG_DLL_LOAD_ERROR "Erreur %d au chargement du module %s" -#define MSG_DOMAIN_EMPTY "Le domaine %s est vide" -#define MSG_DOMAIN_ERROR "Colonne %s: disparit domaine(%s)/valeur(%s)" -#define MSG_DOMAIN_FULL "Le domaine %s est plein (max=%d)" -#define MSG_DOM_FILE_ERROR "Fichier domain %s introuvable" -#define MSG_DOM_NOT_SUPP "MS-DOM non support par cette version" -#define MSG_DOM_OPEN_ERROR "Erreur d'ouverture du domaine: %s" -#define MSG_DOM_READ_ERROR "Erreur %d en lecture de domaine: %s" -#define MSG_DOM_READ_ONLY "La table domaine %s est en lecture seulement" -#define MSG_DOM_WRITE_ERROR "Erreur %d en criture de domaine: %s" -#define MSG_DONE "Effectu, rc=%d" -#define MSG_DOSALMEM_NOMEM "Erreur d'allocation, pas assez de mmoire" -#define MSG_DROP_DB_ERR "Echec du Drop sur le base de donnes %s" -#define MSG_DSORT_LOG_ERROR "Kindex: Erreur logique de tri distincte" -#define MSG_DUMMY_NO_COLS "Les tables DUMMY ne peuvent pas avoir de colonne" -#define MSG_DUPLICAT_COUNT "Count sur plus d'une colonne" -#define MSG_DUP_COL_NAME "La colonne %s existe en double" -#define MSG_DUP_PROJNUM "Non unique projnum %d pour la colonne %s" -#define MSG_DVAL_NOTIN_LIST "Valeur %s non trouve dans la liste des valeurs distinctes de la colonne %s" -#define MSG_EMPTY_DOC "Document vide" -#define MSG_EMPTY_FILE "%s du fichier vide %s: " -#define MSG_ENDSTR_MISMATCH "Fins de chane et de noeud ne correspondent pas" -#define MSG_END_OF_DELETE "%d ligne(s) enleve(s) en %.2lf sec" -#define MSG_END_OF_INSERT "%d ligne(s) insre(s) en %.2lf sec" -#define MSG_END_OF_QUERY "%d ligne(s) extraite(s) en %.2lf sec" -#define MSG_END_OF_UPDATE "%d ligne(s) modifie(s) en %.2lf sec" -#define MSG_EOF_AFTER_LINE "Fin de fichier aprs la ligne %d" -#define MSG_EOF_INDEX_FILE "EOF lisant le fichier index" -#define MSG_ERASED " et efface" -#define MSG_ERASE_FAILED " (chec de l'effacement)" -#define MSG_ERROR "Erreur" -#define MSG_ERROR_IN_LSK "Erreur %d dans lseek64" -#define MSG_ERROR_IN_SFP "Erreur %d dans SetFilePointer" -#define MSG_ERROR_NO_PARM "Paramtre absent (valide seulement pour %.8s.1 et %.8s.5)" -#define MSG_ERROR_OPENING "Erreur l'ouverture de : " -#define MSG_ERR_NUM_GT_MAX "Erreur: Numval (%d) plus grand que Maxnum (%d)" -#define MSG_ERR_READING_REC "Erreur lisant l'enregistrement %d de %s" -#define MSG_ERR_RET_RULE "Retour erreur, rgle=%u" -#define MSG_ERR_RET_TYPE "Retour erreur, type=%d" -#define MSG_EVAL_EXPIRED "Cette version d'valuation est expire" -#define MSG_EVAL_ONLY "L'utilisation de cette Dll est pour valuation seulement" -#define MSG_EXECUTING "Excution" -#define MSG_EXECUTION_ERROR "Erreur d'excution" -#define MSG_EXEC_MODE_IS "Le mode d'excution est %s" -#define MSG_EXEC_MODE_RESET ". Mode remis Execute" -#define MSG_EXEC_MODE_SET "Mode d'excution fix %s" -#define MSG_EXIT_EVAL_ERR "Erreur pendant l'valuation de Exit" -#define MSG_EXIT_FROM_LANG "Fin du langage %s version %d.%d" -#define MSG_FAIL_ADD_NODE "L'ajout du noeud %s dans la table a chou" -#define MSG_FETCHING_DATA "Recherche des donnes" -#define MSG_FETCHING_ROWS "Recherche des lignes" -#define MSG_FETCH_NO_RES "Fetch: Pas de Rsultats" -#define MSG_FIELD_TOO_LONG "Valeur trop longue pour le champs %d ligne %d" -#define MSG_FILELEN_ERROR "Erreur dans %s pour %s" -#define MSG_FILE_CLOSE_ERR "Erreur %d la fermeture du fichier" -#define MSG_FILE_IS_EMPTY "Le fichier %s est vide" -#define MSG_FILE_MAP_ERR "Erreur de File mapping" -#define MSG_FILE_MAP_ERROR "CreateFileMapping %s erreur rc=%d" -#define MSG_FILE_NOT_FOUND "Fichier %s introuvable" -#define MSG_FILE_OPEN_YET "Fichier %s dj ouvert" -#define MSG_FILE_UNFOUND "Fichier %s non trouv" -#define MSG_FILGRP_NO_TABLE "Table %d manquante pour groupe filtre" -#define MSG_FILTER_ATTACH "Filtre pass Attach" -#define MSG_FILTER_NO_TABLE "Filtre: premire table manquante" -#define MSG_FIND_BAD_TYPE "Recherche dans un tableau: type non conforme %s %s" -#define MSG_FIX_OVFLW_ADD "Dpassement de capacit en addition" -#define MSG_FIX_OVFLW_TIMES "Dpassement de capacit en mutiplication" -#define MSG_FIX_UNFLW_ADD "Sous dpassement de capacit en addition" -#define MSG_FIX_UNFLW_TIMES "Sous dpassement de capacit en multiplication" -#define MSG_FLD_TOO_LNG_FOR "Champs %d trop long pour %s ligne %d de %s" -#define MSG_FLTST_NO_CORREL "FilTest ne devrait tre appel que pour les sous-requtes corrles" -#define MSG_FLT_BAD_RESULT "Virgule flottante: rsultat inexacte" -#define MSG_FLT_DENORMAL_OP "Oprande virgule flottante non normalis" -#define MSG_FLT_INVALID_OP "Opration virgule flottante invalide" -#define MSG_FLT_OVERFLOW "Dpassement de capacit virgule flottante" -#define MSG_FLT_STACK_CHECK "Virgule flottante: Erreur de la pile" -#define MSG_FLT_UNDERFLOW "Sous-dpassement de capacit virgule flottante" -#define MSG_FLT_ZERO_DIVIDE "Virgule flottante: division par zro" -#define MSG_FMT_WRITE_NIY "L'criture des fichiers %s n'est pas encore implmente" -#define MSG_FNC_NOTIN_SLIST "Fonction de tri absente de la liste de slection" -#define MSG_FORMAT_ERROR "Erreur de formattage" -#define MSG_FOXPRO_FILE "Fichier FoxPro: " -#define MSG_FPUTS_ERROR "Erreur dans fputs: %s" -#define MSG_FSBPARP_NULL "PUTFON: fsbparp est nul" -#define MSG_FSEEK_ERROR "Erreur dans fseek: %s" -#define MSG_FSETPOS_ERROR "Erreur dans fseek pour i=%d" -#define MSG_FTELL_ERROR "Erreur dans ftell enregistrement=%d: %s" -#define MSG_FUNCTION_ERROR "Erreur dans %s: %d" -#define MSG_FUNC_ERRNO "Erreur %d dans %s" -#define MSG_FUNC_ERROR "Erreur dans %s" -#define MSG_FUNC_ERR_S "Erreur dans %s: %s" -#define MSG_FUNC_REF_DEL "Rfrence une fonction dfinie (rgle %d) qui a t supprime" -#define MSG_FWRITE_ERROR "Erreur dans fwrite: %s" -#define MSG_GETCWD_ERR_NO "?getcwd %s errno=%d" -#define MSG_GETFILESIZE_ERR "Erreur %d dans GetFileSize" -#define MSG_GET_DIST_VALS "Rcupration des valeurs distinctes de " -#define MSG_GET_ERROR "Erreur dans %s (colonne %d)" -#define MSG_GET_FUNC_ERR "Erreur en recherche de la fonction %s: %s" -#define MSG_GET_NAME_ERR "Erreur en retrouvant le nom d'une table SYS" -#define MSG_GLOBAL_ERROR "Erreur d'allocation de Global (taille=%d)\n" -#define MSG_GRAM_ALLOC_ERR "Erreur d'allocation dans Grammar Up" -#define MSG_GRAM_MISMATCH "Avertissement: version de GRAMMAR perime (sauv sous GRAMMAR v%u)" -#define MSG_GRAM_SUBSET_ERR "Erreur d'initialisation du dictionnaire de la grammaire" -#define MSG_GRBY_TAB_NOTIMP "Group by avec tables jointes non implment" -#define MSG_GROUPBY_NOT_ALL "Group By doit inclure toutes les slections non-fonctionnelles" -#define MSG_GROUP_ON_FUNC "Group by invalide sur colonne fonctionnelle" -#define MSG_GRP_COL_MISM "Disparit colonne des groupes" -#define MSG_GRP_LIST_MISMAT "Le groupement ne couvre pas la liste de slection" -#define MSG_GUARD_PAGE "Violation de page de garde" -#define MSG_GZOPEN_ERROR "gzopen %s: erreur %d sur %s" -#define MSG_GZPUTS_ERROR "Erreur dans gzputs: %s" -#define MSG_HANDLE_IS_NULL "%s est NULL: erreur code: %d" -#define MSG_HARRY_COMP_NIY "Compute non implment pour les chanes codes" -#define MSG_HAVING_FILTER "Traitement du Filtre Having" -#define MSG_HBUF_TOO_SMALL "Buffer(%d) trop petit pour entte(%d)" -#define MSG_HEAD_OPEN_ERROR "Erreur l'ouverture du fichier header" -#define MSG_HEAD_READ_ERROR "Erreur en lecture du fichier header %s" -#define MSG_HEAD_WRITE_ERR "Erreur en criture du fichier header" -#define MSG_HI_OFFSET_ERR "Offset suprieur non nul" -#define MSG_HUGE_DEFAULT "Huge est %d par dfault" -#define MSG_HUGE_WARNING_1 "Mmoire Huge non compatible 16-bit pour %d\n" -#define MSG_HUGE_WARNING_2 "Rsultats imprvisibles possibles\n" -#define MSG_IDLE "Au repos" -#define MSG_ILLEGAL_INSTR "Instruction illgale" -#define MSG_ILL_FILTER_CONV "Conversion implicite illgale dans un filtre" -#define MSG_INDEX_CREATED "Index %s cr sur %s" -#define MSG_INDEX_DEF_ERR "Erreur sauvegardant l'index dfinition pour %s" -#define MSG_INDEX_DROPPED "Index %s supprim de %s" -#define MSG_INDEX_INIT_ERR "Echec de l'initialisation de l'index %s" -#define MSG_INDEX_NOT_DEF "Index %s non dfini" -#define MSG_INDEX_NOT_UNIQ "L'index n'est pas Unique" -#define MSG_INDEX_ONE_SAVE "Les index sont sauvegards dans un fichier unique" -#define MSG_INDEX_SEP_SAVE "Les index sont sauvegards dans des fichiers spars" -#define MSG_INDEX_YET_ON "L'index %s existe dj sur %s" -#define MSG_INDX_ALL_DROP "Tous les index de %s supprims" -#define MSG_INDX_COL_NOTIN "La colonne index %s n'existe pas dans la table %s" -#define MSG_INDX_EXIST_YET "L'entre index existe dj" -#define MSG_INIT_ERROR "Erreur l'initialisation de %s" -#define MSG_INIT_FAILED "L'initialisation de %s a chou" -#define MSG_INPUT "Entre: " -#define MSG_INPUT_KEYBD_YET "L'entre est dj au clavier" -#define MSG_INSERTING "Insertion: " -#define MSG_INSERT_ERROR "Insert erreur: usage multiple du fichier %s" -#define MSG_INSERT_MISMATCH "Les listes colonne et valeur ne correspondent pas" -#define MSG_INTERNAL "interne" -#define MSG_INT_COL_ERROR "Erreur interne sur la colonne index %s" -#define MSG_INT_OVERFLOW "Dpassement de capacit sur entier" -#define MSG_INT_ZERO_DIVIDE "Division entire par zro" -#define MSG_INVALID_BIP "Bip invalide .%d" -#define MSG_INVALID_DISP "Disposition invalide" -#define MSG_INVALID_FTYPE "SBV: Ftype %d invalide" -#define MSG_INVALID_HANDLE "Poigne invalide" -#define MSG_INVALID_OPER "Oprateur invalide %d pour %s" -#define MSG_INVALID_OPTION "Option invalide %s" -#define MSG_INV_COLUMN_TYPE "Type %d Invalide pour la colonne %s" -#define MSG_INV_COL_DATATYP "Type de donnes %d invalide pour la colonne %d" -#define MSG_INV_COL_NUM "Colonne invalide %d" -#define MSG_INV_COL_TYPE "Type de colonne %s invalide" -#define MSG_INV_CONC_BIP "Bip invalide (seuls valides: %.8s.0 .1 and .5)" -#define MSG_INV_DATA_PATH "Chemin vers les donnes invalide" -#define MSG_INV_DEF_READ "Lecture diffre invalide rc=%d" -#define MSG_INV_DIRCOL_OFST "Offset invalide pour une colonne DIR" -#define MSG_INV_DOMAIN_TYPE "Type invalide %d" -#define MSG_INV_FILTER "Filtre rsiduel dans %s" -#define MSG_INV_FNC_BUFTYPE "FNC: Type %d de l'argument invalide pour %s" -#define MSG_INV_INFO_TYPE "Type d'info catalog invalide %d" -#define MSG_INV_INIPATH "Inipath invalide " -#define MSG_INV_MAP_POS "Position mmoire invalide" -#define MSG_INV_OPERATOR "oprateur invalide %d\n" -#define MSG_INV_PARAMETER "Paramtre invalide %s" -#define MSG_INV_PARM_TYPE "Type de paramtre invalide" -#define MSG_INV_QUALIFIER "Qalificateur '%s' invalide" -#define MSG_INV_QUERY_TYPE "Type de requte %d invalide" -#define MSG_INV_RAND_ACC "L'accs alatoire d'une table non optimise est impossible" -#define MSG_INV_REC_POS "Position d'enregistrement invalide" -#define MSG_INV_RESULT_TYPE "Type de rsultat invalide %s" -#define MSG_INV_SET_SUBTYPE "Type de formattage %d invalide" -#define MSG_INV_SPECIAL_CMD "%s: Commande spciale invalide" -#define MSG_INV_SUBTYPE "Sous type invalide %s" -#define MSG_INV_TOK_DOMAIN "Le domaine %s n'existe pas" -#define MSG_INV_TOPSEM_CMD "Commande TopSem invalide %c" -#define MSG_INV_TRANSF_USE "Usage invalide en rgle transformationnelle" -#define MSG_INV_TYPE_SPEC "Spcification de type invalide (%.8s.%d)" -#define MSG_INV_UPDT_TABLE "Table %s invalide pour Update" -#define MSG_INV_VALUE_LIST "Liste de valeurs invalide pour Insert" -#define MSG_INV_WHERE_JOIN "Clause Where invalide dans une requte de jointure" -#define MSG_INV_WORK_PATH "Chemin de travail invalide" -#define MSG_IN_ARGTYPE_MISM "Arguments de types incompatibles pour une expression IN" -#define MSG_IN_USE " et en activit" -#define MSG_IN_WITHOUT_SUB "IN ou EXISTS sans tableau ou subquery" -#define MSG_IS_NOT_CONN "%s n'est pas une connexion dfinie" -#define MSG_JCT_MISS_COLS "Colonnes manquantes pour une table JCT" -#define MSG_JCT_MISS_TABLE "Table jointe manquante pour JCT" -#define MSG_JCT_NO_FILTER "Filtrage impossible des tables virtuelles JCT" -#define MSG_JCT_NO_KEY "Erreur logique JCT: cl manquante" -#define MSG_JOIN_KEY_NO_COL "La cl de jointure n'est pas une colonne" -#define MSG_KEY_ALLOC_ERR "Erreur d'allocation d'un bloc offset cl" -#define MSG_KEY_ALLOC_ERROR "Erreur d'allocation mmoire, Klen=%d n=%d" -#define MSG_LANGUAGE_QUIT "%s libr" -#define MSG_LANG_ACTIVE "Langage %s actif" -#define MSG_LANG_ALLOC_FAIL "PlugInitLang: Erreur d'allocation du bloc Lang" -#define MSG_LANG_ALREADY_UP "Langage dj en dition" -#define MSG_LANG_BAD_SAVE "Langage %s peut-tre incorrectement sauvegard" -#define MSG_LANG_NOT_FREED "Langage %s non librable (pas dans la chane principale)" -#define MSG_LANG_SAVED "Langage %s sauvegard" -#define MSG_LANG_WR_LEN_ERR "Erreur de longueur l'criture du bloc Lang" -#define MSG_LDF_ALLOC_ERROR "Erreur d'allocation d'un LdfBlock" -#define MSG_LDF_RN_MISMATCH "LDF: dcalage des numros de rgle" -#define MSG_LDF_WLEN_ERROR "Erreur de longueur en crivant LdfData" -#define MSG_LDF_W_LEN_ERROR "Erreur de longueur pour LdfData en criture" -#define MSG_LIC_NO_MYSQL "Votre licence actuelle ne permet pas l'utilisation du type MYSQL" -#define MSG_LINEAR_ERROR "Erreur de linarisation" -#define MSG_LINE_LENGTH "Largeur d'impression fixe %d" -#define MSG_LINE_MAXLIN "Nombre de lignes de travail plafonn %d" -#define MSG_LINE_MAXRES "Nombre de lignes de rsultat plafonn %d" -#define MSG_LINE_MAXTMP "Nombre de lignes intermdiaires plafonn %d" -#define MSG_LINE_TOO_LONG "La nouvelle ligne est trop longue" -#define MSG_LINJOINDB_ERROR "Erreur systme: appel incorrecte LinJoinDB" -#define MSG_LIST "--Liste--" -#define MSG_LNG_NOT_IN_LIST "Le langage %s n'est pas dans la liste" -#define MSG_LOADING_DB "Chargement description de la BD" -#define MSG_LOADING_FAILED "Le chargement de %s a chou" -#define MSG_LOAD_CDLL_ERROR "Erreur au chargement de ConnDll: rc=%d" -#define MSG_LOCSTRG_TOO_BIG "LOCSTRG: n trop grand ? (%d)\n" -#define MSG_LOGICAL_ERROR "%s: Erreur logique" -#define MSG_LRECL_TOO_SMALL "Lrecl trop petit (longueur en-tte = %d)" -#define MSG_MAC_NO_DELETE "Pas de suppression de lignes pour les tables MAC" -#define MSG_MAC_NO_INDEX "Pas d'accs direct aux tables MAC" -#define MSG_MAC_READ_ONLY "Les tables MAC sont en lecture seulement" -#define MSG_MAC_WIN_ONLY "Les tables MAC sont seulement sous Windows" -#define MSG_MAKE_EMPTY_FILE "Gnration du fichier vide %s: %s" -#define MSG_MAKING "Gnration" -#define MSG_MAKING_DISTINCT "Regroupement des valeures distinctes" -#define MSG_MALLOC_ERROR "Allocation mmoire impossible par %s" -#define MSG_MALLOC_NULL "malloc retourne Null" -#define MSG_MAP_NO_MORE "Le type %s n'est plus support" -#define MSG_MAP_OBJ_ERR "Erreur %d la fermeture du map objet" -#define MSG_MAP_VEC_ONLY "MAP Insert permis seulement pour les tables VEC Estimate" -#define MSG_MAP_VIEW_ERROR "MapViewOfFile %s erreur rc=%d" -#define MSG_MAXSIZE_ERROR "Maxsize incalculable sur table ouverte" -#define MSG_MAXTMP_TRUNCATE "Rsultats intermdiaires tronqus par maxtmp=%d" -#define MSG_MAX_BITMAP "Taille maxi des bitmaps d'optimisation fixe %d" -#define MSG_MEMSIZE_TOO_BIG "Erreur: memsize (%d) trop grand pour Length (%d)" -#define MSG_MEM_ALLOC_ERR "Erreur d'allocation mmoire, taille %s = %d" -#define MSG_MEM_ALLOC_ERROR "Erreur d'allocation mmoire" -#define MSG_MEM_ALLOC_YET "Mmoire dj alloue" -#define MSG_METAFILE_NOTFND "Fichier Meta introuvable" -#define MSG_MISPLACED_QUOTE "Appostrophe mal place ligne %d" -#define MSG_MISSING "Manquant: Value=%p Argval=%p Builtin=%d" -#define MSG_MISSING_ARG "Argument manquant pour l'oprateur %d" -#define MSG_MISSING_COL_DEF "Dfinition des colonnes manquante" -#define MSG_MISSING_CONNECT "Connection #1 manquante" -#define MSG_MISSING_EOL "Fin de ligne manquante dans %s" -#define MSG_MISSING_FIELD "Champs %d manquant dans %s ligne %d" -#define MSG_MISSING_FNAME "Nom du fichier manquant" -#define MSG_MISSING_NODE "Noeud %s manquant dans %s" -#define MSG_MISSING_POS "POS code manquant" -#define MSG_MISSING_ROWNODE "Impossible de trouver le noeud de la ligne %d" -#define MSG_MISSING_SERV_DB "Indication serveur et/ou base de donnes manquante" -#define MSG_MISS_LEAD_COL "Colonne majeure %s manquante" -#define MSG_MISS_NAME_LRECL "Nom du fichier et/ou LRECL manquant" -#define MSG_MISS_TABLE_LIST "Liste des tables manquante" -#define MSG_MISS_VCT_ELMT "Taille de bloc vectoriel manquante (Elements)" -#define MSG_MIS_TAG_LIST "Liste des balises colonne manquante" -#define MSG_MKEMPTY_NIY "MakeEmptyFile: pas encore implement pour Huge et Unix" -#define MSG_MOVE_INV_TYPE "MOVPARM: paramtre de type invalide %d" -#define MSG_MULT_DISTINCT "Distinct utilis plus d'une fois" -#define MSG_MULT_KEY_ERROR "Erreur sur cl multiple k=%d n=%d" -#define MSG_MUL_MAKECOL_ERR "Erreur logique dans TABMUL::MakeCol" -#define MSG_MYSQL_CNC_OFF "La connexion MySQL est ferme" -#define MSG_MYSQL_CNC_ON "La connexion MySQL est tablie" -#define MSG_MYSQL_NOT_SUP "Pas de support de MySQL dans cette version" -#define MSG_MY_CNC_ALREADY "La connexion MySQL est dj active" -#define MSG_NAME_CONV_ERR "Erreur de convertion du nom de noeud" -#define MSG_NAME_IS_USED "Le nom %s est dj utilis" -#define MSG_NCOL_GT_MAXCOL "Trop de colonnes (%d > %d max)" -#define MSG_NEW_CHAR_NULL "new char(%d) retourne Null" -#define MSG_NEW_DOC_FAILED "Impossible de crer le nouveau document" -#define MSG_NEW_RETURN_NULL "NULL renvoy par New dans PlugEvalLike" -#define MSG_NEW_TABLE_ERR "La nouvelle table %s ne peut pas tre charge" -#define MSG_NEXT_FILE_ERROR "Erreur en recherche du fichier suivant. rc=%s" -#define MSG_NODEF_FROM_VIEW "Pas de dfinition de table depuis une view" -#define MSG_NODE_FOR_CHAR "Noeud %s trouv au lieu d'un caractre" -#define MSG_NODE_SUBSET_ERR "Erreur d'initialisation de la zone Noeud %d" -#define MSG_NONCONT_EXCEPT "Exception non-continuable" -#define MSG_NON_DUP_HAVING "Clause Having dans une requte non fonctionelle" -#define MSG_NON_EVAL_SEM "Sem non value: p_no=%d" -#define MSG_NOP_ZLIB_INDEX "L'indexage d'une table zlib non optimise est impossible" -#define MSG_NOT_A_DBF_FILE "Le fichier n'a pas le format dBASE dbf " -#define MSG_NOT_ENOUGH_COLS "Pas assez de colonnes dans %s" -#define MSG_NOT_ENOUGH_MEM "Mmoire insuffisante pour cette opration" -#define MSG_NOT_FIXED_LEN "Fichier %s non fixe, len=%d lrecl=%d" -#define MSG_NOT_IMPLEMENTED "Non implement: %.8s" -#define MSG_NOT_IMPL_JOIN "Pas implment pour les jointures" -#define MSG_NOT_IMPL_SET "Pas implment pour les oprateurs d'ensembles" -#define MSG_NOT_IMPL_YET "Pas encore implement" -#define MSG_NOT_LINEARIZED "Arborescence des tables non linarise" -#define MSG_NOT_MODIFIABLE " (non modifiable)" -#define MSG_NO_0DH_HEAD "0DH manquant en fin d'en-tte (dbc=%d)" -#define MSG_NO_ACTIVE_APPL "Pas d'application active" -#define MSG_NO_ACTIVE_DB "Pas de base de donnes active" -#define MSG_NO_ACTIVE_UDIC "Pas de dictionaire utilisateur actif" -#define MSG_NO_AGGR_FUNC "Fonction aggrge %d illgale cet endroit" -#define MSG_NO_AREA_FILE "Fichier Area introuvable" -#define MSG_NO_AVAIL_RESULT "Pas de rsultat disponible" -#define MSG_NO_BIG_DELETE "Dltion Partielle non implmente pour les fichiers HUGE" -#define MSG_NO_CHAR_FROM "Conversion de type %d en caractres impossible" -#define MSG_NO_CLUSTER_COL "Pas de colonne optimisable" -#define MSG_NO_COL_ADDING "Ajouter des colonnes dans une dfinition existante est impossible" -#define MSG_NO_COL_DEF_AS "La dfinitions des colonnes est incompatible avec AS Select" -#define MSG_NO_COL_FOUND "La section colonne %s est vide" -#define MSG_NO_COL_IN_TABLE "La colonne %d n'est pas dans la table %s" -#define MSG_NO_COL_SECTION "Section colonne manquante pour la table %s" -#define MSG_NO_CONNECT_ADDR "Adresse de connection non spcifie" -#define MSG_NO_CONST_FILTER "Filtres constants non implements" -#define MSG_NO_CURLY_BRKT "Pas d'accolade de fermeture" -#define MSG_NO_DATABASE "Base de donnes %s introuvable" -#define MSG_NO_DATE_FMT "Pas de format date pour le valblock de type %d" -#define MSG_NO_DBF_INSERT "Insert pas encore implment pour les fichier DBF" -#define MSG_NO_DEF_FNCCOL "Colonne fonction par dfaut introuvable" -#define MSG_NO_DEF_PIVOTCOL "Colonne pivot par dfaut introuvable" -#define MSG_NO_DIR_INDX_RD "Pas d'accs directe des tables %s" -#define MSG_NO_DMY_DIR_ACC "Pas d'accs direct aux tables virtuelles DUMMY" -#define MSG_NO_DOM_DELETE "Dltion Partielle non implmente pour les domaines" -#define MSG_NO_DOM_MATCH "Chane %.8s... non touve dans le domaine %s" -#define MSG_NO_EDITED_LANG "Coparm: Pas de langage en dition" -#define MSG_NO_EXP_LINK "Liaison par expression invalide pour une table JCT" -#define MSG_NO_EXT_FILTER "Le filtrage ne peut se rfrer une autre table" -#define MSG_NO_EXT_UPDATE "Pas de mise jour en rfrence une autre table" -#define MSG_NO_FEAT_SUPPORT "%s non support dans cette version" -#define MSG_NO_FILE_LIST "La table %s n'a pas de liste de fichiers" -#define MSG_NO_FLD_FORMAT "Format absent pour le champs %d de %s" -#define MSG_NO_FORMAT_COL "Type COLUMN informattable" -#define MSG_NO_FORMAT_TYPE "Le format ne peut pas tre dfini partir du type %d" -#define MSG_NO_FULL_JOIN "Jointures autorises seulement galit sur cl(s)" -#define MSG_NO_FUL_OUT_JOIN "Jointures externes compltes non supportes" -#define MSG_NO_FUNC_ORDER "Tri non support sur lment fonctionnel" -#define MSG_NO_HEAD_JOIN "Jointure sur une table non en tte" -#define MSG_NO_HQL_CONV "Conversion en HQL non disponible" -#define MSG_NO_INDEX "La table %s n'a pas d'index" -#define MSG_NO_INDEX_GBX "Pas ou mauvais index pour SQLGBX" -#define MSG_NO_INDEX_IN "Pas d'index dans %s" -#define MSG_NO_INDEX_READ "Pas d'accs directe des tables multiples" -#define MSG_NO_INIT_LANG "Pas de langage initial" -#define MSG_NO_JOIN_TO_EXP "Jointure vers une expression impossible" -#define MSG_NO_JOIN_UPDEL "Pas de jointure avec Update/Delete" -#define MSG_NO_KEY_COL "Pas de colonne cl trouve" -#define MSG_NO_KEY_UPDATE "Le nom des cls ne peut pas tre modifi" -#define MSG_NO_LANGUAGE "Pas de langage oprationnel\n" -#define MSG_NO_LANG_TO_QUIT "Pas de langage quitter" -#define MSG_NO_LISTVAL_HERE "LSTBLK: Liste de valeurs utilise hors contexte" -#define MSG_NO_MAP_INSERT "MAP incompatible avec Insert" -#define MSG_NO_MATCHING_COL "Pas de colonne correspondant %s dans %s" -#define MSG_NO_MATCH_COL "Colonne correspondante introuvable" -#define MSG_NO_MEMORY "Mmoire pleine" -#define MSG_NO_MEM_CORR_SUB "Subquery corrle en mmoire non encore implmente" -#define MSG_NO_MODE_PADDED "Mode non support pour les fichiers 'padded'" -#define MSG_NO_MORE_COL "La colonne %s n'est plus dans la table pivot" -#define MSG_NO_MORE_LANG "Plus de langage, exit de %s\n" -#define MSG_NO_MORE_VAR "Les fichiers VAR ne sont plus supports" -#define MSG_NO_MULCOL_JOIN "Jointure vers un index multi-colonne pas encore possible" -#define MSG_NO_MULT_HAVING "Clauses Having multiples non implmentes" -#define MSG_NO_MUL_DIR_ACC "Accs direct des tables multiples pas encore implment" -#define MSG_NO_MUL_VCT "Les tables VCT ne peuvent pas tre multiples" -#define MSG_NO_MYSQL_CONN "Aucune connexion MySQL ouverte" -#define MSG_NO_MYSQL_DELETE "Pas de Delete pour les tables MySQL" -#define MSG_NO_NBCOL "Pas de NBcol" -#define MSG_NO_NBLIN "Pas de NBlin, MaxSize ou Continued" -#define MSG_NO_NBLIN_CONT "Fetch: Pas de NBlin ou Continued" -#define MSG_NO_NULL_CONST "Les constantes ne sont pas prises en charge" -#define MSG_NO_ODBC_COL "Colonnes ODBC automatiques non supportes par cette version" -#define MSG_NO_ODBC_DELETE "Delete ne devrait pas tre appel pour les tables ODBC" -#define MSG_NO_ODBC_DIRECT "Accs directe des tables ODBC non encore implment" -#define MSG_NO_ODBC_MUL "Multiple(2) non support pour les tables ODBC" -#define MSG_NO_ODBC_SPECOL "Pas de colonne spciale ODBC" -#define MSG_NO_OPT_COLUMN "Pas optimisable ou pas de colonne optimises" -#define MSG_NO_OP_MODIF "Les modificateurs ne s'appliquent pas %s" -#define MSG_NO_PARAMETER "Pas de paramtre" -#define MSG_NO_PART_DEL "Delete partiel des fichier %s impossible" -#define MSG_NO_PART_MAP "Mapping partiel non implment pour cet OS" -#define MSG_NO_PAR_BLK_INS "Insertion de bloc partiel impossible" -#define MSG_NO_PIV_DIR_ACC "Pas d'accs directe aux tables PIVOT" -#define MSG_NO_POS_ADDED "Pos_code non ajout" -#define MSG_NO_PROMPTING "Relance impossible pour les tables distribues" -#define MSG_NO_QRY_DELETE "Delete n'est pas utilisable pour les views QRY" -#define MSG_NO_QUERY_ARRAY "Tableaux avec QUERY non encore implments" -#define MSG_NO_RCUR_DSK_YET "Usage recursif de DISK non encore implement" -#define MSG_NO_READ_32 "Lecture de 32 octets impossible" -#define MSG_NO_RECOV_SPACE "Espace non recouvrable dans le fichier index" -#define MSG_NO_REF_DELETE "Pas de suppression en rfrence une autre table" -#define MSG_NO_REF_UPDATE "Pas de mise jour en rfrence une autre table" -#define MSG_NO_REMOTE_FNC "Certaines fonctions ne peuvent pas tre excutes distance" -#define MSG_NO_ROWID_FOR_AM "Accs direct impossible de ROWID pour les tables de type %s" -#define MSG_NO_ROW_NODE "Le nom du Rownode n'est pas dfini" -#define MSG_NO_SECTION_NAME "Nom de section manquant" -#define MSG_NO_SEC_UPDATE "Les noms de section ne peuvent pas tre modifis" -#define MSG_NO_SELECTED_DB "Aucune base de donnes slecte" -#define MSG_NO_SELF_PIVOT "Une table ne peut se pivoter elle-mme !" -#define MSG_NO_SERVER_FOUND "Serveur introuvable" -#define MSG_NO_SETPOS_YET "SetPos pas encore implment pour les fichier %s" -#define MSG_NO_SFEXIT_UNIX "Fonction %s non disponible sur Unix" -#define MSG_NO_SOURCE " (pas de source)" -#define MSG_NO_SPEC_COL "Pas de colonne spciales MYSQL" -#define MSG_NO_SQL_DELETE "Delete n'est pas utilisable actuellement pour les views SQL" -#define MSG_NO_SUB_VAL "Pas de sous-value d'un tableau de type %d" -#define MSG_NO_SUCH_INDEX "La table %s n'a pas l'index %s" -#define MSG_NO_SUCH_SERVER "Serveur %s introuvable" -#define MSG_NO_SUCH_TABLE "Table %s pas dans la base de donnes" -#define MSG_NO_TABCOL_DATA "Pas de donnes pour la table %s colonne %s" -#define MSG_NO_TABLE_COL "Aucune colonne trouve pour %s" -#define MSG_NO_TABLE_DEL "Delete non autoris pour les tables %s " -#define MSG_NO_TABLE_DESC "Pas de bloc descriptif de table" -#define MSG_NO_TABLE_INDEX "La table %s n'a pas d'index" -#define MSG_NO_TABLE_LIST "Pas de liste de tables" -#define MSG_NO_TAB_DATA "Pas de donnes pour la table %s" -#define MSG_NO_TERM_IN_TOK "Les non-terminaux ne sont pas utilisables dans les rgles de Token" -#define MSG_NO_TOKEN_DB "DB introuvable pour la colonne TOKEN %s" -#define MSG_NO_UNIX_CATINFO "Pas d'info catalogue sous Unix" -#define MSG_NO_UPDEL_JOIN "Pas de jointure de tables ODBC pour Update/Delete" -#define MSG_NO_VCT_DELETE "Dltion Partielle non implmente pour les fichiers VCT" -#define MSG_NO_VIEW_COLDEF "Colonne dfinition impossible pour les views" -#define MSG_NO_VIEW_SORT "La View fonctionnelle %s ne peut pas tre trie ou jointe" -#define MSG_NO_ZIP_DELETE "Delete sur fichier Zip non encore implement" -#define MSG_NO_ZIP_DIR_ACC "Accs directe des tables ZDOS non encore implement" -#define MSG_NULL_COL_VALUE "La colonne n'a pas de valeur" -#define MSG_NULL_ENTRY "InitLang, entre nulle %d %s" -#define MSG_NULL_QUERY "Requte vide" -#define MSG_NUMVAL_NOMATCH "Disparit de Numval pour %s" -#define MSG_N_FULL_PARSES "%d significations" -#define MSG_ODBC_READ_ONLY "ODBC est actuellement en lecture seulement" -#define MSG_OFFSET_NOT_SUPP "Offset non support pour ce type de sous requte" -#define MSG_ONE_LANG_YET "Un langage est dj en dition" -#define MSG_ONE_PARAM_ONLY "Un seul paramtre autoris" -#define MSG_ONLY_LOG10_IMPL "Seul Log10 est implement" -#define MSG_ON_LANGUAGE "Langage %.8s version %d niveau %d ditable" -#define MSG_OPENING "Ouverture" -#define MSG_OPENING_QUERY "Ouverture de la requte" -#define MSG_OPEN_EMPTY_FILE "Ouverture du fichier vide %s: %s" -#define MSG_OPEN_ERROR "Erreur d'ouverture %d en mode %d sur %s: " -#define MSG_OPEN_ERROR_IS "Erreur l'ouverture de %s: %s" -#define MSG_OPEN_ERROR_ON "Erreur d'ouverture sur %s" -#define MSG_OPEN_MODE_ERROR "Erreur d'ouverture(%s) %d sur %s" -#define MSG_OPEN_SORT_ERROR "Erreur logique de tri dans QUERY Open" -#define MSG_OPEN_STRERROR "Erreur l'ouverture: %s" -#define MSG_OPEN_W_ERROR "Erreur l'ouverture de %s en criture" -#define MSG_OPTBLK_RD_ERR "Erreur la lecture d'un bloc optimisation: %s" -#define MSG_OPTBLK_WR_ERR "Erreur l'criture d'un bloc optimisation: %s" -#define MSG_OPTIMIZING "Optimisation de " -#define MSG_OPT_BMAP_RD_ERR "Erreur en lecture des bitmaps d'optimisation: %s" -#define MSG_OPT_BMAP_WR_ERR "Erreur en criture des bitmaps d'optimisation: %s" -#define MSG_OPT_CANCELLED "Optimisation interrompue par l'utilisateur" -#define MSG_OPT_DVAL_RD_ERR "Erreur en lecture des valeurs distinctes: %s" -#define MSG_OPT_DVAL_WR_ERR "Erreur en criture des valeurs distinctes: %s" -#define MSG_OPT_HEAD_RD_ERR "Erreur en lecture de l'entte du fichier opt: %s" -#define MSG_OPT_HEAD_WR_ERR "Erreur en criture de l'entte du fichier opt: %s" -#define MSG_OPT_INIT "Optimisation initialise" -#define MSG_OPT_LOGIC_ERR "Erreur logique dans SetBitmap, i=%d" -#define MSG_OPT_MAX_RD_ERR "Erreur en lecture des valeurs maxi: %s" -#define MSG_OPT_MAX_WR_ERR "Erreur en criture des valeurs maxi: %s" -#define MSG_OPT_MIN_RD_ERR "Erreur en lecture des valeurs mini: %s" -#define MSG_OPT_MIN_WR_ERR "Erreur en criture des valeurs mini: %s" -#define MSG_OPT_NOT_MATCH "Le fichier opt %s n'est pas jour" -#define MSG_OP_RES_TOO_LONG "Rsultat trop long pour l'oprateur=%d" -#define MSG_ORDER_OUT_RANGE "Tri: Order %d hors limite" -#define MSG_ORDER_TWICE "Un mme lment est tri deux fois" -#define MSG_PAGE_ERROR "Erreur de pagination" -#define MSG_PARM_CNT_MISS "Disparit du nombre de Paramtres" -#define MSG_PARSE_NULL_SEM "Smantique nulle" -#define MSG_PARSING_QUERY "Analyse de la requte" -#define MSG_PIX_ERROR "Pix %s erreur rgle no=%u\n" -#define MSG_PIX_TEST_ERROR "Rgle=%u: pix-TEST pas dans le premier noeud\n" -#define MSG_PLG_READ_ONLY "PLG est actuellement en lecture seulement" -#define MSG_PLM_NULL_SFP "TABPLM ReadDB: Sfp est NULL" -#define MSG_PLUG_NOT_INIT "Plug n'est pas initialis\n" -#define MSG_PLUG_NOT_RUN "Plug n'est pas en marche" -#define MSG_PNODE_RULE "(Noeud %d rgle %d) " -#define MSG_POS_TOO_LONG "%s trop long (>%d)" -#define MSG_PREC_VBLP_NULL "ARRAY SetPrecision: Vblp est NULL" -#define MSG_PRIV_INSTR "Instruction privilgie" -#define MSG_PROCADD_ERROR "Erreur %d sur l'adresse de %s" -#define MSG_PROCESS_SUBQRY "Sub-Query en cours de traitement" -#define MSG_PROC_WOULD_LOOP "Bouclage du traitement (maxres=%d maxlin=%d)" -#define MSG_PROGRESS_INFO "Informations sur le traitement en cours" -#define MSG_PROMPT_CANCEL "Relance annule" -#define MSG_PROMPT_NIY "Prompt non implment pour cette configuration" -#define MSG_PTR_NOT_FOUND "Pointeur introuvable Num=%d ti1=%d" -#define MSG_PXDEF_IS_NULL "Pxdef est NULL" -#define MSG_QRY_READ_ONLY "Les views QRY sont en lecture seulement" -#define MSG_QUERY_CANCELLED "Requte interrompue par l'utilisateur" -#define MSG_QUERY_NOT_EXEC "Requte non excute" -#define MSG_QUERY_SAVED "Requte %s sauvegarde" -#define MSG_QUOTE_IN_QUOTE "Appostrophe dans un champ entre appostrophe ligne %d" -#define MSG_RANGE_NIY "Range pas encore implment pour %s" -#define MSG_RANGE_NO_JOIN "Range non compatible avec les index de jointure" -#define MSG_RC_READING "rc=%d en lecture de la table %s" -#define MSG_READB_BAD_INIT "%s ReadDB appel avec Init=0" -#define MSG_READCOL_ERROR "SQLCOL: erreur dans ReadColumn" -#define MSG_READING "Lecture" -#define MSG_READING_FROM "Lecture de %s" -#define MSG_READING_RECORD "Erreur en lecture de l'enregistrement %d de %s" -#define MSG_READY "Prt" -#define MSG_READ_ERROR "Erreur en lecture sur %s: %s" -#define MSG_READ_ERROR_RC "Erreur en lecture, rc=%d" -#define MSG_READ_MEM_ERROR "Lecture mmoire %d: taille=%d" -#define MSG_READ_ONLY "Cette table protge en lecture seule ne peut tre modifie" -#define MSG_READ_SEEK_ERROR "Erreur de recherche en lecture: %s" -#define MSG_READ_SEG_ERROR "Lecture segment %d: taille=%d" -#define MSG_RECEIVED "Reu %c\n" -#define MSG_RECORD_ERROR "Erreur la lecture de l'enregistrement %d de %s" -#define MSG_RECORD_NO_SEP "Enregistrement sans sparateur" -#define MSG_REC_SKIPPED " (%d lignes erronnes sautes par l'option MaxErr)" -#define MSG_REDUCE_INDEX "Rduction de l'index" -#define MSG_REGISTER_ERR "Enregistrement NS impossible, prfix='%s' et href='%s'" -#define MSG_REMOTE_CONN_ERR "La connection loigne a chou" -#define MSG_REMOVE_ERROR "Erreur en supprimant %s: %s" -#define MSG_REMOVE_NOT_IMPL "Remove non implment pour TDB non Table" -#define MSG_RENAME_ERROR "Erreur renommant %s en %s: %s" -#define MSG_RENUM_RULES "Renumrotez les rgles et rentrez ADD (rgle sauvegarde dans la zone tampon)" -#define MSG_REORDER_INDEX "Reclassement de l'index" -#define MSG_REQU_ARG_NUM "La fonction %s doit avoir %d arguments" -#define MSG_RESET_TO "%s remis %d" -#define MSG_RES_NOT_UNIQUE "Le rsultat n'est pas unique" -#define MSG_RET_FROM_LANG "Retour au language %s version %d.%d du language %s version %d.%d" -#define MSG_ROWID_NOT_IMPL "RowNumber non implment pour les tables de type %s" -#define MSG_ROWS_SELECTED "%d lignes slectionnes en %.2lf sec" -#define MSG_ROWS_TRUNCATED " (tronqu par MAXRES, LIMIT, FREQ ou AreaSize)" -#define MSG_ROW_ARGNB_ERR "ROW: disparit du nombre d'arguments (%d,%d)" -#define MSG_RPC_SERVER_ERR "Erreur logique dans TABMUL::MakeCol" -#define MSG_RSC_ALLOC_ERROR "Erreur d'allocation mmoire dans Rescol %s" -#define MSG_RULE_ENTERED "Rgle %d entre" -#define MSG_RULE_SUBSET_ERR "Erreur d'initialisation de la zone Rgles" -#define MSG_SAVING_INDEX "Sauvegarde du fichier index" -#define MSG_SCAN_NOT_IMP "Scan non implment" -#define MSG_SEC_KEY_FIRST "Les sections et cls doivent tre insres en premier" -#define MSG_SEC_NAME_FIRST "Le nom de section doit tre en tte de liste en insertion" -#define MSG_SEC_NOT_FOUND "Section %s absente de %s" -#define MSG_SEEK_ERROR "Seek erreur dans CopyHeader" -#define MSG_SEMANTIC_TREE "Arbre smantique" -#define MSG_SEM_BAD_REF "Sem @%d rfrence un argument de type non 0 ou 1" -#define MSG_SEM_UNKNOWN "inconnue, rc=%d" -#define MSG_SEP_IN_FIELD "Le champ %d contient le caractre sparateur" -#define MSG_SEQUENCE_ERROR "HSTMT: Allocation hors squence" -#define MSG_SETEOF_ERROR "Erreur %d dans SetEndOfFile" -#define MSG_SETRECPOS_NIY "SetRecpos non implment pour ce type de table" -#define MSG_SET_LOCALE "Locale fixe %s" -#define MSG_SET_NULL_DOM "Valeur %d donne un domaine nul" -#define MSG_SET_OP_NOT_IMPL "Oprateurs ensemblistes non implements" -#define MSG_SET_STR_TRUNC "SetValue: Chane de caractres tronque" -#define MSG_SEVERAL_TREES "Jointure non spcifie pour certaines tables" -#define MSG_SFP_ERROR "Erreur sur SetFilePointer: %s" -#define MSG_SFUNC_NOT_IMPL "Fonction scalaire %s non implmente" -#define MSG_SHARED_LIB_ERR "Erreur au chargement de la librairie partage %s: %s" -#define MSG_SINGLE_STEP "Pas pas" -#define MSG_SLEEP "J'ai dormi %d milliseconds" -#define MSG_SMART_SORTING "Rcupration des lignes tries (passage %d de %d)" -#define MSG_SMART_SORT_ERR "Erreur logique 1 dans Smart Sort" -#define MSG_SORTING "Tri en cours" -#define MSG_SORTING_INDEX "Tri de l'index" -#define MSG_SORTING_VAL "Tri de %d valeurs" -#define MSG_SORT_JOIN_INDEX "Tri de l'index de jointure" -#define MSG_SPCOL_READONLY "La colonne spciale %s est en lecture seulement" -#define MSG_SPEC_CMD_SEP "Les commandes spciales doivent tre excutes sparment" -#define MSG_SQL_BAD_TYPE "RephraseSQL: type %d non support" -#define MSG_SQL_BLOCK_MISM "CheckColumn: bloc SQL courant non correspondant" -#define MSG_SQL_CONF_ERROR "Erreur SQL: SQL_CONFORMANCE" -#define MSG_SQL_READ_ONLY "Les views SQL sont actuellement en lecture seulement" -#define MSG_SRCH_CLOSE_ERR "Erreur la fermeture de l'Handle de recherche" -#define MSG_SRC_TABLE_UNDEF "La table source n'est pas dfinie" -#define MSG_STACK_ERROR "Erreur sur la pile, i=%d\n" -#define MSG_STACK_OVERFLOW "Parser: Dbordement de la pile\n" -#define MSG_STRG_NOT_FOUND "Chane introuvable" -#define MSG_STRING_INV_LIST "Liste invalide pour SemString" -#define MSG_STRING_TOO_BIG "Chane trop grande pour le domaine %s" -#define MSG_SUBALLOC_ERROR "Pas assez de mmoire en zone %p pour allouer %d (utilis=%d libre=%d)" -#define MSG_SUBAL_HUGE_ERR "Pas assez de mmoire en zone huge %p pour allouer %d" -#define MSG_SUBARG_NOSEM "Argument @ ou sous-phrase de niveau %d pointe sur un noeud sans Sem" -#define MSG_SUBARG_OUTRANGE "Argument @ ou sous-phrase de niveau %d hors limite" -#define MSG_SUBQRY_ONEITEM "Une Sub-Query ne doit avoir qu'une slection" -#define MSG_SUBSET_ERROR "SubSet erreur dans LoadDB" -#define MSG_SUB_OPEN_YET "Subquery dj ouverte" -#define MSG_SUB_RES_TOO_LNG "Rsultat trop long pour SUBSTR" -#define MSG_SYNTAX_ERROR "Erreur de syntaxe" -#define MSG_SYSTEM_ERROR "Erreur systme %d" -#define MSG_S_ACCESS_DENIED "%s: accs non autoris" -#define MSG_S_ERROR "%s erreur" -#define MSG_S_ERROR_NUM "%s: erreur=%d" -#define MSG_S_INTRUPT_ERROR "%s: erreur interruption" -#define MSG_S_INVALID_PARM "%s: paramtre invalide" -#define MSG_S_INV_ADDRESS "%s: adresse invalide" -#define MSG_S_UNKNOWN_ERROR "%s: erreur de code %u inconnu" -#define MSG_TABDIR_READONLY "Les tables DIR sont en lecture seulement" -#define MSG_TABLE_ALREADY "La table %s existe dj" -#define MSG_TABLE_ALTERED "Table %s %s altre" -#define MSG_TABLE_CREATED "%s table %s cre" -#define MSG_TABLE_DROPPED "Table %s supprime" -#define MSG_TABLE_MULT_JOIN "Utilisation multiple de la table %s pour jointure" -#define MSG_TABLE_NOT_IN_DB "La table %s n'existe pas dans %s" -#define MSG_TABLE_NOT_OPT "Table non optimisable" -#define MSG_TABLE_NO_INDEX "La table %s n'est pas indexable" -#define MSG_TABLE_NO_OPT "La table %s n'existe pas ou de type non optimisable" -#define MSG_TABLE_READ_ONLY "Les tables %s sont en lecture seulement " -#define MSG_TABMUL_READONLY "Les tables multiples sont en lecture seulement" -#define MSG_TAB_NOT_LOADED " (certaines tables n'ont put tre charges)" -#define MSG_TAB_NOT_SPEC "Table non specifie" -#define MSG_TB_VW_NOTIN_DB "Table ou view %s pas dans la base de donnes" -#define MSG_TDB_NXT_NOT_NUL "Tdb.Next non NULL" -#define MSG_TDB_USE_ERROR "Erreur, Tdbp->Use=%d" -#define MSG_TOO_MANY_COLS "Trop de colonnes" -#define MSG_TOO_MANY_COLTAB "Trop de colonnes dans %s (%d)" -#define MSG_TOO_MANY_FIELDS "Trop de champs ligne %d de %s" -#define MSG_TOO_MANY_JUMPS "Trop de niveaux de saut" -#define MSG_TOO_MANY_KEYS "Trop de cls (%d)" -#define MSG_TOO_MANY_POS "Trop de pos_codes" -#define MSG_TOO_MANY_TABLES "Trop de tables (%d)" -#define MSG_TOPSEM_ERROR "Erreur inconnue dans TopSem" -#define MSG_TO_BLK_IS_NULL "To Blk est nul" -#define MSG_TO_FTR_NOT_NULL "Set.To_Ftr n'est pas nul" -#define MSG_TO_PIX_NOT_NULL "Set.To_Pix n'est pas nul" -#define MSG_TO_SEM_NOT_NULL "Set.To_Sem n'est pas nul" -#define MSG_TRUNCATE_ERROR "Erreur en troncation: %s" -#define MSG_TRUNC_BY_ESTIM "Tronqu par l'option Estimate" -#define MSG_TYPES_ERROR "Erreur sur Types(%d)" -#define MSG_TYPE_CONV_ERROR "Type non convertible dans une expression" -#define MSG_TYPE_DEF_MISM "Disparit entre type et dfinition" -#define MSG_TYPE_MISMATCH "Cl et source ne sont pas du mme type" -#define MSG_TYPE_RECFM_MISM "Disparit entre Type et Recfm" -#define MSG_TYPE_TO_VERIFY "Type vrifier: %d" -#define MSG_TYPE_VALUE_ERR "Colonne %s: disparit type(%s)/valeur(%s)" -#define MSG_UNBALANCE_QUOTE "Appostrophe en trop ligne %d" -#define MSG_UNDEFINED_AM "COLBLK %s: mthode d'accs indfinie" -#define MSG_UNDEFINED_PATH "Chemin d'accs indfini pour Plgcnx.ini" -#define MSG_UNDEF_COL_COUNT "Count sur colonne non dfinie" -#define MSG_UNKNOWN_DOMAIN "Domaine inconnu %s" -#define MSG_UNKNOWN_ERROR "Erreur inconnue" -#define MSG_UNKNOWN_EXCPT "Exception non rpertorie" -#define MSG_UNKNOWN_NAME "Nom inconnu: %.8s" -#define MSG_UNKNOWN_PATH "Chemin d'accs inconnu pour Plgcnx.ini" -#define MSG_UNKNOWN_POS "Nom pos_code inconnu: %s" -#define MSG_UNKNOWN_SEM "Sem %.8s inconnue, rc=%d" -#define MSG_UNKNOWN_SYNONYM "Synonyme inconnu" -#define MSG_UNKNW_QRY_TYPE "ReadDB: type de requte inconnu" -#define MSG_UNKN_ERR_CODE "Erreur de code %d inconnu" -#define MSG_UNLOADABLE " inchargeable: " -#define MSG_UNLOADABLE_PRM "%s inchargeable: %s" -#define MSG_UNMATCH_FIL_ARG "Argument de filtre dpareill" -#define MSG_UNQ_COL_SEV_TAB "La colonne %s non qualifie est dans plusieurs tables" -#define MSG_UNRESOLVED_ARG "?Argument manquant: %s non rsolu en %d ligne %d" -#define MSG_UPDATE_ERROR "Erreur en Update sur %s" -#define MSG_UPDATING_ROWS "Mise jour des lignes" -#define MSG_UPD_ZIP_NOT_IMP "Mise jour des tables ZDOS non encore implement" -#define MSG_UP_LANGUAGE "Bloc langage %.8s version %d niveau %d charg" -#define MSG_USED_FREE_MEM "Sarea: utilis %d, libre %d" -#define MSG_USETEMP_IS "Usetemp est : %s" -#define MSG_USETEMP_RESET ". Usetemp remis Auto" -#define MSG_USETEMP_SET "Usetemp fix %s" -#define MSG_USE_NO_MATCH "Use non correspondant : Use=%d, ti2=%d, ti3=%d" -#define MSG_USING_INDEX " (Index par" -#define MSG_VALIST_MISMATCH "Disparit des listes de valeurs" -#define MSG_VALSTR_TOO_LONG "Valeur %s trop longue pour une chane de longueur %d" -#define MSG_VALTYPE_NOMATCH "Disparit types de valeur" -#define MSG_VALUE_ERROR "Colonne %s: bloc valeur nul" -#define MSG_VALUE_NOT_ALLOC "Valeur non alloue pour la colonne R%d %s" -#define MSG_VALUE_TOO_BIG "Valeur %lld trop grande pour la colonne %s" -#define MSG_VALUE_TOO_LONG "Valeur %s trop longue pour la colonne %s de longueur %d" -#define MSG_VAL_ALLOC_ERR "Allocation impossible du noeud valeur" -#define MSG_VAL_TOO_LONG "Valeur %s trop longue pour le champ %s" -#define MSG_VIEW_ALREADY "La VIEW %s existe dj" -#define MSG_VIEW_CREATED "%s view %s cre" -#define MSG_VIEW_DROPPED "View %s supprime" -#define MSG_VIEW_NOT_IN_DB "%s n'est pas une View de %s" -#define MSG_VIR_NO_DELETE "Delete impossible sur les tables %s" -#define MSG_VIR_READ_ONLY "Les tables virtuelles %s sont en lecture seulement" -#define MSG_VM_LANG "Langage au format VM, non support" -#define MSG_VOID_FIRST_ARG "Le premier argument ne doit pas tre vide" -#define MSG_VOID_IN_STRING "Erreur: chane IN vide" -#define MSG_VOID_ORDER_LIST "Liste de tri vide, erreur systme ?" -#define MSG_VOID_POS_DICT "Dictionnaire interne du langage vide" -#define MSG_VOID_QUERY "Requte vide %s" -#define MSG_WORK_AREA "Espace de travail: %s" -#define MSG_WORK_TOO_SMALL "Zone de travail trop petite, accrotre AreaSize" -#define MSG_WRITE_ERROR "Erreur l'criture de %s" -#define MSG_WRITE_SEEK_ERR "Erreur de recherche en criture: %s" -#define MSG_WRITE_STRERROR "Erreur en criture sur %s: %s" -#define MSG_WRITING "Ecriture" -#define MSG_WRITING_ERROR "Erreur l'criture de %s: %s" -#define MSG_WRITING_QUERY "Erreur l'criture de la requte: " -#define MSG_WRONG_ARG_NUM "La fonction %s ne prend pas %d arguments" -#define MSG_WRONG_COL_NUM "Numro de colonne %d trop grand pour %s" -#define MSG_WRONG_DB_LIST "Liste des bases de donnes incorrecte ou vide" -#define MSG_WRONG_FUNCTION "Mauvaise fonction %d" -#define MSG_WRONG_OP_PARM "Mauvais oprateur ou paramtres pour %s" -#define MSG_WRONG_PARMS "Mauvais paramtres pour %s" -#define MSG_WRONG_PASSWORD "Mot de passe illgal pour %s" -#define MSG_WRONG_TYPE "type non support" -#define MSG_WRONG_USERFILE "La Userfile a une mauvaise taille %d" -#define MSG_WS_CONV_ERR "Erreur de convertion de %s en WS" -#define MSG_XCOL_MISMATCH "La colonne %s ne correspond pas l'index" -#define MSG_XDB_DEL_ERROR "Erreur en supprimant des entres du fichier XDB" -#define MSG_XFILE_READERR "Erreur %d en lisant le fichier index" -#define MSG_XFILE_TOO_SMALL "Le fichier index est plus petit que la taille de l'index" -#define MSG_XFILE_WRITERR "Erreur en crivant le fichier index: %s" -#define MSG_XMLTAB_INIT_ERR "Erreur d'initialisation de la table XML" -#define MSG_XML_INIT_ERROR "Erreur d'initialisation du nouveau fichier XML" -#define MSG_XPATH_CNTX_ERR "Le nouveau contexte XPath ne peut tre cr" -#define MSG_XPATH_EVAL_ERR "Impossible d'valuer l'emplacement xpath '%s'" -#define MSG_XPATH_NOT_SUPP "Xpath non support colonne %s" -#define MSG_X_ARG_ADDED "%d arguments ajouts" -#define MSG_X_ARG_SET "%d arguments ont t initialiss" -#define MSG_X_ON_TAB " %s sur %s(" -#define MSG_ZERO_DIVIDE "Division par zro dans une expression" diff --git a/storage/connect/frmsg2.h b/storage/connect/frmsg2.h deleted file mode 100644 index 487db3395fb..00000000000 --- a/storage/connect/frmsg2.h +++ /dev/null @@ -1,1013 +0,0 @@ -#define MSG_ACCESS_VIOLATN "Violation accs mmoire" -#define MSG_ACT_ALLOC_FAIL "PlugInitLang: Erreur d'allocation du bloc Activity" -#define MSG_ADDVAL_ERROR "Erreur %d dans AddValue" -#define MSG_ADD_BAD_TYPE "Ajout d'une valeur de type %s non conforme dans un tableau %s" -#define MSG_ADD_NULL_DOM "Ajout de la chane %s un domaine nul" -#define MSG_ADPOS_IN_DICTP "ADPOS au travail dans User_Dictp" -#define MSG_AFTER " aprs: " -#define MSG_ALG_CHOICE_AUTO "Le choix du meilleur algorithme est automatique" -#define MSG_ALG_CHOICE_BAD "Choix d'algorithme invalide, remis AUTO" -#define MSG_ALG_CHOICE_QRY "Utilise l'algorithme 'Query'" -#define MSG_ALG_CURLY_BRK "Le choix de l'algorithme dpend des accolades externes" -#define MSG_ALLOC_ERROR "Erreur d'allocation de %s" -#define MSG_ALL_DELETED "Toutes les lignes enleves en %.2lf sec" -#define MSG_ALTER_DB_ERR "Impossible de dterminer la base de donnes modifier" -#define MSG_AMBIG_COL_QUAL "Qualificateur ambigu %s pour la colonne %s" -#define MSG_AMBIG_CORREL "Select %s.* corrlation ambigue" -#define MSG_AMBIG_SPEC_COL "Colonne spciale ambigue %s" -#define MSG_ANSWER_TYPE "Rponse de type" -#define MSG_API_CONF_ERROR "Erreur SQL: API_CONFORMANCE" -#define MSG_APPL_ACCESSIBLE "Application %s accessible" -#define MSG_APPL_ACTIVE "Application %s encore active" -#define MSG_APPL_BAD_SAVE "Application %s partiellement sauvegarde" -#define MSG_APPL_CREATED "Application %s cr" -#define MSG_APPL_IS_ACTIVE "Application dj active" -#define MSG_APPL_NOT_INIT "Application non initialise" -#define MSG_APPL_NOT_LOADED "Application non charge" -#define MSG_APPL_QUIT "Fin de l'application %s" -#define MSG_APPL_SAVED "Application %s sauvegarde" -#define MSG_APP_STILL_ACTIV "Application du langage %s encore active (non librable)" -#define MSG_AREAFILE_NOTFND "Fichier Area introuvable" -#define MSG_ARGS_SYNTAX_ERR "?SetArgs erreur de syntaxe: %s inattendu aprs %s" -#define MSG_ARG_ALREADY_SET "Argument %d dj allou" -#define MSG_ARG_NOT_AN_ATTR "L'argument n'est pas un attribut (type %d erron)" -#define MSG_ARG_OUT_CONTEXT "Argument de type @ utilis hors contexte" -#define MSG_ARG_OUT_RANGE "Argument de phrase valant %d hors limite" -#define MSG_ARG_PTR_NOSEM "Argument valant %d pointe sur un noeud sans Sem" -#define MSG_ARG_PTR_NOSEMS "Argument valant %d pointe sur un noeud sans smantique" -#define MSG_ARG_REF_LOOP "?Bouclage entre rfrences croises des arguments" -#define MSG_ARG_TWO_CONST "Le 2me argument de %s doit tre constant" -#define MSG_ARRAY_ALLOC_ERR "Erreur d'allocation mmoire dans ARRAY" -#define MSG_ARRAY_BNDS_EXCD "Hors limite de tableau" -#define MSG_ARRAY_ERROR "Erreur de fonctionnement k=%d n=%d" -#define MSG_ATTRIBUTE_ERROR "Erreur rgle %u attribut %s: " -#define MSG_ATT_NOT_CASE "Mauvaise valeur %d pour attribut (pas une CaseValue)" -#define MSG_ATT_POSCODE_BIG "Code attribut %d trop grand (max=%d)" -#define MSG_AVGLEN_ERROR "avglen doit tre entre %d et %d" -#define MSG_BAD_AGGREG_FUNC "Fonction aggrge %d non supporte" -#define MSG_BAD_ARGTYPES "Argument de type invalide pour %s" -#define MSG_BAD_ARGUMENTS "Argument non attachs pour %s" -#define MSG_BAD_ARG_NUM "Nombre d'arguments invalide %d" -#define MSG_BAD_ARG_TYPE "Type d'argument %d invalide" -#define MSG_BAD_ARRAY_OPER "Les tableaux doivent utiliser l'oprateur IN" -#define MSG_BAD_ARRAY_TYPE "Type=%d invalide pour un tableau" -#define MSG_BAD_ARRAY_VAL "Les tableaux doivent avoir le mme nombre de valeurs" -#define MSG_BAD_BIN_FMT "Format invalide %c pour la colonne BIN %s" -#define MSG_BAD_BLK_ESTIM "Nombre de blocs suprieur l'estimation" -#define MSG_BAD_BLK_SIZE "Taille du bloc %d non conforme" -#define MSG_BAD_BYTE_NUM "Le nombre d'octets crits est faux" -#define MSG_BAD_BYTE_READ "Le nombre d'octets lus est faux" -#define MSG_BAD_CARDINALITY "Appel invalide de Cardinality pour une table multiple" -#define MSG_BAD_CASE_SPEC "Min/Maj: spcification %c incorrecte, recommencez: " -#define MSG_BAD_CHAR_SPEC "Spcification '%s' invalide pour caractre" -#define MSG_BAD_CHECK_TYPE "Sous-type %d invalide pour CheckColumn" -#define MSG_BAD_CHECK_VAL "Valeur pour Check invalide '%s'" -#define MSG_BAD_COLCRT_ARG "COLCRT: Arg invalide (type=%hd, domain=%hd)" -#define MSG_BAD_COLDEF_TYPE "Coldefs: type illgal %d" -#define MSG_BAD_COLIST_ITEM "Elment invalide dans une Colist" -#define MSG_BAD_COLIST_TYPE "Mauvais type=%d pour une Colist" -#define MSG_BAD_COLSIZE "Colsize %d trop petit pour cette base de donnes" -#define MSG_BAD_COL_ENTRY "Entre invalide pour la colonne %s" -#define MSG_BAD_COL_FORMAT "Type de formattage %d invalide pour une colonne" -#define MSG_BAD_COL_IN_FILT "Colonne incorrecte dans un filtre" -#define MSG_BAD_COL_QUALIF "Qualificateur invalide %s pour la colonne %s" -#define MSG_BAD_COL_TYPE "Type invalide %s pour la colonne %s" -#define MSG_BAD_COL_XPATH "Xpath invalide colonne %s de la table HTML %s" -#define MSG_BAD_COMPARE_OP "Oprateur de comparaison %d invalide" -#define MSG_BAD_CONST_TYPE "Type=%d invalide pour une constante" -#define MSG_BAD_CONV_TYPE "Convertion de type invalide %d" -#define MSG_BAD_CORREL "Select %s.* corrlation absente" -#define MSG_BAD_DATETIME "Valeur date/temps invalide" -#define MSG_BAD_DATE_OPER "Oprateur de date inattendu %d" -#define MSG_BAD_DBF_FILE "Le fichier DBF %s est altr" -#define MSG_BAD_DBF_REC "Fichier DBF %s altr enregistrement %d" -#define MSG_BAD_DBF_TYPE "Type DBF %c non support" -#define MSG_BAD_DEF_ARG "Argument invalide pour INDEXDEF (type=%hd, domain=%hd)" -#define MSG_BAD_DEF_READ "EOF inattendue en lecture diffre" -#define MSG_BAD_DEF_TYPE "Type de colonne invalide" -#define MSG_BAD_DIRECTORY "Rpertoire invalide %s: %s" -#define MSG_BAD_DIST_JN_FIL "Filtre de jointure distincte invalide" -#define MSG_BAD_DIST_JOIN "Spcification invalide de jointure distincte" -#define MSG_BAD_DOM_COL_DEF "Dfinition de colonnes invalide pour un domaine" -#define MSG_BAD_DOM_VALUE "La valeur %d n'appartient pas au domaine" -#define MSG_BAD_EDIT_INIT "Coparm: dition %s initialise improprement" -#define MSG_BAD_EVAL_TYPE "Fonction scalaire de type=%d invalide" -#define MSG_BAD_EXEC_MODE "Mode d'excution invalide '%s'" -#define MSG_BAD_EXP_ARGTYPE "Argument de type %d invalide pour une expression" -#define MSG_BAD_EXP_OPER "Oprateur=%d invalide pour expression" -#define MSG_BAD_FETCH_RC "Code retour inattendu de Fetch %d" -#define MSG_BAD_FIELD_FMT "Format de champ invalide %c pour %s" -#define MSG_BAD_FIELD_RANK "Rang %d invalide pour la colonne %s" -#define MSG_BAD_FIELD_TYPE "Mauvais type de champ %s" -#define MSG_BAD_FILE_HANDLE "Handle de fichier invalide: %s" -#define MSG_BAD_FILE_LIST "La section liste de fichiers est errone" -#define MSG_BAD_FILTER "Mauvais filtre: Opc=%d B_T=%d %d Type=%d %d" -#define MSG_BAD_FILTER_CONV "Conversion filtre incorrecte, B_T=%d,%d" -#define MSG_BAD_FILTER_LINK "Oprateur de chanage illgal %d" -#define MSG_BAD_FILTER_OP "Oprateur de filtre invalide %d" -#define MSG_BAD_FILTEST_OP "Oprateur invalide %d %d pour FilTest" -#define MSG_BAD_FLD_FORMAT "Format invalide pour le champs %d de %s" -#define MSG_BAD_FLD_LENGTH "Champs %s trop long (%s --> %d) ligne %d de %s" -#define MSG_BAD_FLOAT_CONV "Convertion invalide d'un tableau flottant" -#define MSG_BAD_FPARM_NEXT "Coparm: FPARM avec Next non nul" -#define MSG_BAD_FREQ_SET "Spcification erronne de Freq pour la colonne %s" -#define MSG_BAD_FUNC_ARG "Funcarg de type %d non implment" -#define MSG_BAD_FUNC_ARGTYP "Mauvais type d'argument=%d pour une fonction" -#define MSG_BAD_FUNC_MODE "%s: mode invalide %d" -#define MSG_BAD_GENRE "Genre est invalide" -#define MSG_BAD_GETVIEW_RET "GetView: type de retour %d invalide" -#define MSG_BAD_HANDLE_VAL "Valeur Handle invalide" -#define MSG_BAD_HAV_FILTER "Filtre Having sur une requte non groupe" -#define MSG_BAD_HAV_FILTYPE "Filtre invalide pour clause Having" -#define MSG_BAD_HEADER "Fichier %s: bloc en-tte altr" -#define MSG_BAD_HEADER_VAL "Valeur invalide pour Header" -#define MSG_BAD_HEAD_END "Lecture fin d'en-tte impossible" -#define MSG_BAD_INDEX_COL "Colonne %s invalide pour index %s" -#define MSG_BAD_INDEX_DEF "Dfinition invalide pour index %s" -#define MSG_BAD_INDEX_FILE "Fichier index %s corrompu" -#define MSG_BAD_INDEX_PART "Dfinition colonne invalide pour index %s" -#define MSG_BAD_INPUT "Entre incorrecte" -#define MSG_BAD_IN_ARGTYPE "Argument de type invalide pour l'oprateur IN" -#define MSG_BAD_IN_ENDING "Erreur: fin de chane IN invalide" -#define MSG_BAD_IN_STRING "La chane IN commence ou finie par des caractres invalides %c ... %c" -#define MSG_BAD_JCOL_TYPE "Erreur logique JCT: disparit des types colonnes" -#define MSG_BAD_JOIN_EXP "Expression invalide pour une jointure" -#define MSG_BAD_JOIN_FILTER "Filtre de jointure invalide" -#define MSG_BAD_JOIN_OP "Oprateur de joint invalide %d" -#define MSG_BAD_LANG_SIZE "Le fichier langage a une mauvaise taille %d" -#define MSG_BAD_LINEFLD_FMT "Format invalide ligne %d champs %d de %s" -#define MSG_BAD_LINE_LEN "Longueur ligne non gale Lrecl" -#define MSG_BAD_LIST_TYPE "Type de liste invalide %d" -#define MSG_BAD_LOCALE "Locale invalide %s" -#define MSG_BAD_LOCDFON_ARG "Mauvais paramtre pour LOCDFON" -#define MSG_BAD_LOCNODE_USE "Usage inattendu de LOCNODE" -#define MSG_BAD_LRECL "Disparit lrecl table/fichier (%d,%hd)" -#define MSG_BAD_MAX_HAVING "MAXTMP trop petit pour Having" -#define MSG_BAD_MAX_NREC "MaxRec=%d ne correspond pas MaxBlk=%d Nrec=%d" -#define MSG_BAD_MAX_PARAM "Mauvais paramtres pour spcifier une valeur maximum" -#define MSG_BAD_MAX_SETTING "Mauvaise valeur '%c' pour max" -#define MSG_BAD_MERGE_TYPE "Le type %d ne pas tre intercall" -#define MSG_BAD_NODE_TYPE "Type noeud erron pour la table" -#define MSG_BAD_OFFSET_VAL "Nul offset invalide pour une table CSV" -#define MSG_BAD_OPEN_MODE "Mode d'ouverture invalide %d" -#define MSG_BAD_OPERATOR "Oprateur invalide %s" -#define MSG_BAD_ORDER_MODE "Mode de tri %c invalide" -#define MSG_BAD_ORDER_TYPE "Tri sur objet de type=%d invalide" -#define MSG_BAD_OUTER_JOIN "Jointure externe invalide sur table enfant" -#define MSG_BAD_PAD_ARGTYP "Argument de type invalide pour Pad ou Justify" -#define MSG_BAD_PARAMETERS "%.8s: Mauvais paramtres" -#define MSG_BAD_PARAM_TYPE "%.8s: Paramtre de type=%d invalide" -#define MSG_BAD_PARM_COUNT "Nombre de paramtres incohrent" -#define MSG_BAD_PHASE_NUM "Numro de phrase %d hors limite" -#define MSG_BAD_PHRASE_NB "numro de phrase hors limite %d rc=%d\n" -#define MSG_BAD_POS_CODE "POS_code invalide %d" -#define MSG_BAD_POS_TYPE "Type de POS_code invalide %d" -#define MSG_BAD_PROJNUM "Mauvais projnum %d pour la colonne %s" -#define MSG_BAD_QUERY_OPEN "Mode invalide %d pour l'ouverture d'une requte" -#define MSG_BAD_QUERY_TYPE "Type de requte %d invalide pour %s" -#define MSG_BAD_QUOTE_FIELD "Quote manquante dans %s champs %d ligne %d" -#define MSG_BAD_READ_NUMBER "Mauvais nombre %d de valeurs lues dans %s" -#define MSG_BAD_RECFM "Recfm type %d invalide pour DOSCOL" -#define MSG_BAD_RECFM_VAL "Valeur invalide %d de Recfm" -#define MSG_BAD_RESULT_TYPE "Mauvais type de rsultat %d pour %s" -#define MSG_BAD_RETURN_TYPE "Type de retour %d incorrect" -#define MSG_BAD_ROW_VALIST "Liste de valeurs invalide pour ROW" -#define MSG_BAD_ROW_VALNB "Nombre de valeurs ingal dans la liste" -#define MSG_BAD_SCF_ARGTYPE "Argument %d de type=%s invalide pour %s" -#define MSG_BAD_SEM_DOMAIN "Domain .%d invalide" -#define MSG_BAD_SETTINGS "Certaines spcifications sont incompatibles avec le type de la table" -#define MSG_BAD_SET_CASE "La casse d'un tableau ne peut pas passer de non respect respecter" -#define MSG_BAD_SET_STRING "SetValue: appel invalide pour STRING" -#define MSG_BAD_SET_TYPE "Set type %hd invalide" -#define MSG_BAD_SPECIAL_CMD "Commande spciale invalide" -#define MSG_BAD_SPECIAL_COL "Colonne spciale invalide %s" -#define MSG_BAD_SPEC_COLUMN "Colonne spciale invalide pour ce type de table" -#define MSG_BAD_SQL_PARAM "Paramtre SQL invalide pour FindColblk" -#define MSG_BAD_SUBLST_TYPE "Coparm: type %d de sous-liste invalide" -#define MSG_BAD_SUBSEL_IN_X "Sub-select invalide pour une expression" -#define MSG_BAD_SUBSEL_TYPE "Type %d invalide retourn de Sub-Select" -#define MSG_BAD_SUB_RESULT "Rsultat indfini de fonction Sub-Select" -#define MSG_BAD_SUB_SELECT "Sub-select invalide comme argument de fonction" -#define MSG_BAD_TABLE_LINE "Ligne '%s' illgale ou tronque dans la section Tables" -#define MSG_BAD_TABLE_LIST "Table %s absente de la liste des tables" -#define MSG_BAD_TABLE_TYPE "Type invalide %s pour la table %s" -#define MSG_BAD_TEST_TYPE "BlockTest sur tableau: types dpareills %s %s" -#define MSG_BAD_TRIM_ARGTYP "Argument de type invalide pour Trim" -#define MSG_BAD_TYPE_FOR_IN "Types d'argument incompatibles pour la fonction IN" -#define MSG_BAD_TYPE_FOR_S "Type incorrecte %d pour %s(%d)" -#define MSG_BAD_TYPE_LIKE "Type(%d)= %d invalide pour LIKE" -#define MSG_BAD_UPD_COR "Le qualificateur %s de la colonne %s ne se refre pas la table mise jour %s" -#define MSG_BAD_USERBLK_LEN "Mauvaise longueur l'criture du bloc utilisateur" -#define MSG_BAD_USETEMP "Usetemp invalide '%s'" -#define MSG_BAD_USETEMP_VAL "Valeur pour Usetemp invalide %d" -#define MSG_BAD_VALBLK_INDX "Valeur hors limites de l'index du bloc de valeurs" -#define MSG_BAD_VALBLK_TYPE "Type=%d invalide pour un bloc de valeurs" -#define MSG_BAD_VALNODE "Type %d invalide pour le noeud valeur colonne %s" -#define MSG_BAD_VALUE_TYPE "Type de valeur invalide %d" -#define MSG_BAD_VAL_UPDATE "Impossible de dterminer quelle valeur %s doit tre mise jour" -#define MSG_BAD_VIEW_OPEN "Mode invalide %d pour l'ouverture d'une View" -#define MSG_BAD_XMODE_VAL "Mode d'excution %d invalide" -#define MSG_BAD_XOBJ_TYPE "Mauvais type de Xobject %d" -#define MSG_BAS_NS_LIST "Format invalide de la liste des espace-noms" -#define MSG_BIN_F_TOO_LONG "Valeur trop longue pour le champ %s (%d --> %d)" -#define MSG_BIN_MODE_FAIL "Echec mode binaire: %s" -#define MSG_BLKTYPLEN_MISM "Disparit types/longueurs de bloc dans SetValue" -#define MSG_BLK_IS_NULL "Blk est nul" -#define MSG_BLOCK_NO_MATCH "Bloc non correspondant" -#define MSG_BREAKPOINT "Point de controle" -#define MSG_BUFF_TOO_SMALL "GetColData: Buffer trop petit" -#define MSG_BUFSIZE_ERROR "Erreur en recherchant la taille du buffer" -#define MSG_BUILDING_GROUPS "Formation des groupes" -#define MSG_BUILD_DIST_GRPS "Formation des groupes distinctes" -#define MSG_BUILD_INDEX "Construction index %s sur %s" -#define MSG_BXP_NULL "Bxp nul dans PUTFON" -#define MSG_CANNOT_OPEN "Ouverture impossible de %s" -#define MSG_CD_ONE_STEP "Count Distinct doit tre excut en une seule tape" -#define MSG_CD_ORDER_ERROR "Erreur de tri dans Count Distinct" -#define MSG_CHECKING_ROWS "Test des lignes mettre jour" -#define MSG_CHECK_LEVEL "Niveau de vrification fix %u" -#define MSG_CHSIZE_ERROR "Erreur dans chsize: %s" -#define MSG_CLN_NOT_IN_JOIN "La colonne C%d n'est pas dans le join" -#define MSG_CNTDIS_COL_LOST "Colonne du Count Distinct perdue" -#define MSG_COLIST_BAD_TYPE "Type=%d invalide pour Colist" -#define MSG_COLNAM_TOO_LONG "Nom de colonne trop long" -#define MSG_COLSEC_TOO_BIG "Section colonne trop grande, table %s (%d)" -#define MSG_COLS_REDUCED " (rduit par Maxcol)" -#define MSG_COLUMN_ERROR "Erreur de colonne" -#define MSG_COLUMN_MISMATCH "Colonne %s dpareille" -#define MSG_COLUMN_NOT_KEY "La colonne jointe R%d.%s n'est pas une cl" -#define MSG_COL_ALLOC_ERR "Allocation impossible du noeud colonne" -#define MSG_COL_ALLOC_ERROR "Erreur d'allocation mmoire pour la colonne %d" -#define MSG_COL_HAS_NO_DEF "La colonne %s n'est pas dfinie" -#define MSG_COL_INVAL_TABLE "La colonne %s.%s n'existe pas dans la table %s alias %s" -#define MSG_COL_ISNOT_TABLE "La colonne %s n'est pas dans la table %s" -#define MSG_COL_NB_MISM "Le nombre de colonnes ne correspond pas" -#define MSG_COL_NOTIN_GRPBY "La colonne %s n'est pas dans la liste de Group By" -#define MSG_COL_NOTIN_TABLE "La colonne %s n'est dans aucune table" -#define MSG_COL_NOTIN_UPDT "%s n'appartient pas la table mise jour %s" -#define MSG_COL_NOT_CODED "La colonne %s n'est pas codifie" -#define MSG_COL_NOT_EXIST "La colonne %s n'existe pas dans %s" -#define MSG_COL_NOT_FOUND "La colonne %s n'est pas dans la table %s" -#define MSG_COL_NOT_IN_DB "La colonne %s de la table %s n'est pas dans la base de donnes" -#define MSG_COL_NOT_IN_JOIN "La colonne %s n'est pas dans le join" -#define MSG_COL_NOT_SORTED "La colonne %s de la table %s n'est pas trie" -#define MSG_COL_NUM_MISM "Disparit du nombre de colonnes" -#define MSG_COL_USED_TWICE "Colonne %s utilise deux fois ???" -#define MSG_COMPUTE_ERROR "Erreur dans Compute, op=%d" -#define MSG_COMPUTE_NIY "Compute non implment pour TOKEN" -#define MSG_COMPUTING "Calculs en cours" -#define MSG_COMPUTING_DIST "Comptage des valeurs distinctes" -#define MSG_COMPUTING_FUNC "Calcul de(s) fonction(s)" -#define MSG_COM_ERROR "Erreur Com" -#define MSG_CONCAT_SUBNODE "Concatnation de sous-noeuds impossible" -#define MSG_CONNECTED "Connecte" -#define MSG_CONNECT_CANCEL "Connection interrompue par l'utilisateur" -#define MSG_CONNECT_ERROR "Erreur %d se connectant %s" -#define MSG_CONN_CLOSED "%s(%d) ferme" -#define MSG_CONN_CREATED "Connexion %s cre" -#define MSG_CONN_DROPPED "Connexion %s supprime" -#define MSG_CONN_OPEN "%s(%d) ouverte (%s)" -#define MSG_CONN_SUC_OPEN "%s(%d) ouverte avec succs" -#define MSG_CONTROL_C_EXIT "Exit par Ctrl-C" -#define MSG_COPY_BAD_PHASE "Copie de liste invalide en phase %d" -#define MSG_COPY_INV_TYPE "Coparm: type non support %d" -#define MSG_CORREL_NO_QRY "Les sous-requtes corrles ne peuvent pas tre de type QRY" -#define MSG_CREATED_PLUGDB " Cr par PlugDB %s " -#define MSG_CURSOR_SET "Curseur remis %d" -#define MSG_DATABASE_ACTIVE "Base de donnes %s active" -#define MSG_DATABASE_LOADED "Base de donnes %s charge" -#define MSG_DATA_IS_NULL "ExecSpecialCmd: data est NULL" -#define MSG_DATA_MISALIGN "Mauvais alignement pour ce type de donnes" -#define MSG_DBASE_FILE "Fichier dBASE dbf: " -#define MSG_DB_ALREADY_DEF "Base de donnes %s dj dfinie" -#define MSG_DB_ALTERED "Base de donnes modifie" -#define MSG_DB_CREATED "Base de donnes %s cre" -#define MSG_DB_NOT_SPEC "Base de donnes non spcifie" -#define MSG_DB_REMOVED "Base de donnes %s retire de la liste" -#define MSG_DB_SORT_ERROR "Erreur de tri DB" -#define MSG_DB_STOPPED "Arrt de la base de donnes %s" -#define MSG_DEBUG_NOT_ACTIV "Mode Debug inactif" -#define MSG_DEBUG_SET_INV "Invalide pour Debug: %c" -#define MSG_DEF_ALLOC_ERROR "Erreur d'allocation de la classe DEF %s" -#define MSG_DELETING_ROWS "Suppression des lignes" -#define MSG_DEL_FILE_ERR "Erreur l'effacement de %s" -#define MSG_DEL_READ_ERROR "Delete: erreur en lecture req=%d len=%d" -#define MSG_DEL_WRITE_ERROR "Delete: erreur en criture: %s" -#define MSG_DEPREC_FLAG "Option Flag prime, utiliser Coltype" -#define MSG_DICTIONARY "Dictionnaire " -#define MSG_DIRECT_VARTOK "Accs direct aux rgles du Variable Token non implment" -#define MSG_DISCONNECTED "Dconnect" -#define MSG_DISTINCT_ERROR "Plus d'un lment fonctionel DISTINCT" -#define MSG_DISTINCT_ROWS "Slection des lignes distinctes" -#define MSG_DISTINCT_VALUES "Extraction des valeurs distinctes" -#define MSG_DIS_NOHEAD_JOIN "Jointure distincte sur une table non en tte" -#define MSG_DLL_LOAD_ERROR "Erreur %d au chargement du module %s" -#define MSG_DOMAIN_EMPTY "Le domaine %s est vide" -#define MSG_DOMAIN_ERROR "Colonne %s: disparit domaine(%s)/valeur(%s)" -#define MSG_DOMAIN_FULL "Le domaine %s est plein (max=%d)" -#define MSG_DOM_FILE_ERROR "Fichier domain %s introuvable" -#define MSG_DOM_NOT_SUPP "MS-DOM non support par cette version" -#define MSG_DOM_OPEN_ERROR "Erreur d'ouverture du domaine: %s" -#define MSG_DOM_READ_ERROR "Erreur %d en lecture de domaine: %s" -#define MSG_DOM_READ_ONLY "La table domaine %s est en lecture seulement" -#define MSG_DOM_WRITE_ERROR "Erreur %d en criture de domaine: %s" -#define MSG_DONE "Effectu, rc=%d" -#define MSG_DOSALMEM_NOMEM "Erreur d'allocation, pas assez de mmoire" -#define MSG_DROP_DB_ERR "Echec du Drop sur le base de donnes %s" -#define MSG_DSORT_LOG_ERROR "Kindex: Erreur logique de tri distincte" -#define MSG_DUMMY_NO_COLS "Les tables DUMMY ne peuvent pas avoir de colonne" -#define MSG_DUPLICAT_COUNT "Count sur plus d'une colonne" -#define MSG_DUP_COL_NAME "La colonne %s existe en double" -#define MSG_DUP_PROJNUM "Non unique projnum %d pour la colonne %s" -#define MSG_DVAL_NOTIN_LIST "Valeur %s non trouve dans la liste des valeurs distinctes de la colonne %s" -#define MSG_EMPTY_DOC "Document vide" -#define MSG_EMPTY_FILE "%s du fichier vide %s: " -#define MSG_ENDSTR_MISMATCH "Fins de chane et de noeud ne correspondent pas" -#define MSG_END_OF_DELETE "%d ligne(s) enleve(s) en %.2lf sec" -#define MSG_END_OF_INSERT "%d ligne(s) insre(s) en %.2lf sec" -#define MSG_END_OF_QUERY "%d ligne(s) extraite(s) en %.2lf sec" -#define MSG_END_OF_UPDATE "%d ligne(s) modifie(s) en %.2lf sec" -#define MSG_EOF_AFTER_LINE "Fin de fichier aprs la ligne %d" -#define MSG_EOF_INDEX_FILE "EOF lisant le fichier index" -#define MSG_ERASED " et efface" -#define MSG_ERASE_FAILED " (chec de l'effacement)" -#define MSG_ERROR "Erreur" -#define MSG_ERROR_IN_LSK "Erreur %d dans lseek64" -#define MSG_ERROR_IN_SFP "Erreur %d dans SetFilePointer" -#define MSG_ERROR_NO_PARM "Paramtre absent (valide seulement pour %.8s.1 et %.8s.5)" -#define MSG_ERROR_OPENING "Erreur l'ouverture de : " -#define MSG_ERR_NUM_GT_MAX "Erreur: Numval (%d) plus grand que Maxnum (%d)" -#define MSG_ERR_READING_REC "Erreur lisant l'enregistrement %d de %s" -#define MSG_ERR_RET_RULE "Retour erreur, rgle=%u" -#define MSG_ERR_RET_TYPE "Retour erreur, type=%d" -#define MSG_EVAL_EXPIRED "Cette version d'valuation est expire" -#define MSG_EVAL_ONLY "L'utilisation de cette Dll est pour valuation seulement" -#define MSG_EXECUTING "Excution" -#define MSG_EXECUTION_ERROR "Erreur d'excution" -#define MSG_EXEC_MODE_IS "Le mode d'excution est %s" -#define MSG_EXEC_MODE_RESET ". Mode remis Execute" -#define MSG_EXEC_MODE_SET "Mode d'excution fix %s" -#define MSG_EXIT_EVAL_ERR "Erreur pendant l'valuation de Exit" -#define MSG_EXIT_FROM_LANG "Fin du langage %s version %d.%d" -#define MSG_FAIL_ADD_NODE "L'ajout du noeud %s dans la table a chou" -#define MSG_FETCHING_DATA "Recherche des donnes" -#define MSG_FETCHING_ROWS "Recherche des lignes" -#define MSG_FETCH_NO_RES "Fetch: Pas de Rsultats" -#define MSG_FIELD_TOO_LONG "Valeur trop longue pour le champs %d ligne %d" -#define MSG_FILELEN_ERROR "Erreur dans %s pour %s" -#define MSG_FILE_CLOSE_ERR "Erreur %d la fermeture du fichier" -#define MSG_FILE_IS_EMPTY "Le fichier %s est vide" -#define MSG_FILE_MAP_ERR "Erreur de File mapping" -#define MSG_FILE_MAP_ERROR "CreateFileMapping %s erreur rc=%d" -#define MSG_FILE_NOT_FOUND "Fichier %s introuvable" -#define MSG_FILE_OPEN_YET "Fichier %s dj ouvert" -#define MSG_FILE_UNFOUND "Fichier %s non trouv" -#define MSG_FILGRP_NO_TABLE "Table %d manquante pour groupe filtre" -#define MSG_FILTER_ATTACH "Filtre pass Attach" -#define MSG_FILTER_NO_TABLE "Filtre: premire table manquante" -#define MSG_FIND_BAD_TYPE "Recherche dans un tableau: type non conforme %s %s" -#define MSG_FIX_OVFLW_ADD "Dpassement de capacit en addition" -#define MSG_FIX_OVFLW_TIMES "Dpassement de capacit en mutiplication" -#define MSG_FIX_UNFLW_ADD "Sous dpassement de capacit en addition" -#define MSG_FIX_UNFLW_TIMES "Sous dpassement de capacit en multiplication" -#define MSG_FLD_TOO_LNG_FOR "Champs %d trop long pour %s ligne %d de %s" -#define MSG_FLTST_NO_CORREL "FilTest ne devrait tre appel que pour les sous-requtes corrles" -#define MSG_FLT_BAD_RESULT "Virgule flottante: rsultat inexacte" -#define MSG_FLT_DENORMAL_OP "Oprande virgule flottante non normalis" -#define MSG_FLT_INVALID_OP "Opration virgule flottante invalide" -#define MSG_FLT_OVERFLOW "Dpassement de capacit virgule flottante" -#define MSG_FLT_STACK_CHECK "Virgule flottante: Erreur de la pile" -#define MSG_FLT_UNDERFLOW "Sous-dpassement de capacit virgule flottante" -#define MSG_FLT_ZERO_DIVIDE "Virgule flottante: division par zro" -#define MSG_FMT_WRITE_NIY "L'criture des fichiers %s n'est pas encore implmente" -#define MSG_FNC_NOTIN_SLIST "Fonction de tri absente de la liste de slection" -#define MSG_FORMAT_ERROR "Erreur de formattage" -#define MSG_FOXPRO_FILE "Fichier FoxPro: " -#define MSG_FPUTS_ERROR "Erreur dans fputs: %s" -#define MSG_FSBPARP_NULL "PUTFON: fsbparp est nul" -#define MSG_FSEEK_ERROR "Erreur dans fseek: %s" -#define MSG_FSETPOS_ERROR "Erreur dans fseek pour i=%d" -#define MSG_FTELL_ERROR "Erreur dans ftell enregistrement=%d: %s" -#define MSG_FUNCTION_ERROR "Erreur dans %s: %d" -#define MSG_FUNC_ERRNO "Erreur %d dans %s" -#define MSG_FUNC_ERROR "Erreur dans %s" -#define MSG_FUNC_ERR_S "Erreur dans %s: %s" -#define MSG_FUNC_REF_DEL "Rfrence une fonction dfinie (rgle %d) qui a t supprime" -#define MSG_FWRITE_ERROR "Erreur dans fwrite: %s" -#define MSG_GETCWD_ERR_NO "?getcwd %s errno=%d" -#define MSG_GETFILESIZE_ERR "Erreur %d dans GetFileSize" -#define MSG_GET_DIST_VALS "Rcupration des valeurs distinctes de " -#define MSG_GET_ERROR "Erreur dans %s (colonne %d)" -#define MSG_GET_FUNC_ERR "Erreur en recherche de la fonction %s: %s" -#define MSG_GET_NAME_ERR "Erreur en retrouvant le nom d'une table SYS" -#define MSG_GLOBAL_ERROR "Erreur d'allocation de Global (taille=%d)\n" -#define MSG_GRAM_ALLOC_ERR "Erreur d'allocation dans Grammar Up" -#define MSG_GRAM_MISMATCH "Avertissement: version de GRAMMAR prime (sauv sous GRAMMAR v%u)" -#define MSG_GRAM_SUBSET_ERR "Erreur d'initialisation du dictionnaire de la grammaire" -#define MSG_GRBY_TAB_NOTIMP "Group by avec tables jointes non implment" -#define MSG_GROUPBY_NOT_ALL "Group By doit inclure toutes les slections non-fonctionnelles" -#define MSG_GROUP_ON_FUNC "Group by invalide sur colonne fonctionnelle" -#define MSG_GRP_COL_MISM "Disparit colonne des groupes" -#define MSG_GRP_LIST_MISMAT "Le groupement ne couvre pas la liste de slection" -#define MSG_GUARD_PAGE "Violation de page de garde" -#define MSG_GZOPEN_ERROR "gzopen %s: erreur %d sur %s" -#define MSG_GZPUTS_ERROR "Erreur dans gzputs: %s" -#define MSG_HANDLE_IS_NULL "%s est NULL: erreur code: %d" -#define MSG_HARRY_COMP_NIY "Compute non implment pour les chanes codes" -#define MSG_HAVING_FILTER "Traitement du Filtre Having" -#define MSG_HBUF_TOO_SMALL "Buffer(%d) trop petit pour entte(%d)" -#define MSG_HEAD_OPEN_ERROR "Erreur l'ouverture du fichier header" -#define MSG_HEAD_READ_ERROR "Erreur en lecture du fichier header %s" -#define MSG_HEAD_WRITE_ERR "Erreur en criture du fichier header" -#define MSG_HI_OFFSET_ERR "Offset suprieur non nul" -#define MSG_HUGE_DEFAULT "Huge est %d par dfault" -#define MSG_HUGE_WARNING_1 "Mmoire Huge non compatible 16-bit pour %d\n" -#define MSG_HUGE_WARNING_2 "Rsultats imprvisibles possibles\n" -#define MSG_IDLE "Au repos" -#define MSG_ILLEGAL_INSTR "Instruction illgale" -#define MSG_ILL_FILTER_CONV "Conversion implicite illgale dans un filtre" -#define MSG_INDEX_CREATED "Index %s cr sur %s" -#define MSG_INDEX_DEF_ERR "Erreur sauvegardant l'index dfinition pour %s" -#define MSG_INDEX_DROPPED "Index %s supprim de %s" -#define MSG_INDEX_INIT_ERR "Echec de l'initialisation de l'index %s" -#define MSG_INDEX_NOT_DEF "Index %s non dfini" -#define MSG_INDEX_NOT_UNIQ "L'index n'est pas Unique" -#define MSG_INDEX_ONE_SAVE "Les index sont sauvegards dans un fichier unique" -#define MSG_INDEX_SEP_SAVE "Les index sont sauvegards dans des fichiers spars" -#define MSG_INDEX_YET_ON "L'index %s existe dj sur %s" -#define MSG_INDX_ALL_DROP "Tous les index de %s supprims" -#define MSG_INDX_COL_NOTIN "La colonne index %s n'existe pas dans la table %s" -#define MSG_INDX_EXIST_YET "L'entre index existe dj" -#define MSG_INIT_ERROR "Erreur l'initialisation de %s" -#define MSG_INIT_FAILED "L'initialisation de %s a chou" -#define MSG_INPUT "Entre: " -#define MSG_INPUT_KEYBD_YET "L'entre est dj au clavier" -#define MSG_INSERTING "Insertion: " -#define MSG_INSERT_ERROR "Insert erreur: usage multiple du fichier %s" -#define MSG_INSERT_MISMATCH "Les listes colonne et valeur ne correspondent pas" -#define MSG_INTERNAL "interne" -#define MSG_INT_COL_ERROR "Erreur interne sur la colonne index %s" -#define MSG_INT_OVERFLOW "Dpassement de capacit sur entier" -#define MSG_INT_ZERO_DIVIDE "Division entire par zro" -#define MSG_INVALID_BIP "Bip invalide .%d" -#define MSG_INVALID_DISP "Disposition invalide" -#define MSG_INVALID_FTYPE "SBV: Ftype %d invalide" -#define MSG_INVALID_HANDLE "Poigne invalide" -#define MSG_INVALID_OPER "Oprateur invalide %d pour %s" -#define MSG_INVALID_OPTION "Option invalide %s" -#define MSG_INV_COLUMN_TYPE "Type %d Invalide pour la colonne %s" -#define MSG_INV_COL_DATATYP "Type de donnes %d invalide pour la colonne %d" -#define MSG_INV_COL_NUM "Colonne invalide %d" -#define MSG_INV_COL_TYPE "Type de colonne %s invalide" -#define MSG_INV_CONC_BIP "Bip invalide (seuls valides: %.8s.0 .1 and .5)" -#define MSG_INV_DATA_PATH "Chemin vers les donnes invalide" -#define MSG_INV_DEF_READ "Lecture diffre invalide rc=%d" -#define MSG_INV_DIRCOL_OFST "Offset invalide pour une colonne DIR" -#define MSG_INV_DOMAIN_TYPE "Type invalide %d" -#define MSG_INV_FILTER "Filtre rsiduel dans %s" -#define MSG_INV_FNC_BUFTYPE "FNC: Type %d de l'argument invalide pour %s" -#define MSG_INV_INFO_TYPE "Type d'info catalog invalide %d" -#define MSG_INV_INIPATH "Inipath invalide " -#define MSG_INV_MAP_POS "Position mmoire invalide" -#define MSG_INV_OPERATOR "oprateur invalide %d\n" -#define MSG_INV_PARAMETER "Paramtre invalide %s" -#define MSG_INV_PARM_TYPE "Type de paramtre invalide" -#define MSG_INV_QUALIFIER "Qalificateur '%s' invalide" -#define MSG_INV_QUERY_TYPE "Type de requte %d invalide" -#define MSG_INV_RAND_ACC "L'accs alatoire d'une table non optimise est impossible" -#define MSG_INV_REC_POS "Position d'enregistrement invalide" -#define MSG_INV_RESULT_TYPE "Type de rsultat invalide %s" -#define MSG_INV_SET_SUBTYPE "Type de formattage %d invalide" -#define MSG_INV_SPECIAL_CMD "%s: Commande spciale invalide" -#define MSG_INV_SUBTYPE "Sous type invalide %s" -#define MSG_INV_TOK_DOMAIN "Le domaine %s n'existe pas" -#define MSG_INV_TOPSEM_CMD "Commande TopSem invalide %c" -#define MSG_INV_TRANSF_USE "Usage invalide en rgle transformationnelle" -#define MSG_INV_TYPE_SPEC "Spcification de type invalide (%.8s.%d)" -#define MSG_INV_UPDT_TABLE "Table %s invalide pour Update" -#define MSG_INV_VALUE_LIST "Liste de valeurs invalide pour Insert" -#define MSG_INV_WHERE_JOIN "Clause Where invalide dans une requte de jointure" -#define MSG_INV_WORK_PATH "Chemin de travail invalide" -#define MSG_IN_ARGTYPE_MISM "Arguments de types incompatibles pour une expression IN" -#define MSG_IN_USE " et en activit" -#define MSG_IN_WITHOUT_SUB "IN ou EXISTS sans tableau ou subquery" -#define MSG_IS_NOT_CONN "%s n'est pas une connexion dfinie" -#define MSG_JCT_MISS_COLS "Colonnes manquantes pour une table JCT" -#define MSG_JCT_MISS_TABLE "Table jointe manquante pour JCT" -#define MSG_JCT_NO_FILTER "Filtrage impossible des tables virtuelles JCT" -#define MSG_JCT_NO_KEY "Erreur logique JCT: cl manquante" -#define MSG_JOIN_KEY_NO_COL "La cl de jointure n'est pas une colonne" -#define MSG_KEY_ALLOC_ERR "Erreur d'allocation d'un bloc offset cl" -#define MSG_KEY_ALLOC_ERROR "Erreur d'allocation mmoire, Klen=%d n=%d" -#define MSG_LANGUAGE_QUIT "%s libr" -#define MSG_LANG_ACTIVE "Langage %s actif" -#define MSG_LANG_ALLOC_FAIL "PlugInitLang: Erreur d'allocation du bloc Lang" -#define MSG_LANG_ALREADY_UP "Langage dj en dition" -#define MSG_LANG_BAD_SAVE "Langage %s peut-tre incorrectement sauvegard" -#define MSG_LANG_NOT_FREED "Langage %s non librable (pas dans la chane principale)" -#define MSG_LANG_SAVED "Langage %s sauvegard" -#define MSG_LANG_WR_LEN_ERR "Erreur de longueur l'criture du bloc Lang" -#define MSG_LDF_ALLOC_ERROR "Erreur d'allocation d'un LdfBlock" -#define MSG_LDF_RN_MISMATCH "LDF: dcalage des numros de rgle" -#define MSG_LDF_WLEN_ERROR "Erreur de longueur en crivant LdfData" -#define MSG_LDF_W_LEN_ERROR "Erreur de longueur pour LdfData en criture" -#define MSG_LIC_NO_MYSQL "Votre licence actuelle ne permet pas l'utilisation du type MYSQL" -#define MSG_LINEAR_ERROR "Erreur de linarisation" -#define MSG_LINE_LENGTH "Largeur d'impression fixe %d" -#define MSG_LINE_MAXLIN "Nombre de lignes de travail plafonn %d" -#define MSG_LINE_MAXRES "Nombre de lignes de rsultat plafonn %d" -#define MSG_LINE_MAXTMP "Nombre de lignes intermdiaires plafonn %d" -#define MSG_LINE_TOO_LONG "La nouvelle ligne est trop longue" -#define MSG_LINJOINDB_ERROR "Erreur systme: appel incorrecte LinJoinDB" -#define MSG_LIST "--Liste--" -#define MSG_LNG_NOT_IN_LIST "Le langage %s n'est pas dans la liste" -#define MSG_LOADING_DB "Chargement description de la BD" -#define MSG_LOADING_FAILED "Le chargement de %s a chou" -#define MSG_LOAD_CDLL_ERROR "Erreur au chargement de ConnDll: rc=%d" -#define MSG_LOCSTRG_TOO_BIG "LOCSTRG: n trop grand ? (%d)\n" -#define MSG_LOGICAL_ERROR "%s: Erreur logique" -#define MSG_LRECL_TOO_SMALL "Lrecl trop petit (longueur en-tte = %d)" -#define MSG_MAC_NO_DELETE "Pas de suppression de lignes pour les tables MAC" -#define MSG_MAC_NO_INDEX "Pas d'accs direct aux tables MAC" -#define MSG_MAC_READ_ONLY "Les tables MAC sont en lecture seulement" -#define MSG_MAC_WIN_ONLY "Les tables MAC sont seulement sous Windows" -#define MSG_MAKE_EMPTY_FILE "Gnration du fichier vide %s: %s" -#define MSG_MAKING "Gnration" -#define MSG_MAKING_DISTINCT "Regroupement des valeures distinctes" -#define MSG_MALLOC_ERROR "Allocation mmoire impossible par %s" -#define MSG_MALLOC_NULL "malloc retourne Null" -#define MSG_MAP_NO_MORE "Le type %s n'est plus support" -#define MSG_MAP_OBJ_ERR "Erreur %d la fermeture du map objet" -#define MSG_MAP_VEC_ONLY "MAP Insert permis seulement pour les tables VEC Estimate" -#define MSG_MAP_VIEW_ERROR "MapViewOfFile %s erreur rc=%d" -#define MSG_MAXSIZE_ERROR "Maxsize incalculable sur table ouverte" -#define MSG_MAXTMP_TRUNCATE "Rsultats intermdiaires tronqus par maxtmp=%d" -#define MSG_MAX_BITMAP "Taille maxi des bitmaps d'optimisation fixe %d" -#define MSG_MEMSIZE_TOO_BIG "Erreur: memsize (%d) trop grand pour Length (%d)" -#define MSG_MEM_ALLOC_ERR "Erreur d'allocation mmoire, taille %s = %d" -#define MSG_MEM_ALLOC_ERROR "Erreur d'allocation mmoire" -#define MSG_MEM_ALLOC_YET "Mmoire dj alloue" -#define MSG_METAFILE_NOTFND "Fichier Meta introuvable" -#define MSG_MISPLACED_QUOTE "Appostrophe mal place ligne %d" -#define MSG_MISSING "Manquant: Value=%p Argval=%p Builtin=%d" -#define MSG_MISSING_ARG "Argument manquant pour l'oprateur %d" -#define MSG_MISSING_COL_DEF "Dfinition des colonnes manquante" -#define MSG_MISSING_CONNECT "Connection #1 manquante" -#define MSG_MISSING_EOL "Fin de ligne manquante dans %s" -#define MSG_MISSING_FIELD "Champs %d manquant dans %s ligne %d" -#define MSG_MISSING_FNAME "Nom du fichier manquant" -#define MSG_MISSING_NODE "Noeud %s manquant dans %s" -#define MSG_MISSING_POS "POS code manquant" -#define MSG_MISSING_ROWNODE "Impossible de trouver le noeud de la ligne %d" -#define MSG_MISSING_SERV_DB "Indication serveur et/ou base de donnes manquante" -#define MSG_MISS_LEAD_COL "Colonne majeure %s manquante" -#define MSG_MISS_NAME_LRECL "Nom du fichier et/ou LRECL manquant" -#define MSG_MISS_TABLE_LIST "Liste des tables manquante" -#define MSG_MISS_VCT_ELMT "Taille de bloc vectoriel manquante (Elements)" -#define MSG_MIS_TAG_LIST "Liste des balises colonne manquante" -#define MSG_MKEMPTY_NIY "MakeEmptyFile: pas encore implement pour Huge et Unix" -#define MSG_MOVE_INV_TYPE "MOVPARM: paramtre de type invalide %d" -#define MSG_MULT_DISTINCT "Distinct utilis plus d'une fois" -#define MSG_MULT_KEY_ERROR "Erreur sur cl multiple k=%d n=%d" -#define MSG_MUL_MAKECOL_ERR "Erreur logique dans TABMUL::MakeCol" -#define MSG_MYSQL_CNC_OFF "La connexion MySQL est ferme" -#define MSG_MYSQL_CNC_ON "La connexion MySQL est tablie" -#define MSG_MYSQL_NOT_SUP "Pas de support de MySQL dans cette version" -#define MSG_MY_CNC_ALREADY "La connexion MySQL est dj active" -#define MSG_NAME_CONV_ERR "Erreur de convertion du nom de noeud" -#define MSG_NAME_IS_USED "Le nom %s est dj utilis" -#define MSG_NCOL_GT_MAXCOL "Trop de colonnes (%d > %d max)" -#define MSG_NEW_CHAR_NULL "new char(%d) retourne Null" -#define MSG_NEW_DOC_FAILED "Impossible de crer le nouveau document" -#define MSG_NEW_RETURN_NULL "NULL renvoy par New dans PlugEvalLike" -#define MSG_NEW_TABLE_ERR "La nouvelle table %s ne peut pas tre charge" -#define MSG_NEXT_FILE_ERROR "Erreur en recherche du fichier suivant. rc=%s" -#define MSG_NODEF_FROM_VIEW "Pas de dfinition de table depuis une view" -#define MSG_NODE_FOR_CHAR "Noeud %s trouve au lieu d'un caractre" -#define MSG_NODE_SUBSET_ERR "Erreur d'initialisation de la zone Noeud %d" -#define MSG_NONCONT_EXCEPT "Exception non-continuable" -#define MSG_NON_DUP_HAVING "Clause Having dans une requte non fonctionelle" -#define MSG_NON_EVAL_SEM "Sem non value: p_no=%d" -#define MSG_NOP_ZLIB_INDEX "L'indexage d'une table zlib non optimise est impossible" -#define MSG_NOT_A_DBF_FILE "Le fichier n'a pas le format dBASE dbf " -#define MSG_NOT_ENOUGH_COLS "Pas assez de colonnes dans %s" -#define MSG_NOT_ENOUGH_MEM "Mmoire insuffisante pour cette opration" -#define MSG_NOT_FIXED_LEN "Fichier %s non fixe, len=%d lrecl=%d" -#define MSG_NOT_IMPLEMENTED "Non implement: %.8s" -#define MSG_NOT_IMPL_JOIN "Pas implment pour les jointures" -#define MSG_NOT_IMPL_SET "Pas implment pour les oprateurs d'ensembles" -#define MSG_NOT_IMPL_YET "Pas encore implement" -#define MSG_NOT_LINEARIZED "Arborescence des tables non linarise" -#define MSG_NOT_MODIFIABLE " (non modifiable)" -#define MSG_NO_0DH_HEAD "0DH manquant en fin d'en-tte (dbc=%d)" -#define MSG_NO_ACTIVE_APPL "Pas d'application active" -#define MSG_NO_ACTIVE_DB "Pas de base de donnes active" -#define MSG_NO_ACTIVE_UDIC "Pas de dictionaire utilisateur actif" -#define MSG_NO_AGGR_FUNC "Fonction aggrge %d illgale cet endroit" -#define MSG_NO_AREA_FILE "Fichier Area introuvable" -#define MSG_NO_AVAIL_RESULT "Pas de rsultat disponible" -#define MSG_NO_BIG_DELETE "Dltion Partielle non implmente pour les fichiers HUGE" -#define MSG_NO_CHAR_FROM "Conversion de type %d en caractres impossible" -#define MSG_NO_CLUSTER_COL "Pas de colonne optimisable" -#define MSG_NO_COL_ADDING "Ajouter des colonnes dans une dfinition existante est impossible" -#define MSG_NO_COL_DEF_AS "La dfinitions des colonnes est incompatible avec AS Select" -#define MSG_NO_COL_FOUND "La section colonne %s est vide" -#define MSG_NO_COL_IN_TABLE "La colonne %d n'est pas dans la table %s" -#define MSG_NO_COL_SECTION "Section colonne manquante pour la table %s" -#define MSG_NO_CONNECT_ADDR "Adresse de connection non spcifie" -#define MSG_NO_CONST_FILTER "Filtres constants non implements" -#define MSG_NO_CURLY_BRKT "Pas d'accolade de fermeture" -#define MSG_NO_DATABASE "Base de donnes %s introuvable" -#define MSG_NO_DATE_FMT "Pas de format date pour le valblock de type %d" -#define MSG_NO_DBF_INSERT "Insert pas encore implment pour les fichier DBF" -#define MSG_NO_DEF_FNCCOL "Colonne fonction par dfaut introuvable" -#define MSG_NO_DEF_PIVOTCOL "Colonne pivot par dfaut introuvable" -#define MSG_NO_DIR_INDX_RD "Pas d'accs directe des tables %s" -#define MSG_NO_DMY_DIR_ACC "Pas d'accs direct aux tables virtuelles DUMMY" -#define MSG_NO_DOM_DELETE "Dltion Partielle non implmente pour les domaines" -#define MSG_NO_DOM_MATCH "Chane %.8s... non touve dans le domaine %s" -#define MSG_NO_EDITED_LANG "Coparm: Pas de langage en dition" -#define MSG_NO_EXP_LINK "Liaison par expression invalide pour une table JCT" -#define MSG_NO_EXT_FILTER "Le filtrage ne peut se rfrer une autre table" -#define MSG_NO_EXT_UPDATE "Pas de mise jour en rfrence une autre table" -#define MSG_NO_FEAT_SUPPORT "%s non support dans cette version" -#define MSG_NO_FILE_LIST "La table %s n'a pas de liste de fichiers" -#define MSG_NO_FLD_FORMAT "Format absent pour le champs %d de %s" -#define MSG_NO_FORMAT_COL "Type COLUMN informattable" -#define MSG_NO_FORMAT_TYPE "Le format ne peut pas tre dfini partir du type %d" -#define MSG_NO_FULL_JOIN "Jointures autorises seulement galit sur cl(s)" -#define MSG_NO_FUL_OUT_JOIN "Jointures externes compltes non supportes" -#define MSG_NO_FUNC_ORDER "Tri non support sur lment fonctionnel" -#define MSG_NO_HEAD_JOIN "Jointure sur une table non en tte" -#define MSG_NO_HQL_CONV "Conversion en HQL non disponible" -#define MSG_NO_INDEX "La table %s n'a pas d'index" -#define MSG_NO_INDEX_GBX "Pas ou mauvais index pour SQLGBX" -#define MSG_NO_INDEX_IN "Pas d'index dans %s" -#define MSG_NO_INDEX_READ "Pas d'accs directe des tables multiples" -#define MSG_NO_INIT_LANG "Pas de langage initial" -#define MSG_NO_JOIN_TO_EXP "Jointure vers une expression impossible" -#define MSG_NO_JOIN_UPDEL "Pas de jointure avec Update/Delete" -#define MSG_NO_KEY_COL "Pas de colonne cl trouve" -#define MSG_NO_KEY_UPDATE "Le nom des cls ne peut pas tre modifi" -#define MSG_NO_LANGUAGE "Pas de langage oprationnel\n" -#define MSG_NO_LANG_TO_QUIT "Pas de langage quitter" -#define MSG_NO_LISTVAL_HERE "LSTBLK: Liste de valeurs utilise hors contexte" -#define MSG_NO_MAP_INSERT "MAP incompatible avec Insert" -#define MSG_NO_MATCHING_COL "Pas de colonne correspondant %s dans %s" -#define MSG_NO_MATCH_COL "Colonne correspondante introuvable" -#define MSG_NO_MEMORY "Mmoire pleine" -#define MSG_NO_MEM_CORR_SUB "Subquery corrle en mmoire non encore implmente" -#define MSG_NO_MODE_PADDED "Mode non support pour les fichiers 'padded'" -#define MSG_NO_MORE_COL "La colonne %s n'est plus dans la table pivot" -#define MSG_NO_MORE_LANG "Plus de langage, exit de %s\n" -#define MSG_NO_MORE_VAR "Les fichiers VAR ne sont plus supports" -#define MSG_NO_MULCOL_JOIN "Jointure vers un index multi-colonne pas encore possible" -#define MSG_NO_MULT_HAVING "Clauses Having multiples non implmentes" -#define MSG_NO_MUL_DIR_ACC "Accs direct des tables multiples pas encore implment" -#define MSG_NO_MUL_VCT "Les tables VCT ne peuvent pas tre multiples" -#define MSG_NO_MYSQL_CONN "Aucune connexion MySQL ouverte" -#define MSG_NO_MYSQL_DELETE "Pas de Delete pour les tables MySQL" -#define MSG_NO_NBCOL "Pas de NBcol" -#define MSG_NO_NBLIN "Pas de NBlin, MaxSize ou Continued" -#define MSG_NO_NBLIN_CONT "Fetch: Pas de NBlin ou Continued" -#define MSG_NO_NULL_CONST "Les constantes ne sont pas prises en charge" -#define MSG_NO_ODBC_COL "Colonnes ODBC automatiques non supportes par cette version" -#define MSG_NO_ODBC_DELETE "Delete ne devrait pas tre appel pour les tables ODBC" -#define MSG_NO_ODBC_DIRECT "Accs directe des tables ODBC non encore implment" -#define MSG_NO_ODBC_MUL "Multiple(2) non support pour les tables ODBC" -#define MSG_NO_ODBC_SPECOL "Pas de colonne spciale ODBC" -#define MSG_NO_OPT_COLUMN "Pas optimisable ou pas de colonne optimises" -#define MSG_NO_OP_MODIF "Les modificateurs ne s'appliquent pas %s" -#define MSG_NO_PARAMETER "Pas de paramtre" -#define MSG_NO_PART_DEL "Delete partiel des fichier %s impossible" -#define MSG_NO_PART_MAP "Mapping partiel non implment pour cet OS" -#define MSG_NO_PAR_BLK_INS "Insertion de bloc partiel impossible" -#define MSG_NO_PIV_DIR_ACC "Pas d'accs directe aux tables PIVOT" -#define MSG_NO_POS_ADDED "Pos_code non ajout" -#define MSG_NO_PROMPTING "Relance impossible pour les tables distribues" -#define MSG_NO_QRY_DELETE "Delete n'est pas utilisable pour les views QRY" -#define MSG_NO_QUERY_ARRAY "Tableaux avec QUERY non encore implments" -#define MSG_NO_RCUR_DSK_YET "Usage rcursif de DISK non encore implement" -#define MSG_NO_READ_32 "Lecture de 32 octets impossible" -#define MSG_NO_RECOV_SPACE "Espace non recouvrable dans le fichier index" -#define MSG_NO_REF_DELETE "Pas de suppression en rfrence une autre table" -#define MSG_NO_REF_UPDATE "Pas de mise jour en rfrence une autre table" -#define MSG_NO_REMOTE_FNC "Certaines fonctions ne peuvent pas tre excutes distance" -#define MSG_NO_ROWID_FOR_AM "Accs direct impossible de ROWID pour les tables de type %s" -#define MSG_NO_ROW_NODE "Le nom du Rownode n'est pas dfini" -#define MSG_NO_SECTION_NAME "Nom de section manquant" -#define MSG_NO_SEC_UPDATE "Les noms de section ne peuvent pas tre modifis" -#define MSG_NO_SELECTED_DB "Aucune base de donnes slecte" -#define MSG_NO_SELF_PIVOT "Une table ne peut se pivoter elle-mme !" -#define MSG_NO_SERVER_FOUND "Serveur introuvable" -#define MSG_NO_SETPOS_YET "SetPos pas encore implment pour les fichier %s" -#define MSG_NO_SFEXIT_UNIX "Fonction %s non disponible sur Unix" -#define MSG_NO_SOURCE " (pas de source)" -#define MSG_NO_SPEC_COL "Pas de colonne spciales MYSQL" -#define MSG_NO_SQL_DELETE "Delete n'est pas utilisable actuellement pour les views SQL" -#define MSG_NO_SUB_VAL "Pas de sous-value d'un tableau de type %d" -#define MSG_NO_SUCH_INDEX "La table %s n'a pas l'index %s" -#define MSG_NO_SUCH_SERVER "Serveur %s introuvable" -#define MSG_NO_SUCH_TABLE "Table %s pas dans la base de donnes" -#define MSG_NO_TABCOL_DATA "Pas de donnes pour la table %s colonne %s" -#define MSG_NO_TABLE_COL "Aucune colonne trouve pour %s" -#define MSG_NO_TABLE_DEL "Delete non autoris pour les tables %s " -#define MSG_NO_TABLE_DESC "Pas de bloc descriptif de table" -#define MSG_NO_TABLE_INDEX "La table %s n'a pas d'index" -#define MSG_NO_TABLE_LIST "Pas de liste de tables" -#define MSG_NO_TAB_DATA "Pas de donnes pour la table %s" -#define MSG_NO_TERM_IN_TOK "Les non-terminaux ne sont pas utilisables dans les rgles de Token" -#define MSG_NO_TOKEN_DB "DB introuvable pour la colonne TOKEN %s" -#define MSG_NO_UNIX_CATINFO "Pas d'info catalogue sous Unix" -#define MSG_NO_UPDEL_JOIN "Pas de jointure de tables ODBC pour Update/Delete" -#define MSG_NO_VCT_DELETE "Dltion Partielle non implmente pour les fichiers VCT" -#define MSG_NO_VIEW_COLDEF "Colonne dfinition impossible pour les views" -#define MSG_NO_VIEW_SORT "La View fonctionnelle %s ne peut pas tre trie ou jointe" -#define MSG_NO_ZIP_DELETE "Delete sur fichier Zip non encore implement" -#define MSG_NO_ZIP_DIR_ACC "Accs directe des tables ZDOS non encore implement" -#define MSG_NULL_COL_VALUE "La colonne n'a pas de valeur" -#define MSG_NULL_ENTRY "InitLang, entre nulle %d %s" -#define MSG_NULL_QUERY "Requte vide" -#define MSG_NUMVAL_NOMATCH "Disparit de Numval pour %s" -#define MSG_N_FULL_PARSES "%d significations" -#define MSG_ODBC_READ_ONLY "ODBC est actuellement en lecture seulement" -#define MSG_OFFSET_NOT_SUPP "Offset non support pour ce type de sous requte" -#define MSG_ONE_LANG_YET "Un langage est dj en dition" -#define MSG_ONE_PARAM_ONLY "Un seul paramtre autoris" -#define MSG_ONLY_LOG10_IMPL "Seul Log10 est implement" -#define MSG_ON_LANGUAGE "Langage %.8s version %d niveau %d ditable" -#define MSG_OPENING "Ouverture" -#define MSG_OPENING_QUERY "Ouverture de la requte" -#define MSG_OPEN_EMPTY_FILE "Ouverture du fichier vide %s: %s" -#define MSG_OPEN_ERROR "Erreur d'ouverture %d en mode %d sur %s: " -#define MSG_OPEN_ERROR_IS "Erreur l'ouverture de %s: %s" -#define MSG_OPEN_ERROR_ON "Erreur d'ouverture sur %s" -#define MSG_OPEN_MODE_ERROR "Erreur d'ouverture(%s) %d sur %s" -#define MSG_OPEN_SORT_ERROR "Erreur logique de tri dans QUERY Open" -#define MSG_OPEN_STRERROR "Erreur l'ouverture: %s" -#define MSG_OPEN_W_ERROR "Erreur l'ouverture de %s en criture" -#define MSG_OPTBLK_RD_ERR "Erreur la lecture d'un bloc optimisation: %s" -#define MSG_OPTBLK_WR_ERR "Erreur l'criture d'un bloc optimisation: %s" -#define MSG_OPTIMIZING "Optimisation de " -#define MSG_OPT_BMAP_RD_ERR "Erreur en lecture des bitmaps d'optimisation: %s" -#define MSG_OPT_BMAP_WR_ERR "Erreur en criture des bitmaps d'optimisation: %s" -#define MSG_OPT_CANCELLED "Optimisation interrompue par l'utilisateur" -#define MSG_OPT_DVAL_RD_ERR "Erreur en lecture des valeurs distinctes: %s" -#define MSG_OPT_DVAL_WR_ERR "Erreur en criture des valeurs distinctes: %s" -#define MSG_OPT_HEAD_RD_ERR "Erreur en lecture de l'entte du fichier opt: %s" -#define MSG_OPT_HEAD_WR_ERR "Erreur en criture de l'entte du fichier opt: %s" -#define MSG_OPT_INIT "Optimisation initialise" -#define MSG_OPT_LOGIC_ERR "Erreur logique dans SetBitmap, i=%d" -#define MSG_OPT_MAX_RD_ERR "Erreur en lecture des valeurs maxi: %s" -#define MSG_OPT_MAX_WR_ERR "Erreur en criture des valeurs maxi: %s" -#define MSG_OPT_MIN_RD_ERR "Erreur en lecture des valeurs mini: %s" -#define MSG_OPT_MIN_WR_ERR "Erreur en criture des valeurs mini: %s" -#define MSG_OPT_NOT_MATCH "Le fichier opt %s n'est pas jour" -#define MSG_OP_RES_TOO_LONG "Rsultat trop long pour l'oprateur=%d" -#define MSG_ORDER_OUT_RANGE "Tri: Order %d hors limite" -#define MSG_ORDER_TWICE "Un mme lment est tri deux fois" -#define MSG_PAGE_ERROR "Erreur de pagination" -#define MSG_PARM_CNT_MISS "Disparit du nombre de Paramtres" -#define MSG_PARSE_NULL_SEM "Smantique nulle" -#define MSG_PARSING_QUERY "Analyse de la requte" -#define MSG_PIX_ERROR "Pix %s erreur rgle no=%u\n" -#define MSG_PIX_TEST_ERROR "Rgle=%u: pix-TEST pas dans le premier noeud\n" -#define MSG_PLG_READ_ONLY "PLG est actuellement en lecture seulement" -#define MSG_PLM_NULL_SFP "TABPLM ReadDB: Sfp est NULL" -#define MSG_PLUG_NOT_INIT "Plug n'est pas initialis\n" -#define MSG_PLUG_NOT_RUN "Plug n'est pas en marche" -#define MSG_PNODE_RULE "(Noeud %d rgle %d) " -#define MSG_POS_TOO_LONG "%s trop long (>%d)" -#define MSG_PREC_VBLP_NULL "ARRAY SetPrecision: Vblp est NULL" -#define MSG_PRIV_INSTR "Instruction privilgie" -#define MSG_PROCADD_ERROR "Erreur %d sur l'adresse de %s" -#define MSG_PROCESS_SUBQRY "Sub-Query en cours de traitement" -#define MSG_PROC_WOULD_LOOP "Bouclage du traitement (maxres=%d maxlin=%d)" -#define MSG_PROGRESS_INFO "Informations sur le traitement en cours" -#define MSG_PROMPT_CANCEL "Relance annule" -#define MSG_PROMPT_NIY "Prompt non implment pour cette configuration" -#define MSG_PTR_NOT_FOUND "Pointeur introuvable Num=%d ti1=%d" -#define MSG_PXDEF_IS_NULL "Pxdef est NULL" -#define MSG_QRY_READ_ONLY "Les views QRY sont en lecture seulement" -#define MSG_QUERY_CANCELLED "Requte interrompue par l'utilisateur" -#define MSG_QUERY_NOT_EXEC "Requte non excute" -#define MSG_QUERY_SAVED "Requte %s sauvegarde" -#define MSG_QUOTE_IN_QUOTE "Appostrophe dans un champ entre appostrophe ligne %d" -#define MSG_RANGE_NIY "Range pas encore implment pour %s" -#define MSG_RANGE_NO_JOIN "Range non compatible avec les index de jointure" -#define MSG_RC_READING "rc=%d en lecture de la table %s" -#define MSG_READB_BAD_INIT "%s ReadDB appel avec Init=0" -#define MSG_READCOL_ERROR "SQLCOL: erreur dans ReadColumn" -#define MSG_READING "Lecture" -#define MSG_READING_FROM "Lecture de %s" -#define MSG_READING_RECORD "Erreur en lecture de l'enregistrement %d de %s" -#define MSG_READY "Prt" -#define MSG_READ_ERROR "Erreur en lecture sur %s: %s" -#define MSG_READ_ERROR_RC "Erreur en lecture, rc=%d" -#define MSG_READ_MEM_ERROR "Lecture mmoire %d: taille=%d" -#define MSG_READ_ONLY "Cette table protge en lecture seule ne peut tre modifie" -#define MSG_READ_SEEK_ERROR "Erreur de recherche en lecture: %s" -#define MSG_READ_SEG_ERROR "Lecture segment %d: taille=%d" -#define MSG_RECEIVED "Reu %c\n" -#define MSG_RECORD_ERROR "Erreur la lecture de l'enregistrement %d de %s" -#define MSG_RECORD_NO_SEP "Enregistrement sans sparateur" -#define MSG_REC_SKIPPED " (%d lignes erronnes sautes par l'option MaxErr)" -#define MSG_REDUCE_INDEX "Rduction de l'index" -#define MSG_REGISTER_ERR "Enregistrement NS impossible, prfix='%s' et href='%s'" -#define MSG_REMOTE_CONN_ERR "La connection loigne a chou" -#define MSG_REMOVE_ERROR "Erreur en supprimant %s: %s" -#define MSG_REMOVE_NOT_IMPL "Remove non implment pour TDB non Table" -#define MSG_RENAME_ERROR "Erreur renommant %s en %s: %s" -#define MSG_RENUM_RULES "Renumrotez les rgles et rentrez ADD (rgle sauvegarde dans la zone tampon)" -#define MSG_REORDER_INDEX "Reclassement de l'index" -#define MSG_REQU_ARG_NUM "La fonction %s doit avoir %d arguments" -#define MSG_RESET_TO "%s remis %d" -#define MSG_RES_NOT_UNIQUE "Le rsultat n'est pas unique" -#define MSG_RET_FROM_LANG "Retour au language %s version %d.%d du language %s version %d.%d" -#define MSG_ROWID_NOT_IMPL "RowNumber non implment pour les tables de type %s" -#define MSG_ROWS_SELECTED "%d lignes slectionnes en %.2lf sec" -#define MSG_ROWS_TRUNCATED " (tronqu par MAXRES, LIMIT, FREQ ou AreaSize)" -#define MSG_ROW_ARGNB_ERR "ROW: disparit du nombre d'arguments (%d,%d)" -#define MSG_RPC_SERVER_ERR "Erreur logique dans TABMUL::MakeCol" -#define MSG_RSC_ALLOC_ERROR "Erreur d'allocation mmoire dans Rescol %s" -#define MSG_RULE_ENTERED "Rgle %d entre" -#define MSG_RULE_SUBSET_ERR "Erreur d'initialisation de la zone Rgles" -#define MSG_SAVING_INDEX "Sauvegarde du fichier index" -#define MSG_SCAN_NOT_IMP "Scan non implment" -#define MSG_SEC_KEY_FIRST "Les sections et cls doivent tre insres en premier" -#define MSG_SEC_NAME_FIRST "Le nom de section doit tre en tte de liste en insertion" -#define MSG_SEC_NOT_FOUND "Section %s absente de %s" -#define MSG_SEEK_ERROR "Seek erreur dans CopyHeader" -#define MSG_SEMANTIC_TREE "Arbre smantique" -#define MSG_SEM_BAD_REF "Sem @%d rfrence un argument de type non 0 ou 1" -#define MSG_SEM_UNKNOWN "inconnue, rc=%d" -#define MSG_SEP_IN_FIELD "Le champ %d contient le caractre sparateur" -#define MSG_SEQUENCE_ERROR "HSTMT: Allocation hors squence" -#define MSG_SETEOF_ERROR "Erreur %d dans SetEndOfFile" -#define MSG_SETRECPOS_NIY "SetRecpos non implment pour ce type de table" -#define MSG_SET_LOCALE "Locale fixe %s" -#define MSG_SET_NULL_DOM "Valeur %d donne un domaine nul" -#define MSG_SET_OP_NOT_IMPL "Oprateurs ensemblistes non implments" -#define MSG_SET_STR_TRUNC "SetValue: Chane de caractres tronque" -#define MSG_SEVERAL_TREES "Jointure non spcifie pour certaines tables" -#define MSG_SFP_ERROR "Erreur sur SetFilePointer: %s" -#define MSG_SFUNC_NOT_IMPL "Fonction scalaire %s non implmente" -#define MSG_SHARED_LIB_ERR "Erreur au chargement de la librairie partage %s: %s" -#define MSG_SINGLE_STEP "Pas pas" -#define MSG_SLEEP "J'ai dormi %d milliseconds" -#define MSG_SMART_SORTING "Rcupration des lignes tries (passage %d de %d)" -#define MSG_SMART_SORT_ERR "Erreur logique 1 dans Smart Sort" -#define MSG_SORTING "Tri en cours" -#define MSG_SORTING_INDEX "Tri de l'index" -#define MSG_SORTING_VAL "Tri de %d valeurs" -#define MSG_SORT_JOIN_INDEX "Tri de l'index de jointure" -#define MSG_SPCOL_READONLY "La colonne spciale %s est en lecture seulement" -#define MSG_SPEC_CMD_SEP "Les commandes spciales doivent tre excutes sparment" -#define MSG_SQL_BAD_TYPE "RephraseSQL: type %d non support" -#define MSG_SQL_BLOCK_MISM "CheckColumn: bloc SQL courant non correspondant" -#define MSG_SQL_CONF_ERROR "Erreur SQL: SQL_CONFORMANCE" -#define MSG_SQL_READ_ONLY "Les views SQL sont actuellement en lecture seulement" -#define MSG_SRCH_CLOSE_ERR "Erreur la fermeture de l'Handle de recherche" -#define MSG_SRC_TABLE_UNDEF "La table source n'est pas dfinie" -#define MSG_STACK_ERROR "Erreur sur la pile, i=%d\n" -#define MSG_STACK_OVERFLOW "Parser: Dbordement de la pile\n" -#define MSG_STRG_NOT_FOUND "Chane introuvable" -#define MSG_STRING_INV_LIST "Liste invalide pour SemString" -#define MSG_STRING_TOO_BIG "Chane trop grande pour le domaine %s" -#define MSG_SUBALLOC_ERROR "Pas assez de mmoire en zone %p pour allouer %d (utilis=%d libre=%d)" -#define MSG_SUBAL_HUGE_ERR "Pas assez de mmoire en zone huge %p pour allouer %d" -#define MSG_SUBARG_NOSEM "Argument @ ou sous-phrase de niveau %d pointe sur un noeud sans Sem" -#define MSG_SUBARG_OUTRANGE "Argument @ ou sous-phrase de niveau %d hors limite" -#define MSG_SUBQRY_ONEITEM "Une Sub-Query ne doit avoir qu'une slection" -#define MSG_SUBSET_ERROR "SubSet erreur dans LoadDB" -#define MSG_SUB_OPEN_YET "Subquery dj ouverte" -#define MSG_SUB_RES_TOO_LNG "Rsultat trop long pour SUBSTR" -#define MSG_SYNTAX_ERROR "Erreur de syntaxe" -#define MSG_SYSTEM_ERROR "Erreur systme %d" -#define MSG_S_ACCESS_DENIED "%s: accs non autoris" -#define MSG_S_ERROR "%s erreur" -#define MSG_S_ERROR_NUM "%s: erreur=%d" -#define MSG_S_INTRUPT_ERROR "%s: erreur interruption" -#define MSG_S_INVALID_PARM "%s: paramtre invalide" -#define MSG_S_INV_ADDRESS "%s: adresse invalide" -#define MSG_S_UNKNOWN_ERROR "%s: erreur de code %u inconnu" -#define MSG_TABDIR_READONLY "Les tables DIR sont en lecture seulement" -#define MSG_TABLE_ALREADY "La table %s existe dj" -#define MSG_TABLE_ALTERED "Table %s %s altre" -#define MSG_TABLE_CREATED "%s table %s cre" -#define MSG_TABLE_DROPPED "Table %s supprime" -#define MSG_TABLE_MULT_JOIN "Utilisation multiple de la table %s pour jointure" -#define MSG_TABLE_NOT_IN_DB "La table %s n'existe pas dans %s" -#define MSG_TABLE_NOT_OPT "Table non optimisable" -#define MSG_TABLE_NO_INDEX "La table %s n'est pas indexable" -#define MSG_TABLE_NO_OPT "La table %s n'existe pas ou de type non optimisable" -#define MSG_TABLE_READ_ONLY "Les tables %s sont en lecture seulement " -#define MSG_TABMUL_READONLY "Les tables multiples sont en lecture seulement" -#define MSG_TAB_NOT_LOADED " (certaines tables n'ont put tre charges)" -#define MSG_TAB_NOT_SPEC "Table non specifie" -#define MSG_TB_VW_NOTIN_DB "Table ou view %s pas dans la base de donnes" -#define MSG_TDB_NXT_NOT_NUL "Tdb.Next non NULL" -#define MSG_TDB_USE_ERROR "Erreur, Tdbp->Use=%d" -#define MSG_TOO_MANY_COLS "Trop de colonnes" -#define MSG_TOO_MANY_COLTAB "Trop de colonnes dans %s (%d)" -#define MSG_TOO_MANY_FIELDS "Trop de champs ligne %d de %s" -#define MSG_TOO_MANY_JUMPS "Trop de niveaux de saut" -#define MSG_TOO_MANY_KEYS "Trop de cls (%d)" -#define MSG_TOO_MANY_POS "Trop de pos_codes" -#define MSG_TOO_MANY_TABLES "Trop de tables (%d)" -#define MSG_TOPSEM_ERROR "Erreur inconnue dans TopSem" -#define MSG_TO_BLK_IS_NULL "To Blk est nul" -#define MSG_TO_FTR_NOT_NULL "Set.To_Ftr n'est pas nul" -#define MSG_TO_PIX_NOT_NULL "Set.To_Pix n'est pas nul" -#define MSG_TO_SEM_NOT_NULL "Set.To_Sem n'est pas nul" -#define MSG_TRUNCATE_ERROR "Erreur en troncation: %s" -#define MSG_TRUNC_BY_ESTIM "Tronqu par l'option Estimate" -#define MSG_TYPES_ERROR "Erreur sur Types(%d)" -#define MSG_TYPE_CONV_ERROR "Type non convertible dans une expression" -#define MSG_TYPE_DEF_MISM "Disparit entre type et dfinition" -#define MSG_TYPE_MISMATCH "Cl et source ne sont pas du mme type" -#define MSG_TYPE_RECFM_MISM "Disparit entre Type et Recfm" -#define MSG_TYPE_TO_VERIFY "Type vrifier: %d" -#define MSG_TYPE_VALUE_ERR "Colonne %s: disparit type(%s)/valeur(%s)" -#define MSG_UNBALANCE_QUOTE "Appostrophe en trop ligne %d" -#define MSG_UNDEFINED_AM "COLBLK %s: mthode d'accs indfinie" -#define MSG_UNDEFINED_PATH "Chemin d'accs indfini pour Plgcnx.ini" -#define MSG_UNDEF_COL_COUNT "Count sur colonne non dfinie" -#define MSG_UNKNOWN_DOMAIN "Domaine inconnu %s" -#define MSG_UNKNOWN_ERROR "Erreur inconnue" -#define MSG_UNKNOWN_EXCPT "Exception non rpertorie" -#define MSG_UNKNOWN_NAME "Nom inconnu: %.8s" -#define MSG_UNKNOWN_PATH "Chemin d'accs inconnu pour Plgcnx.ini" -#define MSG_UNKNOWN_POS "Nom pos_code inconnu: %s" -#define MSG_UNKNOWN_SEM "Sem %.8s inconnue, rc=%d" -#define MSG_UNKNOWN_SYNONYM "Synonyme inconnu" -#define MSG_UNKNW_QRY_TYPE "ReadDB: type de requte inconnu" -#define MSG_UNKN_ERR_CODE "Erreur de code %d inconnu" -#define MSG_UNLOADABLE " inchargeable: " -#define MSG_UNLOADABLE_PRM "%s inchargeable: %s" -#define MSG_UNMATCH_FIL_ARG "Argument de filtre dpareill" -#define MSG_UNQ_COL_SEV_TAB "La colonne %s non qualifie est dans plusieurs tables" -#define MSG_UNRESOLVED_ARG "?Argument manquant: %s non rsolu en %d ligne %d" -#define MSG_UPDATE_ERROR "Erreur en Update sur %s" -#define MSG_UPDATING_ROWS "Mise jour des lignes" -#define MSG_UPD_ZIP_NOT_IMP "Mise jour des tables ZDOS non encore implement" -#define MSG_UP_LANGUAGE "Bloc langage %.8s version %d niveau %d charg" -#define MSG_USED_FREE_MEM "Sarea: utilis %d, libre %d" -#define MSG_USETEMP_IS "Usetemp est : %s" -#define MSG_USETEMP_RESET ". Usetemp remis Auto" -#define MSG_USETEMP_SET "Usetemp fix %s" -#define MSG_USE_NO_MATCH "Use non correspondant : Use=%d, ti2=%d, ti3=%d" -#define MSG_USING_INDEX " (Index par" -#define MSG_VALIST_MISMATCH "Disparit des listes de valeurs" -#define MSG_VALSTR_TOO_LONG "Valeur %s trop longue pour une chane de longueur %d" -#define MSG_VALTYPE_NOMATCH "Disparit types de valeur" -#define MSG_VALUE_ERROR "Colonne %s: bloc valeur nul" -#define MSG_VALUE_NOT_ALLOC "Valeur non alloue pour la colonne R%d %s" -#define MSG_VALUE_TOO_BIG "Valeur %lld trop grande pour la colonne %s" -#define MSG_VALUE_TOO_LONG "Valeur %s trop longue pour la colonne %s de longueur %d" -#define MSG_VAL_ALLOC_ERR "Allocation impossible du noeud valeur" -#define MSG_VAL_TOO_LONG "Valeur %s trop longue pour le champ %s" -#define MSG_VIEW_ALREADY "La VIEW %s existe dj" -#define MSG_VIEW_CREATED "%s view %s cre" -#define MSG_VIEW_DROPPED "View %s supprime" -#define MSG_VIEW_NOT_IN_DB "%s n'est pas une View de %s" -#define MSG_VIR_NO_DELETE "Delete impossible sur les tables %s" -#define MSG_VIR_READ_ONLY "Les tables virtuelles %s sont en lecture seulement" -#define MSG_VM_LANG "Langage au format VM, non support" -#define MSG_VOID_FIRST_ARG "Le premier argument ne doit pas tre vide" -#define MSG_VOID_IN_STRING "Erreur: chane IN vide" -#define MSG_VOID_ORDER_LIST "Liste de tri vide, erreur systme ?" -#define MSG_VOID_POS_DICT "Dictionnaire interne du langage vide" -#define MSG_VOID_QUERY "Requte vide %s" -#define MSG_WORK_AREA "Espace de travail: %s" -#define MSG_WORK_TOO_SMALL "Zone de travail trop petite, accrotre AreaSize" -#define MSG_WRITE_ERROR "Erreur l'criture de %s" -#define MSG_WRITE_SEEK_ERR "Erreur de recherche en criture: %s" -#define MSG_WRITE_STRERROR "Erreur en criture sur %s: %s" -#define MSG_WRITING "Ecriture" -#define MSG_WRITING_ERROR "Erreur l'criture de %s: %s" -#define MSG_WRITING_QUERY "Erreur l'criture de la requte: " -#define MSG_WRONG_ARG_NUM "La fonction %s ne prend pas %d arguments" -#define MSG_WRONG_COL_NUM "Numro de colonne %d trop grand pour %s" -#define MSG_WRONG_DB_LIST "Liste des bases de donnes incorrecte ou vide" -#define MSG_WRONG_FUNCTION "Mauvaise fonction %d" -#define MSG_WRONG_OP_PARM "Mauvais oprateur ou paramtres pour %s" -#define MSG_WRONG_PARMS "Mauvais paramtres pour %s" -#define MSG_WRONG_PASSWORD "Mot de passe illgal pour %s" -#define MSG_WRONG_TYPE "type non support" -#define MSG_WRONG_USERFILE "La Userfile a une mauvaise taille %d" -#define MSG_WS_CONV_ERR "Erreur de convertion de %s en WS" -#define MSG_XCOL_MISMATCH "La colonne %s ne correspond pas l'index" -#define MSG_XDB_DEL_ERROR "Erreur en supprimant des entres du fichier XDB" -#define MSG_XFILE_READERR "Erreur %d en lisant le fichier index" -#define MSG_XFILE_TOO_SMALL "Le fichier index est plus petit que la taille de l'index" -#define MSG_XFILE_WRITERR "Erreur en crivant le fichier index: %s" -#define MSG_XMLTAB_INIT_ERR "Erreur d'initialisation de la table XML" -#define MSG_XML_INIT_ERROR "Erreur d'initialisation du nouveau fichier XML" -#define MSG_XPATH_CNTX_ERR "Le nouveau contexte XPath ne peut tre cr" -#define MSG_XPATH_EVAL_ERR "Impossible d'valuer l'emplacement xpath '%s'" -#define MSG_XPATH_NOT_SUPP "Xpath non support colonne %s" -#define MSG_X_ARG_ADDED "%d arguments ajouts" -#define MSG_X_ARG_SET "%d arguments ont t initialiss" -#define MSG_X_ON_TAB " %s sur %s(" -#define MSG_ZERO_DIVIDE "Division par zro dans une expression" diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 0e91742b1fa..7479c898bfe 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -540,11 +540,7 @@ extern "C" const char *msglang(void) #else // !XMSG && !NEWMSG extern "C" const char *msglang(void) { -#if defined(FRENCH) - return "french"; -#else // DEFAULT return "english"; -#endif // DEFAULT } // end of msglang #endif // !XMSG && !NEWMSG diff --git a/storage/connect/messages.h b/storage/connect/messages.h index b55ec39b235..91e04f3d472 100644 --- a/storage/connect/messages.h +++ b/storage/connect/messages.h @@ -1,13 +1,5 @@ /**************************************************************************/ /* NLS messsages definition. */ /**************************************************************************/ -#if defined(FRENCH) -#if defined(CPX) -#include "frmsg1.h" -#else /* not CPX */ -#include "frmsg2.h" -#endif /* CPX */ -#else /* not FRENCH */ #include "engmsg.h" -#endif /* FRENCH */ /* ---------------------------------------------------------------------- */ diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index 370bf69ffa0..4371f90a21d 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -14,11 +14,7 @@ /***********************************************************************/ /* DB Constant definitions. */ /***********************************************************************/ -#if defined(FRENCH) -#define DEFAULT_LOCALE "French" -#else // !FRENCH #define DEFAULT_LOCALE "English" -#endif // !FRENCH #define DOS_MAX_PATH 144 /* Must be the same across systems */ #define DOS_BUFF_LEN 100 /* Number of lines in binary file buffer */ diff --git a/storage/connect/rcmsg.c b/storage/connect/rcmsg.c index 4cd443d88bb..e2fd08ba866 100644 --- a/storage/connect/rcmsg.c +++ b/storage/connect/rcmsg.c @@ -32,17 +32,6 @@ const char *GetMsgid(int id) const char *p = NULL; // This conditional until a real fix is found for MDEV-7304 -#if defined(FRENCH) - if (!stricmp(msglang(), "french")) - switch (id) { -#include "frids.h" -#if defined(NEWMSG) -#include "frcas.h" -#endif // NEWMSG - } // endswitch(id) - - else // English -#endif // FRENCH switch (id) { #include "enids.h" #if defined(NEWMSG) From 1db4fc543bba0cadbdcecdd82a6584875559a667 Mon Sep 17 00:00:00 2001 From: anson1014 <56494179+anson1014@users.noreply.github.com> Date: Tue, 30 Aug 2022 04:21:40 -0400 Subject: [PATCH 29/80] Ensure that source files contain only valid UTF8 encodings (#2188) Modern software (including text editors, static analysis software, and web-based code review interfaces) often requires source code files to be interpretable via a consistent character encoding, with UTF-8 or ASCII (a strict subset of UTF-8) as the default. Several of the MariaDB source files contain bytes that are not valid in either the UTF-8 or ASCII encodings, but instead represent strings encoded in the ISO-8859-1/Latin-1 or ISO-8859-2/Latin-2 encodings. These inconsistent encodings may prevent software from correctly presenting or processing such files. Converting all source files to valid UTF8 characters will ensure correct handling. Comments written in Czech were replaced with lightly-corrected translations from Google Translate. Additionally, comments describing the proper handling of special characters were changed so that the comments are now purely UTF8. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. Co-authored-by: Andrew Hutchings --- mysys/my_win_popen.cc | 2 +- storage/connect/domdoc.cpp | 1 - strings/ctype-czech.c | 69 ++++++++++++-------------------------- strings/ctype-latin1.c | 16 ++++----- 4 files changed, 31 insertions(+), 57 deletions(-) diff --git a/mysys/my_win_popen.cc b/mysys/my_win_popen.cc index f41f54100f1..cceb77e9019 100644 --- a/mysys/my_win_popen.cc +++ b/mysys/my_win_popen.cc @@ -92,7 +92,7 @@ extern "C" FILE *my_win_popen(const char *cmd, const char *mode) goto error; break; default: - /* Unknown mode, xpected "r", "rt", "w", "wt" */ + /* Unknown mode, expected "r", "rt", "w", "wt" */ abort(); } if (!SetHandleInformation(parent_pipe_end, HANDLE_FLAG_INHERIT, 0)) diff --git a/storage/connect/domdoc.cpp b/storage/connect/domdoc.cpp index 7d5b87a2640..268ad771ef9 100644 --- a/storage/connect/domdoc.cpp +++ b/storage/connect/domdoc.cpp @@ -642,7 +642,6 @@ bool DOMNODELIST::DropItem(PGLOBAL g, int n) if (Listp == NULL || Listp->length < n) return true; -//Listp->item[n] = NULL; La proprit n'a pas de mthode 'set' return false; } // end of DeleteItem diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 33d43d4dd4e..cb5205f315e 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -23,13 +23,13 @@ solution was needed than the one-to-one conversion table. To note a few, here is an example of a Czech sorting sequence: - co < hlaska < hlska < hlava < chlapec < krtek + co < hlaska < hláska < hlava < chlapec < krtek It because some of the rules are: double char 'ch' is sorted - between 'h' and 'i'. Accented character '' (a with acute) is + between 'h' and 'i'. Accented character 'á' (a with acute) is sorted after 'a' and before 'b', but only if the word is otherwise the same. However, because 's' is sorted before 'v' - in hlava, the accentness of '' is overridden. There are many + in hlava, the accentness of 'á' is overridden. There are many more rules. This file defines functions my_strxfrm and my_strcoll for @@ -42,8 +42,9 @@ passes, that's why we need four times more space for expanded string. - This file also contains the ISO-Latin-2 definitions of - characters. + The non-ASCII literal strings in this file are encoded + in the iso-8859-2 / latin-2 character set + (https://en.wikipedia.org/wiki/ISO/IEC_8859-2) Author: (c) 1997--1998 Jan Pazdziora, adelton@fi.muni.cz Jan Pazdziora has a shared copyright for this code @@ -111,7 +112,7 @@ static const struct wordvalue doubles[] = { }; /* - Unformal description of the algorithm: + Informal description of the algorithm: We walk the string left to right. @@ -126,7 +127,7 @@ static const struct wordvalue doubles[] = { End of pass is marked with value 1 on the output. - For each character, we read it's value from the table. + For each character, we read its value from the table. If the value is ignore (0), we go straight to the next character. @@ -138,31 +139,6 @@ static const struct wordvalue doubles[] = { exists behind it, find its value. We append 0 to the end. ---- - Neformln popis algoritmu: - - Prochzme etzec zleva doprava. - - Konec etzce je pedn bu jako parametr, nebo je to *p == 0. - Toto je oeteno makrem IS_END. - - Pokud jsme doli na konec etzce pi prchodu 0, nejdeme na - zatek, ale na uloenou pozici, protoe prvn a druh prchod - b souasn. - - Konec vstupu (prchodu) ozname na vstupu hodnotou 1. - - Pro kad znak etzce nateme hodnotu z tdc tabulky. - - Jde-li o hodnotu ignorovat (0), skome ihned na dal znak.. - - Jde-li o hodnotu konec slova (2) a je to prchod 0 nebo 1, - peskome vechny dal 0 -- 2 a prohodme prchody. - - Jde-li o kompozitn znak (255), otestujeme, zda nsleduje - sprvn do dvojice, dohledme sprvnou hodnotu. - - Na konci pipojme znak 0 */ #define ADD_TO_RESULT(dest, len, totlen, value) \ @@ -335,24 +311,23 @@ my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)), /* - Neformln popis algoritmu: + Informal description of the algorithm: - prochzme etzec zleva doprava - konec etzce poznme podle *p == 0 - pokud jsme doli na konec etzce pi prchodu 0, nejdeme na - zatek, ale na uloenou pozici, protoe prvn a druh - prchod b souasn - konec vstupu (prchodu) ozname na vstupu hodnotou 1 + we pass the chain from left to right + we know the end of the string by *p == 0 + if we reached the end of the string on transition 0, then we don't go to + start, but to the saved position, because the first and second + the passage runs concurrently + we mark the end of the input (transition) with the value 1 on the output - nateme hodnotu z tdc tabulky - jde-li o hodnotu ignorovat (0), skome na dal prchod - jde-li o hodnotu konec slova (2) a je to prchod 0 nebo 1, - peskome vechny dal 0 -- 2 a prohodme - prchody - jde-li o kompozitn znak (255), otestujeme, zda nsleduje - sprvn do dvojice, dohledme sprvnou hodnotu + then we load the value from the sorting table + if the value is ignore (0), we jump to the next pass + if the value is the end of the word (2) and it is a 0 or 1 transition, + we skip all the other 0 -- 2 and switch transitions + if it is a composite character (255), we test whether it follows + correct to the pair, we find the correct value - na konci pipojme znak 0 + then we add the character 0 at the end */ diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index bcf1cc6c9f1..b6ffd0906c8 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -499,19 +499,19 @@ struct charset_info_st my_charset_latin1_nopad= * * The modern sort order is used, where: * - * '' -> "ae" - * '' -> "oe" - * '' -> "ue" - * '' -> "ss" + * 'ä' -> "ae" + * 'ö' -> "oe" + * 'ü' -> "ue" + * 'ß' -> "ss" */ /* * This is a simple latin1 mapping table, which maps all accented * characters to their non-accented equivalents. Note: in this - * table, '' is mapped to 'A', '' is mapped to 'Y', etc. - all + * table, 'ä' is mapped to 'A', 'ÿ' is mapped to 'Y', etc. - all * accented characters except the following are treated the same way. - * , , , , , + * Ü, ü, Ö, ö, Ä, ä */ static const uchar sort_order_latin1_de[] = { @@ -577,7 +577,7 @@ static const uchar combo2map[]={ my_strnxfrm_latin_de() on both strings and compared the result strings. This means that: - must also matches E and A, because my_strxn_frm_latin_de() will convert + Ä must also matches ÁE and Aè, because my_strxn_frm_latin_de() will convert both to AE. The other option would be to not do any accent removal in @@ -703,7 +703,7 @@ void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)), /* Remove end space. We have to do this to be able to compare - 'AE' and '' as identical + 'AE' and 'Ä' as identical */ end= skip_trailing_space(key, len); From f4ce1e487e752cf6c9b8a2bcbe195440cfdfcbbe Mon Sep 17 00:00:00 2001 From: Robin Newhouse Date: Sat, 18 Mar 2023 00:19:08 +0000 Subject: [PATCH 30/80] All-green GitLab CI in 10.4 branch Note to mergers: Do not merge this commit to 10.5+. An additional PR will be created for the 10.5 branch which is compatible with later branches. Include cppcheck and FlawFinder for SAST scanning. From 10.6, cherry-picked 12bf5c46 (Remove unused French translations in Connect engine) and c6072ed9 (Ensure that source files contain only valid UTF8 encodings). Necessary for FlawFinder to execute and useful anyway. Removing MSAN build and test as it was not introduced until 10.5 and does not successfully build. Remove failing upgrade test since Fedora installs MariaDB 10.5 and the 10.5->10.4 upgrade rightfully complains Add to skiplist failing test: main.func_math (MDEV-20966) All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc. --- .gitlab-ci.yml | 125 ++-- tests/code_quality/cppcheck_ignorelist.txt | 251 +++++++ tests/code_quality/flawfinder_ignorelist.json | 622 ++++++++++++++++++ 3 files changed, 938 insertions(+), 60 deletions(-) create mode 100644 tests/code_quality/cppcheck_ignorelist.txt create mode 100644 tests/code_quality/flawfinder_ignorelist.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39dae0facb8..14bd3eb2bec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,7 @@ stages: - build - test - Salsa-CI + - sast default: # Base image for builds and tests unless otherwise defined @@ -42,7 +43,7 @@ variables: CMAKE_FLAGS: "-DPLUGIN_COLUMNSTORE=NO -DPLUGIN_ROCKSDB=NO -DPLUGIN_S3=NO -DPLUGIN_MROONGA=NO -DPLUGIN_CONNECT=NO -DPLUGIN_MROONGA=NO -DPLUGIN_TOKUDB=NO -DPLUGIN_PERFSCHEMA=NO -DWITH_WSREP=OFF" # Major version dictates which branches share the same ccache. E.g. 10.6-abc # and 10.6-xyz will have the same cache. - MARIADB_MAJOR_VERSION: "10.6" + MARIADB_MAJOR_VERSION: "10.4" # NOTE! Currently ccache is only used on the Centos8 build. As each job has # sufficiently different environments they are unable to benefit from each # other's ccaches. As each build generates about 1 GB of ccache, having @@ -206,7 +207,7 @@ fedora-sanitizer: - builddir/_CPack_Packages/Linux/RPM/SPECS/ parallel: matrix: - - SANITIZER: [-DWITH_ASAN=YES, -DWITH_TSAN=YES, -DWITH_UBSAN=YES, -DWITH_MSAN=YES] + - SANITIZER: [-DWITH_ASAN=YES, -DWITH_TSAN=YES, -DWITH_UBSAN=YES] centos8: stage: build @@ -298,6 +299,7 @@ centos7: main.mysqldump : Field separator argument is not what is expected; check the manual when executing 'SELECT INTO OUTFILE' main.flush_logs_not_windows : query 'flush logs' succeeded - should have failed with error ER_CANT_CREATE_FILE (1004) main.mysql_upgrade_noengine : upgrade output order does not match the expected + main.func_math : MDEV-20966 - Wrong error code " > skiplist - ./mtr --suite=main --force --parallel=auto --xml-report=$CI_PROJECT_DIR/junit.xml --skip-test-list=skiplist $RESTART_POLICY @@ -331,6 +333,7 @@ mysql-test-run-asan: needs: - "fedora-sanitizer: [-DWITH_ASAN=YES]" <<: *mysql-test-run-def + allow_failure: true artifacts: when: always # Also show results when tests fail reports: @@ -369,22 +372,6 @@ mysql-test-run-ubsan: junit: - junit.xml -mysql-test-run-msan: - stage: test - variables: - RESTART_POLICY: "--force-restart" - dependencies: - - "fedora-sanitizer: [-DWITH_MSAN=YES]" - needs: - - "fedora-sanitizer: [-DWITH_MSAN=YES]" - <<: *mysql-test-run-def - allow_failure: true - artifacts: - when: always # Also show results when tests fail - reports: - junit: - - junit.xml - rpmlint: stage: test dependencies: @@ -439,52 +426,70 @@ fedora install: - installed-database.sql - upgraded-database.sql -fedora upgrade: - stage: test - dependencies: - - fedora - needs: - - fedora +cppcheck: + stage: sast + needs: [] + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal script: - - dnf install -y mariadb-server - # Fedora does not support running services in Docker (like Debian packages do) so start it manually - - /usr/libexec/mariadb-check-socket - - /usr/libexec/mariadb-prepare-db-dir - - sudo -u mysql /usr/libexec/mariadbd --basedir=/usr & sleep 10 - # Dump database contents in installed state - - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > old-installed-database.sql - - /usr/libexec/mariadb-check-upgrade - # Dump database contents in upgraded state - - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > old-upgraded-database.sql - - mariadb --skip-column-names -e "SELECT @@version, @@version_comment" # Show version - # @TODO: Upgrade from Fedora 33 MariaDB 10.4 to MariaDB.org latest does not work - # so do this manual step to remove conflicts until packaging is fixed - - yum remove -y mariadb-server-utils mariadb-gssapi-server mariadb-cracklib-password-check mariadb-backup mariadb-connector-c-config - - rm -f rpm/*debuginfo* # Not relevant in this test - - yum install -y rpm/*.rpm - # nothing provides galera-4 on Fedora, so this step fails if built with wsrep - - mysql -e "SHUTDOWN;" - - /usr/bin/mariadb-install-db # This step should not do anything on upgrades, just exit - - sudo -u mysql /usr/sbin/mariadbd & sleep 10 - # Dump database contents in installed state - - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > new-installed-database.sql || true - # The step above fails on: mariadb-dump: Couldn't execute 'show events': Cannot proceed, because event scheduler is disabled (1577) - # @TODO: Since we did a manual start, we also need to run upgrade manually - - /usr/bin/mariadb-upgrade - # Dump database contents in upgraded state - - mariadb-dump --all-databases --all-tablespaces --triggers --routines --events --skip-extended-insert > new-upgraded-database.sql - - | - mariadb --skip-column-names -e "SELECT @@version, @@version_comment" | tee /tmp/version - grep $MARIADB_MAJOR_VERSION /tmp/version || echo "MariaDB didn't upgrade properly" - - mariadb --table -e "SELECT * FROM mysql.global_priv; SHOW CREATE USER root@localhost; SHOW CREATE USER 'mariadb.sys'@localhost" - - mariadb --table -e "SELECT * FROM mysql.plugin; SHOW PLUGINS" + - yum install -y cppcheck diffutils + # --template: use a single-line template + # --force: check large directories without warning + # -i: ignore this directory when scanning + # -j: run multiple cppcheck threads + # Use newline to escape colon in yaml + - > + cppcheck --template="{file}:{line}: {severity}: {message}" --force + client dbug extra include libmariadb libmysqld libservices mysql-test mysys mysys_ssl pcre plugin + strings tests unittest vio wsrep-lib sql sql-common storage + -istorage/mroonga -istorage/tokudb -istorage/spider -istorage/rocksdb -iextra/ -ilibmariadb/ -istorage/columnstore + --output-file=cppcheck.txt -j $(nproc) + # Parallel jobs may output findings in an nondeterministic order. Sort to match ignorelist. + - cat cppcheck.txt | sort > cppcheck_sorted.txt + # Remove line numbers for diff + - sed 's/:[^:]*:/:/' cppcheck_sorted.txt > cppcheck_sorted_no_line_numbers.txt + # Only print new issues not found in ignore list + - echo "Problems found in ignore list that were not discovered by cppcheck (may have been fixed)." + - diff --changed-group-format='%>' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt || true + - echo "Problems found by cppcheck that were not in ignore list." + - diff --changed-group-format='%<' --unchanged-group-format='' cppcheck_sorted_no_line_numbers.txt tests/code_quality/cppcheck_ignorelist.txt > lines_not_ignored.txt || true + - cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt artifacts: + when: always paths: - - old-installed-database.sql - - old-upgraded-database.sql - - new-installed-database.sql - - new-upgraded-database.sql + - cppcheck_sorted.txt +flawfinder: + stage: sast + needs: [] + variables: + GIT_STRATEGY: fetch + GIT_SUBMODULE_STRATEGY: normal + script: + - yum install -y python3 python3-pip jq diffutils git + - pip install flawfinder + - flawfinder --falsepositive --quiet --html . > flawfinder-all-vulnerabilities.html + - cat flawfinder-all-vulnerabilities.html | grep "Hits =" + - flawfinder --falsepositive --quiet --minlevel=5 --sarif . > flawfinder-output.json + # FlawFinder's --sarif output will display all vulnerabilities despite having --minlevel=5 specified. + # Therefore, we postprocess the results with jq and filter out findings where the vulnerability level is less than 5. + # Also in the SARIF output format, the vulnerabilities are ranked as 0.2/0.4/0.6/0.8/1.0 which correspond to the --minlevel=1/2/3/4/5 of FlawFinder. + # Additionally, we sort the results because individual findings are consistent across different runs, but their ordering may not be. + # Vulnerabilities can also be ignored in-line (/* Flawfinder: ignore */), but this option was chosen as to not clutter the codebase. + - jq 'del(.runs[] | .tool | .driver | .rules) | del(.runs[] | .results[] | select(.rank < 1)) | del(.runs[] | .results[] | .locations[] | .physicalLocation | .region | .startLine) | .runs[0].results|=sort_by(.fingerprints)' flawfinder-output.json > flawfinder-min-level5.json + # Diff against known vulnerabilities, but ignore the line number. + - echo "Problems found in ignore list that were not discovered by flawfinder (may have been fixed)." + - diff --changed-group-format='%>' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json || true + - echo "Problems found by flawfinder that were not in ignore list." + - diff --changed-group-format='%<' --unchanged-group-format='' flawfinder-min-level5.json tests/code_quality/flawfinder_ignorelist.json > lines_not_ignored.txt || true + - cat lines_not_ignored.txt && test ! -s lines_not_ignored.txt + artifacts: + when: always + paths: + - flawfinder-all-vulnerabilities.html + - flawfinder-min-level5.json + # Once all RPM builds and tests have passed, also run the DEB builds and tests # @NOTE: This is likely to work well only on salsa.debian.org as the Gitlab.com # runners are too small for everything this stage does. diff --git a/tests/code_quality/cppcheck_ignorelist.txt b/tests/code_quality/cppcheck_ignorelist.txt new file mode 100644 index 00000000000..268bf8108d4 --- /dev/null +++ b/tests/code_quality/cppcheck_ignorelist.txt @@ -0,0 +1,251 @@ +client/mysql.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysql_upgrade.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqladmin.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlbinlog.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlcheck.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlimport.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqlshow.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +client/mysqltest.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +dbug/tests.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +lexyy.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +mysql-test/lib/My/SafeProcess/safe_process_win.cc: error: Uninitialized variable: message_text +mysys/mf_keycache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_fopen.c: error: Return value of allocation function 'freopen' is not stored. +mysys/my_getsystime.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_pread.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_rename.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_winfile.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +mysys/my_write.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +mysys/thr_lock.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_TABLE_WAIT_VARIABLES is a macro then please configure it. +mysys/tree.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +pcre/pcrecpp.cc: warning: Uninitialized variable: kmat +pcre/pcrecpp.h: error: syntax error +pcre/pcregrep.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/audit_null/audit_null.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_ed25519/server_ed25519.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/auth_0x0100.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/dialog_examples.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/qa_auth_interface.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/qa_auth_server.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_examples/test_plugin.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_gssapi/server_plugin.cc: error: syntax error +plugin/auth_gssapi/sspi.h: error: #include nested too deeply +plugin/auth_pam/auth_pam.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_pam/auth_pam_v1.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_pipe/auth_pipe.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/auth_socket/auth_socket.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/aws_key_management/aws_key_management_plugin.cc: error: syntax error +plugin/cracklib_password_check/cracklib_password_check.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/daemon_example/daemon_example.cc: error: syntax error +plugin/debug_key_management/debug_key_management_plugin.cc: error: syntax error +plugin/disks/information_schema_disks.cc: error: syntax error +plugin/example_key_management/example_key_management_plugin.cc: error: syntax error +plugin/feedback/feedback.cc: error: syntax error +plugin/file_key_management/file_key_management_plugin.cc: error: syntax error +plugin/fulltext/plugin_example.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/handler_socket/handlersocket/handlersocket.cpp: error: syntax error +plugin/locale_info/locale_info.cc: error: syntax error +plugin/metadata_lock_info/metadata_lock_info.cc: error: syntax error +plugin/metadata_lock_info/metadata_lock_info.cc: error: syntax error +plugin/qc_info/qc_info.cc: error: syntax error +plugin/query_response_time/plugin.cc: error: syntax error +plugin/query_response_time/query_response_time.cc: error: Array 'm_count[41]' accessed at index 43, which is out of bounds. +plugin/query_response_time/query_response_time.cc: error: Array 'm_total[41]' accessed at index 43, which is out of bounds. +plugin/server_audit/server_audit.c: error: Uninitialized variable: &tm_time +plugin/server_audit/server_audit.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/server_audit/server_audit.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/server_audit/server_audit.c: error: Uninitialized variable: &tm_time +plugin/simple_password_check/simple_password_check.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/sql_errlog/sql_errlog.c: error: Found a exit path from function with non-void return type that has missing return statement +plugin/sql_errlog/sql_errlog.c: error: Uninitialized variable: &t +plugin/user_variables/user_variables.cc: error: syntax error +plugin/userstat/userstat.cc: error: syntax error +plugin/versioning/versioning.cc: error: syntax error +plugin/wsrep_info/plugin.cc: error: syntax error +sql-common/client.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql-common/client_plugin.c: error: va_list 'unused' used before va_start() was called. +sql/debug_sync.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE is a macro then please configure it. +sql/gcalc_slicescan.cc: warning: Possible null pointer dereference: first_bottom_point +sql/gen_lex_hash.cc: error: Common realloc mistake: 'hash_map' nulled but not freed upon failure +sql/handler.h: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/log.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/log_event.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/log_event_old.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/net_serv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/protocol.h: error: syntax error +sql/rpl_utility.h: error: There is an unknown macro here somewhere. Configuration is required. If CPP_UNNAMED_NS_START is a macro then please configure it. +sql/semisync_slave.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +sql/sql_select.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/sql_string.cc: warning: Iterators to containers from different expressions 'to' and 'from' are used together. +sql/table.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +sql/winservice.c: error: Resource leak: mysql_upgrade_info +sql/wsrep_thd.h: error: failed to expand 'wsrep_create_appliers', Wrong number of parameters for macro 'wsrep_create_appliers'. +storage/archive/azio.c: error: Syntax Error: AST broken, 'if' doesn't have two operands. +storage/archive/ha_archive.cc: error: syntax error +storage/blackhole/ha_blackhole.cc: error: syntax error +storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp: error: Found a exit path from function with non-void return type that has missing return statement +storage/cassandra/ha_cassandra.cc: error: syntax error +storage/connect/connect.cc: error: Uninitialized variable: lg +storage/connect/domdoc.cpp: error: syntax error +storage/connect/ha_connect.cc: error: syntax error +storage/connect/myconn.cpp: error: Unmatched '{'. Configuration: 'ALPHA;MYSQL_PREPARED_STATEMENTS'. +storage/connect/myconn.cpp: error: Unmatched '{'. Configuration: 'MYSQL_PREPARED_STATEMENTS'. +storage/connect/odbconn.cpp: warning: Uninitialized variable: b +storage/connect/odbconn.cpp: warning: Uninitialized variable: b +storage/connect/odbconn.cpp: warning: Uninitialized variable: b +storage/connect/plugutil.cpp: error: Width 255 given in format string (no. 2) is larger than destination buffer 'stmsg[200]', use %199[^\"] to prevent overflowing it. +storage/connect/plugutil.cpp: error: Width 255 given in format string (no. 1) is larger than destination buffer 'stmsg[200]', use %199[^\"] to prevent overflowing it. +storage/connect/tabjson.cpp: warning: Possible null pointer dereference: Val +storage/connect/tabmul.cpp: error: Uninitialized variable: buf +storage/connect/tabmul.cpp: error: Uninitialized variable: buf +storage/connect/tabmul.cpp: error: Uninitialized variable: buf +storage/connect/taboccur.cpp: warning: Uninitialized variable: *pcrp +storage/connect/unzip.c: warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file +storage/connect/value.cpp: error: Signed integer overflow for expression 'n*126230400'. +storage/connect/zip.c: warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file +storage/csv/ha_tina.cc: error: syntax error +storage/example/ha_example.cc: error: syntax error +storage/federated/ha_federated.cc: error: syntax error +storage/heap/ha_heap.cc: error: syntax error +storage/innobase/btr/btr0btr.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/btr/btr0cur.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/btr/btr0defragment.cc: error: There is an unknown macro here somewhere. Configuration is required. If DECLARE_THREAD is a macro then please configure it. +storage/innobase/btr/btr0sea.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/buf/buf0buf.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/buf/buf0dump.cc: error: There is an unknown macro here somewhere. Configuration is required. If DECLARE_THREAD is a macro then please configure it. +storage/innobase/buf/buf0flu.cc: error: There is an unknown macro here somewhere. Configuration is required. If DECLARE_THREAD is a macro then please configure it. +storage/innobase/buf/buf0lru.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/dict/dict0crea.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/dict/dict0dict.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/dict/dict0load.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/dict/dict0stats.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/dict/dict0stats_bg.cc: error: There is an unknown macro here somewhere. Configuration is required. If DECLARE_THREAD is a macro then please configure it. +storage/innobase/fil/fil0crypt.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/fil/fil0fil.cc: error: syntax error +storage/innobase/fsp/fsp0file.cc: error: Resource leak: file +storage/innobase/fsp/fsp0fsp.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/fts/fts0fts.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/fts/fts0opt.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/fts/fts0que.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/gis/gis0rtree.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/gis/gis0sea.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/handler/ha_innodb.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/handler/handler0alter.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/handler/i_s.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/ibuf/ibuf0ibuf.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/ibuf/ibuf0ibuf.cc: error: failed to expand 'ibuf_bitmap_page_get_bits', Wrong number of parameters for macro 'ibuf_bitmap_page_get_bits'. +storage/innobase/lock/lock0lock.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/lock/lock0wait.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/lock/lock0wait.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/log/log0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/log/log0recv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/os/os0file.cc: error: syntax error +storage/innobase/page/page0page.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/page/page0zip.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/pars/pars0pars.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0ftsort.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0import.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/row/row0ins.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0log.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/row/row0merge.cc: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/innobase/row/row0mysql.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0quiesce.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/row/row0sel.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/row/row0umod.cc: error: There is an unknown macro here somewhere. Configuration is required. If ut_d is a macro then please configure it. +storage/innobase/row/row0upd.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/row/row0vers.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/srv/srv0conc.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ALIGNED is a macro then please configure it. +storage/innobase/srv/srv0srv.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/srv/srv0start.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ATTRIBUTE is a macro then please configure it. +storage/innobase/trx/trx0i_s.cc: error: Array 'table_cache->chunks[39]' accessed at index 39, which is out of bounds. +storage/innobase/trx/trx0i_s.cc: error: Array 'table_cache->chunks[39]' accessed at index 39, which is out of bounds. +storage/innobase/trx/trx0purge.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/trx/trx0rec.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/trx/trx0roll.cc: error: There is an unknown macro here somewhere. Configuration is required. If DECLARE_THREAD is a macro then please configure it. +storage/innobase/trx/trx0trx.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/innobase/trx/trx0undo.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ha_maria.cc: error: syntax error +storage/maria/ma_bitmap.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_blockrec.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_check.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_checkpoint.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/maria/ma_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_ft_parser.c: error: Address of local auto-variable assigned to a function parameter. +storage/maria/ma_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_loghandler.c: warning: Uninitialized variable: data->current_offset +storage/maria/ma_open.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/maria/ma_pagecache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_pagecache.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_range.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_recovery_util.c: error: va_start() or va_copy() called subsequently on 'args' without va_end() in between. +storage/maria/ma_rkey.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_rt_index.c: error: failed to expand 'rt_PAGE_END', Wrong number of parameters for macro 'rt_PAGE_END'. +storage/maria/ma_search.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_sp_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_update.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/maria/ma_update.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/ma_write.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/maria/ma_write.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/maria/maria_pack.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/ft_parser.c: error: Address of local auto-variable assigned to a function parameter. +storage/myisam/ha_myisam.cc: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_check.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_close.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/myisam/mi_delete.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_key.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_locking.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_open.c: error: There is an unknown macro here somewhere. Configuration is required. If DBUG_EXECUTE_IF is a macro then please configure it. +storage/myisam/mi_range.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_rkey.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_search.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_update.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/mi_write.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisam/myisampack.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +storage/myisammrg/ha_myisammrg.cc: error: syntax error +storage/oqgraph/ha_oqgraph.cc: error: syntax error +storage/perfschema/ha_perfschema.cc: error: syntax error +storage/perfschema/pfs_instr.h: error: Uninitialized variable: m_has_io_stats +storage/perfschema/pfs_instr.h: error: Uninitialized variable: m_has_lock_stats +storage/perfschema/pfs_instr_class.cc: error: There is an unknown macro here somewhere. Configuration is required. If MY_ALIGNED is a macro then please configure it. +storage/perfschema/table_accounts.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esgs_by_account_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esgs_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esgs_by_user_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esms_by_account_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esms_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_esms_by_user_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_events_waits.cc: error: Uninitialized struct member: wait.m_wait_class +storage/perfschema/table_events_waits.cc: error: Uninitialized variable: wait +storage/perfschema/table_events_waits.cc: error: Uninitialized struct member: wait.m_wait_class +storage/perfschema/table_ews_by_account_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_ews_by_host_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_ews_by_user_by_event_name.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_hosts.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_setup_actors.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_threads.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/perfschema/table_users.cc: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +storage/sequence/sequence.cc: error: syntax error +storage/test_sql_discovery/test_sql_discovery.cc: error: syntax error +strings/decimal.c: warning: Possible null pointer dereference: to +strings/dump_map.c: error: Array 'fromstat[256]' accessed at index 256, which is out of bounds. +tests/mysql_client_fw.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +tests/thread_test.c: error: There is an unknown macro here somewhere. Configuration is required. If STRINGIFY_ARG is a macro then please configure it. +unittest/mysys/dynstring-t.c: error: syntax error +unittest/mysys/queues-t.c: error: Uninitialized variable: i +unittest/mysys/waiting_threads-t.c: error: Uninitialized variable: m +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +unittest/mytap/tap.c: error: va_list 'ap' used before va_start() was called. +vio/viosocket.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_SOCKET_WAIT_VARIABLES is a macro then please configure it. +vio/viosocket.c: error: There is an unknown macro here somewhere. Configuration is required. If MYSQL_SOCKET_WAIT_VARIABLES is a macro then please configure it. +vio/viosslfactories.c: error: There is an unknown macro here somewhere. Configuration is required. If ; is a macro then please configure it. +vio/viotest-sslconnect.cc: error: Memory pointed to by 'vio' is freed twice. +vio/viotest-sslconnect.cc: error: Memory pointed to by 'ssl_connector' is freed twice. +wsrep-lib/src/server_state.cpp: error: syntax error: keyword 'try' is not allowed in global scope +wsrep-lib/src/thread_service_v1.cpp: error: Rethrowing current exception with 'throw;', it seems there is no current exception to rethrow. If there is no current exception this calls std::terminate(). More: https://isocpp.org/wiki/faq/exceptions#throw-without-an-object diff --git a/tests/code_quality/flawfinder_ignorelist.json b/tests/code_quality/flawfinder_ignorelist.json new file mode 100644 index 00000000000..7b598689693 --- /dev/null +++ b/tests/code_quality/flawfinder_ignorelist.json @@ -0,0 +1,622 @@ +{ + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "version": "2.1.0", + "runs": [ + { + "tool": { + "driver": { + "name": "Flawfinder", + "version": "2.0.19", + "informationUri": "https://dwheeler.com/flawfinder/", + "supportedTaxonomies": [ + { + "name": "CWE", + "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5" + } + ] + } + }, + "columnKind": "utf16CodeUnits", + "results": [ + { + "ruleId": "FF1010", + "level": "error", + "message": { + "text": "buffer/strncat:Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/portability/file.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 5, + "endColumn": 39, + "snippet": { + "text": " strncat(buf, path, TOKU_PATH_MAX);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "02af921b7054342955d8e30b196aa5ffdc3b1ac019e26c92823a7ab171d2b1fa" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/ft/logger/logformat.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 5, + "endColumn": 40, + "snippet": { + "text": " chmod(headerpath, S_IRUSR|S_IWUSR);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "085f579f942967e5c81fff75af832721b7b9bc59e54a7a9ebc086065cf56be13" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/portability/file.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 25, + "endColumn": 63, + "snippet": { + "text": " ssize_t s = readlink(fdname, lname, sizeof lname);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "0dba1d2cdc995ccf30ad8fe5ce3ccf8795bd4f5a207f65c627affa2ef388496c" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./extra/mariabackup/xtrabackup.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 17, + "endColumn": 57, + "snippet": { + "text": " ssize_t ret = readlink(\"/proc/self/exe\", buf, size-1);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "11523490c7f8cba115bce125bbce94de5cd5e7f66d4dd07a391aac70fbbdd353" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./client/mysqltest.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 13, + "endColumn": 38, + "snippet": { + "text": " err_code= chmod(ds_file.str, mode);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "12a7fa6bbd4c81be975838bae2b7b26fe841acaf9804e6d0299188683e230908" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/ft/logger/logformat.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 5, + "endColumn": 38, + "snippet": { + "text": " chmod(codepath, S_IRUSR|S_IWUSR);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "2827dedcdf10af2bf4105f3d48e30575238fa2552603cdcb09d536b288808f0e" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1014", + "level": "error", + "message": { + "text": "buffer/gets:Does not check for buffer overflows (CWE-120, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./extra/readline/tilde.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 12, + "endColumn": 24, + "snippet": { + "text": " if (!gets (line))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "34a940ccc6e0248a2cf725e8a0c3f808d1f36d47fc814bd9daadb17f5563d357" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./sql/sql_class.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 10, + "endColumn": 28, + "snippet": { + "text": " (void) chmod(path, 0644);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "3f97fd0452062ab69db87a04222a17c37c216c4e28e2ae3622730da8dd070d2e" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_chmod.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 25, + "snippet": { + "text": " if (chmod(name, mode))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "46805eec1d288b072d4edb3214822220d394307195be79a33ec3bce455d14750" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1010", + "level": "error", + "message": { + "text": "buffer/strncat:Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/ft/tests/recovery-datadir-is-file.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 47, + "snippet": { + "text": " strncat(buf, testfile, TOKU_PATH_MAX);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "4ca2dff1e35445f7997a9979cdd006d89befcc89922cf5d4a60bc9c07126a78d" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_symlink.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 15, + "endColumn": 56, + "snippet": { + "text": " if ((length=readlink(filename, to, FN_REFLEN-1)) < 0)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "7da5207ac0f5baba73c026472a2d3805eed92931852575db64f513702977dd70" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_redel.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 49, + "snippet": { + "text": " if (chown(to, statbuf.st_uid, statbuf.st_gid))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "97d2cfe4cb9428e812b796eb39c27f28dc8b198ab9655c2aff8c442de39bdcfe" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/ft/logger/logformat.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 50, + "snippet": { + "text": " chmod(codepath, S_IRUSR|S_IRGRP|S_IROTH);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "a62b28fca5c6218ee4731e78bb3eacb93604fae20c91c69cccad3834973e70d5" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/rocksdb/rocksdb/port/stack_trace.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 15, + "endColumn": 54, + "snippet": { + "text": " auto read = readlink(link, name, sizeof(name) - 1);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "acb399f2a4a15ef8da36c47631bc4ee4bcc1bb0577dfbda141d2eb5d7723af40" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./sql/signal_handler.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 13, + "endColumn": 66, + "snippet": { + "text": " if ((len= readlink(\"/proc/self/cwd\", buff, sizeof(buff))) >= 0)" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "b55a5f3db29b1ce25e12f94e4ea344ed7fb0e63a230cf6b6deb42c28de924457" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_copy.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 46, + "snippet": { + "text": " if (chmod(to, stat_buff.st_mode & 07777))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "bddb795a7efbd73a4387bbd33fd4f9e505b4f759d784e5d51f60cc43011ee610" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1031", + "level": "error", + "message": { + "text": "race/chown:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_copy.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 55, + "snippet": { + "text": " if (chown(to, stat_buff.st_uid, stat_buff.st_gid))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "c63a81105d753de4762cbcab48d9700f7069da3cd9d57bf4329a6d20fad288aa" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/ft/logger/logformat.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 9, + "endColumn": 52, + "snippet": { + "text": " chmod(headerpath, S_IRUSR|S_IRGRP|S_IROTH);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "cc51b21d9b803a08b6c619b63abf77f4ca9ce247db0ef1b81f4bd83dfb95f3d8" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./sql/mysqld.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 12, + "endColumn": 71, + "snippet": { + "text": " (void) chmod(mysqld_unix_port,S_IFSOCK);\t/* Fix solaris 2.6 bug */" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "d0c4f1302290e2367e246ef7c8d3ea69589cbc4bc148e0efdd4c283fa03cbe01" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1033", + "level": "error", + "message": { + "text": "race/chmod:This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./mysys/my_redel.c", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 7, + "endColumn": 42, + "snippet": { + "text": " if (chmod(to, statbuf.st_mode & 07777))" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "e11b8df9cbb9e459e4d67a0af5e627b6b1285c78fe23f5a1c823285da96495a8" + }, + "rank": 1.0 + }, + { + "ruleId": "FF1035", + "level": "error", + "message": { + "text": "race/readlink:This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20)." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "./storage/tokudb/PerconaFT/portability/file.cc", + "uriBaseId": "SRCROOT" + }, + "region": { + "startColumn": 29, + "endColumn": 67, + "snippet": { + "text": " ssize_t n = readlink(fname, symname, MY_MAX_PATH);" + } + } + } + } + ], + "fingerprints": { + "contextHash/v1": "e307b1923cc852324e3050b3e4423be7ac4d1d64af274b70b897a85b1cde815f" + }, + "rank": 1.0 + } + ], + "externalPropertyFileReferences": { + "taxonomies": [ + { + "location": { + "uri": "https://raw.githubusercontent.com/sarif-standard/taxonomies/main/CWE_v4.4.sarif" + }, + "guid": "FFC64C90-42B6-44CE-8BEB-F6B7DAE649E5" + } + ] + } + } + ] +} From b54e7b0cea5dffe57d71b4ec7486ecce700086df Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Fri, 12 May 2023 12:11:53 +0300 Subject: [PATCH 31/80] MDEV-31185 rw_trx_hash_t::find() unpins pins too early MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rw_trx_hash_t::find() acquires element->mutex, then unpins pins, used for lf_hash element search. After that the "element" can be deallocated and reused by some other thread. If we take a look rw_trx_hash_t::insert()->lf_hash_insert()->lf_alloc_new() calls, we will not find any element->mutex acquisition, as it was not initialized yet before it's allocation. rw_trx_hash_t::insert() can reuse the chunk, unpinned in rw_trx_hash_t::find(). The scenario is the following: 1. Thread 1 have just executed lf_hash_search() in rw_trx_hash_t::find(), but have not acquired element->mutex yet. 2. Thread 2 have removed the element from hash table with rw_trx_hash_t::erase() call. 3. Thread 1 acquired element->mutex and unpinned pin 2 pin with lf_hash_search_unpin(pins) call. 4. Some thread purged memory of the element. 5. Thread 3 reused the memory for the element, filled element->id, element->trx. 6. Thread 1 crashes with failed "DBUG_ASSERT(trx_id == trx->id)" assertion. Note that trx_t objects are also reused, see the code around trx_pools for details. The fix is to invoke "lf_hash_search_unpin(pins);" after element->trx is stored in local variable in rw_trx_hash_t::find(). Reviewed by: Nikita Malyavin, Marko Mäkelä. --- .../r/trx_sys_t_find_lf_hash_error.result | 25 ++++++ .../t/trx_sys_t_find_lf_hash_error.test | 87 +++++++++++++++++++ mysys/lf_alloc-pin.c | 3 + sql/table_cache.cc | 4 + sql/xa.cc | 5 ++ storage/innobase/include/trx0sys.h | 21 ++++- 6 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/innodb/r/trx_sys_t_find_lf_hash_error.result create mode 100644 mysql-test/suite/innodb/t/trx_sys_t_find_lf_hash_error.test diff --git a/mysql-test/suite/innodb/r/trx_sys_t_find_lf_hash_error.result b/mysql-test/suite/innodb/r/trx_sys_t_find_lf_hash_error.result new file mode 100644 index 00000000000..11d3fb4a7a3 --- /dev/null +++ b/mysql-test/suite/innodb/r/trx_sys_t_find_lf_hash_error.result @@ -0,0 +1,25 @@ +create table t1 (a int) engine=innodb STATS_PERSISTENT=0; +create table t2 (a int) engine=innodb STATS_PERSISTENT=0; +BEGIN; +insert into t1 values(1); +connect con_1, localhost, root,,; +SET DEBUG_SYNC="before_trx_hash_find_element_mutex_enter SIGNAL before_mutex_enter WAIT_FOR cont1"; +SET DEBUG_SYNC="after_trx_hash_find_element_mutex_enter SIGNAL after_mutex_enter WAIT_FOR cont2"; +SELECT * FROM t1 WHERE a = 1 FOR UPDATE; +connection default; +SET DEBUG_SYNC="now WAIT_FOR before_mutex_enter"; +COMMIT; +SET DEBUG_SYNC="now SIGNAL cont1"; +SET DEBUG_SYNC="now WAIT_FOR after_mutex_enter"; +insert into t2 values(1); +BEGIN; +INSERT INTO t2 VALUES(2); +SET DEBUG_SYNC="now SIGNAL cont2"; +connection con_1; +a +1 +disconnect con_1; +connection default; +DROP TABLE t1; +DROP TABLE t2; +SET DEBUG_SYNC="reset"; diff --git a/mysql-test/suite/innodb/t/trx_sys_t_find_lf_hash_error.test b/mysql-test/suite/innodb/t/trx_sys_t_find_lf_hash_error.test new file mode 100644 index 00000000000..833919f9ad6 --- /dev/null +++ b/mysql-test/suite/innodb/t/trx_sys_t_find_lf_hash_error.test @@ -0,0 +1,87 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/count_sessions.inc + +create table t1 (a int) engine=innodb STATS_PERSISTENT=0; +create table t2 (a int) engine=innodb STATS_PERSISTENT=0; + +BEGIN; # trx1 +# register rw-transaction in trx_sys.rw_trx_hash +insert into t1 values(1); + +--connect (con_1, localhost, root,,) +SET DEBUG_SYNC="before_trx_hash_find_element_mutex_enter SIGNAL before_mutex_enter WAIT_FOR cont1"; +SET DEBUG_SYNC="after_trx_hash_find_element_mutex_enter SIGNAL after_mutex_enter WAIT_FOR cont2"; + +# trx2 is converting implicit lock of trx1 to explicit one, it's invoking +# ▾ l_search +# ▾ lf_hash_search_using_hash_value +# ▾ lf_hash_search +# ▾ rw_trx_hash_t::find +# ▾ trx_sys_t::find +# ▾ lock_rec_convert_impl_to_expl +# rw_trx_hash_t::find returns lf_hash element, pin 2 is pinned, +# but element->mutex has not been acquired yet, what allows trx1 element to be +# removed from trx_sys.rw_trx_hash at one hand, and at the other hand, the +# content of the element is still valid as it's pinned. +# +# trx2 +--send SELECT * FROM t1 WHERE a = 1 FOR UPDATE +--connection default +SET DEBUG_SYNC="now WAIT_FOR before_mutex_enter"; +--disable_query_log +SET @saved_dbug = @@debug_dbug; + +# Usually pinbox purgatory is purged either when the number of elements in +# purgatory is greater then some limit(see lf_pinbox_free()), or when thread +# invokes rw_trx_hash_t::put_pins() explicitly. For this test the first +# variant was choosen. The following option makes lf_pinbox_free() to purge +# pinbox purgatory on each call, ignoring pins->purgatory_count. +SET DEBUG_DBUG='+d,unconditional_pinbox_free'; +--enable_query_log + +# trx1 is committed and removed from trx_sys.rw_trx_hash. It can be done as +# trx2 has not been acquired element->mutex yet. +COMMIT; +--disable_query_log +SET DEBUG_DBUG = @saved_dbug; +--enable_query_log + +# Let trx2 to acquire element->mutex and unpin pin 2 +SET DEBUG_SYNC="now SIGNAL cont1"; +SET DEBUG_SYNC="now WAIT_FOR after_mutex_enter"; + +--disable_query_log +SET @saved_dbug = @@debug_dbug; +SET DEBUG_DBUG='+d,unconditional_pinbox_free'; +--enable_query_log +# trx3 commits and invokes lf_pinbox_free(), which purges pin 2 of trx2 and +# places its pointer on trx_sys.rw_trx_hash.hash.alloc.top. +insert into t2 values(1); +--disable_query_log +SET DEBUG_DBUG = @saved_dbug; +--enable_query_log + +BEGIN; # trx4 +# trx_sys.rw_trx_hash.hash.alloc.top points to "freed" trx2 lf_hash element, +# lf_alloc_new() gets the pointer from trx_sys.rw_trx_hash.hash.alloc.top, +# so the memory for lf_hash element will be reused for trx4 if MDEV-31185 is +# not fixed +INSERT INTO t2 VALUES(2); + +# let trx2 to invoke DBUG_ASSERT(trx_id == trx->id) and crash if MDEV-31185 +# is not fixed +SET DEBUG_SYNC="now SIGNAL cont2"; + +--connection con_1 +# trx 2 assertion failure if MDEV-31185 is not fixed +--reap +--disconnect con_1 +--connection default +DROP TABLE t1; +DROP TABLE t2; + +SET DEBUG_SYNC="reset"; + +--source include/wait_until_count_sessions.inc diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index f844920a664..6d80b381e5e 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -270,6 +270,9 @@ void lf_pinbox_free(LF_PINS *pins, void *addr) add_to_purgatory(pins, addr); if (pins->purgatory_count % LF_PURGATORY_SIZE == 0) lf_pinbox_real_free(pins); + DBUG_EXECUTE_IF("unconditional_pinbox_free", + if (pins->purgatory_count % LF_PURGATORY_SIZE) + lf_pinbox_real_free(pins);); } struct st_harvester { diff --git a/sql/table_cache.cc b/sql/table_cache.cc index 15255c56083..9b28e7b7b0f 100644 --- a/sql/table_cache.cc +++ b/sql/table_cache.cc @@ -824,6 +824,10 @@ retry: element= (TDC_element*) lf_hash_search_using_hash_value(&tdc_hash, thd->tdc_hash_pins, hash_value, (uchar*) key, key_length); + /* It's safe to unpin the pins here, because an empty element was inserted + above, "empty" means at least element->share = 0. Some other thread can't + delete it while element->share == 0. And element->share is also protected + with element->LOCK_table_share mutex. */ lf_hash_search_unpin(thd->tdc_hash_pins); DBUG_ASSERT(element); diff --git a/sql/xa.cc b/sql/xa.cc index 85fbe9358a3..7b5296f20f9 100644 --- a/sql/xa.cc +++ b/sql/xa.cc @@ -246,9 +246,14 @@ static XID_cache_element *xid_cache_search(THD *thd, XID *xid) xid->key(), xid->key_length()); if (element) { + /* The element can be removed from lf_hash by other thread, but + element->acquire_recovered() will return false in this case. */ if (!element->acquire_recovered()) element= 0; lf_hash_search_unpin(thd->xid_hash_pins); + /* Once the element is acquired (i.e. got the ACQUIRED bit) by this thread, + only this thread can delete it. The deletion happens in xid_cache_delete(). + See also the XID_cache_element documentation. */ DEBUG_SYNC(thd, "xa_after_search"); } return element; diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 246af942419..0f12cd90495 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -632,9 +632,21 @@ public: sizeof(trx_id_t))); if (element) { + /* rw_trx_hash_t::erase() sets element->trx to nullptr under + element->mutex protection before removing the element from hash table. + If the element was removed before the mutex acquisition, element->trx + will be equal to nullptr. */ + DEBUG_SYNC_C("before_trx_hash_find_element_mutex_enter"); mutex_enter(&element->mutex); + /* element_trx can't point to reused object now. If transaction was + deregistered before element->mutex acquisition, element->trx is nullptr. + It can't be deregistered while element->mutex is held. */ + trx_t *element_trx = element->trx; lf_hash_search_unpin(pins); - if ((trx= element->trx)) { + /* The *element can be reused now, as element->trx value is stored + locally in element_trx. */ + DEBUG_SYNC_C("after_trx_hash_find_element_mutex_enter"); + if ((trx= element_trx)) { DBUG_ASSERT(trx_id == trx->id); ut_d(validate_element(trx)); if (do_ref_count) @@ -650,12 +662,19 @@ public: trx_mutex_enter(trx); const trx_state_t state= trx->state; trx_mutex_exit(trx); + /* trx_t::commit_in_memory() sets the state to + TRX_STATE_COMMITTED_IN_MEMORY before deregistering the transaction. + It also waits for any implicit-to-explicit lock conversions to cease + after deregistering. */ if (state == TRX_STATE_COMMITTED_IN_MEMORY) trx= NULL; else trx->reference(); } } + /* element's lifetime is equal to the hash lifetime, that's why + element->mutex is valid here despite the element is unpinned. In the + worst case some thread will wait for element->mutex releasing. */ mutex_exit(&element->mutex); } if (!caller_trx) From 131ef14a6e70eeaadf71f65e8463d59e30bf76c5 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 10 May 2023 20:08:33 +0300 Subject: [PATCH 32/80] Fix ./mtr --view-protocol opt_trace Follow the approach taken in the rest of the test. --- mysql-test/main/opt_trace.test | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 2f1047df7c5..5f73e076fec 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -751,6 +751,11 @@ select * from from t10 left join t11 on t11.col1=t10.col1 group by grp_id) T on T.grp_id=t1.b; +# Not sure how MDEV-27871 is related but this test uses this reason +# all over the place: +#enable after fix MDEV-27871 +--disable_view_protocol + select json_detailed(json_extract(trace, '$**.check_split_materialized')) as JS from information_schema.optimizer_trace; @@ -763,6 +768,7 @@ select ) as JS from information_schema.optimizer_trace; +--enable_view_protocol drop table t1,t2,t3,t10,t11; set optimizer_trace=DEFAULT; From 60f0765b58ff2a1042b005cf629da30e3f730d3b Mon Sep 17 00:00:00 2001 From: Oleg Smirnov Date: Sun, 29 Jan 2023 19:39:14 +0700 Subject: [PATCH 33/80] MDEV-30143 Segfault on select query using index for group-by and filesort The problem was trying to access JOIN_TAB::select which is set to NULL when using the filesort. The correct way is accessing either JOIN_TAB::select or JOIN_TAB::filesort->select depending on whether the filesort is used. This commit introduces member function JOIN_TAB::get_sql_select() encapsulating that check so the code duplication is eliminated. The new condition (s->table->quick_keys.is_set(best_key->key)) was added to best_access_path() to eliminate a Valgrind error. The cause of that error was using TRASH_ALLOC(quick_key_parts) instead of bzero(quick_key_parts); hence, accessing s->table->quick_key_parts[best_key->key]) without prior checking for quick_keys.is_set() might have caused reading "dirty" memory --- mysql-test/main/group_min_max_innodb.result | 22 ++++++++++++++++++++ mysql-test/main/group_min_max_innodb.test | 23 ++++++++++++++++++++- sql/sql_select.cc | 6 +++--- sql/sql_select.h | 9 ++++++-- 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/mysql-test/main/group_min_max_innodb.result b/mysql-test/main/group_min_max_innodb.result index 3586ad5237f..a2b06b0481b 100644 --- a/mysql-test/main/group_min_max_innodb.result +++ b/mysql-test/main/group_min_max_innodb.result @@ -308,6 +308,28 @@ NULL bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb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+CREATE TABLE t1 (a varchar(35), b varchar(4)) ENGINE=InnoDB; +INSERT INTO t1 VALUES +('Albania','AXA'),('Australia','AUS'),('American Samoa','AMSA'),('Bahamas','BS'); +CREATE TABLE t2 (a varchar(4), b varchar(50), PRIMARY KEY (b,a), KEY (a)) ENGINE=InnoDB; +INSERT INTO t2 VALUES +('BERM','African Methodist Episcopal'),('AUS','Anglican'),('BERM','Anglican'),('BS','Anglican'),('BS','Baptist'),('BS','Methodist'); +EXPLAIN SELECT t1.a +FROM (SELECT a FROM t2 GROUP BY a ORDER BY COUNT(DISTINCT b) LIMIT 1) dt +JOIN t1 ON dt.a=t1.b; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL # +1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join) +2 DERIVED t2 range a a 58 NULL # Using index for group-by (scanning); Using temporary; Using filesort +SELECT t1.a +FROM (SELECT a FROM t2 GROUP BY a ORDER BY COUNT(DISTINCT b) LIMIT 1) dt +JOIN t1 ON dt.a=t1.b; +a +Australia +DROP TABLES t1, t2; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; diff --git a/mysql-test/main/group_min_max_innodb.test b/mysql-test/main/group_min_max_innodb.test index 87a6e320887..fcecbec41b3 100644 --- a/mysql-test/main/group_min_max_innodb.test +++ b/mysql-test/main/group_min_max_innodb.test @@ -251,7 +251,28 @@ insert into t2 values (1,repeat("a",1000)),(2,repeat("a",1000)),(3,repeat("b",10 SELECT GROUP_CONCAT(t1.language_id SEPARATOR ',') AS `translation_resources`, `d`.`serialized_c` FROM t2 AS `d` LEFT JOIN t1 ON `d`.`voter_id` = t1.`voter_id` GROUP BY `d`.`voter_id` ORDER BY 10-d.voter_id+RAND()*0; drop table t1,t2; + +--echo # +--echo # MDEV-30143: Segfault on select query using index for group-by and filesort +--echo # +CREATE TABLE t1 (a varchar(35), b varchar(4)) ENGINE=InnoDB; +INSERT INTO t1 VALUES +('Albania','AXA'),('Australia','AUS'),('American Samoa','AMSA'),('Bahamas','BS'); + +CREATE TABLE t2 (a varchar(4), b varchar(50), PRIMARY KEY (b,a), KEY (a)) ENGINE=InnoDB; +INSERT INTO t2 VALUES +('BERM','African Methodist Episcopal'),('AUS','Anglican'),('BERM','Anglican'),('BS','Anglican'),('BS','Baptist'),('BS','Methodist'); + +let query= +SELECT t1.a +FROM (SELECT a FROM t2 GROUP BY a ORDER BY COUNT(DISTINCT b) LIMIT 1) dt +JOIN t1 ON dt.a=t1.b; +--replace_column 9 # +eval EXPLAIN $query; +eval $query; + +DROP TABLES t1, t2; + set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; - diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 34da8639d9a..53bdc567901 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8120,6 +8120,7 @@ best_access_path(JOIN *join, if ((records >= s->found_records || best > s->read_time) && // (1) !(best_key && best_key->key == MAX_KEY) && // (2) !(s->quick && best_key && s->quick->index == best_key->key && // (2) + s->table->quick_keys.is_set(best_key->key) && // (2) best_max_key_part >= s->table->quick_key_parts[best_key->key]) &&// (2) !((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3) ! s->table->covering_keys.is_clear_all() && best_key && !s->quick) &&// (3) @@ -13791,7 +13792,7 @@ double JOIN_TAB::scan_time() ha_rows JOIN_TAB::get_examined_rows() { double examined_rows; - SQL_SELECT *sel= filesort? filesort->select : this->select; + const SQL_SELECT *sel= get_sql_select(); if (sel && sel->quick && use_quick != 2) examined_rows= (double)sel->quick->records; @@ -26858,13 +26859,12 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, eta->key.clear(); eta->quick_info= NULL; - SQL_SELECT *tab_select; /* We assume that if this table does pre-sorting, then it doesn't do filtering with SQL_SELECT. */ DBUG_ASSERT(!(select && filesort)); - tab_select= (filesort)? filesort->select : select; + const SQL_SELECT *tab_select= get_sql_select(); if (filesort) { diff --git a/sql/sql_select.h b/sql/sql_select.h index d2d17611e48..f551126c7d7 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -546,14 +546,19 @@ typedef struct st_join_table { void cleanup(); inline bool is_using_loose_index_scan() { - const SQL_SELECT *sel= filesort ? filesort->select : select; + const SQL_SELECT *sel= get_sql_select(); return (sel && sel->quick && (sel->quick->get_type() == QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX)); } bool is_using_agg_loose_index_scan () { + const SQL_SELECT *sel= get_sql_select(); return (is_using_loose_index_scan() && - ((QUICK_GROUP_MIN_MAX_SELECT *)select->quick)->is_agg_distinct()); + ((QUICK_GROUP_MIN_MAX_SELECT *)sel->quick)->is_agg_distinct()); + } + const SQL_SELECT *get_sql_select() + { + return filesort ? filesort->select : select; } bool is_inner_table_of_semi_join_with_first_match() { From 6966d7fe4b7ccfb2b7d16ca4d7d5ab08234fa9ec Mon Sep 17 00:00:00 2001 From: Teemu Ollakka Date: Mon, 17 Apr 2023 16:04:01 +0300 Subject: [PATCH 34/80] MDEV-29293 MariaDB stuck on starting commit state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a backport from 10.5. The problem seems to be a deadlock between KILL command execution and BF abort issued by an applier, where: * KILL has locked victim's LOCK_thd_kill and LOCK_thd_data. * Applier has innodb side global lock mutex and victim trx mutex. * KILL is calling innobase_kill_query, and is blocked by innodb global lock mutex. * Applier is in wsrep_innobase_kill_one_trx and is blocked by victim's LOCK_thd_kill. The fix in this commit removes the TOI replication of KILL command and makes KILL execution less intrusive operation. Aborting the victim happens now by using awake_no_mutex() and ha_abort_transaction(). If the KILL happens when the transaction is committing, the KILL operation is postponed to happen after the statement has completed in order to avoid KILL to interrupt commit processing. Notable changes in this commit: * wsrep client connections's error state may remain sticky after client connection is closed. This error message will then pop up for the next client session issuing first SQL statement. This problem raised with test galera.galera_bf_kill. The fix is to reset wsrep client error state, before a THD is reused for next connetion. * Release THD locks in wsrep_abort_transaction when locking innodb mutexes. This guarantees same locking order as with applier BF aborting. * BF abort from MDL was changed to do BF abort on server/wsrep-lib side first, and only then do the BF abort on InnoDB side. This removes the need to call back from InnoDB for BF aborts which originate from MDL and simplifies the locking. * Removed wsrep_thd_set_wsrep_aborter() from service_wsrep.h. The manipulation of the wsrep_aborter can be done solely on server side. Moreover, it is now debug only variable and could be excluded from optimized builds. * Remove LOCK_thd_kill from wsrep_thd_LOCK/UNLOCK to allow more fine grained locking for SR BF abort which may require locking of victim LOCK_thd_kill. Added explicit call for wsrep_thd_kill_LOCK/UNLOCK where appropriate. * Wsrep-lib was updated to version which allows external locking for BF abort calls. Changes to MTR tests: * Disable galera_bf_abort_group_commit. This test is going to be removed (MDEV-30855). * Record galera_gcache_recover_manytrx as result file was incomplete. Trivial change. * Make galera_create_table_as_select more deterministic: Wait until CTAS execution has reached MDL wait for multi-master conflict case. Expected error from multi-master conflict is ER_QUERY_INTERRUPTED. This is because CTAS does not yet have open wsrep transaction when it is waiting for MDL, query gets interrupted instead of BF aborted. This should be addressed in separate task. * A new test galera_kill_group_commit to verify correct behavior when KILL is executed while the transaction is committing. Co-authored-by: Seppo Jaakola Co-authored-by: Jan Lindström Signed-off-by: Julius Goryavsky --- include/mysql/service_wsrep.h | 9 +- mysql-test/suite/galera/disabled.def | 1 + mysql-test/suite/galera/r/MDEV-29293.result | 21 ++ .../r/galera_create_table_as_select.result | 1 + .../galera/r/galera_kill_group_commit.result | 27 +++ mysql-test/suite/galera/t/MDEV-29293.test | 41 ++++ .../t/galera_create_table_as_select.test | 6 +- .../galera/t/galera_kill_group_commit.cnf | 5 + .../galera/t/galera_kill_group_commit.test | 69 ++++++ sql/handler.cc | 7 + sql/service_wsrep.cc | 38 +--- sql/sql_class.cc | 27 ++- sql/sql_class.h | 9 +- sql/sql_parse.cc | 58 +---- sql/sql_plugin_services.inl | 2 +- sql/wsrep_dummy.cc | 8 +- sql/wsrep_high_priority_service.cc | 1 + sql/wsrep_mysqld.cc | 45 ++-- sql/wsrep_server_service.cc | 8 +- sql/wsrep_server_service.h | 3 +- sql/wsrep_thd.cc | 213 +++++++++++++----- sql/wsrep_thd.h | 36 ++- sql/wsrep_trans_observer.h | 26 ++- storage/innobase/handler/ha_innodb.cc | 191 +++++++++------- wsrep-lib | 2 +- 25 files changed, 591 insertions(+), 263 deletions(-) create mode 100644 mysql-test/suite/galera/r/MDEV-29293.result create mode 100644 mysql-test/suite/galera/r/galera_kill_group_commit.result create mode 100644 mysql-test/suite/galera/t/MDEV-29293.test create mode 100644 mysql-test/suite/galera/t/galera_kill_group_commit.cnf create mode 100644 mysql-test/suite/galera/t/galera_kill_group_commit.test diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h index 1e6aaa1b9b9..e1f7994f779 100644 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@ -57,6 +57,7 @@ extern struct wsrep_service_st { my_bool (*wsrep_on_func)(const MYSQL_THD thd); bool (*wsrep_prepare_key_for_innodb_func)(MYSQL_THD thd, const unsigned char*, size_t, const unsigned char*, size_t, struct wsrep_buf*, size_t*); void (*wsrep_thd_LOCK_func)(const MYSQL_THD thd); + int (*wsrep_thd_TRYLOCK_func)(const MYSQL_THD thd); void (*wsrep_thd_UNLOCK_func)(const MYSQL_THD thd); const char * (*wsrep_thd_query_func)(const MYSQL_THD thd); int (*wsrep_thd_retry_counter_func)(const MYSQL_THD thd); @@ -83,7 +84,6 @@ extern struct wsrep_service_st { my_bool (*wsrep_get_debug_func)(); void (*wsrep_commit_ordered_func)(MYSQL_THD thd); my_bool (*wsrep_thd_is_applying_func)(const MYSQL_THD thd); - bool (*wsrep_thd_set_wsrep_aborter_func)(MYSQL_THD bf_thd, MYSQL_THD thd); void (*wsrep_report_bf_lock_wait_func)(const MYSQL_THD thd, unsigned long long trx_id); void (*wsrep_thd_kill_LOCK_func)(const MYSQL_THD thd); @@ -105,6 +105,7 @@ extern struct wsrep_service_st { #define wsrep_on(thd) (thd) && WSREP_ON && wsrep_service->wsrep_on_func(thd) #define wsrep_prepare_key_for_innodb(A,B,C,D,E,F,G) wsrep_service->wsrep_prepare_key_for_innodb_func(A,B,C,D,E,F,G) #define wsrep_thd_LOCK(T) wsrep_service->wsrep_thd_LOCK_func(T) +#define wsrep_thd_TRYLOCK(T) wsrep_service->wsrep_thd_TRYLOCK_func(T) #define wsrep_thd_UNLOCK(T) wsrep_service->wsrep_thd_UNLOCK_func(T) #define wsrep_thd_kill_LOCK(T) wsrep_service->wsrep_thd_kill_LOCK_func(T) #define wsrep_thd_kill_UNLOCK(T) wsrep_service->wsrep_thd_kill_UNLOCK_func(T) @@ -130,7 +131,6 @@ extern struct wsrep_service_st { #define wsrep_get_debug() wsrep_service->wsrep_get_debug_func() #define wsrep_commit_ordered(T) wsrep_service->wsrep_commit_ordered_func(T) #define wsrep_thd_is_applying(T) wsrep_service->wsrep_thd_is_applying_func(T) -#define wsrep_thd_set_wsrep_aborter(T) wsrep_service->wsrep_thd_set_wsrep_aborter_func(T1, T2) #define wsrep_report_bf_lock_wait(T,I) wsrep_service->wsrep_report_bf_lock_wait(T,I) #define wsrep_thd_set_PA_unsafe(T) wsrep_service->wsrep_thd_set_PA_unsafe_func(T) #else @@ -164,6 +164,8 @@ void wsrep_set_data_home_dir(const char *data_dir); extern "C" my_bool wsrep_on(const MYSQL_THD thd); /* Lock thd wsrep lock */ extern "C" void wsrep_thd_LOCK(const MYSQL_THD thd); +/* Try thd wsrep lock. Return non-zero if lock could not be taken. */ +extern "C" int wsrep_thd_TRYLOCK(const MYSQL_THD thd); /* Unlock thd wsrep lock */ extern "C" void wsrep_thd_UNLOCK(const MYSQL_THD thd); @@ -186,8 +188,6 @@ extern "C" my_bool wsrep_thd_is_local(const MYSQL_THD thd); /* Return true if thd is in high priority mode */ /* todo: rename to is_high_priority() */ extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd); -/* set wsrep_aborter for the target THD */ -extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd); /* Return true if thd is in TOI mode */ extern "C" my_bool wsrep_thd_is_toi(const MYSQL_THD thd); /* Return true if thd is in replicating TOI mode */ @@ -228,7 +228,6 @@ extern "C" my_bool wsrep_get_debug(); extern "C" void wsrep_commit_ordered(MYSQL_THD thd); extern "C" my_bool wsrep_thd_is_applying(const MYSQL_THD thd); -extern "C" bool wsrep_thd_set_wsrep_aborter(MYSQL_THD bf_thd, MYSQL_THD victim_thd); extern "C" void wsrep_report_bf_lock_wait(const THD *thd, unsigned long long trx_id); /* declare parallel applying unsafety for the THD */ diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index ce0e8d986a4..7bd12ba7514 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -19,3 +19,4 @@ galera_var_notify_ssl_ipv6 : MDEV-29861 Galera test case hangs galera_var_notify_cmd: MDEV-29861 Galera test case hangs galera_var_node_address : MDEV-20485 Galera test failure MDEV-26575 : MDEV-29878 Galera test failure on MDEV-26575 +galera_bf_abort_group_commit : MDEV-30855 PR to remove the test exists diff --git a/mysql-test/suite/galera/r/MDEV-29293.result b/mysql-test/suite/galera/r/MDEV-29293.result new file mode 100644 index 00000000000..70c0cc84a31 --- /dev/null +++ b/mysql-test/suite/galera/r/MDEV-29293.result @@ -0,0 +1,21 @@ +connection node_2; +connection node_1; +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +set wsrep_sync_wait = 0; +CREATE TABLE t1(a int not null primary key auto_increment, b int) engine=InnoDB; +INSERT INTO t1 VALUES (1,2); +connection node_1a; +BEGIN; +UPDATE t1 SET b=3 WHERE a=1; +connection node_1; +set debug_sync='wsrep_kill_before_awake_no_mutex SIGNAL before_kill WAIT_FOR continue'; +connection node_1b; +set debug_sync= 'now WAIT_FOR before_kill'; +connection node_2; +UPDATE t1 SET b=7 WHERE a=1; +connection node_1b; +set debug_sync= 'now SIGNAL continue'; +connection node_1; +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/galera/r/galera_create_table_as_select.result b/mysql-test/suite/galera/r/galera_create_table_as_select.result index 6f65ee99f0a..beda5f30fe2 100644 --- a/mysql-test/suite/galera/r/galera_create_table_as_select.result +++ b/mysql-test/suite/galera/r/galera_create_table_as_select.result @@ -82,6 +82,7 @@ connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; LOCK TABLE t2 WRITE; connection node_1; CREATE TABLE t1 AS SELECT * FROM t2;; +connection node_1a; connection node_2; SELECT COUNT(*) = 5 FROM t2; COUNT(*) = 5 diff --git a/mysql-test/suite/galera/r/galera_kill_group_commit.result b/mysql-test/suite/galera/r/galera_kill_group_commit.result new file mode 100644 index 00000000000..bb59ce1486f --- /dev/null +++ b/mysql-test/suite/galera/r/galera_kill_group_commit.result @@ -0,0 +1,27 @@ +connection node_2; +connection node_1; +connect node_1_kill, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_sync_wait = 0; +connect node_1_follower, 127.0.0.1, root, , test, $NODE_MYPORT_1; +SET SESSION wsrep_sync_wait = 0; +connection node_1; +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; +SET SESSION DEBUG_SYNC = "commit_before_enqueue SIGNAL leader_before_enqueue_reached WAIT_FOR leader_before_enqueue_continue"; +INSERT INTO t1 VALUES (1); +connection node_1_ctrl; +SET DEBUG_SYNC = "now WAIT_FOR leader_before_enqueue_reached"; +connection node_1_follower; +INSERT INTO t1 VALUES (2);; +connection node_1_ctrl; +connection node_1_kill; +# Execute KILL QUERY for group commit follower +SET DEBUG_SYNC = "now SIGNAL leader_before_enqueue_continue"; +connection node_1_follower; +connection node_1; +SELECT * FROM t1; +f1 +1 +2 +SET DEBUG_SYNC = "RESET"; +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MDEV-29293.test b/mysql-test/suite/galera/t/MDEV-29293.test new file mode 100644 index 00000000000..dacbf714c06 --- /dev/null +++ b/mysql-test/suite/galera/t/MDEV-29293.test @@ -0,0 +1,41 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc + +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 +set wsrep_sync_wait = 0; + +CREATE TABLE t1(a int not null primary key auto_increment, b int) engine=InnoDB; +INSERT INTO t1 VALUES (1,2); + +--connection node_1a +--let $victim_id = `SELECT CONNECTION_ID()` +BEGIN; +UPDATE t1 SET b=3 WHERE a=1; + +--connection node_1 +set debug_sync='wsrep_kill_before_awake_no_mutex SIGNAL before_kill WAIT_FOR continue'; +--disable_query_log +--disable_result_log +--send_eval KILL CONNECTION $victim_id +--enable_result_log +--enable_query_log + +--connection node_1b +set debug_sync= 'now WAIT_FOR before_kill'; + +--connection node_2 +UPDATE t1 SET b=7 WHERE a=1; + +--connection node_1b +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE User = 'system user' AND State LIKE 'Update_rows_log_event%'; +--source include/wait_condition.inc +set debug_sync= 'now SIGNAL continue'; + +--connection node_1 +--reap +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; + diff --git a/mysql-test/suite/galera/t/galera_create_table_as_select.test b/mysql-test/suite/galera/t/galera_create_table_as_select.test index a6c1f657280..cfee63e5e27 100644 --- a/mysql-test/suite/galera/t/galera_create_table_as_select.test +++ b/mysql-test/suite/galera/t/galera_create_table_as_select.test @@ -113,6 +113,10 @@ LOCK TABLE t2 WRITE; --connection node_1 --send CREATE TABLE t1 AS SELECT * FROM t2; +--connection node_1a +--let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE STATE LIKE 'Waiting for table metadata lock%' +--source include/wait_condition.inc + --connection node_2 SELECT COUNT(*) = 5 FROM t2; CREATE TABLE t1 AS SELECT * FROM t2; @@ -121,7 +125,7 @@ CREATE TABLE t1 AS SELECT * FROM t2; UNLOCK TABLES; --connection node_1 ---error ER_TABLE_EXISTS_ERROR,ER_LOCK_DEADLOCK +--error ER_TABLE_EXISTS_ERROR,ER_QUERY_INTERRUPTED --reap DROP TABLE t1, t2; diff --git a/mysql-test/suite/galera/t/galera_kill_group_commit.cnf b/mysql-test/suite/galera/t/galera_kill_group_commit.cnf new file mode 100644 index 00000000000..60f4f776409 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_kill_group_commit.cnf @@ -0,0 +1,5 @@ +!include ../galera_2nodes.cnf + +[mysqld] +log-bin +log-slave-updates diff --git a/mysql-test/suite/galera/t/galera_kill_group_commit.test b/mysql-test/suite/galera/t/galera_kill_group_commit.test new file mode 100644 index 00000000000..4b84f2d90ef --- /dev/null +++ b/mysql-test/suite/galera/t/galera_kill_group_commit.test @@ -0,0 +1,69 @@ +# +# Verify that transaction which has reached group commit queue +# cannot be killed. If the kill succeeds, assertion for +# wsrep transaction state will fail. +# +# If the bug is present, i.e. wsrep transaction gets killed during +# group commit wait, this test is enough to reproduce the crash +# most of the time. +# + +--source include/have_innodb.inc +--source include/have_debug_sync.inc +--source include/galera_cluster.inc + +# Connection for KILL commands +--connect node_1_kill, 127.0.0.1, root, , test, $NODE_MYPORT_1 +# Connection for sync point control +--connect node_1_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET SESSION wsrep_sync_wait = 0; +# Connection for group commit follower +--connect node_1_follower, 127.0.0.1, root, , test, $NODE_MYPORT_1 +# Need to disable sync wait to reach commit queue when leader +# is blocked. +SET SESSION wsrep_sync_wait = 0; +--let $follower_id = `SELECT CONNECTION_ID()` + +--connection node_1 +CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; + +SET SESSION DEBUG_SYNC = "commit_before_enqueue SIGNAL leader_before_enqueue_reached WAIT_FOR leader_before_enqueue_continue"; +--send INSERT INTO t1 VALUES (1) + +--connection node_1_ctrl +SET DEBUG_SYNC = "now WAIT_FOR leader_before_enqueue_reached"; + +--connection node_1_follower +# SET SESSION DEBUG_SYNC = "group_commit_waiting_for_prior SIGNAL follower_waiting_for_prior_reached WAIT_FOR follower_waiting_for_prior_continue"; +--send INSERT INTO t1 VALUES (2); + +--connection node_1_ctrl +# TODO: Is it possible to use sync points to enforce group commit to happen? +# The leader will hold commit monitor in commit_before_enqueue sync point, +# which prevents the follower to reach the group commit wait state. +# We now sleep and expect the follower to reach group commit, but this +# may cause false negatives. +--sleep 1 + +--connection node_1_kill +--echo # Execute KILL QUERY for group commit follower +--disable_query_log +--disable_result_log +# Because it is currently impossible to verify that the +# follower has reached group commit queue, the KILL may +# sometimes return success. +--error 0,ER_KILL_DENIED_ERROR +--eval KILL QUERY $follower_id +--enable_result_log +--enable_query_log + +SET DEBUG_SYNC = "now SIGNAL leader_before_enqueue_continue"; +--connection node_1_follower +--reap + +--connection node_1 +--reap +SELECT * FROM t1; + +SET DEBUG_SYNC = "RESET"; +DROP TABLE t1; diff --git a/sql/handler.cc b/sql/handler.cc index 455a5e509c8..f7d781eb82f 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -7170,6 +7170,9 @@ Compare_keys handler::compare_key_parts(const Field &old_field, concurrent accesses. And it's an overkill to take LOCK_plugin and iterate the whole installed_htons[] array every time. + @note Object victim_thd is not guaranteed to exist after this + function returns. + @param bf_thd brute force THD asking for the abort @param victim_thd victim THD to be aborted @@ -7183,6 +7186,8 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) if (!WSREP(bf_thd) && !(bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU && wsrep_thd_is_toi(bf_thd))) { + mysql_mutex_unlock(&victim_thd->LOCK_thd_data); + mysql_mutex_unlock(&victim_thd->LOCK_thd_kill); DBUG_RETURN(0); } @@ -7194,6 +7199,8 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) else { WSREP_WARN("Cannot abort InnoDB transaction"); + mysql_mutex_unlock(&victim_thd->LOCK_thd_data); + mysql_mutex_unlock(&victim_thd->LOCK_thd_kill); } DBUG_RETURN(0); diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc index 722c22809de..6a2ee1dd3db 100644 --- a/sql/service_wsrep.cc +++ b/sql/service_wsrep.cc @@ -29,14 +29,17 @@ extern "C" my_bool wsrep_on(const THD *thd) extern "C" void wsrep_thd_LOCK(const THD *thd) { - mysql_mutex_lock(&thd->LOCK_thd_kill); mysql_mutex_lock(&thd->LOCK_thd_data); } +extern "C" int wsrep_thd_TRYLOCK(const THD *thd) +{ + return mysql_mutex_trylock(&thd->LOCK_thd_data); +} + extern "C" void wsrep_thd_UNLOCK(const THD *thd) { mysql_mutex_unlock(&thd->LOCK_thd_data); - mysql_mutex_unlock(&thd->LOCK_thd_kill); } extern "C" void wsrep_thd_kill_LOCK(const THD *thd) @@ -249,21 +252,13 @@ extern "C" my_bool wsrep_thd_bf_abort(THD *bf_thd, THD *victim_thd, if ((ret || !wsrep_on(victim_thd)) && signal) { - if (victim_thd->wsrep_aborter && victim_thd->wsrep_aborter != bf_thd->thread_id) - { - WSREP_DEBUG("victim is killed already by %llu, skipping awake", - victim_thd->wsrep_aborter); - wsrep_thd_UNLOCK(victim_thd); - return false; - } - victim_thd->wsrep_aborter= bf_thd->thread_id; victim_thd->awake_no_mutex(KILL_QUERY); } else - WSREP_DEBUG("wsrep_thd_bf_abort skipped awake for %llu", thd_get_thread_id(victim_thd)); + WSREP_DEBUG("wsrep_thd_bf_abort skipped awake for %llu", + thd_get_thread_id(victim_thd)); - wsrep_thd_UNLOCK(victim_thd); return ret; } @@ -349,25 +344,6 @@ extern "C" void wsrep_commit_ordered(THD *thd) } } -extern "C" bool wsrep_thd_set_wsrep_aborter(THD *bf_thd, THD *victim_thd) -{ - mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); - if (!bf_thd) - { - victim_thd->wsrep_aborter= 0; - WSREP_DEBUG("wsrep_thd_set_wsrep_aborter resetting wsrep_aborter"); - return false; - } - if (victim_thd->wsrep_aborter && victim_thd->wsrep_aborter != bf_thd->thread_id) - { - return true; - } - victim_thd->wsrep_aborter= bf_thd->thread_id; - WSREP_DEBUG("wsrep_thd_set_wsrep_aborter setting wsrep_aborter %u", - victim_thd->wsrep_aborter); - return false; -} - extern "C" void wsrep_report_bf_lock_wait(const THD *thd, unsigned long long trx_id) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 73bb654080a..dc58d2a250a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1279,6 +1279,11 @@ void THD::init() m_wsrep_next_trx_id = WSREP_UNDEFINED_TRX_ID; wsrep_replicate_GTID = false; wsrep_aborter = 0; + wsrep_abort_by_kill = NOT_KILLED; + wsrep_abort_by_kill_err = 0; +#ifndef DBUG_OFF + wsrep_killed_state = 0; +#endif /* DBUG_OFF */ wsrep_desynced_backup_stage= false; #endif /* WITH_WSREP */ @@ -1637,6 +1642,13 @@ void THD::reset_for_reuse() #endif #ifdef WITH_WSREP wsrep_free_status(this); + wsrep_cs().reset_error(); + wsrep_aborter= 0; + wsrep_abort_by_kill= NOT_KILLED; + wsrep_abort_by_kill_err= 0; +#ifndef DBUG_OFF + wsrep_killed_state= 0; +#endif /* DBUG_OFF */ #endif /* WITH_WSREP */ } @@ -1886,7 +1898,9 @@ void THD::awake_no_mutex(killed_state state_to_set) } /* Interrupt target waiting inside a storage engine. */ - if (state_to_set != NOT_KILLED && !wsrep_is_bf_aborted(this)) + if (state_to_set != NOT_KILLED && + IF_WSREP(!wsrep_is_bf_aborted(this) && wsrep_abort_by_kill == NOT_KILLED, + true)) ha_kill_query(this, thd_kill_level(this)); abort_current_cond_wait(false); @@ -2128,6 +2142,17 @@ void THD::reset_killed() mysql_mutex_unlock(&LOCK_thd_kill); } #ifdef WITH_WSREP + if (WSREP_NNULL(this)) + { + if (wsrep_abort_by_kill != NOT_KILLED) + { + mysql_mutex_assert_not_owner(&LOCK_thd_kill); + mysql_mutex_lock(&LOCK_thd_kill); + wsrep_abort_by_kill= NOT_KILLED; + wsrep_abort_by_kill_err= 0; + mysql_mutex_unlock(&LOCK_thd_kill); + } + } mysql_mutex_assert_not_owner(&LOCK_thd_data); mysql_mutex_lock(&LOCK_thd_data); wsrep_aborter= 0; diff --git a/sql/sql_class.h b/sql/sql_class.h index d0c3e0244e7..4e5aba33443 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -4982,7 +4982,14 @@ public: bool wsrep_ignore_table; /* thread who has started kill for this THD protected by LOCK_thd_data*/ my_thread_id wsrep_aborter; - + /* Kill signal used, if thread was killed by manual KILL. Protected by + LOCK_thd_kill. */ + std::atomic wsrep_abort_by_kill; + /* */ + struct err_info* wsrep_abort_by_kill_err; +#ifndef DBUG_OFF + int wsrep_killed_state; +#endif /* DBUG_OFF */ /* true if BF abort is observed in do_command() right after reading client's packet, and if the client has sent PS execute command. */ bool wsrep_delayed_BF_abort; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 48d4f0cbd55..473b23fd20c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7848,7 +7848,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length, thd->wsrep_retry_counter < thd->variables.wsrep_retry_autocommit) { #ifdef ENABLED_DEBUG_SYNC - DBUG_EXECUTE_IF("sync.wsrep_retry_autocommit", + DBUG_EXECUTE_IF("sync.wsrep_retry_autocommit", { const char act[]= "now " @@ -9212,21 +9212,15 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type thd->security_ctx->user_matches(tmp->security_ctx)) #endif /* WITH_WSREP */ { + { #ifdef WITH_WSREP - DEBUG_SYNC(thd, "before_awake_no_mutex"); - if (tmp->wsrep_aborter && tmp->wsrep_aborter != thd->thread_id) - { - /* victim is in hit list already, bail out */ - WSREP_DEBUG("victim %lld has wsrep aborter: %lu, skipping awake()", - id, tmp->wsrep_aborter); - error= 0; - } - else + if (WSREP(tmp)) + { + /* Object tmp is not guaranteed to exist after wsrep_kill_thd() + returns, so do early return from this function. */ + DBUG_RETURN(wsrep_kill_thd(thd, tmp, kill_signal)); + } #endif /* WITH_WSREP */ - { - WSREP_DEBUG("kill_one_thread victim: %lld wsrep_aborter %lu" - " by signal %d", - id, tmp->wsrep_aborter, kill_signal); tmp->awake_no_mutex(kill_signal); error= 0; } @@ -9350,18 +9344,6 @@ static void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type) { uint error; -#ifdef WITH_WSREP - if (WSREP(thd)) - { - WSREP_DEBUG("sql_kill called"); - if (thd->wsrep_applier) - { - WSREP_DEBUG("KILL in applying, bailing out here"); - return; - } - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - } -#endif /* WITH_WSREP */ if (likely(!(error= kill_one_thread(thd, id, state, type)))) { if (!thd->killed) @@ -9371,13 +9353,6 @@ void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type) } else my_error(error, MYF(0), id); -#ifdef WITH_WSREP - return; - wsrep_error_label: - error= (type == KILL_TYPE_QUERY ? ER_KILL_QUERY_DENIED_ERROR : - ER_KILL_DENIED_ERROR); - my_error(error, MYF(0), (long long) id); -#endif /* WITH_WSREP */ } @@ -9386,18 +9361,6 @@ void sql_kill_user(THD *thd, LEX_USER *user, killed_state state) { uint error; ha_rows rows; -#ifdef WITH_WSREP - if (WSREP(thd)) - { - WSREP_DEBUG("sql_kill_user called"); - if (thd->wsrep_applier) - { - WSREP_DEBUG("KILL in applying, bailing out here"); - return; - } - WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - } -#endif /* WITH_WSREP */ switch (error= kill_threads_for_user(thd, user, state, &rows)) { case 0: @@ -9413,11 +9376,6 @@ void sql_kill_user(THD *thd, LEX_USER *user, killed_state state) default: my_error(error, MYF(0)); } -#ifdef WITH_WSREP - return; - wsrep_error_label: - my_error(ER_CANNOT_USER, MYF(0), user ? user->user.str : "NULL"); -#endif /* WITH_WSREP */ } diff --git a/sql/sql_plugin_services.inl b/sql/sql_plugin_services.inl index 60ba38eae61..519a21ee9c6 100644 --- a/sql/sql_plugin_services.inl +++ b/sql/sql_plugin_services.inl @@ -150,6 +150,7 @@ static struct wsrep_service_st wsrep_handler = { wsrep_on, wsrep_prepare_key_for_innodb, wsrep_thd_LOCK, + wsrep_thd_TRYLOCK, wsrep_thd_UNLOCK, wsrep_thd_query, wsrep_thd_retry_counter, @@ -173,7 +174,6 @@ static struct wsrep_service_st wsrep_handler = { wsrep_get_debug, wsrep_commit_ordered, wsrep_thd_is_applying, - wsrep_thd_set_wsrep_aborter, wsrep_report_bf_lock_wait, wsrep_thd_kill_LOCK, wsrep_thd_kill_UNLOCK, diff --git a/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc index 83bf4778d10..60e4449c9b8 100644 --- a/sql/wsrep_dummy.cc +++ b/sql/wsrep_dummy.cc @@ -56,6 +56,11 @@ my_bool wsrep_on(const THD *) void wsrep_thd_LOCK(const THD *) { } +int wsrep_thd_TRYLOCK(const THD *) +{ + return 0; +} + void wsrep_thd_UNLOCK(const THD *) { } @@ -141,9 +146,6 @@ void wsrep_log(void (*)(const char *, ...), const char *, ...) my_bool wsrep_thd_is_applying(const THD*) { return 0;} -bool wsrep_thd_set_wsrep_aborter(THD*, THD*) -{ return 0;} - void wsrep_report_bf_lock_wait(const THD*, unsigned long long) {} diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index 3c6524b7ddf..4874da51673 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -480,6 +480,7 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_ m_thd->wait_for_prior_commit(); } + WSREP_DEBUG("checkpointing dummy write set %lld", ws_meta.seqno().get()); wsrep_set_SE_checkpoint(ws_meta.gtid()); if (!WSREP_EMULATE_BINLOG(m_thd)) diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index a898b554a78..903ed56d948 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -2053,11 +2053,6 @@ static int wsrep_TOI_event_buf(THD* thd, uchar** buf, size_t* buf_len) case SQLCOM_DROP_TABLE: err= wsrep_drop_table_query(thd, buf, buf_len); break; - case SQLCOM_KILL: - WSREP_DEBUG("KILL as TOI: %s", thd->query()); - err= wsrep_to_buf_helper(thd, thd->query(), thd->query_length(), - buf, buf_len); - break; case SQLCOM_CREATE_ROLE: if (sp_process_definer(thd)) { @@ -2440,8 +2435,15 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, /* Here we will call wsrep_abort_transaction so we should hold THD::LOCK_thd_data to protect victim from concurrent usage - and THD::LOCK_thd_kill to protect from disconnect or delete. */ - wsrep_thd_LOCK(granted_thd); + and THD::LOCK_thd_kill to protect from disconnect or delete. + + Note that all calls to wsrep_abort_thd() and ha_abort_transaction() + unlock LOCK_thd_kill for granted_thd, so granted_thd must not be + accessed after any of those calls. Moreover all other if branches + must release those locks. + */ + mysql_mutex_lock(&granted_thd->LOCK_thd_kill); + mysql_mutex_lock(&granted_thd->LOCK_thd_data); if (wsrep_thd_is_toi(granted_thd) || wsrep_thd_is_applying(granted_thd)) @@ -2450,22 +2452,22 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, { WSREP_DEBUG("BF thread waiting for SR in aborting state"); ticket->wsrep_report(wsrep_debug); - wsrep_thd_UNLOCK(granted_thd); + mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + mysql_mutex_unlock(&granted_thd->LOCK_thd_kill); } else if (wsrep_thd_is_SR(granted_thd) && !wsrep_thd_is_SR(request_thd)) { WSREP_MDL_LOG(INFO, "MDL conflict, DDL vs SR", schema, schema_len, request_thd, granted_thd); wsrep_abort_thd(request_thd, granted_thd, 1); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_data); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_kill); } else { WSREP_MDL_LOG(INFO, "MDL BF-BF conflict", schema, schema_len, request_thd, granted_thd); ticket->wsrep_report(true); - wsrep_thd_UNLOCK(granted_thd); + mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + mysql_mutex_unlock(&granted_thd->LOCK_thd_kill); unireg_abort(1); } } @@ -2474,7 +2476,8 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, { WSREP_DEBUG("BF thread waiting for FLUSH"); ticket->wsrep_report(wsrep_debug); - wsrep_thd_UNLOCK(granted_thd); + mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + mysql_mutex_unlock(&granted_thd->LOCK_thd_kill); } else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE) { @@ -2482,8 +2485,6 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, wsrep_thd_transaction_state_str(granted_thd)); ticket->wsrep_report(wsrep_debug); wsrep_abort_thd(request_thd, granted_thd, 1); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_data); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_kill); } else { @@ -2493,8 +2494,6 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, if (granted_thd->wsrep_trx().active()) { wsrep_abort_thd(request_thd, granted_thd, true); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_data); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_kill); } else { @@ -2504,15 +2503,16 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, */ if (wsrep_thd_is_BF(request_thd, FALSE)) { + granted_thd->awake_no_mutex(KILL_QUERY_HARD); ha_abort_transaction(request_thd, granted_thd, TRUE); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_data); - mysql_mutex_assert_not_owner(&granted_thd->LOCK_thd_kill); } else { WSREP_MDL_LOG(INFO, "MDL unknown BF-BF conflict", schema, schema_len, request_thd, granted_thd); ticket->wsrep_report(true); + mysql_mutex_unlock(&granted_thd->LOCK_thd_data); + mysql_mutex_unlock(&granted_thd->LOCK_thd_kill); unireg_abort(1); } } @@ -2528,17 +2528,22 @@ void wsrep_handle_mdl_conflict(MDL_context *requestor_ctx, static bool abort_replicated(THD *thd) { bool ret_code= false; + wsrep_thd_kill_LOCK(thd); wsrep_thd_LOCK(thd); if (thd->wsrep_trx().state() == wsrep::transaction::s_committing) { WSREP_DEBUG("aborting replicated trx: %llu", (ulonglong)(thd->real_id)); - (void)wsrep_abort_thd(thd, thd, TRUE); + wsrep_abort_thd(thd, thd, TRUE); ret_code= true; } else + { + /* wsrep_abort_thd() above releases LOCK_thd_data and LOCK_thd_kill, so + must do it here too. */ wsrep_thd_UNLOCK(thd); - + wsrep_thd_kill_UNLOCK(thd); + } return ret_code; } diff --git a/sql/wsrep_server_service.cc b/sql/wsrep_server_service.cc index cf6f76cf02e..71f5d20feba 100644 --- a/sql/wsrep_server_service.cc +++ b/sql/wsrep_server_service.cc @@ -143,9 +143,13 @@ void Wsrep_server_service::release_high_priority_service(wsrep::high_priority_se wsrep_delete_threadvars(); } -void Wsrep_server_service::background_rollback(wsrep::client_state& client_state) +void Wsrep_server_service::background_rollback( + wsrep::unique_lock &lock WSREP_UNUSED, + wsrep::client_state &client_state) { - Wsrep_client_state& cs= static_cast(client_state); + DBUG_ASSERT(lock.owns_lock()); + Wsrep_client_state &cs= static_cast(client_state); + mysql_mutex_assert_owner(&cs.thd()->LOCK_thd_data); wsrep_fire_rollbacker(cs.thd()); } diff --git a/sql/wsrep_server_service.h b/sql/wsrep_server_service.h index 168e98206e3..0fc48402024 100644 --- a/sql/wsrep_server_service.h +++ b/sql/wsrep_server_service.h @@ -46,7 +46,8 @@ public: void release_high_priority_service(wsrep::high_priority_service*); - void background_rollback(wsrep::client_state&); + void background_rollback(wsrep::unique_lock &, + wsrep::client_state &); void bootstrap(); void log_message(enum wsrep::log::level, const char*); diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 05c96491906..950c1528141 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -307,50 +307,9 @@ void wsrep_fire_rollbacker(THD *thd) } } - -int wsrep_abort_thd(THD *bf_thd, - THD *victim_thd, - my_bool signal) +static bool wsrep_bf_abort_low(THD *bf_thd, THD *victim_thd) { - DBUG_ENTER("wsrep_abort_thd"); - mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); - mysql_mutex_assert_owner(&victim_thd->LOCK_thd_kill); - - /* Note that when you use RSU node is desynced from cluster, thus WSREP(thd) - might not be true. - */ - if ((WSREP(bf_thd) || - ((WSREP_ON || bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU) && - wsrep_thd_is_toi(bf_thd))) && - !wsrep_thd_is_aborting(victim_thd)) - { - WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", - (long long)bf_thd->real_id, (long long)victim_thd->real_id); - ha_abort_transaction(bf_thd, victim_thd, signal); - } - else - { - WSREP_DEBUG("wsrep_abort_thd not effective: bf %llu victim %llu " - "wsrep %d wsrep_on %d RSU %d TOI %d aborting %d", - (long long)bf_thd->real_id, (long long)victim_thd->real_id, - WSREP_NNULL(bf_thd), WSREP_ON, - bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU, - wsrep_thd_is_toi(bf_thd), - wsrep_thd_is_aborting(victim_thd)); - wsrep_thd_UNLOCK(victim_thd); - } - - DBUG_RETURN(1); -} - -bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd) -{ - WSREP_LOG_THD(bf_thd, "BF aborter before"); - WSREP_LOG_THD(victim_thd, "victim before"); - - mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); - mysql_mutex_assert_owner(&victim_thd->LOCK_thd_kill); #ifdef ENABLED_DEBUG_SYNC DBUG_EXECUTE_IF("sync.wsrep_bf_abort", @@ -364,6 +323,87 @@ bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd) };); #endif + wsrep::seqno bf_seqno(bf_thd->wsrep_trx().ws_meta().seqno()); + bool ret; + + { + /* Adopt the lock, it is being held by the caller. */ + Wsrep_mutex wsm{&victim_thd->LOCK_thd_data}; + wsrep::unique_lock lock{wsm, std::adopt_lock}; + + if (wsrep_thd_is_toi(bf_thd)) + { + ret= victim_thd->wsrep_cs().total_order_bf_abort(lock, bf_seqno); + } + else + { + DBUG_ASSERT(WSREP(victim_thd) ? victim_thd->wsrep_trx().active() : 1); + ret= victim_thd->wsrep_cs().bf_abort(lock, bf_seqno); + } + if (ret) + { + /* BF abort should be allowed only once by wsrep-lib.*/ + DBUG_ASSERT(victim_thd->wsrep_aborter == 0); + victim_thd->wsrep_aborter= bf_thd->thread_id; + wsrep_bf_aborts_counter++; + } + lock.release(); /* No unlock at the end of the scope. */ + } + + /* Sanity check for wsrep-lib calls to return with LOCK_thd_data held. */ + mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); + + return ret; +} + + +void wsrep_abort_thd(THD *bf_thd, + THD *victim_thd, + my_bool signal) +{ + DBUG_ENTER("wsrep_abort_thd"); + + mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); + mysql_mutex_assert_owner(&victim_thd->LOCK_thd_kill); + + /* Note that when you use RSU node is desynced from cluster, thus WSREP(thd) + might not be true. + */ + if ((WSREP(bf_thd) + || ((WSREP_ON || bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU) + && wsrep_thd_is_toi(bf_thd))) + && !wsrep_thd_is_aborting(victim_thd) && + wsrep_bf_abort_low(bf_thd, victim_thd) && + !victim_thd->wsrep_cs().is_rollbacker_active()) + { + WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", + (long long)bf_thd->real_id, (long long)victim_thd->real_id); + victim_thd->awake_no_mutex(KILL_QUERY_HARD); + ha_abort_transaction(bf_thd, victim_thd, signal); + } + else + { + WSREP_DEBUG("wsrep_abort_thd not effective: bf %llu victim %llu " + "wsrep %d wsrep_on %d RSU %d TOI %d aborting %d", + (long long)bf_thd->real_id, (long long)victim_thd->real_id, + WSREP_NNULL(bf_thd), WSREP_ON, + bf_thd->variables.wsrep_OSU_method == WSREP_OSU_RSU, + wsrep_thd_is_toi(bf_thd), + wsrep_thd_is_aborting(victim_thd)); + mysql_mutex_unlock(&victim_thd->LOCK_thd_data); + mysql_mutex_unlock(&victim_thd->LOCK_thd_kill); + } + + DBUG_VOID_RETURN; +} + +bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd) +{ + WSREP_LOG_THD(bf_thd, "BF aborter before"); + WSREP_LOG_THD(victim_thd, "victim before"); + + mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); + if (WSREP(victim_thd) && !victim_thd->wsrep_trx().active()) { WSREP_DEBUG("wsrep_bf_abort, BF abort for non active transaction"); @@ -385,32 +425,81 @@ bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd) mysql_mutex_lock(&victim_thd->LOCK_thd_data); } - bool ret; - wsrep::seqno bf_seqno(bf_thd->wsrep_trx().ws_meta().seqno()); + return wsrep_bf_abort_low(bf_thd, victim_thd); +} - if (wsrep_thd_is_toi(bf_thd)) +uint wsrep_kill_thd(THD *thd, THD *victim_thd, killed_state kill_signal) +{ + DBUG_ENTER("wsrep_kill_thd"); + DBUG_ASSERT(WSREP(victim_thd)); + mysql_mutex_assert_owner(&victim_thd->LOCK_thd_kill); + mysql_mutex_assert_owner(&victim_thd->LOCK_thd_data); + using trans= wsrep::transaction; + auto trx_state= victim_thd->wsrep_trx().state(); +#ifndef DBUG_OFF + victim_thd->wsrep_killed_state= trx_state; +#endif /* DBUG_OFF */ + /* + Already killed or in commit codepath. Mark the victim as killed, + the killed status will be restored in wsrep_after_commit() and + will be processed after the commit is over. In case of multiple + KILLs happened on commit codepath, the last one will be effective. + */ + if (victim_thd->wsrep_abort_by_kill || + trx_state == trans::s_preparing || + trx_state == trans::s_committing || + trx_state == trans::s_ordered_commit) { - /* Here we enter wsrep-lib were LOCK_thd_data will be acquired, - thus we need to release it. However, we can still hold - LOCK_thd_kill to protect from disconnect or delete. */ + victim_thd->wsrep_abort_by_kill= kill_signal; mysql_mutex_unlock(&victim_thd->LOCK_thd_data); - ret= victim_thd->wsrep_cs().total_order_bf_abort(bf_seqno); - mysql_mutex_lock(&victim_thd->LOCK_thd_data); + mysql_mutex_unlock(&victim_thd->LOCK_thd_kill); + DBUG_RETURN(0); } - else + /* + Mark killed victim_thd with kill_signal so that awake_no_mutex does + not dive into storage engine. We use ha_abort_transaction() + to do the storage engine part for wsrep THDs. + */ + DEBUG_SYNC(thd, "wsrep_kill_before_awake_no_mutex"); + victim_thd->wsrep_abort_by_kill= kill_signal; + victim_thd->awake_no_mutex(kill_signal); + /* ha_abort_transaction() releases tmp->LOCK_thd_kill, so tmp + is not safe to access anymore. */ + ha_abort_transaction(thd, victim_thd, 1); + DBUG_RETURN(0); +} + +void wsrep_backup_kill_for_commit(THD *thd) +{ + DBUG_ASSERT(WSREP(thd)); + mysql_mutex_assert_owner(&thd->LOCK_thd_kill); + DBUG_ASSERT(thd->killed != NOT_KILLED); + mysql_mutex_lock(&thd->LOCK_thd_data); + /* If the transaction will roll back, keep the killed state. + For must replay, the replay will happen in different THD context + which is high priority and cannot be killed. The owning thread will + pick the killed state in after statement processing. */ + if (thd->wsrep_trx().state() != wsrep::transaction::s_cert_failed && + thd->wsrep_trx().state() != wsrep::transaction::s_must_abort && + thd->wsrep_trx().state() != wsrep::transaction::s_aborting && + thd->wsrep_trx().state() != wsrep::transaction::s_must_replay) { - /* Test: mysql-wsrep-features#165. Here we enter wsrep-lib - were LOCK_thd_data will be acquired and later LOCK_thd_kill - thus we need to release them. */ - wsrep_thd_UNLOCK(victim_thd); - ret= victim_thd->wsrep_cs().bf_abort(bf_seqno); - wsrep_thd_LOCK(victim_thd); + thd->wsrep_abort_by_kill= thd->killed; + thd->wsrep_abort_by_kill_err= thd->killed_err; + thd->killed= NOT_KILLED; + thd->killed_err= 0; } - if (ret) - { - wsrep_bf_aborts_counter++; - } - return ret; + mysql_mutex_unlock(&thd->LOCK_thd_data); +} + +void wsrep_restore_kill_after_commit(THD *thd) +{ + DBUG_ASSERT(WSREP(thd)); + mysql_mutex_assert_owner(&thd->LOCK_thd_kill); + thd->killed= thd->wsrep_abort_by_kill; + thd->killed_err= thd->wsrep_abort_by_kill_err; + thd->wsrep_abort_by_kill= NOT_KILLED; + thd->wsrep_abort_by_kill_err= 0; } int wsrep_create_threadvars() diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h index a17de084c93..488268bde69 100644 --- a/sql/wsrep_thd.h +++ b/sql/wsrep_thd.h @@ -88,10 +88,44 @@ bool wsrep_create_appliers(long threads, bool mutex_protected=false); void wsrep_create_rollbacker(); bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd); -int wsrep_abort_thd(THD *bf_thd, +/* + Abort transaction for victim_thd. This function is called from + MDL BF abort codepath. + + @note This thread unlocks victim_thd->LOCK_thd_kill, so accessing + victim_thd after the function returns is not safe anymore. +*/ +void wsrep_abort_thd(THD *bf_thd, THD *victim_thd, my_bool signal) __attribute__((nonnull(1,2))); +/** + Kill wsrep connection with kill_signal. Object thd is not + guaranteed to exist anymore when this function returns. + + Asserts that the caller holds victim_thd->LOCK_thd_kill, + victim_thd->LOCK_thd_data. + + Releases victim_thd->LOCK_thd_kill, victim_thd->LOCK_thd_data. + + @param thd THD object for connection that executes the KILL. + @param victim_thd THD object for connection to be killed. + @param kill_signal Kill signal. + + @return Zero if the kill was successful, otherwise non-zero error code. + */ +uint wsrep_kill_thd(THD *thd, THD *victim_thd, killed_state kill_signal); + +/* + Backup kill status for commit. + */ +void wsrep_backup_kill_for_commit(THD *); + +/* + Restore KILL status after commit. + */ +void wsrep_restore_kill_after_commit(THD *); + /* Helper methods to deal with thread local storage. The purpose of these methods is to hide the details of thread diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index 2d5e4d3a1f2..83079d5a083 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -252,6 +252,11 @@ static inline int wsrep_before_prepare(THD* thd, bool all) wsrep_xid_init(&thd->wsrep_xid, thd->wsrep_trx().ws_meta().gtid()); } + + mysql_mutex_lock(&thd->LOCK_thd_kill); + if (thd->killed) wsrep_backup_kill_for_commit(thd); + mysql_mutex_unlock(&thd->LOCK_thd_kill); + DBUG_RETURN(ret); } @@ -294,6 +299,11 @@ static inline int wsrep_before_commit(THD* thd, bool all) thd->wsrep_trx().ws_meta().gtid()); wsrep_register_for_group_commit(thd); } + + mysql_mutex_lock(&thd->LOCK_thd_kill); + if (thd->killed) wsrep_backup_kill_for_commit(thd); + mysql_mutex_unlock(&thd->LOCK_thd_kill); + DBUG_RETURN(ret); } @@ -314,7 +324,8 @@ static inline int wsrep_ordered_commit(THD* thd, const wsrep_apply_error&) { DBUG_ENTER("wsrep_ordered_commit"); - WSREP_DEBUG("wsrep_ordered_commit: %d", wsrep_is_real(thd, all)); + WSREP_DEBUG("wsrep_ordered_commit: %d %lld", wsrep_is_real(thd, all), + (long long) wsrep_thd_trx_seqno(thd)); DBUG_ASSERT(wsrep_run_commit_hook(thd, all)); DBUG_RETURN(thd->wsrep_cs().ordered_commit()); } @@ -420,9 +431,16 @@ int wsrep_after_statement(THD* thd) wsrep::to_c_string(thd->wsrep_cs().mode()), wsrep::to_c_string(thd->wsrep_cs().transaction().state()), wsrep_thd_query(thd)); - DBUG_RETURN((thd->wsrep_cs().state() != wsrep::client_state::s_none && - thd->wsrep_cs().mode() == Wsrep_client_state::m_local) ? - thd->wsrep_cs().after_statement() : 0); + int ret= ((thd->wsrep_cs().state() != wsrep::client_state::s_none && + thd->wsrep_cs().mode() == Wsrep_client_state::m_local) ? + thd->wsrep_cs().after_statement() : 0); + if (wsrep_is_active(thd)) + { + mysql_mutex_lock(&thd->LOCK_thd_kill); + wsrep_restore_kill_after_commit(thd); + mysql_mutex_unlock(&thd->LOCK_thd_kill); + } + DBUG_RETURN(ret); } static inline void wsrep_after_apply(THD* thd) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c4a23a95d85..3a787da3fa8 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18678,50 +18678,6 @@ static struct st_mysql_storage_engine innobase_storage_engine= #ifdef WITH_WSREP -static -void -wsrep_kill_victim( - MYSQL_THD const bf_thd, - MYSQL_THD thd, - trx_t* victim_trx, - my_bool signal) -{ - DBUG_ENTER("wsrep_kill_victim"); - - /* Mark transaction as a victim for Galera abort */ - victim_trx->lock.was_chosen_as_wsrep_victim= true; - if (wsrep_thd_set_wsrep_aborter(bf_thd, thd)) - { - WSREP_DEBUG("innodb kill transaction skipped due to wsrep_aborter set"); - wsrep_thd_UNLOCK(thd); - DBUG_VOID_RETURN; - } - - if (wsrep_thd_bf_abort(bf_thd, thd, signal)) - { - lock_t* wait_lock= victim_trx->lock.wait_lock; - if (wait_lock) - { - DBUG_ASSERT(victim_trx->is_wsrep()); - WSREP_DEBUG("victim has wait flag: %lu", thd_get_thread_id(thd)); - victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; - lock_cancel_waiting_and_release(wait_lock); - } - } - else - { - wsrep_thd_LOCK(thd); - victim_trx->lock.was_chosen_as_wsrep_victim= false; - wsrep_thd_set_wsrep_aborter(NULL, thd); - wsrep_thd_UNLOCK(thd); - - WSREP_DEBUG("wsrep_thd_bf_abort has failed, victim %lu will survive", - thd_get_thread_id(thd)); - } - - DBUG_VOID_RETURN; -} - /** This function is used to kill one transaction. This transaction was open on this node (not-yet-committed), and a @@ -18768,10 +18724,45 @@ wsrep_innobase_kill_one_trx( DBUG_VOID_RETURN; } - /* Here we need to lock THD::LOCK_thd_data to protect from - concurrent usage or disconnect or delete. */ + /* Grab reference to victim_trx before releasing the mutex, this will + prevent victim to release locks or commit while the mutex is + unlocked. The state may change to TRX_STATE_COMMITTED_IN_MEMORY. + See skip_lock_inheritance_n_ref in trx0trx.h. */ + const trx_id_t victim_trx_id= victim_trx->id; +retry_lock: + victim_trx->reference(); + trx_mutex_exit(victim_trx); + DEBUG_SYNC(bf_thd, "wsrep_before_BF_victim_lock"); - wsrep_thd_LOCK(thd); + wsrep_thd_kill_LOCK(thd); + /* + There is now a cycle + + trx reference + -> LOCK_commit_order + -> LOCK_thd_data + -> trx reference + + which may prevent the transaction committing because reference was grabbed + above. Try to lock LOCK_thd_data, and if not successul, enter the + trx mutex again to release the reference and try again. + */ + if (wsrep_thd_TRYLOCK(thd)) + { + wsrep_thd_kill_UNLOCK(thd); + trx_mutex_enter(victim_trx); + victim_trx->release_reference(); + if (victim_trx_id != victim_trx->id || + victim_trx->state == TRX_STATE_COMMITTED_IN_MEMORY || + victim_trx->state == TRX_STATE_NOT_STARTED) + { + WSREP_DEBUG("wsrep_innobase_kill_one_trx: Victim committed in memory"); + DBUG_VOID_RETURN; + } + goto retry_lock; + } + + DEBUG_SYNC(bf_thd, "wsrep_after_BF_victim_lock"); WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); @@ -18802,7 +18793,31 @@ wsrep_innobase_kill_one_trx( wsrep_thd_transaction_state_str(thd), wsrep_thd_query(thd)); - wsrep_kill_victim(bf_thd, thd, victim_trx, signal); + const bool success= wsrep_thd_bf_abort(bf_thd, thd, signal); + + wsrep_thd_UNLOCK(thd); + wsrep_thd_kill_UNLOCK(thd); + trx_mutex_enter(victim_trx); + + if (success && victim_trx->state == TRX_STATE_ACTIVE) + { + lock_t* wait_lock= victim_trx->lock.wait_lock; + if (wait_lock) + { + victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; + DBUG_ASSERT(victim_trx->is_wsrep()); + WSREP_DEBUG("victim has wait flag: %lu", thd_get_thread_id(thd)); + lock_cancel_waiting_and_release(wait_lock); + } + } + else + { + victim_trx->lock.was_chosen_as_wsrep_victim= false; + WSREP_DEBUG("wsrep_thd_bf_abort has failed, victim %lu will survive", + thd_get_thread_id(thd)); + } + victim_trx->release_reference(); + DBUG_VOID_RETURN; } @@ -18823,43 +18838,61 @@ wsrep_abort_transaction( THD *victim_thd, my_bool signal) { - /* Note that victim thd is protected with - THD::LOCK_thd_data and THD::LOCK_thd_kill here. */ + /* Unlock LOCK_thd_kill and LOCK_thd_data temporarily to grab mutexes + in the right order: + lock_sys.mutex + LOCK_thd_kill + LOCK_thd_data + trx.mutex + */ trx_t* victim_trx= thd_to_trx(victim_thd); - trx_t* bf_trx= thd_to_trx(bf_thd); - WSREP_DEBUG("wsrep_abort_transaction: BF:" - " thread %ld client_state %s client_mode %s" - " trans_state %s query %s trx " TRX_ID_FMT, - thd_get_thread_id(bf_thd), - wsrep_thd_client_state_str(bf_thd), - wsrep_thd_client_mode_str(bf_thd), - wsrep_thd_transaction_state_str(bf_thd), - wsrep_thd_query(bf_thd), - bf_trx ? bf_trx->id : 0); + trx_id_t victim_trx_id= victim_trx ? victim_trx->id : 0; + wsrep_thd_UNLOCK(victim_thd); + wsrep_thd_kill_UNLOCK(victim_thd); + /* After this point must use find_thread_by_id() if victim_thd + is needed again. */ - WSREP_DEBUG("wsrep_abort_transaction: victim:" - " thread %ld client_state %s client_mode %s" - " trans_state %s query %s trx " TRX_ID_FMT, - thd_get_thread_id(victim_thd), - wsrep_thd_client_state_str(victim_thd), - wsrep_thd_client_mode_str(victim_thd), - wsrep_thd_transaction_state_str(victim_thd), - wsrep_thd_query(victim_thd), - victim_trx ? victim_trx->id : 0); - - if (victim_trx) + /* Victim didn't have active RW transaction. Note that tere is a possible + race when the victim transaction is just starting write operation + as is still read only. This however will be resolved eventually since + all the possible blocking transactions are also BF aborted, + and the victim will find that it was BF aborted on server level after + the write operation in InnoDB completes. */ + if (!victim_trx_id) { - lock_mutex_enter(); - trx_mutex_enter(victim_trx); - wsrep_kill_victim(bf_thd, victim_thd, victim_trx, signal); +#ifdef ENABLED_DEBUG_SYNC + DBUG_EXECUTE_IF( + "sync.wsrep_abort_transaction_read_only", + {const char act[]= + "now " + "SIGNAL sync.wsrep_abort_transaction_read_only_reached " + "WAIT_FOR signal.wsrep_abort_transaction_read_only"; + DBUG_ASSERT(!debug_sync_set_action(bf_thd, STRING_WITH_LEN(act))); + };); +#endif /* ENABLED_DEBUG_SYNC*/ + return; + } + lock_mutex_enter(); + + /* Check if victim trx still exists. */ + /* Note based on comment on trx0sys.h only ACTIVE or PREPARED trx + objects may participate in hash. However, transaction may get committed + before this method returns. */ + if(!(victim_trx= trx_sys.find(nullptr, victim_trx_id, true))) { + WSREP_DEBUG("wsrep_abort_transaction: Victim trx does not exist anymore"); lock_mutex_exit(); - trx_mutex_exit(victim_trx); - wsrep_srv_conc_cancel_wait(victim_trx); + return; } - else - { - wsrep_thd_bf_abort(bf_thd, victim_thd, signal); + trx_mutex_enter(victim_trx); + + if (victim_trx->state == TRX_STATE_ACTIVE && victim_trx->lock.wait_lock) { + victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; + lock_cancel_waiting_and_release(victim_trx->lock.wait_lock); } + + trx_mutex_exit(victim_trx); + victim_trx->release_reference(); + lock_mutex_exit(); } static diff --git a/wsrep-lib b/wsrep-lib index 4951c383577..e238c0d240c 160000 --- a/wsrep-lib +++ b/wsrep-lib @@ -1 +1 @@ -Subproject commit 4951c38357737d568b554402bc5b6abe88a38fe1 +Subproject commit e238c0d240c2557229b0523a4a032f3cf8b41639 From 1ac00c5e9f6168cfbb1934e23fc81f4891a678c0 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Wed, 15 Mar 2023 15:27:23 +0100 Subject: [PATCH 35/80] MDEV-30855 Remove test galera.galera_bf_abort_group_commit This test was re-enabled in commit 0174a9ff3d412ada22205edc19066, and has been failing since then. The test is configured such that Galera runs with commit ordering disabled, a configuration which is which was meant for testing the performance penalty of commit ordering (not meant to be used in practice). Moreover, we have test galera_sr.galera_sr_bf_abort, which is identical, but runs with commit ordering enabled. No reasons to keep the failing test around. --- .../galera/t/galera_bf_abort_group_commit.cnf | 15 ---- .../t/galera_bf_abort_group_commit.test | 77 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 mysql-test/suite/galera/t/galera_bf_abort_group_commit.cnf delete mode 100644 mysql-test/suite/galera/t/galera_bf_abort_group_commit.test diff --git a/mysql-test/suite/galera/t/galera_bf_abort_group_commit.cnf b/mysql-test/suite/galera/t/galera_bf_abort_group_commit.cnf deleted file mode 100644 index 612418c17c0..00000000000 --- a/mysql-test/suite/galera/t/galera_bf_abort_group_commit.cnf +++ /dev/null @@ -1,15 +0,0 @@ -!include ../galera_2nodes.cnf - -# We set repl.commit_order=1 in order to disable provider commit -# ordering. - -[mysqld.1] -log-bin -log-slave-updates -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;repl.commit_order=1' - -[mysqld.2] - -log-bin -log-slave-updates -wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;repl.commit_order=1' \ No newline at end of file diff --git a/mysql-test/suite/galera/t/galera_bf_abort_group_commit.test b/mysql-test/suite/galera/t/galera_bf_abort_group_commit.test deleted file mode 100644 index a828701cd0e..00000000000 --- a/mysql-test/suite/galera/t/galera_bf_abort_group_commit.test +++ /dev/null @@ -1,77 +0,0 @@ -# -# This test uses galera_sr_bf_abort.inc to probe various BF abort points -# for SR transactions with wsrep provider commit ordering disabled. -# - ---source include/galera_cluster.inc ---source include/have_innodb.inc ---source include/galera_have_debug_sync.inc - -# Control connection for manipulating sync points on node 1 ---connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 -SET SESSION wsrep_sync_wait = 0; - -# SR bf abort on fragment ---let $wsrep_trx_fragment_size = 1 ---echo galera_sr_bf_abort_at_commit = 0 ---let $galera_sr_bf_abort_at_commit = 0 - ---echo after_replicate_sync ---let $galera_sr_bf_abort_sync_point = after_replicate_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo local_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = local_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo apply_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = apply_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo commit_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = commit_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - -# SR bf abort on commit fragment ---let $wsrep_trx_fragment_size = 1 ---echo galera_sr_bf_abort_at_commit = 1 ---let $galera_sr_bf_abort_at_commit = 1 - ---echo after_replicate_sync ---let $galera_sr_bf_abort_sync_point = after_replicate_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo local_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = local_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo apply_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = apply_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo commit_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = commit_monitor_master_enter_sync ---source suite/galera/t/galera_sr_bf_abort.inc - -# Normal bf abort on commit ---let $wsrep_trx_fragment_size = 0 ---echo galera_sr_bf_abort_at_commit = 1 ---let $galera_sr_bf_abort_at_commit = 1 - ---echo after_replicate_sync ---let $galera_sr_bf_abort_sync_point = after_replicate_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo local_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = local_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo apply_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = apply_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - ---echo commit_monitor_master_enter_sync ---let $galera_sr_bf_abort_sync_point = commit_monitor_master_enter_sync ---source ../../suite/galera_sr/t/galera_sr_bf_abort.inc - -CALL mtr.add_suppression("WSREP: fragment replication failed: 1"); From 9f909e546e14ed9b529cddc2c1a5c2aa61d57e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Tue, 2 May 2023 12:42:13 +0300 Subject: [PATCH 36/80] MDEV-30197 : Missing DBUG_RETURN or DBUG_VOID_RETURN macro in function "Wsrep_schema::restore_view()" Here user is starting server with unsupported client charset. We need to create wsrep_schema tables using explicit latin1 charset to avoid errors in restoring view. --- sql/wsrep_schema.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc index 94eef413dc5..a59d13dd839 100644 --- a/sql/wsrep_schema.cc +++ b/sql/wsrep_schema.cc @@ -50,7 +50,7 @@ static const std::string create_cluster_table_str= "view_seqno BIGINT NOT NULL," "protocol_version INT NOT NULL," "capabilities INT NOT NULL" - ") ENGINE=InnoDB STATS_PERSISTENT=0"; + ") ENGINE=InnoDB STATS_PERSISTENT=0 CHARSET=latin1"; static const std::string create_members_table_str= "CREATE TABLE IF NOT EXISTS " + wsrep_schema_str + "." + members_table_str + @@ -59,7 +59,7 @@ static const std::string create_members_table_str= "cluster_uuid CHAR(36) NOT NULL," "node_name CHAR(32) NOT NULL," "node_incoming_address VARCHAR(256) NOT NULL" - ") ENGINE=InnoDB STATS_PERSISTENT=0"; + ") ENGINE=InnoDB STATS_PERSISTENT=0 CHARSET=latin1"; #ifdef WSREP_SCHEMA_MEMBERS_HISTORY static const std::string cluster_member_history_table_str= "wsrep_cluster_member_history"; @@ -72,7 +72,7 @@ static const std::string create_members_history_table_str= "last_view_seqno BIGINT NOT NULL," "node_name CHAR(32) NOT NULL," "node_incoming_address VARCHAR(256) NOT NULL" - ") ENGINE=InnoDB STATS_PERSISTENT=0"; + ") ENGINE=InnoDB STATS_PERSISTENT=0 CHARSET=latin1"; #endif /* WSREP_SCHEMA_MEMBERS_HISTORY */ static const std::string create_frag_table_str= @@ -84,7 +84,7 @@ static const std::string create_frag_table_str= "flags INT NOT NULL, " "frag LONGBLOB NOT NULL, " "PRIMARY KEY (node_uuid, trx_id, seqno)" - ") ENGINE=InnoDB STATS_PERSISTENT=0"; + ") ENGINE=InnoDB STATS_PERSISTENT=0 CHARSET=latin1"; static const std::string delete_from_cluster_table= "DELETE FROM " + wsrep_schema_str + "." + cluster_table_str; @@ -96,21 +96,21 @@ static const std::string delete_from_members_table= persistent statistics to be collected from these tables. */ static const std::string alter_cluster_table= "ALTER TABLE " + wsrep_schema_str + "." + cluster_table_str + - " STATS_PERSISTENT=0"; + " STATS_PERSISTENT=0 CHARSET=latin1"; static const std::string alter_members_table= "ALTER TABLE " + wsrep_schema_str + "." + members_table_str + - " STATS_PERSISTENT=0"; + " STATS_PERSISTENT=0 CHARSET=latin1"; #ifdef WSREP_SCHEMA_MEMBERS_HISTORY static const std::string alter_members_history_table= "ALTER TABLE " + wsrep_schema_str + "." + members_history_table_str + - " STATS_PERSISTENT=0"; + " STATS_PERSISTENT=0 CHARSET=latin1"; #endif static const std::string alter_frag_table= "ALTER TABLE " + wsrep_schema_str + "." + sr_table_str + - " STATS_PERSISTENT=0"; + " STATS_PERSISTENT=0 CHARSET=latin1"; namespace Wsrep_schema_impl { From d1b1f8c9f2c52082e5794e99aa4cbe1f9125bf33 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 24 May 2023 15:32:53 +0300 Subject: [PATCH 37/80] Updated some test result for 32 bit systems --- mysql-test/suite/maria/maria-64bit.result | 55 +++ mysql-test/suite/maria/maria-64bit.test | 41 +++ mysql-test/suite/maria/maria.result | 54 --- mysql-test/suite/maria/maria.test | 35 -- .../r/myisam_sort_buffer_size_basic.result | 8 +- .../suite/sys_vars/r/sysvars_aria,32bit.rdiff | 54 +-- .../r/sysvars_server_notembedded,32bit.rdiff | 315 +++++++++--------- .../t/aria_sort_buffer_size_basic.test | 3 +- .../t/myisam_sort_buffer_size_basic.test | 17 +- 9 files changed, 289 insertions(+), 293 deletions(-) create mode 100644 mysql-test/suite/maria/maria-64bit.result create mode 100644 mysql-test/suite/maria/maria-64bit.test diff --git a/mysql-test/suite/maria/maria-64bit.result b/mysql-test/suite/maria/maria-64bit.result new file mode 100644 index 00000000000..d558814a665 --- /dev/null +++ b/mysql-test/suite/maria/maria-64bit.result @@ -0,0 +1,55 @@ +set session storage_engine=aria; +# +# BUG#47444 - --myisam_repair_threads > 1 can result in all index +# cardinalities=1 +# +SET aria_repair_threads=2; +SET aria_sort_buffer_size=16384; +CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); +Warnings: +Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release +Note 1831 Duplicate index `a_3`. This is deprecated and will be disallowed in a future release +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3); +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; +CARDINALITY +14 +14 +14 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; +SET aria_repair_threads=@@global.aria_repair_threads; +# +# BUG#47073 - valgrind errs, corruption,failed repair of partition, +# low myisam_sort_buffer_size +# +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); +INSERT INTO t1 select seq,'0' from seq_1_to_65536; +SET aria_sort_buffer_size=16384; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair error aria_sort_buffer_size is too small. X +test.t1 repair error Create index by sort failed +test.t1 repair info Retrying repair with keycache +test.t1 repair status OK +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SET aria_repair_threads=2; +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair error aria_sort_buffer_size is too small. X +test.t1 repair error Create index by sort failed +test.t1 repair info Retrying repair with keycache +test.t1 repair status OK +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SET aria_repair_threads=@@global.aria_repair_threads; +SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/maria-64bit.test b/mysql-test/suite/maria/maria-64bit.test new file mode 100644 index 00000000000..117ace42f7c --- /dev/null +++ b/mysql-test/suite/maria/maria-64bit.test @@ -0,0 +1,41 @@ +--source include/have_maria.inc +--source include/have_sequence.inc +--source include/have_64bit.inc + +set session storage_engine=aria; + +--echo # +--echo # BUG#47444 - --myisam_repair_threads > 1 can result in all index +--echo # cardinalities=1 +--echo # + +SET aria_repair_threads=2; +SET aria_sort_buffer_size=16384; +CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3); +--replace_regex /Current aria_sort_buffer_size.*/X/ +REPAIR TABLE t1; +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; +CHECK TABLE t1; +DROP TABLE t1; +SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; +SET aria_repair_threads=@@global.aria_repair_threads; + +--echo # +--echo # BUG#47073 - valgrind errs, corruption,failed repair of partition, +--echo # low myisam_sort_buffer_size +--echo # +CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); +INSERT INTO t1 select seq,'0' from seq_1_to_65536; +SET aria_sort_buffer_size=16384; +--replace_regex /Current aria_sort_buffer_size.*/X/ +REPAIR TABLE t1; +CHECK TABLE t1; +SET aria_repair_threads=2; +# May report different values depending on threads activity. +--replace_regex /Current aria_sort_buffer_size.*/X/ +REPAIR TABLE t1; +CHECK TABLE t1; +SET aria_repair_threads=@@global.aria_repair_threads; +SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; +DROP TABLE t1; diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index f8911bdde2b..e21d974625c 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2809,60 +2809,6 @@ DROP TABLE t1; # # End of 5.5 tests # -# -# BUG#47444 - --myisam_repair_threads > 1 can result in all index -# cardinalities=1 -# -SET aria_repair_threads=2; -SET aria_sort_buffer_size=16384; -CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); -Warnings: -Note 1831 Duplicate index `a_2`. This is deprecated and will be disallowed in a future release -Note 1831 Duplicate index `a_3`. This is deprecated and will be disallowed in a future release -INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3); -REPAIR TABLE t1; -Table Op Msg_type Msg_text -test.t1 repair status OK -SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; -CARDINALITY -14 -14 -14 -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -DROP TABLE t1; -SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; -SET aria_repair_threads=@@global.aria_repair_threads; -# -# BUG#47073 - valgrind errs, corruption,failed repair of partition, -# low myisam_sort_buffer_size -# -CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); -INSERT INTO t1 select seq,'0' from seq_1_to_65536; -SET aria_sort_buffer_size=16384; -REPAIR TABLE t1; -Table Op Msg_type Msg_text -test.t1 repair error aria_sort_buffer_size is too small. X -test.t1 repair error Create index by sort failed -test.t1 repair info Retrying repair with keycache -test.t1 repair status OK -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SET aria_repair_threads=2; -REPAIR TABLE t1; -Table Op Msg_type Msg_text -test.t1 repair error aria_sort_buffer_size is too small. X -test.t1 repair error Create index by sort failed -test.t1 repair info Retrying repair with keycache -test.t1 repair status OK -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SET aria_repair_threads=@@global.aria_repair_threads; -SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; -DROP TABLE t1; CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); INSERT INTO t1 VALUES(1,'0'),(2,'0'),(3,'0'),(4,'0'),(5,'0'), (6,'0'),(7,'0'); diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index f7a5b5c35b2..f0b665449dc 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -2030,41 +2030,6 @@ DROP TABLE t1; --echo # End of 5.5 tests --echo # ---echo # ---echo # BUG#47444 - --myisam_repair_threads > 1 can result in all index ---echo # cardinalities=1 ---echo # -SET aria_repair_threads=2; -SET aria_sort_buffer_size=16384; -CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); -INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3); ---replace_regex /Current aria_sort_buffer_size.*/X/ -REPAIR TABLE t1; -SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; -CHECK TABLE t1; -DROP TABLE t1; -SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; -SET aria_repair_threads=@@global.aria_repair_threads; - ---echo # ---echo # BUG#47073 - valgrind errs, corruption,failed repair of partition, ---echo # low myisam_sort_buffer_size ---echo # -CREATE TABLE t1(a INT, b CHAR(10), KEY(a), KEY(b)); -INSERT INTO t1 select seq,'0' from seq_1_to_65536; -SET aria_sort_buffer_size=16384; ---replace_regex /Current aria_sort_buffer_size.*/X/ -REPAIR TABLE t1; -CHECK TABLE t1; -SET aria_repair_threads=2; -# May report different values depending on threads activity. ---replace_regex /Current aria_sort_buffer_size.*/X/ -REPAIR TABLE t1; -CHECK TABLE t1; -SET aria_repair_threads=@@global.aria_repair_threads; -SET aria_sort_buffer_size=@@global.aria_sort_buffer_size; -DROP TABLE t1; - # # Check FLUSH FOR EXPORT # diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result index 6fbbdac5a45..0acb7878a75 100644 --- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic.result @@ -26,10 +26,10 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size 4096 -SET @@global.myisam_sort_buffer_size = 4294967295; +SET @@global.myisam_sort_buffer_size = 268435455; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4294967295 +268435455 SET @@global.myisam_sort_buffer_size = 655354; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -41,10 +41,10 @@ Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size 4096 -SET @@session.myisam_sort_buffer_size = 4294967295; +SET @@session.myisam_sort_buffer_size = 268435455; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4294967295 +268435455 SET @@session.myisam_sort_buffer_size = 655345; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff index 979f9d8903a..80af54a1d3a 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff @@ -1,16 +1,16 @@ ---- sysvars_aria.result 2015-01-09 11:49:32.000000000 +0100 -+++ sysvars_aria,32bit.result 2015-01-09 17:30:11.000000000 +0100 -@@ -7,7 +7,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +--- suite/sys_vars/r/sysvars_aria.result 2023-05-02 23:37:10.180795104 +0300 ++++ suite/sys_vars/r/sysvars_aria,32bit.reject 2023-05-24 15:11:33.621611216 +0300 +@@ -5,7 +5,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 8192 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT Block size to be used for Aria index pages. - NUMERIC_MIN_VALUE 1024 + NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 32768 -@@ -21,7 +21,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -17,7 +17,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 30 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -18,8 +18,8 @@ VARIABLE_COMMENT Interval between tries to do an automatic checkpoints. In seconds; 0 means 'no automatic checkpoints' which makes sense only for testing. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -35,7 +35,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -29,7 +29,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -27,8 +27,8 @@ VARIABLE_COMMENT Number of bytes that the transaction log has to grow between checkpoints before a new checkpoint is written to the log. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -63,7 +63,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -53,7 +53,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -36,8 +36,8 @@ VARIABLE_COMMENT Number of consecutive log recovery failures after which logs will be automatically deleted to cure the problem; 0 (the default) disables the feature. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -91,7 +91,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -77,7 +77,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -45,8 +45,8 @@ VARIABLE_COMMENT Interval between commite in microseconds (1/1000000c). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -105,7 +105,7 @@ - GLOBAL_VALUE_ORIGIN CONFIG +@@ -101,7 +101,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -54,8 +54,8 @@ VARIABLE_COMMENT Limit for transaction log size NUMERIC_MIN_VALUE 8388608 NUMERIC_MAX_VALUE 4294967295 -@@ -147,10 +147,10 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -137,10 +137,10 @@ + SESSION_VALUE NULL DEFAULT_VALUE 300 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -67,8 +67,8 @@ NUMERIC_BLOCK_SIZE 100 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -175,7 +175,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -161,7 +161,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -76,8 +76,8 @@ VARIABLE_COMMENT The minimum percentage of warm blocks in key cache NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100 -@@ -189,7 +189,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -173,7 +173,7 @@ + SESSION_VALUE NULL DEFAULT_VALUE 512 VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -85,8 +85,8 @@ VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files. NUMERIC_MIN_VALUE 128 NUMERIC_MAX_VALUE 16384 -@@ -231,7 +231,7 @@ - GLOBAL_VALUE_ORIGIN COMPILE-TIME +@@ -209,7 +209,7 @@ + SESSION_VALUE 1 DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED @@ -94,12 +94,12 @@ VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 128 -@@ -248,7 +248,7 @@ +@@ -224,7 +224,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. - NUMERIC_MIN_VALUE 4096 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 + NUMERIC_MIN_VALUE 16376 +-NUMERIC_MAX_VALUE 1152921504606846975 ++NUMERIC_MAX_VALUE 268435455 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff index bfe56dbc1a9..11f8189b592 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff @@ -1,6 +1,6 @@ ---- sysvars_server_notembedded.result -+++ sysvars_server_notembedded.result -@@ -34,7 +34,7 @@ READ_ONLY NO +--- suite/sys_vars/r/sysvars_server_notembedded.result 2023-05-02 23:37:10.180795104 +0300 ++++ suite/sys_vars/r/sysvars_server_notembedded,32bit.reject 2023-05-24 15:07:00.882252929 +0300 +@@ -34,7 +34,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_BLOCK_SIZE VARIABLE_SCOPE GLOBAL @@ -9,7 +9,7 @@ VARIABLE_COMMENT Block size to be used for Aria index pages. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 32768 -@@ -44,7 +44,7 @@ READ_ONLY YES +@@ -44,7 +44,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_CHECKPOINT_INTERVAL VARIABLE_SCOPE GLOBAL @@ -18,7 +18,7 @@ VARIABLE_COMMENT Interval between tries to do an automatic checkpoints. In seconds; 0 means 'no automatic checkpoints' which makes sense only for testing. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -54,7 +54,7 @@ READ_ONLY NO +@@ -54,7 +54,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_CHECKPOINT_LOG_ACTIVITY VARIABLE_SCOPE GLOBAL @@ -27,7 +27,7 @@ VARIABLE_COMMENT Number of bytes that the transaction log has to grow between checkpoints before a new checkpoint is written to the log. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -74,7 +74,7 @@ READ_ONLY NO +@@ -74,7 +74,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME ARIA_FORCE_START_AFTER_RECOVERY_FAILURES VARIABLE_SCOPE GLOBAL @@ -36,7 +36,7 @@ VARIABLE_COMMENT Number of consecutive log recovery failures after which logs will be automatically deleted to cure the problem; 0 (the default) disables the feature. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -94,7 +94,7 @@ READ_ONLY NO +@@ -94,7 +94,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_GROUP_COMMIT_INTERVAL VARIABLE_SCOPE GLOBAL @@ -45,7 +45,7 @@ VARIABLE_COMMENT Interval between commite in microseconds (1/1000000c). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -104,7 +104,7 @@ READ_ONLY NO +@@ -114,7 +114,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_LOG_FILE_SIZE VARIABLE_SCOPE GLOBAL @@ -54,7 +54,7 @@ VARIABLE_COMMENT Limit for transaction log size NUMERIC_MIN_VALUE 8388608 NUMERIC_MAX_VALUE 4294967295 -@@ -134,10 +134,10 @@ READ_ONLY NO +@@ -144,10 +144,10 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD VARIABLE_SCOPE GLOBAL @@ -67,7 +67,7 @@ NUMERIC_BLOCK_SIZE 100 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -154,7 +154,7 @@ READ_ONLY YES +@@ -164,7 +164,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT VARIABLE_SCOPE GLOBAL @@ -76,7 +76,7 @@ VARIABLE_COMMENT The minimum percentage of warm blocks in key cache NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100 -@@ -164,7 +164,7 @@ READ_ONLY NO +@@ -174,7 +174,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_PAGECACHE_FILE_HASH_SIZE VARIABLE_SCOPE GLOBAL @@ -85,7 +85,7 @@ VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files. NUMERIC_MIN_VALUE 128 NUMERIC_MAX_VALUE 16384 -@@ -194,7 +194,7 @@ READ_ONLY NO +@@ -204,7 +204,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME ARIA_REPAIR_THREADS VARIABLE_SCOPE SESSION @@ -94,16 +94,16 @@ VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 128 -@@ -207,7 +207,7 @@ VARIABLE_SCOPE SESSION +@@ -217,7 +217,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. - NUMERIC_MIN_VALUE 4096 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 + NUMERIC_MIN_VALUE 16376 +-NUMERIC_MAX_VALUE 1152921504606846975 ++NUMERIC_MAX_VALUE 268435455 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -264,7 +264,7 @@ READ_ONLY NO +@@ -274,7 +274,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME AUTO_INCREMENT_INCREMENT VARIABLE_SCOPE SESSION @@ -112,7 +112,7 @@ VARIABLE_COMMENT Auto-increment columns are incremented by this NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 65535 -@@ -274,7 +274,7 @@ READ_ONLY NO +@@ -284,7 +284,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME AUTO_INCREMENT_OFFSET VARIABLE_SCOPE SESSION @@ -121,7 +121,7 @@ VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1 NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 65535 -@@ -284,7 +284,7 @@ READ_ONLY NO +@@ -294,7 +294,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME BACK_LOG VARIABLE_SCOPE GLOBAL @@ -130,7 +130,7 @@ VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -337,7 +337,7 @@ VARIABLE_SCOPE GLOBAL +@@ -347,7 +347,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance NUMERIC_MIN_VALUE 4096 @@ -139,7 +139,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -354,20 +354,20 @@ READ_ONLY NO +@@ -364,20 +364,20 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT VARIABLE_SCOPE GLOBAL @@ -164,7 +164,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -387,7 +387,7 @@ VARIABLE_SCOPE GLOBAL +@@ -397,7 +397,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of file cache for the binary log NUMERIC_MIN_VALUE 8192 @@ -173,7 +173,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -427,7 +427,7 @@ VARIABLE_SCOPE GLOBAL +@@ -437,7 +437,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance. NUMERIC_MIN_VALUE 4096 @@ -182,7 +182,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -437,7 +437,7 @@ VARIABLE_SCOPE SESSION +@@ -447,7 +447,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread! NUMERIC_MIN_VALUE 0 @@ -191,7 +191,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -624,7 +624,7 @@ READ_ONLY NO +@@ -634,7 +634,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME CONNECT_TIMEOUT VARIABLE_SCOPE GLOBAL @@ -200,7 +200,7 @@ VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake' NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 31536000 -@@ -674,7 +674,7 @@ READ_ONLY YES +@@ -684,7 +684,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG VARIABLE_SCOPE SESSION @@ -209,7 +209,7 @@ VARIABLE_COMMENT Long search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 33 -@@ -684,7 +684,7 @@ READ_ONLY NO +@@ -694,7 +694,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT VARIABLE_SCOPE SESSION @@ -218,7 +218,7 @@ VARIABLE_COMMENT Short search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 32 -@@ -694,7 +694,7 @@ READ_ONLY NO +@@ -704,7 +704,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_TIMEOUT_LONG VARIABLE_SCOPE SESSION @@ -227,7 +227,7 @@ VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -704,7 +704,7 @@ READ_ONLY NO +@@ -714,7 +714,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT VARIABLE_SCOPE SESSION @@ -236,7 +236,7 @@ VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -764,7 +764,7 @@ READ_ONLY NO +@@ -774,7 +774,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME DEFAULT_WEEK_FORMAT VARIABLE_SCOPE SESSION @@ -245,7 +245,7 @@ VARIABLE_COMMENT The default week format used by WEEK() functions NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 7 -@@ -774,7 +774,7 @@ READ_ONLY NO +@@ -784,7 +784,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DELAYED_INSERT_LIMIT VARIABLE_SCOPE GLOBAL @@ -254,7 +254,7 @@ VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -784,7 +784,7 @@ READ_ONLY NO +@@ -794,7 +794,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DELAYED_INSERT_TIMEOUT VARIABLE_SCOPE GLOBAL @@ -263,7 +263,7 @@ VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -794,7 +794,7 @@ READ_ONLY NO +@@ -804,7 +804,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DELAYED_QUEUE_SIZE VARIABLE_SCOPE GLOBAL @@ -272,7 +272,7 @@ VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -824,7 +824,7 @@ READ_ONLY NO +@@ -834,7 +834,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME DIV_PRECISION_INCREMENT VARIABLE_SCOPE SESSION @@ -281,7 +281,7 @@ VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 38 -@@ -914,7 +914,7 @@ READ_ONLY NO +@@ -924,7 +924,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME EXPIRE_LOGS_DAYS VARIABLE_SCOPE GLOBAL @@ -290,7 +290,7 @@ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 99 -@@ -944,7 +944,7 @@ READ_ONLY YES +@@ -954,7 +954,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME EXTRA_MAX_CONNECTIONS VARIABLE_SCOPE GLOBAL @@ -299,7 +299,7 @@ VARIABLE_COMMENT The number of connections on extra-port NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -974,7 +974,7 @@ READ_ONLY NO +@@ -984,7 +984,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME FLUSH_TIME VARIABLE_SCOPE GLOBAL @@ -308,7 +308,7 @@ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -1004,7 +1004,7 @@ READ_ONLY NO +@@ -1014,7 +1014,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME FT_MAX_WORD_LEN VARIABLE_SCOPE GLOBAL @@ -317,7 +317,7 @@ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 84 -@@ -1014,7 +1014,7 @@ READ_ONLY YES +@@ -1024,7 +1024,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME FT_MIN_WORD_LEN VARIABLE_SCOPE GLOBAL @@ -326,7 +326,7 @@ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 84 -@@ -1024,7 +1024,7 @@ READ_ONLY YES +@@ -1034,7 +1034,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT VARIABLE_SCOPE GLOBAL @@ -335,16 +335,7 @@ VARIABLE_COMMENT Number of best matches to use for query expansion NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -1067,7 +1067,7 @@ VARIABLE_SCOPE SESSION - VARIABLE_TYPE BIGINT UNSIGNED - VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() - NUMERIC_MIN_VALUE 4 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 - NUMERIC_BLOCK_SIZE 1 - ENUM_VALUE_LIST NULL - READ_ONLY NO -@@ -1274,7 +1274,7 @@ READ_ONLY YES +@@ -1284,7 +1284,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME HISTOGRAM_SIZE VARIABLE_SCOPE SESSION @@ -353,7 +344,7 @@ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1304,7 +1304,7 @@ READ_ONLY YES +@@ -1314,7 +1314,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME HOST_CACHE_SIZE VARIABLE_SCOPE GLOBAL @@ -362,7 +353,7 @@ VARIABLE_COMMENT How many host names should be cached to avoid resolving. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65536 -@@ -1414,7 +1414,7 @@ READ_ONLY NO +@@ -1424,7 +1424,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME INTERACTIVE_TIMEOUT VARIABLE_SCOPE SESSION @@ -371,7 +362,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1447,7 +1447,7 @@ VARIABLE_SCOPE SESSION +@@ -1457,7 +1457,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins NUMERIC_MIN_VALUE 128 @@ -380,7 +371,7 @@ NUMERIC_BLOCK_SIZE 128 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1464,7 +1464,7 @@ READ_ONLY NO +@@ -1474,7 +1474,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME JOIN_CACHE_LEVEL VARIABLE_SCOPE SESSION @@ -389,7 +380,7 @@ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 8 -@@ -1487,7 +1487,7 @@ VARIABLE_SCOPE GLOBAL +@@ -1497,7 +1497,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford NUMERIC_MIN_VALUE 0 @@ -398,7 +389,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1654,7 +1654,7 @@ READ_ONLY YES +@@ -1664,7 +1664,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME LOCK_WAIT_TIMEOUT VARIABLE_SCOPE SESSION @@ -407,7 +398,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -1804,7 +1804,7 @@ READ_ONLY NO +@@ -1814,7 +1814,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME LOG_SLOW_RATE_LIMIT VARIABLE_SCOPE SESSION @@ -416,7 +407,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1834,7 +1834,7 @@ READ_ONLY NO +@@ -1844,7 +1844,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME LOG_WARNINGS VARIABLE_SCOPE SESSION @@ -425,7 +416,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1894,7 +1894,7 @@ READ_ONLY NO +@@ -1904,7 +1904,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME MAX_ALLOWED_PACKET VARIABLE_SCOPE SESSION @@ -434,7 +425,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1907,14 +1907,14 @@ VARIABLE_SCOPE GLOBAL +@@ -1917,14 +1917,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the total size of the transactional cache NUMERIC_MIN_VALUE 4096 @@ -451,7 +442,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -1927,14 +1927,14 @@ VARIABLE_SCOPE GLOBAL +@@ -1937,14 +1937,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the total size of the statement cache NUMERIC_MIN_VALUE 4096 @@ -468,7 +459,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 100000 -@@ -1944,7 +1944,7 @@ READ_ONLY NO +@@ -1954,7 +1954,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_CONNECT_ERRORS VARIABLE_SCOPE GLOBAL @@ -477,7 +468,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1954,7 +1954,7 @@ READ_ONLY NO +@@ -1964,7 +1964,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_DELAYED_THREADS VARIABLE_SCOPE SESSION @@ -486,7 +477,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1974,7 +1974,7 @@ READ_ONLY YES +@@ -1984,7 +1984,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_ERROR_COUNT VARIABLE_SCOPE SESSION @@ -495,7 +486,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -1987,14 +1987,14 @@ VARIABLE_SCOPE SESSION +@@ -1997,14 +1997,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -512,7 +503,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2014,7 +2014,7 @@ READ_ONLY NO +@@ -2024,7 +2024,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA VARIABLE_SCOPE SESSION @@ -521,7 +512,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2024,7 +2024,7 @@ READ_ONLY NO +@@ -2034,7 +2034,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_LONG_DATA_SIZE VARIABLE_SCOPE GLOBAL @@ -530,7 +521,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2054,7 +2054,7 @@ READ_ONLY NO +@@ -2064,7 +2064,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_RECURSIVE_ITERATIONS VARIABLE_SCOPE SESSION @@ -539,7 +530,7 @@ VARIABLE_COMMENT Maximum number of iterations when executing recursive queries NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2077,14 +2077,14 @@ VARIABLE_SCOPE SESSION +@@ -2087,14 +2087,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The maximum size of the container of a rowid filter NUMERIC_MIN_VALUE 1024 @@ -556,16 +547,16 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2104,7 +2104,7 @@ READ_ONLY NO +@@ -2114,7 +2114,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_SORT_LENGTH VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED +VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) - NUMERIC_MIN_VALUE 4 + NUMERIC_MIN_VALUE 64 NUMERIC_MAX_VALUE 8388608 -@@ -2114,7 +2114,7 @@ READ_ONLY NO +@@ -2124,7 +2124,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_SP_RECURSION_DEPTH VARIABLE_SCOPE SESSION @@ -574,7 +565,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2134,7 +2134,7 @@ READ_ONLY NO +@@ -2144,7 +2144,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_TMP_TABLES VARIABLE_SCOPE SESSION @@ -583,7 +574,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2154,7 +2154,7 @@ READ_ONLY NO +@@ -2164,7 +2164,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_WRITE_LOCK_COUNT VARIABLE_SCOPE GLOBAL @@ -592,7 +583,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2164,7 +2164,7 @@ READ_ONLY NO +@@ -2174,7 +2174,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE VARIABLE_SCOPE GLOBAL @@ -601,7 +592,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2174,7 +2174,7 @@ READ_ONLY YES +@@ -2184,7 +2184,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES VARIABLE_SCOPE GLOBAL @@ -610,7 +601,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2184,7 +2184,7 @@ READ_ONLY YES +@@ -2194,7 +2194,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT VARIABLE_SCOPE SESSION @@ -619,7 +610,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2194,7 +2194,7 @@ READ_ONLY NO +@@ -2204,7 +2204,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MRR_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -628,7 +619,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2204,17 +2204,17 @@ READ_ONLY NO +@@ -2214,17 +2214,17 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MULTI_RANGE_COUNT VARIABLE_SCOPE SESSION @@ -649,7 +640,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2224,7 +2224,7 @@ READ_ONLY YES +@@ -2234,7 +2234,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_DATA_POINTER_SIZE VARIABLE_SCOPE GLOBAL @@ -658,7 +649,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2247,7 +2247,7 @@ VARIABLE_SCOPE GLOBAL +@@ -2257,7 +2257,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables NUMERIC_MIN_VALUE 7 @@ -667,7 +658,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2264,10 +2264,10 @@ READ_ONLY YES +@@ -2274,10 +2274,10 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME MYISAM_REPAIR_THREADS VARIABLE_SCOPE SESSION @@ -680,16 +671,16 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2277,7 +2277,7 @@ VARIABLE_SCOPE SESSION +@@ -2287,7 +2287,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 +-NUMERIC_MAX_VALUE 1152921504606846975 ++NUMERIC_MAX_VALUE 268435455 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2314,7 +2314,7 @@ READ_ONLY NO +@@ -2324,7 +2324,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME NET_BUFFER_LENGTH VARIABLE_SCOPE SESSION @@ -698,7 +689,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2324,7 +2324,7 @@ READ_ONLY NO +@@ -2334,7 +2334,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME NET_READ_TIMEOUT VARIABLE_SCOPE SESSION @@ -707,7 +698,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2334,7 +2334,7 @@ READ_ONLY NO +@@ -2344,7 +2344,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME NET_RETRY_COUNT VARIABLE_SCOPE SESSION @@ -716,7 +707,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2344,7 +2344,7 @@ READ_ONLY NO +@@ -2354,7 +2354,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME NET_WRITE_TIMEOUT VARIABLE_SCOPE SESSION @@ -725,7 +716,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2394,7 +2394,7 @@ READ_ONLY NO +@@ -2404,7 +2404,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -734,7 +725,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 or autoset then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2404,7 +2404,7 @@ READ_ONLY YES +@@ -2414,7 +2414,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_PRUNE_LEVEL VARIABLE_SCOPE SESSION @@ -743,7 +734,7 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2414,7 +2414,7 @@ READ_ONLY NO +@@ -2424,7 +2424,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH VARIABLE_SCOPE SESSION @@ -752,7 +743,7 @@ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 62 -@@ -2424,7 +2424,7 @@ READ_ONLY NO +@@ -2434,7 +2434,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT VARIABLE_SCOPE SESSION @@ -761,7 +752,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2454,17 +2454,17 @@ READ_ONLY NO +@@ -2464,17 +2464,17 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_TRACE_MAX_MEM_SIZE VARIABLE_SCOPE SESSION @@ -782,7 +773,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2484,7 +2484,7 @@ READ_ONLY YES +@@ -2494,7 +2494,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE VARIABLE_SCOPE GLOBAL @@ -791,7 +782,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2494,7 +2494,7 @@ READ_ONLY YES +@@ -2504,7 +2504,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE VARIABLE_SCOPE GLOBAL @@ -799,8 +790,8 @@ +VARIABLE_TYPE INT VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 - NUMERIC_MAX_VALUE 200 -@@ -2504,7 +2504,7 @@ READ_ONLY YES + NUMERIC_MAX_VALUE 1048576 +@@ -2514,7 +2514,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE VARIABLE_SCOPE GLOBAL @@ -809,7 +800,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2514,7 +2514,7 @@ READ_ONLY YES +@@ -2524,7 +2524,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE VARIABLE_SCOPE GLOBAL @@ -818,7 +809,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2524,7 +2524,7 @@ READ_ONLY YES +@@ -2534,7 +2534,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE VARIABLE_SCOPE GLOBAL @@ -827,7 +818,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2534,7 +2534,7 @@ READ_ONLY YES +@@ -2544,7 +2544,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE VARIABLE_SCOPE GLOBAL @@ -836,7 +827,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2544,7 +2544,7 @@ READ_ONLY YES +@@ -2554,7 +2554,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE VARIABLE_SCOPE GLOBAL @@ -845,7 +836,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2554,7 +2554,7 @@ READ_ONLY YES +@@ -2564,7 +2564,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE VARIABLE_SCOPE GLOBAL @@ -854,7 +845,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2564,7 +2564,7 @@ READ_ONLY YES +@@ -2574,7 +2574,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE VARIABLE_SCOPE GLOBAL @@ -863,7 +854,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2574,7 +2574,7 @@ READ_ONLY YES +@@ -2584,7 +2584,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES VARIABLE_SCOPE GLOBAL @@ -872,7 +863,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2584,7 +2584,7 @@ READ_ONLY YES +@@ -2594,7 +2594,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES VARIABLE_SCOPE GLOBAL @@ -881,7 +872,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2594,7 +2594,7 @@ READ_ONLY YES +@@ -2604,7 +2604,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH VARIABLE_SCOPE GLOBAL @@ -890,7 +881,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2604,7 +2604,7 @@ READ_ONLY YES +@@ -2614,7 +2614,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES VARIABLE_SCOPE GLOBAL @@ -899,7 +890,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2614,7 +2614,7 @@ READ_ONLY YES +@@ -2624,7 +2624,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES VARIABLE_SCOPE GLOBAL @@ -908,7 +899,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2624,7 +2624,7 @@ READ_ONLY YES +@@ -2634,7 +2634,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES VARIABLE_SCOPE GLOBAL @@ -917,7 +908,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2634,7 +2634,7 @@ READ_ONLY YES +@@ -2644,7 +2644,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES VARIABLE_SCOPE GLOBAL @@ -926,7 +917,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2644,7 +2644,7 @@ READ_ONLY YES +@@ -2654,7 +2654,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES VARIABLE_SCOPE GLOBAL @@ -935,7 +926,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2654,7 +2654,7 @@ READ_ONLY YES +@@ -2664,7 +2664,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES VARIABLE_SCOPE GLOBAL @@ -944,7 +935,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2664,7 +2664,7 @@ READ_ONLY YES +@@ -2674,7 +2674,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES VARIABLE_SCOPE GLOBAL @@ -953,7 +944,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2674,7 +2674,7 @@ READ_ONLY YES +@@ -2684,7 +2684,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES VARIABLE_SCOPE GLOBAL @@ -962,7 +953,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2684,7 +2684,7 @@ READ_ONLY YES +@@ -2694,7 +2694,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES VARIABLE_SCOPE GLOBAL @@ -971,7 +962,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2694,7 +2694,7 @@ READ_ONLY YES +@@ -2704,7 +2704,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES VARIABLE_SCOPE GLOBAL @@ -980,7 +971,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2704,7 +2704,7 @@ READ_ONLY YES +@@ -2714,7 +2714,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES VARIABLE_SCOPE GLOBAL @@ -989,7 +980,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2714,7 +2714,7 @@ READ_ONLY YES +@@ -2724,7 +2724,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES VARIABLE_SCOPE GLOBAL @@ -998,7 +989,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2724,7 +2724,7 @@ READ_ONLY YES +@@ -2734,7 +2734,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES VARIABLE_SCOPE GLOBAL @@ -1007,7 +998,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2734,7 +2734,7 @@ READ_ONLY YES +@@ -2744,7 +2744,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES VARIABLE_SCOPE GLOBAL @@ -1016,7 +1007,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2744,7 +2744,7 @@ READ_ONLY YES +@@ -2754,7 +2754,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES VARIABLE_SCOPE GLOBAL @@ -1025,7 +1016,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2754,7 +2754,7 @@ READ_ONLY YES +@@ -2764,7 +2764,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE VARIABLE_SCOPE GLOBAL @@ -1034,7 +1025,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2764,7 +2764,7 @@ READ_ONLY YES +@@ -2774,7 +2774,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE VARIABLE_SCOPE GLOBAL @@ -1043,7 +1034,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -2774,7 +2774,7 @@ READ_ONLY YES +@@ -2784,7 +2784,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE VARIABLE_SCOPE GLOBAL @@ -1052,7 +1043,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2784,7 +2784,7 @@ READ_ONLY YES +@@ -2794,7 +2794,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE VARIABLE_SCOPE GLOBAL @@ -1061,7 +1052,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2834,7 +2834,7 @@ READ_ONLY YES +@@ -2844,7 +2844,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PRELOAD_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -1070,7 +1061,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -2854,7 +2854,7 @@ READ_ONLY NO +@@ -2864,7 +2864,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME PROFILING_HISTORY_SIZE VARIABLE_SCOPE SESSION @@ -1079,7 +1070,7 @@ VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -2864,7 +2864,7 @@ READ_ONLY NO +@@ -2874,7 +2874,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PROGRESS_REPORT_TIME VARIABLE_SCOPE SESSION @@ -1088,7 +1079,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2924,7 +2924,7 @@ READ_ONLY NO +@@ -2934,7 +2934,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE VARIABLE_SCOPE SESSION @@ -1097,7 +1088,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2934,7 +2934,7 @@ READ_ONLY NO +@@ -2944,7 +2944,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME QUERY_CACHE_LIMIT VARIABLE_SCOPE GLOBAL @@ -1106,7 +1097,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2944,7 +2944,7 @@ READ_ONLY NO +@@ -2954,7 +2954,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT VARIABLE_SCOPE GLOBAL @@ -1115,7 +1106,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2957,7 +2957,7 @@ VARIABLE_SCOPE GLOBAL +@@ -2967,7 +2967,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1124,7 +1115,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2994,7 +2994,7 @@ READ_ONLY NO +@@ -3004,7 +3004,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME QUERY_PREALLOC_SIZE VARIABLE_SCOPE SESSION @@ -1133,7 +1124,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3007,7 +3007,7 @@ VARIABLE_SCOPE SESSION ONLY +@@ -3017,7 +3017,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1142,7 +1133,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3017,14 +3017,14 @@ VARIABLE_SCOPE SESSION ONLY +@@ -3027,14 +3027,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1159,7 +1150,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3037,14 +3037,14 @@ VARIABLE_SCOPE GLOBAL +@@ -3047,14 +3047,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum speed(KB/s) to read binlog from master (0 = no limit) NUMERIC_MIN_VALUE 0 @@ -1176,7 +1167,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3064,7 +3064,7 @@ READ_ONLY NO +@@ -3074,7 +3074,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME READ_RND_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -1185,7 +1176,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3264,10 +3264,10 @@ READ_ONLY YES +@@ -3274,10 +3274,10 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ROWID_MERGE_BUFF_SIZE VARIABLE_SCOPE SESSION @@ -1198,7 +1189,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3284,20 +3284,20 @@ READ_ONLY NO +@@ -3294,20 +3294,20 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME RPL_SEMI_SYNC_MASTER_TIMEOUT VARIABLE_SCOPE GLOBAL @@ -1223,7 +1214,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3354,10 +3354,10 @@ READ_ONLY NO +@@ -3364,10 +3364,10 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL VARIABLE_SCOPE GLOBAL @@ -1236,7 +1227,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3394,7 +3394,7 @@ READ_ONLY YES +@@ -3404,7 +3404,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SERVER_ID VARIABLE_SCOPE SESSION @@ -1245,7 +1236,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -3524,7 +3524,7 @@ READ_ONLY NO +@@ -3534,7 +3534,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLAVE_DOMAIN_PARALLEL_THREADS VARIABLE_SCOPE GLOBAL @@ -1254,7 +1245,7 @@ VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -3554,7 +3554,7 @@ READ_ONLY YES +@@ -3564,7 +3564,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET VARIABLE_SCOPE GLOBAL @@ -1263,7 +1254,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3574,7 +3574,7 @@ READ_ONLY NO +@@ -3584,7 +3584,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLAVE_PARALLEL_MAX_QUEUED VARIABLE_SCOPE GLOBAL @@ -1272,7 +1263,7 @@ VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 2147483647 -@@ -3594,7 +3594,7 @@ READ_ONLY NO +@@ -3604,7 +3604,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME SLAVE_PARALLEL_THREADS VARIABLE_SCOPE GLOBAL @@ -1281,7 +1272,7 @@ VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -3604,7 +3604,7 @@ READ_ONLY NO +@@ -3614,7 +3614,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLAVE_PARALLEL_WORKERS VARIABLE_SCOPE GLOBAL @@ -1290,7 +1281,7 @@ VARIABLE_COMMENT Alias for slave_parallel_threads NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -3644,7 +3644,7 @@ READ_ONLY NO +@@ -3654,7 +3654,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME SLAVE_TRANSACTION_RETRIES VARIABLE_SCOPE GLOBAL @@ -1299,7 +1290,7 @@ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock, elapsed lock wait timeout or listed in slave_transaction_retry_errors, before giving up and stopping NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3664,7 +3664,7 @@ READ_ONLY YES +@@ -3674,7 +3674,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLAVE_TRANSACTION_RETRY_INTERVAL VARIABLE_SCOPE GLOBAL @@ -1308,7 +1299,7 @@ VARIABLE_COMMENT Interval of the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout or listed in slave_transaction_retry_errors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 3600 -@@ -3684,7 +3684,7 @@ READ_ONLY NO +@@ -3694,7 +3694,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLOW_LAUNCH_TIME VARIABLE_SCOPE GLOBAL @@ -1317,7 +1308,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -3727,7 +3727,7 @@ VARIABLE_SCOPE SESSION +@@ -3737,7 +3737,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1326,7 +1317,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3944,7 +3944,7 @@ READ_ONLY NO +@@ -3954,7 +3954,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME STORED_PROGRAM_CACHE VARIABLE_SCOPE GLOBAL @@ -1335,7 +1326,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -4044,7 +4044,7 @@ READ_ONLY NO +@@ -4054,7 +4054,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME TABLE_DEFINITION_CACHE VARIABLE_SCOPE GLOBAL @@ -1344,7 +1335,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 2097152 -@@ -4054,7 +4054,7 @@ READ_ONLY NO +@@ -4064,7 +4064,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TABLE_OPEN_CACHE VARIABLE_SCOPE GLOBAL @@ -1353,7 +1344,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 1048576 -@@ -4114,7 +4114,7 @@ READ_ONLY NO +@@ -4124,7 +4124,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME THREAD_CACHE_SIZE VARIABLE_SCOPE GLOBAL @@ -1362,7 +1353,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -4124,7 +4124,7 @@ READ_ONLY NO +@@ -4134,7 +4134,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME THREAD_CONCURRENCY VARIABLE_SCOPE GLOBAL @@ -1371,7 +1362,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -4287,7 +4287,7 @@ VARIABLE_SCOPE SESSION +@@ -4297,7 +4297,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table. NUMERIC_MIN_VALUE 1024 @@ -1380,7 +1371,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4297,7 +4297,7 @@ VARIABLE_SCOPE SESSION +@@ -4307,7 +4307,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size. NUMERIC_MIN_VALUE 1024 @@ -1389,7 +1380,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4307,14 +4307,14 @@ VARIABLE_SCOPE SESSION +@@ -4317,14 +4317,14 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. NUMERIC_MIN_VALUE 1024 @@ -1406,7 +1397,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4324,7 +4324,7 @@ READ_ONLY NO +@@ -4334,7 +4334,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TRANSACTION_PREALLOC_SIZE VARIABLE_SCOPE SESSION @@ -1415,7 +1406,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4464,7 +4464,7 @@ READ_ONLY YES +@@ -4474,7 +4474,7 @@ COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME WAIT_TIMEOUT VARIABLE_SCOPE SESSION @@ -1424,7 +1415,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -4491,7 +4491,7 @@ order by variable_name; +@@ -4501,7 +4501,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL diff --git a/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test index 818d66328f8..0795d54910d 100644 --- a/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/aria_sort_buffer_size_basic.test @@ -39,8 +39,7 @@ select @@global.aria_sort_buffer_size; --disable_warnings set session aria_sort_buffer_size=cast(-1 as unsigned int); --enable_warnings ---replace_result 4294967295 18446744073709551615 +--replace_result 4294967295 18446744073709551615 268435455 1152921504606846975 select @@session.aria_sort_buffer_size; SET @@global.aria_sort_buffer_size = @start_global_value; - diff --git a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test index 81ff81ae935..ac1e9d615af 100644 --- a/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test +++ b/mysql-test/suite/sys_vars/t/myisam_sort_buffer_size_basic.test @@ -61,7 +61,7 @@ SELECT @@session.myisam_sort_buffer_size = @default_myisam_sort_buffer_size; SET @@global.myisam_sort_buffer_size = 4; SELECT @@global.myisam_sort_buffer_size ; -SET @@global.myisam_sort_buffer_size = 4294967295; +SET @@global.myisam_sort_buffer_size = 268435455; SELECT @@global.myisam_sort_buffer_size ; SET @@global.myisam_sort_buffer_size = 655354; @@ -76,7 +76,7 @@ SELECT @@global.myisam_sort_buffer_size ; SET @@session.myisam_sort_buffer_size = 4; SELECT @@session.myisam_sort_buffer_size ; -SET @@session.myisam_sort_buffer_size = 4294967295; +SET @@session.myisam_sort_buffer_size = 268435455; SELECT @@session.myisam_sort_buffer_size ; SET @@session.myisam_sort_buffer_size = 655345; @@ -96,33 +96,32 @@ SELECT @@global.myisam_sort_buffer_size ; --disable_warnings SET @@global.myisam_sort_buffer_size = 429496729533; --enable_warnings ---replace_result 429496729533 4294967295 +--replace_result 429496729533 4294967295 268435455 4294967295 SELECT @@global.myisam_sort_buffer_size ; - --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_sort_buffer_size = 65530.34; ---replace_result 429496729533 4294967295 +--replace_result 429496729533 4294967295 268435455 4294967295 SELECT @@global.myisam_sort_buffer_size ; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_sort_buffer_size = test; ---replace_result 429496729533 4294967295 +--replace_result 429496729533 4294967295 268435455 4294967295 SELECT @@global.myisam_sort_buffer_size ; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_sort_buffer_size = "test"; ---replace_result 429496729533 4294967295 +--replace_result 429496729533 4294967295 268435455 4294967295 SELECT @@global.myisam_sort_buffer_size ; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_sort_buffer_size = 'test'; ---replace_result 429496729533 4294967295 +--replace_result 429496729533 4294967295 268435455 4294967295 SELECT @@global.myisam_sort_buffer_size ; --Error ER_WRONG_TYPE_FOR_VAR SET @@global.myisam_sort_buffer_size = ON; ---replace_result 429496729533 4294967295 +--replace_result 429496729533 4294967295 268435455 4294967295 SELECT @@global.myisam_sort_buffer_size ; From 832b157bbe3e22e36c75e5b80ee88bfe3d4359a5 Mon Sep 17 00:00:00 2001 From: Angelique Date: Thu, 25 May 2023 23:10:53 +0000 Subject: [PATCH 38/80] MDEV-30214: Generalize log filename in IO Error message --- mysql-test/suite/rpl/r/rpl_manual_change_index_file.result | 2 +- mysql-test/suite/rpl/t/rpl_manual_change_index_file.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index 78a86437867..15ecb55b016 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -8,7 +8,7 @@ FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); connection slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000002' at XXX, the last byte read from 'master-bin.000002' at XXX.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event 'FILE' at XXX, the last event read from 'master-bin.000002' at XXX, the last byte read from 'master-bin.000002' at XXX.'' connection master; CREATE TABLE t2(c1 INT); FLUSH LOGS; diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 1c087c550d0..2b69ef2e82a 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -62,7 +62,7 @@ connection slave; --let $slave_io_errno= 1236 --let $show_slave_io_error= 1 # Mask line numbers ---let $slave_io_error_replace= / at [0-9]*/ at XXX/ +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /the first event '(\.|master-bin.000001)'/the first event 'FILE'/ --source include/wait_for_slave_io_error.inc connection master; From d657f18ea787dbf31460c77cb8fc56c01730b895 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 27 May 2023 16:31:22 +0300 Subject: [PATCH 39/80] MDEV-31226 Server crash or assertion failure with row size close to join_buffer_size The problem was that JOIN_CACHE::alloc_buffer() did not check if the given join_buffer_value is less than the query require. Added a check for this and disabled join cache if it cannot be used. --- mysql-test/main/join_cache.result | 23 +++++++++++++++++++++++ mysql-test/main/join_cache.test | 17 +++++++++++++++++ sql/sql_join_cache.cc | 3 +++ 3 files changed, 43 insertions(+) diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index 6b39f936628..20980d09001 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -6233,3 +6233,26 @@ set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; +# +# MDEV-31226 Server crash or assertion failure with row size close to +# join_buffer_size +# +set @org_optimizer_switch=@@optimizer_switch; +set @org_join_buffer_size=@@join_buffer_size; +CREATE TABLE t (f VARCHAR(16384)) ENGINE=MyISAM CHARACTER SET utf8; +INSERT INTO t VALUES (REPEAT('a',16384)),(REPEAT('b',16384)); +SET OPTIMIZER_SWITCH = 'optimize_join_buffer_size=off'; +SET JOIN_BUFFER_SIZE = 16384; +explain SELECT length(concat(t1.f,t2.f)) FROM t t1, t t2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +SELECT length(concat(t1.f,t2.f)) FROM t t1, t t2; +length(concat(t1.f,t2.f)) +32768 +32768 +32768 +32768 +DROP TABLE t; +set @@optimizer_switch=@org_optimizer_switch; +set @@join_buffer_size=@org_join_buffer_size; diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index 07ac0b760cf..6a5ee8cb533 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4207,3 +4207,20 @@ set @@optimizer_switch=@save_optimizer_switch; set global innodb_stats_persistent= @innodb_stats_persistent_save; set global innodb_stats_persistent_sample_pages= @innodb_stats_persistent_sample_pages_save; + +--echo # +--echo # MDEV-31226 Server crash or assertion failure with row size close to +--echo # join_buffer_size +--echo # + +set @org_optimizer_switch=@@optimizer_switch; +set @org_join_buffer_size=@@join_buffer_size; +CREATE TABLE t (f VARCHAR(16384)) ENGINE=MyISAM CHARACTER SET utf8; +INSERT INTO t VALUES (REPEAT('a',16384)),(REPEAT('b',16384)); +SET OPTIMIZER_SWITCH = 'optimize_join_buffer_size=off'; +SET JOIN_BUFFER_SIZE = 16384; +explain SELECT length(concat(t1.f,t2.f)) FROM t t1, t t2; +SELECT length(concat(t1.f,t2.f)) FROM t t1, t t2; +DROP TABLE t; +set @@optimizer_switch=@org_optimizer_switch; +set @@join_buffer_size=@org_join_buffer_size; diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 7d61ce31cca..1319fd59a99 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -945,6 +945,9 @@ int JOIN_CACHE::alloc_buffer() join_buff_space_limit)) goto fail; // Fatal error } + else if (curr_min_buff_space_sz > buff_size) + goto fail; + if (for_explain_only) return 0; From 1d0e3d80d84c2b375a444cdbb41c28afd78e98b0 Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Tue, 9 May 2023 15:39:15 +0200 Subject: [PATCH 40/80] MDEV-31230: Fix CONNECT_JDBC in CMake - Fix feature summary - Use native CMake module instead of `CMAKE_MODULE_PATH` - Make Java and JNI package as required Reviewer: --- cmake/FindJNI.cmake | 13 --------- cmake/FindJava.cmake | 13 --------- storage/connect/CMakeLists.txt | 53 +++++++++++++++++----------------- 3 files changed, 26 insertions(+), 53 deletions(-) delete mode 100644 cmake/FindJNI.cmake delete mode 100644 cmake/FindJava.cmake diff --git a/cmake/FindJNI.cmake b/cmake/FindJNI.cmake deleted file mode 100644 index b2c6f849c87..00000000000 --- a/cmake/FindJNI.cmake +++ /dev/null @@ -1,13 +0,0 @@ -if(JAVA_AWT_LIBRARY AND JAVA_INCLUDE_PATH) - set(JNI_FOUND TRUE) - return() -endif() -if(DEFINED JAVA_AWT_LIBRARY) - set(JNI_FOUND FALSE) - return() -endif() - -set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) -unset(CMAKE_MODULE_PATH) -include(FindJNI) -set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) diff --git a/cmake/FindJava.cmake b/cmake/FindJava.cmake deleted file mode 100644 index 714f56b1f72..00000000000 --- a/cmake/FindJava.cmake +++ /dev/null @@ -1,13 +0,0 @@ -if(Java_JAVA_EXECUTABLE) - set(JAVA_FOUND TRUE) - return() -endif() -if(DEFINED Java_JAVA_EXECUTABLE) - set(JAVA_FOUND FALSE) - return() -endif() - -set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) -unset(CMAKE_MODULE_PATH) -include(FindJava) -set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index d4c19e9e34b..d225f27c1c2 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -270,40 +270,39 @@ ADD_FEATURE_INFO(CONNECT_ODBC ODBC_LIBRARY "Support for ODBC in the CONNECT stor # # JDBC with MongoDB Java Driver included but disabled if without MONGO # + OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) IF(CONNECT_WITH_JDBC) - FIND_PACKAGE(Java 1.6) + SET(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) + UNSET(CMAKE_MODULE_PATH) + FIND_PACKAGE(Java 1.6 REQUIRED) SET_PACKAGE_PROPERTIES(Java PROPERTIES TYPE OPTIONAL) - FIND_PACKAGE(JNI) + FIND_PACKAGE(JNI REQUIRED) SET_PACKAGE_PROPERTIES(JNI PROPERTIES TYPE OPTIONAL) - IF (JAVA_FOUND AND JNI_FOUND) - INCLUDE(UseJava) - INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) - INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2}) - # SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked + INCLUDE(UseJava) + INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) + INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2}) + # SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked + SET(CONNECT_SOURCES ${CONNECT_SOURCES} + javaconn.cpp jdbconn.cpp tabjdbc.cpp + jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp + jdbccat.h javaconn.h jdbconn.h tabjdbc.h + jmgfam.h jmgoconn.h mongo.h tabjmg.h + JdbcInterface.java ApacheInterface.java MariadbInterface.java + MysqlInterface.java OracleInterface.java PostgresqlInterface.java + Mongo2Interface.java Mongo3Interface.java + mysql-test/connect/std_data/JavaWrappers.jar) + add_definitions(-DJAVA_SUPPORT) + IF(CONNECT_WITH_MONGO) SET(CONNECT_SOURCES ${CONNECT_SOURCES} - javaconn.cpp jdbconn.cpp tabjdbc.cpp - jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp - jdbccat.h javaconn.h jdbconn.h tabjdbc.h - jmgfam.h jmgoconn.h mongo.h tabjmg.h - JdbcInterface.java ApacheInterface.java MariadbInterface.java - MysqlInterface.java OracleInterface.java PostgresqlInterface.java - Mongo2Interface.java Mongo3Interface.java - mysql-test/connect/std_data/JavaWrappers.jar) - add_definitions(-DJAVA_SUPPORT) - ADD_FEATURE_INFO(CONNECT_JDBC "ON" "Support for JDBC in the CONNECT storage engine") - IF(CONNECT_WITH_MONGO) - SET(CONNECT_SOURCES ${CONNECT_SOURCES} - mysql-test/connect/std_data/Mongo2.jar - mysql-test/connect/std_data/Mongo3.jar) - add_definitions(-DMONGO_SUPPORT) - ENDIF() - ELSE() - SET(JDBC_LIBRARY "") - ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine") - ENDIF() + mysql-test/connect/std_data/Mongo2.jar + mysql-test/connect/std_data/Mongo3.jar) + add_definitions(-DMONGO_SUPPORT) + ENDIF(CONNECT_WITH_MONGO) + SET(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) + ADD_FEATURE_INFO(CONNECT_JDBC "ON" "Support for JDBC in the CONNECT storage engine") ELSE(CONNECT_WITH_JDBC) ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine") ENDIF(CONNECT_WITH_JDBC) From 94e5b43ff5affe8337c93ab6b8e13c827f132518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 25 May 2023 15:26:46 +0300 Subject: [PATCH 41/80] MDEV-31335 : Create sequence can cause inconsistency Do not start TOI for CREATE TEMPORARY SEQUENCE because object is local only and not replicated. Similarly, avoid starting RSU for TEMPORARY SEQUENCEs. Finally, we need to run commit hooks for TEMPORARY SEQUENCEs because CREATE TEMPORARY SEQUENCE does implicit commit for previous changes that need to be replicated and committed. Signed-off-by: Julius Goryavsky --- .../suite/galera/r/galera_sequences.result | 9 ++-- .../r/galera_temporary_sequences.result | 46 +++++++++++++++++++ .../suite/galera/t/galera_sequences.test | 16 +++---- .../galera/t/galera_temporary_sequences.test | 37 +++++++++++++++ sql/wsrep_mysqld.cc | 17 +++++++ sql/wsrep_trans_observer.h | 11 +++-- 6 files changed, 121 insertions(+), 15 deletions(-) create mode 100644 mysql-test/suite/galera/r/galera_temporary_sequences.result create mode 100644 mysql-test/suite/galera/t/galera_temporary_sequences.test diff --git a/mysql-test/suite/galera/r/galera_sequences.result b/mysql-test/suite/galera/r/galera_sequences.result index ec3adec8924..e696a707cdf 100644 --- a/mysql-test/suite/galera/r/galera_sequences.result +++ b/mysql-test/suite/galera/r/galera_sequences.result @@ -79,30 +79,31 @@ SET SESSION autocommit=1; DROP SEQUENCE seq1; DROP SEQUENCE seq2; DROP TABLE t2; +connection node_2; SET SESSION AUTOCOMMIT=0; SET SESSION wsrep_OSU_method='RSU'; CREATE TABLE t1(c1 VARCHAR(10)); -INSERT INTO t1 (c1) VALUES(''); create temporary sequence sq1 NOCACHE engine=innodb; create sequence sq2 NOCACHE engine=innodb; COMMIT; +SET SESSION wsrep_OSU_method='TOI'; SHOW CREATE SEQUENCE sq1; Table Create Table sq1 CREATE SEQUENCE `sq1` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB SHOW CREATE SEQUENCE sq2; Table Create Table sq2 CREATE SEQUENCE `sq2` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 nocache nocycle ENGINE=InnoDB -connection node_2; +connection node_1; SHOW CREATE SEQUENCE sq1; ERROR 42S02: Table 'test.sq1' doesn't exist SHOW CREATE SEQUENCE sq2; ERROR 42S02: Table 'test.sq2' doesn't exist -connection node_1; +connection node_2; SET SESSION AUTOCOMMIT=1; DROP TABLE t1; DROP SEQUENCE sq1; DROP SEQUENCE sq2; -SET SESSION wsrep_OSU_method='TOI'; +connection node_1; CREATE TABLE t (f INT) engine=innodb; LOCK TABLE t WRITE; CREATE OR REPLACE SEQUENCE t MAXVALUE=13 INCREMENT BY 1 NOCACHE engine=innodb; diff --git a/mysql-test/suite/galera/r/galera_temporary_sequences.result b/mysql-test/suite/galera/r/galera_temporary_sequences.result new file mode 100644 index 00000000000..af80551c40b --- /dev/null +++ b/mysql-test/suite/galera/r/galera_temporary_sequences.result @@ -0,0 +1,46 @@ +connection node_2; +connection node_1; +connection node_2; +SET AUTOCOMMIT=0; +SET SESSION wsrep_OSU_method='RSU'; +CREATE TABLE t (i int primary key, j int); +CREATE TEMPORARY SEQUENCE seq2 NOCACHE ENGINE=InnoDB; +COMMIT; +SET SESSION wsrep_OSU_method='RSU'; +CREATE SEQUENCE seq1 NOCACHE ENGINE=InnoDB; +SET SESSION wsrep_OSU_method='TOI'; +DROP TABLE t; +DROP SEQUENCE seq2; +DROP SEQUENCE seq1; +connection node_1; +CREATE TABLE t (i int primary key, j int) ENGINE=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t VALUES (3,0); +CREATE TEMPORARY SEQUENCE seq1 NOCACHE ENGINE=InnoDB; +COMMIT; +INSERT INTO t VALUES (4,0); +CREATE SEQUENCE seq2 NOCACHE ENGINE=InnoDB; +commit; +connection node_2; +SELECT * FROM t; +i j +3 0 +4 0 +SHOW CREATE TABLE seq1; +ERROR 42S02: Table 'test.seq1' doesn't exist +SHOW CREATE TABLE seq2; +Table Create Table +seq2 CREATE TABLE `seq2` ( + `next_not_cached_value` bigint(21) NOT NULL, + `minimum_value` bigint(21) NOT NULL, + `maximum_value` bigint(21) NOT NULL, + `start_value` bigint(21) NOT NULL COMMENT 'start value when sequences is created or value if RESTART is used', + `increment` bigint(21) NOT NULL COMMENT 'increment value', + `cache_size` bigint(21) unsigned NOT NULL, + `cycle_option` tinyint(1) unsigned NOT NULL COMMENT '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed', + `cycle_count` bigint(21) NOT NULL COMMENT 'How many cycles have been done' +) ENGINE=InnoDB SEQUENCE=1 +connection node_1; +DROP TABLE t; +DROP SEQUENCE seq1; +DROP SEQUENCE seq2; diff --git a/mysql-test/suite/galera/t/galera_sequences.test b/mysql-test/suite/galera/t/galera_sequences.test index 2582c204435..5c03ab973e0 100644 --- a/mysql-test/suite/galera/t/galera_sequences.test +++ b/mysql-test/suite/galera/t/galera_sequences.test @@ -72,33 +72,33 @@ DROP TABLE t2; # # Case2 # +--connection node_2 SET SESSION AUTOCOMMIT=0; SET SESSION wsrep_OSU_method='RSU'; CREATE TABLE t1(c1 VARCHAR(10)); -INSERT INTO t1 (c1) VALUES(''); create temporary sequence sq1 NOCACHE engine=innodb; create sequence sq2 NOCACHE engine=innodb; COMMIT; +SET SESSION wsrep_OSU_method='TOI'; SHOW CREATE SEQUENCE sq1; SHOW CREATE SEQUENCE sq2; ---connection node_2 ---error ER_NO_SUCH_TABLE -SHOW CREATE SEQUENCE sq1; ---error ER_NO_SUCH_TABLE -SHOW CREATE SEQUENCE sq2; --connection node_1 +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE sq1; +--error ER_NO_SUCH_TABLE +SHOW CREATE SEQUENCE sq2; +--connection node_2 SET SESSION AUTOCOMMIT=1; DROP TABLE t1; DROP SEQUENCE sq1; DROP SEQUENCE sq2; -SET SESSION wsrep_OSU_method='TOI'; # # MDEV-30388 Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command == SQLCOM_CREATE_TABLE # && !thd->is_current_stmt_binlog_format_row()) || # thd->wsrep_cs().transaction().state() == wsrep::transaction::s_aborted' failed # - +--connection node_1 CREATE TABLE t (f INT) engine=innodb; LOCK TABLE t WRITE; CREATE OR REPLACE SEQUENCE t MAXVALUE=13 INCREMENT BY 1 NOCACHE engine=innodb; diff --git a/mysql-test/suite/galera/t/galera_temporary_sequences.test b/mysql-test/suite/galera/t/galera_temporary_sequences.test new file mode 100644 index 00000000000..c46c4243514 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_temporary_sequences.test @@ -0,0 +1,37 @@ +--source include/galera_cluster.inc +--source include/have_sequence.inc + +--connection node_2 +SET AUTOCOMMIT=0; +SET SESSION wsrep_OSU_method='RSU'; +CREATE TABLE t (i int primary key, j int); +CREATE TEMPORARY SEQUENCE seq2 NOCACHE ENGINE=InnoDB; +COMMIT; +SET SESSION wsrep_OSU_method='RSU'; +CREATE SEQUENCE seq1 NOCACHE ENGINE=InnoDB; +SET SESSION wsrep_OSU_method='TOI'; +DROP TABLE t; +DROP SEQUENCE seq2; +DROP SEQUENCE seq1; + +--connection node_1 +CREATE TABLE t (i int primary key, j int) ENGINE=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t VALUES (3,0); +CREATE TEMPORARY SEQUENCE seq1 NOCACHE ENGINE=InnoDB; +COMMIT; +INSERT INTO t VALUES (4,0); +CREATE SEQUENCE seq2 NOCACHE ENGINE=InnoDB; +commit; + +--connection node_2 +SELECT * FROM t; +--error ER_NO_SUCH_TABLE +SHOW CREATE TABLE seq1; +SHOW CREATE TABLE seq2; + + +--connection node_1 +DROP TABLE t; +DROP SEQUENCE seq1; +DROP SEQUENCE seq2; diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 903ed56d948..a8247f977cf 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1975,6 +1975,15 @@ static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table, } return true; + case SQLCOM_CREATE_SEQUENCE: + /* No TOI for temporary sequences as they are + not replicated */ + if (thd->lex->tmp_table()) + { + return false; + } + return true; + default: if (table && !thd->find_temporary_table(db, table)) { @@ -2233,6 +2242,14 @@ static int wsrep_RSU_begin(THD *thd, const char *db_, const char *table_) { WSREP_DEBUG("RSU BEGIN: %lld, : %s", wsrep_thd_trx_seqno(thd), wsrep_thd_query(thd)); + + /* For CREATE TEMPORARY SEQUENCE we do not start RSU because + object is local only and actually CREATE TABLE + INSERT + */ + if (thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE && + thd->lex->tmp_table()) + return 1; + if (thd->wsrep_cs().begin_rsu(5000)) { WSREP_WARN("RSU begin failed"); diff --git a/sql/wsrep_trans_observer.h b/sql/wsrep_trans_observer.h index 83079d5a083..4c9346739fe 100644 --- a/sql/wsrep_trans_observer.h +++ b/sql/wsrep_trans_observer.h @@ -217,13 +217,18 @@ static inline bool wsrep_run_commit_hook(THD* thd, bool all) mysql_mutex_lock(&thd->LOCK_thd_data); /* Transaction creating sequence is TOI or RSU, - CREATE [TEMPORARY] SEQUENCE = CREATE + INSERT (initial value) + CREATE SEQUENCE = CREATE + INSERT (initial value) and replicated using statement based replication, thus - the commit hooks will be skipped */ + the commit hooks will be skipped. + + For TEMPORARY SEQUENCES commit hooks will be done as + CREATE + INSERT is not replicated and needs to be + committed locally. */ if (ret && (thd->wsrep_cs().mode() == wsrep::client_state::m_toi || thd->wsrep_cs().mode() == wsrep::client_state::m_rsu) && - thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE) + thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE && + !thd->lex->tmp_table()) ret= false; mysql_mutex_unlock(&thd->LOCK_thd_data); From 2771890bab51f716c36541e51940b8b056ca6933 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 18 May 2023 12:08:40 +1000 Subject: [PATCH 42/80] =?UTF-8?q?MDEV-31301=20sql/opt=5Fsplit.cc:1043:5:?= =?UTF-8?q?=20warning:=20=E2=80=98best=5Fparam=5Ftables=E2=80=99=20may=20b?= =?UTF-8?q?e=20used=20uninitialized?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The warning is true, it needs to be initialized. Caused by: MDEV-26301 / ce7ffe61d836 --- sql/opt_split.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/opt_split.cc b/sql/opt_split.cc index 6d816552baf..3b3658cb66b 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -963,7 +963,7 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx, SplM_plan_info *spl_plan= 0; uint best_key= 0; uint best_key_parts= 0; - table_map best_param_tables; + table_map best_param_tables= 0L; Json_writer_object trace_obj(thd, "choose_best_splitting"); Json_writer_array trace_arr(thd, "considered_keys"); /* From bd1eb89d7fa90b950bcf0dd0bfad4254965d1283 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 2 Jun 2023 10:52:28 +1000 Subject: [PATCH 43/80] Adding .ccls-cache/ to .gitignore generated by the language server ccls --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 437bd2023d7..afbd26ec2a5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.rpm .*.swp *.ninja +.ccls-cache/ .ninja_* .gdb_history .vs/ From dc9498beb6f79f08edd02fb7f7153e5150a33f7d Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 2 Jun 2023 09:02:09 +0200 Subject: [PATCH 44/80] Revert "MDEV-31230: Fix CONNECT_JDBC in CMake" This reverts commit 1d0e3d80d84c2b375a444cdbb41c28afd78e98b0. --- cmake/FindJNI.cmake | 13 +++++++++ cmake/FindJava.cmake | 13 +++++++++ storage/connect/CMakeLists.txt | 53 +++++++++++++++++----------------- 3 files changed, 53 insertions(+), 26 deletions(-) create mode 100644 cmake/FindJNI.cmake create mode 100644 cmake/FindJava.cmake diff --git a/cmake/FindJNI.cmake b/cmake/FindJNI.cmake new file mode 100644 index 00000000000..b2c6f849c87 --- /dev/null +++ b/cmake/FindJNI.cmake @@ -0,0 +1,13 @@ +if(JAVA_AWT_LIBRARY AND JAVA_INCLUDE_PATH) + set(JNI_FOUND TRUE) + return() +endif() +if(DEFINED JAVA_AWT_LIBRARY) + set(JNI_FOUND FALSE) + return() +endif() + +set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) +unset(CMAKE_MODULE_PATH) +include(FindJNI) +set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) diff --git a/cmake/FindJava.cmake b/cmake/FindJava.cmake new file mode 100644 index 00000000000..714f56b1f72 --- /dev/null +++ b/cmake/FindJava.cmake @@ -0,0 +1,13 @@ +if(Java_JAVA_EXECUTABLE) + set(JAVA_FOUND TRUE) + return() +endif() +if(DEFINED Java_JAVA_EXECUTABLE) + set(JAVA_FOUND FALSE) + return() +endif() + +set(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) +unset(CMAKE_MODULE_PATH) +include(FindJava) +set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index d225f27c1c2..d4c19e9e34b 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -270,39 +270,40 @@ ADD_FEATURE_INFO(CONNECT_ODBC ODBC_LIBRARY "Support for ODBC in the CONNECT stor # # JDBC with MongoDB Java Driver included but disabled if without MONGO # - OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) IF(CONNECT_WITH_JDBC) - SET(orig_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) - UNSET(CMAKE_MODULE_PATH) - FIND_PACKAGE(Java 1.6 REQUIRED) + FIND_PACKAGE(Java 1.6) SET_PACKAGE_PROPERTIES(Java PROPERTIES TYPE OPTIONAL) - FIND_PACKAGE(JNI REQUIRED) + FIND_PACKAGE(JNI) SET_PACKAGE_PROPERTIES(JNI PROPERTIES TYPE OPTIONAL) - INCLUDE(UseJava) - INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) - INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2}) - # SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked - SET(CONNECT_SOURCES ${CONNECT_SOURCES} - javaconn.cpp jdbconn.cpp tabjdbc.cpp - jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp - jdbccat.h javaconn.h jdbconn.h tabjdbc.h - jmgfam.h jmgoconn.h mongo.h tabjmg.h - JdbcInterface.java ApacheInterface.java MariadbInterface.java - MysqlInterface.java OracleInterface.java PostgresqlInterface.java - Mongo2Interface.java Mongo3Interface.java - mysql-test/connect/std_data/JavaWrappers.jar) - add_definitions(-DJAVA_SUPPORT) - IF(CONNECT_WITH_MONGO) + IF (JAVA_FOUND AND JNI_FOUND) + INCLUDE(UseJava) + INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) + INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2}) + # SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked SET(CONNECT_SOURCES ${CONNECT_SOURCES} - mysql-test/connect/std_data/Mongo2.jar - mysql-test/connect/std_data/Mongo3.jar) - add_definitions(-DMONGO_SUPPORT) - ENDIF(CONNECT_WITH_MONGO) - SET(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) - ADD_FEATURE_INFO(CONNECT_JDBC "ON" "Support for JDBC in the CONNECT storage engine") + javaconn.cpp jdbconn.cpp tabjdbc.cpp + jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp + jdbccat.h javaconn.h jdbconn.h tabjdbc.h + jmgfam.h jmgoconn.h mongo.h tabjmg.h + JdbcInterface.java ApacheInterface.java MariadbInterface.java + MysqlInterface.java OracleInterface.java PostgresqlInterface.java + Mongo2Interface.java Mongo3Interface.java + mysql-test/connect/std_data/JavaWrappers.jar) + add_definitions(-DJAVA_SUPPORT) + ADD_FEATURE_INFO(CONNECT_JDBC "ON" "Support for JDBC in the CONNECT storage engine") + IF(CONNECT_WITH_MONGO) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} + mysql-test/connect/std_data/Mongo2.jar + mysql-test/connect/std_data/Mongo3.jar) + add_definitions(-DMONGO_SUPPORT) + ENDIF() + ELSE() + SET(JDBC_LIBRARY "") + ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine") + ENDIF() ELSE(CONNECT_WITH_JDBC) ADD_FEATURE_INFO(CONNECT_JDBC "OFF" "Support for JDBC in the CONNECT storage engine") ENDIF(CONNECT_WITH_JDBC) From 270c233847cb89ccab28c58c85251a8fba9fbcda Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 2 Jun 2023 10:46:02 +0200 Subject: [PATCH 45/80] clarify why cmake is looking for Java and JNI --- storage/connect/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index d4c19e9e34b..20cd4ad3ee1 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -275,9 +275,11 @@ OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) IF(CONNECT_WITH_JDBC) FIND_PACKAGE(Java 1.6) - SET_PACKAGE_PROPERTIES(Java PROPERTIES TYPE OPTIONAL) + SET_PACKAGE_PROPERTIES(Java PROPERTIES TYPE OPTIONAL + PURPOSE "Required for the CONNECT_JDBC feature") FIND_PACKAGE(JNI) - SET_PACKAGE_PROPERTIES(JNI PROPERTIES TYPE OPTIONAL) + SET_PACKAGE_PROPERTIES(JNI PROPERTIES TYPE OPTIONAL + PURPOSE "Required for the CONNECT_JDBC feature") IF (JAVA_FOUND AND JNI_FOUND) INCLUDE(UseJava) INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH}) From d785fa8d0bf3ca8521ef304838c6fa817e8f1b0c Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 2 Jun 2023 12:12:00 +0200 Subject: [PATCH 46/80] cmake warnings --- CMakeLists.txt | 4 ++-- storage/mroonga/vendor/groonga/CMakeLists.txt | 2 +- .../vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt | 2 +- storage/tokudb/CMakeLists.txt | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78ff7c0fb9b..7e5f3e157c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,6 @@ IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "None" "Debug" "Release" "MinSizeRel" "RelWithDebInfo") ENDIF() -PROJECT(MySQL) - IF(POLICY CMP0022) CMAKE_POLICY(SET CMP0022 NEW) ENDIF() @@ -42,6 +40,8 @@ IF(POLICY CMP0075) CMAKE_POLICY(SET CMP0075 NEW) ENDIF() +PROJECT(MySQL) + MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} diff --git a/storage/mroonga/vendor/groonga/CMakeLists.txt b/storage/mroonga/vendor/groonga/CMakeLists.txt index 8afa53be1e0..1d106588fd8 100644 --- a/storage/mroonga/vendor/groonga/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/CMakeLists.txt @@ -15,7 +15,7 @@ # https://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/5263/steps/compile/logs/stdio # says CMake 2.6.2... We want to drop old software support... -cmake_minimum_required(VERSION 2.6.2) +cmake_minimum_required(VERSION 2.8.12) # cmake_minimum_required(VERSION 2.6.4) # CentOS 5 set(GRN_PROJECT_NAME "groonga") set(GRN_PROJECT_LABEL "Groonga") diff --git a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt index 4c2aa343089..96f9b3e6bbf 100644 --- a/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt +++ b/storage/mroonga/vendor/groonga/vendor/plugins/groonga-normalizer-mysql/CMakeLists.txt @@ -15,7 +15,7 @@ # Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1335 USA -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME) set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql") endif() diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index ee91807c619..65110f7d8bd 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -3,6 +3,10 @@ SET(CPACK_RPM_tokudb-engine_PACKAGE_DESCRIPTION "The TokuDB storage engine is fo environments, offering increased compression and better performance based on fractal indexes." PARENT_SCOPE) +IF(POLICY CMP0115) + CMAKE_POLICY(SET CMP0115 OLD) +ENDIF() + SET(TOKUDB_VERSION 5.6.49-89.0) # PerconaFT only supports x86-64 and cmake-2.8.9+ IF(WIN32) From d14c485e1c5c9a53dcfc64ae17c66212cbbf7df5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 2 Jun 2023 12:49:17 +0200 Subject: [PATCH 47/80] test fixes for 32bit * disable main.join_cache_notasan on 32bit as it uses join_buffer_size=5250229460064350213; * update sysvars_server_embedded,32bit.rdiff --- mysql-test/main/join_cache_notasan.test | 1 + .../r/sysvars_server_embedded,32bit.rdiff | 277 +++++++++--------- 2 files changed, 135 insertions(+), 143 deletions(-) diff --git a/mysql-test/main/join_cache_notasan.test b/mysql-test/main/join_cache_notasan.test index 7fd5e4e80b1..cfdfe4eff18 100644 --- a/mysql-test/main/join_cache_notasan.test +++ b/mysql-test/main/join_cache_notasan.test @@ -1,6 +1,7 @@ # # Tests that should be in join_cache but cannot be run with ASAN +--source include/have_64bit.inc --source include/not_asan.inc --source include/have_innodb.inc diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff index 6fa25546ad1..d869b2812f0 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff @@ -1,7 +1,7 @@ --- ../../mysql-test/suite/sys_vars/r/sysvars_server_embedded.result 2022-01-27 20:42:19.039084441 +0200 +++ ../../mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.result~ 2022-01-28 16:12:40.038627481 +0200 -@@ -14,7 +14,7 @@ - order by variable_name; +@@ -34,7 +34,7 @@ READ_ONLY NO + COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_BLOCK_SIZE VARIABLE_SCOPE GLOBAL -VARIABLE_TYPE BIGINT UNSIGNED @@ -45,7 +45,7 @@ VARIABLE_COMMENT Interval between commite in microseconds (1/1000000c). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -104,7 +104,7 @@ READ_ONLY NO +@@ -114,7 +114,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_LOG_FILE_SIZE VARIABLE_SCOPE GLOBAL @@ -54,7 +54,7 @@ VARIABLE_COMMENT Limit for transaction log size NUMERIC_MIN_VALUE 8388608 NUMERIC_MAX_VALUE 4294967295 -@@ -134,10 +134,10 @@ READ_ONLY NO +@@ -144,10 +144,10 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_PAGECACHE_AGE_THRESHOLD VARIABLE_SCOPE GLOBAL @@ -67,7 +67,7 @@ NUMERIC_BLOCK_SIZE 100 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -154,7 +154,7 @@ READ_ONLY YES +@@ -164,7 +164,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_PAGECACHE_DIVISION_LIMIT VARIABLE_SCOPE GLOBAL @@ -76,7 +76,7 @@ VARIABLE_COMMENT The minimum percentage of warm blocks in key cache NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100 -@@ -164,7 +164,7 @@ READ_ONLY NO +@@ -174,7 +174,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ARIA_PAGECACHE_FILE_HASH_SIZE VARIABLE_SCOPE GLOBAL @@ -85,7 +85,7 @@ VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files. NUMERIC_MIN_VALUE 128 NUMERIC_MAX_VALUE 16384 -@@ -194,7 +194,7 @@ READ_ONLY NO +@@ -204,7 +204,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME ARIA_REPAIR_THREADS VARIABLE_SCOPE SESSION @@ -94,16 +94,16 @@ VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 128 -@@ -207,7 +207,7 @@ VARIABLE_SCOPE SESSION +@@ -217,7 +217,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE. NUMERIC_MIN_VALUE 16376 --NUMERIC_MAX_VALUE 18446744073709551615 +-NUMERIC_MAX_VALUE 1152921504606846975 +NUMERIC_MAX_VALUE 268435455 NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -264,7 +264,7 @@ READ_ONLY NO +@@ -274,7 +274,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME AUTO_INCREMENT_INCREMENT VARIABLE_SCOPE SESSION @@ -112,7 +112,7 @@ VARIABLE_COMMENT Auto-increment columns are incremented by this NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 65535 -@@ -274,7 +274,7 @@ READ_ONLY NO +@@ -284,7 +284,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME AUTO_INCREMENT_OFFSET VARIABLE_SCOPE SESSION @@ -121,7 +121,7 @@ VARIABLE_COMMENT Offset added to Auto-increment columns. Used when auto-increment-increment != 1 NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 65535 -@@ -284,7 +284,7 @@ READ_ONLY NO +@@ -294,7 +294,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME BACK_LOG VARIABLE_SCOPE GLOBAL @@ -130,7 +130,7 @@ VARIABLE_COMMENT The number of outstanding connection requests MariaDB can have. This comes into play when the main MariaDB thread gets very many connection requests in a very short time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -337,7 +337,7 @@ VARIABLE_SCOPE GLOBAL +@@ -347,7 +347,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the transactional cache for updates to transactional engines for the binary log. If you often use transactions containing many statements, you can increase this to get more performance NUMERIC_MIN_VALUE 4096 @@ -139,7 +139,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -354,20 +354,20 @@ READ_ONLY NO +@@ -364,20 +364,20 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME BINLOG_COMMIT_WAIT_COUNT VARIABLE_SCOPE GLOBAL @@ -164,7 +164,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -387,7 +387,7 @@ VARIABLE_SCOPE GLOBAL +@@ -397,7 +397,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of file cache for the binary log NUMERIC_MIN_VALUE 8192 @@ -173,7 +173,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -427,7 +427,7 @@ VARIABLE_SCOPE GLOBAL +@@ -437,7 +437,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance. NUMERIC_MIN_VALUE 4096 @@ -182,7 +182,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -437,7 +437,7 @@ VARIABLE_SCOPE SESSION +@@ -447,7 +447,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread! NUMERIC_MIN_VALUE 0 @@ -191,7 +191,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -624,7 +624,7 @@ READ_ONLY NO +@@ -634,7 +634,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME CONNECT_TIMEOUT VARIABLE_SCOPE GLOBAL @@ -200,7 +200,7 @@ VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake' NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 31536000 -@@ -674,7 +674,7 @@ READ_ONLY YES +@@ -684,7 +684,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG VARIABLE_SCOPE SESSION @@ -209,7 +209,7 @@ VARIABLE_COMMENT Long search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 33 -@@ -684,7 +684,7 @@ READ_ONLY NO +@@ -694,7 +694,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT VARIABLE_SCOPE SESSION @@ -218,7 +218,7 @@ VARIABLE_COMMENT Short search depth for the two-step deadlock detection NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 32 -@@ -694,7 +694,7 @@ READ_ONLY NO +@@ -704,7 +704,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_TIMEOUT_LONG VARIABLE_SCOPE SESSION @@ -227,7 +227,7 @@ VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -704,7 +704,7 @@ READ_ONLY NO +@@ -714,7 +714,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT VARIABLE_SCOPE SESSION @@ -236,7 +236,7 @@ VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds) NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -754,7 +754,7 @@ READ_ONLY NO +@@ -764,7 +764,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME DEFAULT_WEEK_FORMAT VARIABLE_SCOPE SESSION @@ -245,7 +245,7 @@ VARIABLE_COMMENT The default week format used by WEEK() functions NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 7 -@@ -764,7 +764,7 @@ READ_ONLY NO +@@ -774,7 +774,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DELAYED_INSERT_LIMIT VARIABLE_SCOPE GLOBAL @@ -254,7 +254,7 @@ VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -774,7 +774,7 @@ READ_ONLY NO +@@ -784,7 +784,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DELAYED_INSERT_TIMEOUT VARIABLE_SCOPE GLOBAL @@ -263,7 +263,7 @@ VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -784,7 +784,7 @@ READ_ONLY NO +@@ -794,7 +794,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME DELAYED_QUEUE_SIZE VARIABLE_SCOPE GLOBAL @@ -272,7 +272,7 @@ VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -814,7 +814,7 @@ READ_ONLY NO +@@ -824,7 +824,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME DIV_PRECISION_INCREMENT VARIABLE_SCOPE SESSION @@ -281,7 +281,7 @@ VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 38 -@@ -894,7 +894,7 @@ READ_ONLY NO +@@ -904,7 +904,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME EXPIRE_LOGS_DAYS VARIABLE_SCOPE GLOBAL @@ -290,7 +290,7 @@ VARIABLE_COMMENT If non-zero, binary logs will be purged after expire_logs_days days; possible purges happen at startup and at binary log rotation NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 99 -@@ -924,7 +924,7 @@ READ_ONLY YES +@@ -934,7 +934,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME EXTRA_MAX_CONNECTIONS VARIABLE_SCOPE GLOBAL @@ -299,7 +299,7 @@ VARIABLE_COMMENT The number of connections on extra-port NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -954,7 +954,7 @@ READ_ONLY NO +@@ -964,7 +964,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME FLUSH_TIME VARIABLE_SCOPE GLOBAL @@ -308,7 +308,7 @@ VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -984,7 +984,7 @@ READ_ONLY NO +@@ -994,7 +994,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME FT_MAX_WORD_LEN VARIABLE_SCOPE GLOBAL @@ -317,7 +317,7 @@ VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 84 -@@ -994,7 +994,7 @@ READ_ONLY YES +@@ -1004,7 +1004,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME FT_MIN_WORD_LEN VARIABLE_SCOPE GLOBAL @@ -326,7 +326,7 @@ VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 84 -@@ -1004,7 +1004,7 @@ READ_ONLY YES +@@ -1014,7 +1014,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT VARIABLE_SCOPE GLOBAL @@ -335,16 +335,7 @@ VARIABLE_COMMENT Number of best matches to use for query expansion NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1000 -@@ -1047,7 +1047,7 @@ VARIABLE_SCOPE SESSION - VARIABLE_TYPE BIGINT UNSIGNED - VARIABLE_COMMENT The maximum length of the result of function GROUP_CONCAT() - NUMERIC_MIN_VALUE 4 --NUMERIC_MAX_VALUE 18446744073709551615 -+NUMERIC_MAX_VALUE 4294967295 - NUMERIC_BLOCK_SIZE 1 - ENUM_VALUE_LIST NULL - READ_ONLY NO -@@ -1174,7 +1174,7 @@ READ_ONLY YES +@@ -1184,7 +1184,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME HISTOGRAM_SIZE VARIABLE_SCOPE SESSION @@ -353,7 +344,7 @@ VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1204,7 +1204,7 @@ READ_ONLY YES +@@ -1214,7 +1214,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME HOST_CACHE_SIZE VARIABLE_SCOPE GLOBAL @@ -362,7 +353,7 @@ VARIABLE_COMMENT How many host names should be cached to avoid resolving. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65536 -@@ -1314,7 +1314,7 @@ READ_ONLY NO +@@ -1324,7 +1324,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME INTERACTIVE_TIMEOUT VARIABLE_SCOPE SESSION @@ -371,7 +362,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1347,7 +1347,7 @@ VARIABLE_SCOPE SESSION +@@ -1357,7 +1357,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer that is used for joins NUMERIC_MIN_VALUE 128 @@ -380,7 +371,7 @@ NUMERIC_BLOCK_SIZE 128 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1364,7 +1364,7 @@ READ_ONLY NO +@@ -1374,7 +1374,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME JOIN_CACHE_LEVEL VARIABLE_SCOPE SESSION @@ -389,7 +380,7 @@ VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 8 -@@ -1387,7 +1387,7 @@ VARIABLE_SCOPE GLOBAL +@@ -1397,7 +1397,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford NUMERIC_MIN_VALUE 0 @@ -398,7 +389,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -1544,7 +1544,7 @@ READ_ONLY YES +@@ -1554,7 +1554,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME LOCK_WAIT_TIMEOUT VARIABLE_SCOPE SESSION @@ -407,7 +398,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -1664,7 +1664,7 @@ READ_ONLY NO +@@ -1674,7 +1674,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME LOG_SLOW_RATE_LIMIT VARIABLE_SCOPE SESSION @@ -416,7 +407,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1694,7 +1694,7 @@ READ_ONLY NO +@@ -1704,7 +1704,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME LOG_WARNINGS VARIABLE_SCOPE SESSION @@ -425,7 +416,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1744,7 +1744,7 @@ READ_ONLY NO +@@ -1754,7 +1754,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME MAX_ALLOWED_PACKET VARIABLE_SCOPE SESSION @@ -434,7 +425,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1757,14 +1757,14 @@ VARIABLE_SCOPE GLOBAL +@@ -1767,14 +1767,14 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the total size of the transactional cache NUMERIC_MIN_VALUE 4096 @@ -451,7 +442,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -1777,14 +1777,14 @@ VARIABLE_SCOPE GLOBAL +@@ -1787,14 +1787,14 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the total size of the statement cache NUMERIC_MIN_VALUE 4096 @@ -468,7 +459,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 100000 -@@ -1794,7 +1794,7 @@ READ_ONLY NO +@@ -1804,7 +1804,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_CONNECT_ERRORS VARIABLE_SCOPE GLOBAL @@ -477,7 +468,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1804,7 +1804,7 @@ READ_ONLY NO +@@ -1814,7 +1814,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_DELAYED_THREADS VARIABLE_SCOPE SESSION @@ -486,7 +477,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1824,7 +1824,7 @@ READ_ONLY YES +@@ -1834,7 +1834,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_ERROR_COUNT VARIABLE_SCOPE SESSION @@ -495,7 +486,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -1837,14 +1837,14 @@ VARIABLE_SCOPE SESSION +@@ -1847,14 +1847,14 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -512,7 +503,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -1864,7 +1864,7 @@ READ_ONLY NO +@@ -1874,7 +1874,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA VARIABLE_SCOPE SESSION @@ -521,7 +512,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -1874,7 +1874,7 @@ READ_ONLY NO +@@ -1884,7 +1884,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_LONG_DATA_SIZE VARIABLE_SCOPE GLOBAL @@ -530,7 +521,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -1904,7 +1904,7 @@ READ_ONLY NO +@@ -1914,7 +1914,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_RECURSIVE_ITERATIONS VARIABLE_SCOPE SESSION @@ -539,7 +530,7 @@ VARIABLE_COMMENT Maximum number of iterations when executing recursive queries NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1917,14 +1917,14 @@ VARIABLE_SCOPE SESSION +@@ -1927,14 +1927,14 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The maximum size of the container of a rowid filter NUMERIC_MIN_VALUE 1024 @@ -556,7 +547,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1944,7 +1944,7 @@ READ_ONLY NO +@@ -1954,7 +1954,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_SORT_LENGTH VARIABLE_SCOPE SESSION @@ -565,7 +556,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 64 NUMERIC_MAX_VALUE 8388608 -@@ -1954,7 +1954,7 @@ READ_ONLY NO +@@ -1964,7 +1964,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_SP_RECURSION_DEPTH VARIABLE_SCOPE SESSION @@ -574,7 +565,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -1974,7 +1974,7 @@ READ_ONLY NO +@@ -1984,7 +1984,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_TMP_TABLES VARIABLE_SCOPE SESSION @@ -583,7 +574,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1994,7 +1994,7 @@ READ_ONLY NO +@@ -2004,7 +2004,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_WRITE_LOCK_COUNT VARIABLE_SCOPE GLOBAL @@ -592,7 +583,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2004,7 +2004,7 @@ READ_ONLY NO +@@ -2014,7 +2014,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE VARIABLE_SCOPE GLOBAL @@ -601,7 +592,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2014,7 +2014,7 @@ READ_ONLY YES +@@ -2024,7 +2024,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES VARIABLE_SCOPE GLOBAL @@ -610,7 +601,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2024,7 +2024,7 @@ READ_ONLY YES +@@ -2034,7 +2034,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT VARIABLE_SCOPE SESSION @@ -619,7 +610,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2034,7 +2034,7 @@ READ_ONLY NO +@@ -2044,7 +2044,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MRR_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -628,7 +619,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2044,17 +2044,17 @@ READ_ONLY NO +@@ -2054,17 +2054,17 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MULTI_RANGE_COUNT VARIABLE_SCOPE SESSION @@ -649,7 +640,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2064,7 +2064,7 @@ READ_ONLY YES +@@ -2074,7 +2074,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_DATA_POINTER_SIZE VARIABLE_SCOPE GLOBAL @@ -658,7 +649,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2087,7 +2087,7 @@ VARIABLE_SCOPE GLOBAL +@@ -2097,7 +2097,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables NUMERIC_MIN_VALUE 7 @@ -667,7 +658,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2104,10 +2104,10 @@ READ_ONLY YES +@@ -2114,10 +2114,10 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME MYISAM_REPAIR_THREADS VARIABLE_SCOPE SESSION @@ -680,7 +671,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2117,7 +2117,7 @@ VARIABLE_SCOPE SESSION +@@ -2127,7 +2127,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -689,7 +680,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2154,7 +2154,7 @@ READ_ONLY NO +@@ -2164,7 +2164,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME NET_BUFFER_LENGTH VARIABLE_SCOPE SESSION @@ -698,7 +689,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2164,7 +2164,7 @@ READ_ONLY NO +@@ -2174,7 +2174,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME NET_READ_TIMEOUT VARIABLE_SCOPE SESSION @@ -707,7 +698,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2174,7 +2174,7 @@ READ_ONLY NO +@@ -2184,7 +2184,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME NET_RETRY_COUNT VARIABLE_SCOPE SESSION @@ -716,7 +707,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2184,7 +2184,7 @@ READ_ONLY NO +@@ -2194,7 +2194,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME NET_WRITE_TIMEOUT VARIABLE_SCOPE SESSION @@ -725,7 +716,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2234,7 +2234,7 @@ READ_ONLY NO +@@ -2244,7 +2244,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -734,7 +725,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 or autoset then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2244,7 +2244,7 @@ READ_ONLY YES +@@ -2254,7 +2254,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_PRUNE_LEVEL VARIABLE_SCOPE SESSION @@ -743,7 +734,7 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2254,7 +2254,7 @@ READ_ONLY NO +@@ -2264,7 +2264,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH VARIABLE_SCOPE SESSION @@ -752,7 +743,7 @@ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 62 -@@ -2264,7 +2264,7 @@ READ_ONLY NO +@@ -2274,7 +2274,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT VARIABLE_SCOPE SESSION @@ -761,7 +752,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2294,17 +2294,17 @@ READ_ONLY NO +@@ -2304,17 +2304,17 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_TRACE_MAX_MEM_SIZE VARIABLE_SCOPE SESSION @@ -782,7 +773,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2324,7 +2324,7 @@ READ_ONLY YES +@@ -2334,7 +2334,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE VARIABLE_SCOPE GLOBAL @@ -791,7 +782,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2334,7 +2334,7 @@ READ_ONLY YES +@@ -2344,7 +2344,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE VARIABLE_SCOPE GLOBAL @@ -800,7 +791,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2144,7 +2144,7 @@ +@@ -2354,7 +2354,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE VARIABLE_SCOPE GLOBAL @@ -809,7 +800,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2354,7 +2354,7 @@ READ_ONLY YES +@@ -2364,7 +2364,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE VARIABLE_SCOPE GLOBAL @@ -818,7 +809,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2364,7 +2364,7 @@ READ_ONLY YES +@@ -2374,7 +2374,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE VARIABLE_SCOPE GLOBAL @@ -827,7 +818,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2374,7 +2374,7 @@ READ_ONLY YES +@@ -2384,7 +2384,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE VARIABLE_SCOPE GLOBAL @@ -836,7 +827,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2384,7 +2384,7 @@ READ_ONLY YES +@@ -2394,7 +2394,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE VARIABLE_SCOPE GLOBAL @@ -845,7 +836,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2394,7 +2394,7 @@ READ_ONLY YES +@@ -2404,7 +2404,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE VARIABLE_SCOPE GLOBAL @@ -854,7 +845,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2404,7 +2404,7 @@ READ_ONLY YES +@@ -2414,7 +2414,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE VARIABLE_SCOPE GLOBAL @@ -863,7 +854,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2414,7 +2414,7 @@ READ_ONLY YES +@@ -2424,7 +2424,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES VARIABLE_SCOPE GLOBAL @@ -872,7 +863,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2424,7 +2424,7 @@ READ_ONLY YES +@@ -2434,7 +2434,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES VARIABLE_SCOPE GLOBAL @@ -881,7 +872,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2434,7 +2434,7 @@ READ_ONLY YES +@@ -2444,7 +2444,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH VARIABLE_SCOPE GLOBAL @@ -890,7 +881,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2444,7 +2444,7 @@ READ_ONLY YES +@@ -2454,7 +2454,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES VARIABLE_SCOPE GLOBAL @@ -899,7 +890,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2454,7 +2454,7 @@ READ_ONLY YES +@@ -2464,7 +2464,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES VARIABLE_SCOPE GLOBAL @@ -908,7 +899,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2464,7 +2464,7 @@ READ_ONLY YES +@@ -2474,7 +2474,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES VARIABLE_SCOPE GLOBAL @@ -917,7 +908,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2474,7 +2474,7 @@ READ_ONLY YES +@@ -2484,7 +2484,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES VARIABLE_SCOPE GLOBAL @@ -926,7 +917,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2484,7 +2484,7 @@ READ_ONLY YES +@@ -2494,7 +2494,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES VARIABLE_SCOPE GLOBAL @@ -935,7 +926,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2494,7 +2494,7 @@ READ_ONLY YES +@@ -2504,7 +2504,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES VARIABLE_SCOPE GLOBAL @@ -944,7 +935,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2504,7 +2504,7 @@ READ_ONLY YES +@@ -2514,7 +2514,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES VARIABLE_SCOPE GLOBAL @@ -953,7 +944,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2514,7 +2514,7 @@ READ_ONLY YES +@@ -2524,7 +2524,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES VARIABLE_SCOPE GLOBAL @@ -962,7 +953,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2524,7 +2524,7 @@ READ_ONLY YES +@@ -2534,7 +2534,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES VARIABLE_SCOPE GLOBAL @@ -971,7 +962,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2534,7 +2534,7 @@ READ_ONLY YES +@@ -2544,7 +2544,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES VARIABLE_SCOPE GLOBAL @@ -980,7 +971,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2544,7 +2544,7 @@ READ_ONLY YES +@@ -2554,7 +2554,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES VARIABLE_SCOPE GLOBAL @@ -989,7 +980,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2554,7 +2554,7 @@ READ_ONLY YES +@@ -2564,7 +2564,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES VARIABLE_SCOPE GLOBAL @@ -998,7 +989,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2564,7 +2564,7 @@ READ_ONLY YES +@@ -2574,7 +2574,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES VARIABLE_SCOPE GLOBAL @@ -1007,7 +998,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2574,7 +2574,7 @@ READ_ONLY YES +@@ -2584,7 +2584,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES VARIABLE_SCOPE GLOBAL @@ -1016,7 +1007,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2584,7 +2584,7 @@ READ_ONLY YES +@@ -2594,7 +2594,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES VARIABLE_SCOPE GLOBAL @@ -1025,7 +1016,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2594,7 +2594,7 @@ READ_ONLY YES +@@ -2604,7 +2604,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE VARIABLE_SCOPE GLOBAL @@ -1034,7 +1025,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2604,7 +2604,7 @@ READ_ONLY YES +@@ -2614,7 +2614,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE VARIABLE_SCOPE GLOBAL @@ -1043,7 +1034,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -2614,7 +2614,7 @@ READ_ONLY YES +@@ -2624,7 +2624,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE VARIABLE_SCOPE GLOBAL @@ -1052,7 +1043,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2624,7 +2624,7 @@ READ_ONLY YES +@@ -2634,7 +2634,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE VARIABLE_SCOPE GLOBAL @@ -1061,7 +1052,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2674,7 +2674,7 @@ READ_ONLY YES +@@ -2684,7 +2684,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PRELOAD_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -1070,7 +1061,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -2694,7 +2694,7 @@ READ_ONLY NO +@@ -2704,7 +2704,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME PROFILING_HISTORY_SIZE VARIABLE_SCOPE SESSION @@ -1079,7 +1070,7 @@ VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -2704,7 +2704,7 @@ READ_ONLY NO +@@ -2714,7 +2714,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PROGRESS_REPORT_TIME VARIABLE_SCOPE SESSION @@ -1088,7 +1079,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2764,7 +2764,7 @@ READ_ONLY NO +@@ -2774,7 +2774,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE VARIABLE_SCOPE SESSION @@ -1097,7 +1088,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2774,7 +2774,7 @@ READ_ONLY NO +@@ -2784,7 +2784,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME QUERY_CACHE_LIMIT VARIABLE_SCOPE GLOBAL @@ -1106,7 +1097,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2784,7 +2784,7 @@ READ_ONLY NO +@@ -2794,7 +2794,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT VARIABLE_SCOPE GLOBAL @@ -1115,7 +1106,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2797,7 +2797,7 @@ VARIABLE_SCOPE GLOBAL +@@ -2807,7 +2807,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1124,7 +1115,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2834,7 +2834,7 @@ READ_ONLY NO +@@ -2844,7 +2844,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME QUERY_PREALLOC_SIZE VARIABLE_SCOPE SESSION @@ -1133,7 +1124,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2847,7 +2847,7 @@ VARIABLE_SCOPE SESSION ONLY +@@ -2857,7 +2857,7 @@ VARIABLE_SCOPE SESSION ONLY VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1142,7 +1133,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2857,14 +2857,14 @@ VARIABLE_SCOPE SESSION ONLY +@@ -2867,14 +2867,14 @@ VARIABLE_SCOPE SESSION ONLY VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1159,7 +1150,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -2874,7 +2874,7 @@ READ_ONLY NO +@@ -2884,7 +2884,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME READ_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -1168,7 +1159,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2894,7 +2894,7 @@ READ_ONLY NO +@@ -2904,7 +2904,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME READ_RND_BUFFER_SIZE VARIABLE_SCOPE SESSION @@ -1177,7 +1168,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -2904,10 +2904,10 @@ READ_ONLY NO +@@ -2914,10 +2914,10 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME ROWID_MERGE_BUFF_SIZE VARIABLE_SCOPE SESSION @@ -1190,7 +1181,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2944,7 +2944,7 @@ READ_ONLY YES +@@ -2954,7 +2954,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SERVER_ID VARIABLE_SCOPE SESSION @@ -1199,7 +1190,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -3014,7 +3014,7 @@ READ_ONLY NO +@@ -3024,7 +3024,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET VARIABLE_SCOPE GLOBAL @@ -1208,7 +1199,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3024,7 +3024,7 @@ READ_ONLY NO +@@ -3034,7 +3034,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SLOW_LAUNCH_TIME VARIABLE_SCOPE GLOBAL @@ -1217,7 +1208,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -3067,7 +3067,7 @@ VARIABLE_SCOPE SESSION +@@ -3077,7 +3077,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1226,7 +1217,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3274,7 +3274,7 @@ READ_ONLY NO +@@ -3284,7 +3284,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME STORED_PROGRAM_CACHE VARIABLE_SCOPE GLOBAL @@ -1235,7 +1226,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -3354,7 +3354,7 @@ READ_ONLY NO +@@ -3364,7 +3364,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME TABLE_DEFINITION_CACHE VARIABLE_SCOPE GLOBAL @@ -1244,7 +1235,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 2097152 -@@ -3364,7 +3364,7 @@ READ_ONLY NO +@@ -3374,7 +3374,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TABLE_OPEN_CACHE VARIABLE_SCOPE GLOBAL @@ -1253,7 +1244,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 1048576 -@@ -3424,7 +3424,7 @@ READ_ONLY NO +@@ -3434,7 +3434,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME THREAD_CACHE_SIZE VARIABLE_SCOPE GLOBAL @@ -1262,7 +1253,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -3434,7 +3434,7 @@ READ_ONLY NO +@@ -3444,7 +3444,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME THREAD_CONCURRENCY VARIABLE_SCOPE GLOBAL @@ -1271,7 +1262,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -3527,7 +3527,7 @@ VARIABLE_SCOPE SESSION +@@ -3537,7 +3537,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table. NUMERIC_MIN_VALUE 1024 @@ -1280,7 +1271,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3537,7 +3537,7 @@ VARIABLE_SCOPE SESSION +@@ -3547,7 +3547,7 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size. NUMERIC_MIN_VALUE 1024 @@ -1289,7 +1280,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3547,14 +3547,14 @@ VARIABLE_SCOPE SESSION +@@ -3557,14 +3557,14 @@ VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. NUMERIC_MIN_VALUE 1024 @@ -1306,7 +1297,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -3564,7 +3564,7 @@ READ_ONLY NO +@@ -3574,7 +3574,7 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME TRANSACTION_PREALLOC_SIZE VARIABLE_SCOPE SESSION @@ -1315,7 +1306,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -3704,7 +3704,7 @@ READ_ONLY YES +@@ -3714,7 +3714,7 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT NULL VARIABLE_NAME WAIT_TIMEOUT VARIABLE_SCOPE SESSION @@ -1324,7 +1315,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -3731,7 +3731,7 @@ order by variable_name; +@@ -3741,7 +3741,7 @@ order by variable_name; VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL From aca641da288b91f4b4e90bb3eb3d6ecca52186fa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 31 May 2023 14:40:17 +0200 Subject: [PATCH 48/80] mtr: handle the case of existing but unreadable /proc/cpuinfo --- mysql-test/lib/My/SysInfo.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm index 1e5ac353def..211f72c0561 100644 --- a/mysql-test/lib/My/SysInfo.pm +++ b/mysql-test/lib/My/SysInfo.pm @@ -68,7 +68,7 @@ sub _cpuinfo { } } $F= undef; # Close file - return $self; + return $self->{cpus}; } @@ -95,12 +95,7 @@ sub _kstat { push(@{$self->{cpus}}, $cpuinfo); } - # At least one cpu should have been found - # if this method worked - if ( $self->{cpus} ) { - return $self; - } - return undef; + return $self->{cpus}; } From c0463704c228647096986a437e33329ba0429f9a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Jun 2023 17:28:41 +0200 Subject: [PATCH 49/80] fix the test for --view --- mysql-test/main/derived_cond_pushdown.result | 22 ++++++-------------- mysql-test/main/derived_cond_pushdown.test | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index a4fc7a7447d..eacda88ffeb 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -18384,7 +18384,7 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as sq from t1 limit 5; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 @@ -18398,14 +18398,9 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as sq from t1 limit 5; -a ( select concat(t3.a,'=',dt.s) -from -(select a, sum(b) as s from t2 group by a) as dt, -t3 -where dt.a=t1.a and t3.a < 3 -) +a sq 1 1=804 2 1=1056 3 1=846 @@ -18424,7 +18419,7 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as sq from t1 limit 5; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 @@ -18438,14 +18433,9 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as sq from t1 limit 5; -a ( select concat(t3.a,'=',dt.s) -from -(select a, sum(b) as s from t2 group by a) as dt, -t3 -where dt.a=t1.a and t3.a < 3 -) +a sq 1 1=11858 2 1=11380 3 1=11588 diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index 7a4d9b4ad7d..deb6a64f393 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3997,7 +3997,7 @@ select (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 - ) + ) as sq from t1 limit 5; eval explain $q; From 69684f689c0f4ab4ac97cdd7652e778d304ce9aa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Jun 2023 18:31:08 +0200 Subject: [PATCH 50/80] use correct collation_connection in --view mysqltest should use the same collation_connection in the service connection (that creates views) as in the main connection this makes weight_string("aaa") to return the expected value in --view and fixes main.func_str failure in --view --- client/mysqltest.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index e745f8a3d2f..219b5532a70 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8943,6 +8943,8 @@ int util_query(MYSQL* org_mysql, const char* query){ org_mysql->unix_socket); cur_con->util_mysql= mysql; + if (mysql->charset != org_mysql->charset) + mysql_set_character_set(mysql, org_mysql->charset->csname); } } else From c05ecda61fb54613d9f1c9da1fbc63779391bbdb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Jun 2023 22:15:41 +0200 Subject: [PATCH 51/80] fix string literal escaping in views process multibyte characters correctly, don't escape half of the character --- mysql-test/include/ctype_E05C.inc | 11 +++++++- mysql-test/main/ctype_big5.result | 13 +++++++--- mysql-test/main/ctype_big5.test | 7 ++--- mysql-test/main/ctype_cp932_binlog_stm.result | 7 ++++- mysql-test/main/ctype_gbk.result | 7 ++++- mysql-test/main/ctype_sjis.result | 7 ++++- sql/sql_string.cc | 26 ++++++++++++------- 7 files changed, 55 insertions(+), 23 deletions(-) diff --git a/mysql-test/include/ctype_E05C.inc b/mysql-test/include/ctype_E05C.inc index 71861044664..d157d8a7c88 100644 --- a/mysql-test/include/ctype_E05C.inc +++ b/mysql-test/include/ctype_E05C.inc @@ -76,6 +76,15 @@ INSERT INTO t1 VALUES (_BINARY'\\'' SELECT a, HEX(a) FROM t1; DROP TABLE t1; +# +# test how strings are written into view's frm +# +disable_view_protocol; +create view v1 as select hex('\'), hex('\t'); +select * from v1; +drop view v1; +enable_view_protocol; + # Checking that with character_set_client=binary 0x5C in 0xE05C # is treated as escape rather than the second byte of a multi-byte character, # even if character_set_connection is big5/cp932/gbk/sjis. @@ -109,5 +118,5 @@ SELECT HEX(a) FROM t1; DROP TABLE t1; --enable_view_protocol ---echo # Start of ctype_E05C.inc +--echo # End of ctype_E05C.inc diff --git a/mysql-test/main/ctype_big5.result b/mysql-test/main/ctype_big5.result index 402eec27ce8..b4c394f178b 100644 --- a/mysql-test/main/ctype_big5.result +++ b/mysql-test/main/ctype_big5.result @@ -537,15 +537,15 @@ create table t1 (a blob); insert into t1 values (0xEE00); select * into outfile 'test/t1.txt' from t1; delete from t1; -select hex(load_file('MYSQLD_DATADIR/test/t1.txt'));; -hex(load_file('MYSQLD_DATADIR/test/t1.txt')) +select hex(load_file('MYSQLD_DATADIR/test/t1.txt')) as lf; +lf 5CEE5C300A load data infile 't1.txt' into table t1; select hex(a) from t1; hex(a) EE00 drop table t1; -End of 5.0 tests +# End of 5.0 tests # # Start of 5.5 tests # @@ -4705,6 +4705,11 @@ a HEX(a) \'\ 5C27E05C \'\ E05C275C DROP TABLE t1; +create view v1 as select hex('\'), hex('\t'); +select * from v1; +hex('\') hex('\t') +E05C E05C74 +drop view v1; SET character_set_client=binary, character_set_results=binary; SELECT @@character_set_client, @@character_set_connection, @@character_set_results; @@character_set_client @@character_set_connection @@character_set_results @@ -4744,7 +4749,7 @@ HEX(a) E05C5B E05B DROP TABLE t1; -# Start of ctype_E05C.inc +# End of ctype_E05C.inc SET NAMES big5; CREATE TABLE t1 (a ENUM('@') CHARACTER SET big5); SHOW CREATE TABLE t1; diff --git a/mysql-test/main/ctype_big5.test b/mysql-test/main/ctype_big5.test index e5a3c5b976f..c859670169c 100644 --- a/mysql-test/main/ctype_big5.test +++ b/mysql-test/main/ctype_big5.test @@ -79,18 +79,15 @@ create table t1 (a blob); insert into t1 values (0xEE00); select * into outfile 'test/t1.txt' from t1; delete from t1; -#enable after fix MDEV-27871 ---disable_view_protocol let $MYSQLD_DATADIR= `select @@datadir`; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR ---eval select hex(load_file('$MYSQLD_DATADIR/test/t1.txt')); +--eval select hex(load_file('$MYSQLD_DATADIR/test/t1.txt')) as lf load data infile 't1.txt' into table t1; select hex(a) from t1; --remove_file $MYSQLD_DATADIR/test/t1.txt drop table t1; -#enable_view_protocol # ---echo End of 5.0 tests +--echo # End of 5.0 tests --echo # diff --git a/mysql-test/main/ctype_cp932_binlog_stm.result b/mysql-test/main/ctype_cp932_binlog_stm.result index 1de52ba5f6e..66f015141c8 100644 --- a/mysql-test/main/ctype_cp932_binlog_stm.result +++ b/mysql-test/main/ctype_cp932_binlog_stm.result @@ -20413,6 +20413,11 @@ a HEX(a) \'\ 5C27E05C \'\ E05C275C DROP TABLE t1; +create view v1 as select hex('\'), hex('\t'); +select * from v1; +hex('\') hex('\t') +E05C E05C74 +drop view v1; SET character_set_client=binary, character_set_results=binary; SELECT @@character_set_client, @@character_set_connection, @@character_set_results; @@character_set_client @@character_set_connection @@character_set_results @@ -20452,7 +20457,7 @@ HEX(a) E05C5B E05B DROP TABLE t1; -# Start of ctype_E05C.inc +# End of ctype_E05C.inc # # End of 10.0 tests # diff --git a/mysql-test/main/ctype_gbk.result b/mysql-test/main/ctype_gbk.result index feb0bf46199..c16be59ae99 100644 --- a/mysql-test/main/ctype_gbk.result +++ b/mysql-test/main/ctype_gbk.result @@ -5053,6 +5053,11 @@ a HEX(a) \'\ 5C27E05C \'\ E05C275C DROP TABLE t1; +create view v1 as select hex('\'), hex('\t'); +select * from v1; +hex('\') hex('\t') +E05C E05C74 +drop view v1; SET character_set_client=binary, character_set_results=binary; SELECT @@character_set_client, @@character_set_connection, @@character_set_results; @@character_set_client @@character_set_connection @@character_set_results @@ -5092,7 +5097,7 @@ HEX(a) E05C5B E05B DROP TABLE t1; -# Start of ctype_E05C.inc +# End of ctype_E05C.inc SET NAMES utf8, character_set_connection=gbk; # # MDEV-13118 Wrong results with LOWER and UPPER and subquery diff --git a/mysql-test/main/ctype_sjis.result b/mysql-test/main/ctype_sjis.result index a48212bf7e2..c929c6d893c 100644 --- a/mysql-test/main/ctype_sjis.result +++ b/mysql-test/main/ctype_sjis.result @@ -18677,6 +18677,11 @@ a HEX(a) \'\ 5C27E05C \'\ E05C275C DROP TABLE t1; +create view v1 as select hex('\'), hex('\t'); +select * from v1; +hex('\') hex('\t') +E05C E05C74 +drop view v1; SET character_set_client=binary, character_set_results=binary; SELECT @@character_set_client, @@character_set_connection, @@character_set_results; @@character_set_client @@character_set_connection @@character_set_results @@ -18716,7 +18721,7 @@ HEX(a) E05C5B E05B DROP TABLE t1; -# Start of ctype_E05C.inc +# End of ctype_E05C.inc # # End of 10.0 tests # diff --git a/sql/sql_string.cc b/sql/sql_string.cc index c6b7f3e68ed..6de1207db95 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -1115,22 +1115,28 @@ String_copier::well_formed_copy(CHARSET_INFO *to_cs, characters with backslashes as necessary. Does not add the enclosing quotes, this is left up to caller. */ -#define APPEND(X) if (append(X)) return 1; else break +#define APPEND(...) if (append(__VA_ARGS__)) return 1; bool String::append_for_single_quote(const char *st, size_t len) { const char *end= st+len; + int chlen; for (; st < end; st++) { - uchar c= *st; - switch (c) + switch (*st) { - case '\\': APPEND(STRING_WITH_LEN("\\\\")); - case '\0': APPEND(STRING_WITH_LEN("\\0")); - case '\'': APPEND(STRING_WITH_LEN("\\'")); - case '\n': APPEND(STRING_WITH_LEN("\\n")); - case '\r': APPEND(STRING_WITH_LEN("\\r")); - case '\032': APPEND(STRING_WITH_LEN("\\Z")); - default: APPEND(c); + case '\\': APPEND(STRING_WITH_LEN("\\\\")); break; + case '\0': APPEND(STRING_WITH_LEN("\\0")); break; + case '\'': APPEND(STRING_WITH_LEN("\\'")); break; + case '\n': APPEND(STRING_WITH_LEN("\\n")); break; + case '\r': APPEND(STRING_WITH_LEN("\\r")); break; + case '\032': APPEND(STRING_WITH_LEN("\\Z")); break; + default: if ((chlen= my_charlen(charset(), st, end)) > 0) + { + APPEND(st, chlen); + st+= chlen-1; + } + else + APPEND(*st); } } return 0; From 8de6740a2ff13b95282595dcb817bcc16960b6d8 Mon Sep 17 00:00:00 2001 From: heyingquan0030 <15198894161@139.com> Date: Sun, 4 Jun 2023 19:04:49 +0800 Subject: [PATCH 52/80] MDEV-31205 Typo: complatible > compatible --- cmake/aws_sdk.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/aws_sdk.cmake b/cmake/aws_sdk.cmake index f6f88f2b880..a0d46e1a892 100644 --- a/cmake/aws_sdk.cmake +++ b/cmake/aws_sdk.cmake @@ -10,7 +10,7 @@ FUNCTION (CHECK_AWS_SDK RETVAL REASON) SKIP_AWS_SDK("AWS_SDK_EXTERNAL_PROJECT is not ON") ENDIF() IF(NOT NOT_FOR_DISTRIBUTION) - SKIP_AWS_SDK("AWS SDK has Apache 2.0 License which is not complatible with GPLv2. Set -DNOT_FOR_DISTRIBUTION=ON if you need it") + SKIP_AWS_SDK("AWS SDK has Apache 2.0 License which is not compatible with GPLv2. Set -DNOT_FOR_DISTRIBUTION=ON if you need it") ENDIF() # Check compiler support IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU") From 0a99d457b3cff4d08d01c2a5a74dcf81f45d79ec Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Wed, 8 Mar 2023 13:49:32 -0700 Subject: [PATCH 53/80] MDEV-13915: STOP SLAVE takes very long time on a busy system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The problem is that a parallel replica would not immediately stop running/queued transactions when issued STOP SLAVE. That is, it allowed the current group of transactions to run, and sometimes the transactions which belong to the next group could be started and run through commit after STOP SLAVE was issued too, if the last group had started committing. This would lead to long periods to wait for all waiting transactions to finish. This patch updates a parallel replica to try and abort immediately and roll-back any ongoing transactions. The exception to this is any transactions which are non-transactional (e.g. those modifying sequences or non-transactional tables), and any prior transactions, will be run to completion. The specifics are as follows: 1. A new stage was added to SHOW PROCESSLIST output for the SQL Thread when it is waiting for a replica thread to either rollback or finish its transaction before stopping. This stage presents as “Waiting for worker thread to stop” 2. Worker threads which error or are killed no longer perform GCO cleanup if there is a concurrently running prior transaction. This is because a worker thread scheduled to run in a future GCO could be killed and incorrectly perform cleanup of the active GCO. 3. Refined cases when the FL_TRANSACTIONAL flag is added to GTID binlog events to disallow adding it to transactions which modify both transactional and non-transactional engines when the binlogging configuration allow the modifications to exist in the same event, i.e. when using binlog_direct_non_trans_update == 0 and binlog_format == statement. 4. A few existing MTR tests relied on the completion of certain transactions after issuing STOP SLAVE, and were re-recorded (potentially with added synchronizations) under the new rollback behavior. Reviewed By =========== Andrei Elkin --- .../binlog_encryption/rpl_parallel.result | 7 +- .../rpl_par_stop_slave_quick_common.test | 608 ++++++++++++++++++ mysql-test/suite/rpl/r/rpl_parallel.result | 7 +- mysql-test/suite/rpl/r/rpl_parallel2.result | 1 + .../rpl/r/rpl_row_par_stop_slave_quick.result | 507 +++++++++++++++ .../rpl/r/rpl_stm_par_stop_slave_quick.result | 461 +++++++++++++ mysql-test/suite/rpl/t/rpl_parallel.test | 20 +- mysql-test/suite/rpl/t/rpl_parallel2.test | 1 + .../t/rpl_parallel_optimistic_error_stop.test | 6 +- .../rpl/t/rpl_row_par_stop_slave_quick.test | 268 ++++++++ .../rpl/t/rpl_stm_par_stop_slave_quick.test | 200 ++++++ sql/log_event.cc | 25 +- sql/mysqld.cc | 1 + sql/mysqld.h | 1 + sql/rpl_parallel.cc | 37 +- sql/rpl_parallel.h | 26 +- sql/rpl_rli.cc | 1 + sql/slave.cc | 7 + sql/sql_class.cc | 21 +- sql/sql_class.h | 6 +- 20 files changed, 2187 insertions(+), 24 deletions(-) create mode 100644 mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test create mode 100644 mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result create mode 100644 mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result create mode 100644 mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.result b/mysql-test/suite/binlog_encryption/rpl_parallel.result index b75a66a634a..610e87e850e 100644 --- a/mysql-test/suite/binlog_encryption/rpl_parallel.result +++ b/mysql-test/suite/binlog_encryption/rpl_parallel.result @@ -732,7 +732,7 @@ SET debug_sync='now WAIT_FOR t3_waiting'; SET debug_sync='now SIGNAL d2_cont'; SET debug_sync='now WAIT_FOR t4_waiting'; KILL THD_ID; -SET debug_sync='now WAIT_FOR t3_killed'; +# Wait for replica to signal worker threads to stop SET debug_sync='now SIGNAL t1_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -742,7 +742,6 @@ a b 61 61 62 62 63 63 -64 64 68 68 69 69 70 70 @@ -816,6 +815,7 @@ connection server_2; SET debug_sync='now WAIT_FOR wait_queue_ready'; KILL THD_ID; SET debug_sync='now WAIT_FOR wait_queue_killed'; +# Wait for replica to signal worker threads to stop SET debug_sync='now SIGNAL query_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -827,6 +827,8 @@ SET binlog_format=@old_format; connection server_2; SET debug_sync='RESET'; include/start_slave.inc +SET debug_sync='now WAIT_FOR query_waiting'; +SET debug_sync='now SIGNAL query_cont'; SELECT * FROM t3 WHERE a >= 80 ORDER BY a; a b 80 0 @@ -1215,6 +1217,7 @@ connection server_2; include/wait_for_slave_sql_to_stop.inc SELECT * FROM t2 WHERE a >= 40 ORDER BY a; a +40 41 42 include/start_slave.inc diff --git a/mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test b/mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test new file mode 100644 index 00000000000..deac78660e8 --- /dev/null +++ b/mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test @@ -0,0 +1,608 @@ +# +# The stop_slave_quick suite of tests aims to validate that stopping a replica +# with parallelization enabled will stop in a timely manner. That is, a +# parallel replica should try to immediately stop and roll-back any ongoing +# transactions. If any threads have a non-transactional workload, then it +# along with all prior transactions are executed before stopping. +# +# This file provides test cases that should be binlog format independent. There +# is, however, behavior that is specific to either statement or row format, +# which each have their own test files that include this file. +# +# Requirements: +# 1. Tables named `ti`, `ti2`, and `ti3` have already been created with +# storage engine InnoDB; and a table named `tm` has been created with +# storage engine MyIsam. +# 2. Test variables ti_ctr, ti2_ctr, ti3_ctr, and tm_ctr have been created +# to serve as dynamic values to insert into their respective tables +# +# References: +# MDEV-13915: STOP SLAVE takes very long time on a busy system +# + +--echo # +--echo # Common Test Case 1: +--echo # Using one parallel replication worker thread on workload {T,T}, ensure +--echo # the replica immediately rolls back the transaction and stops the +--echo # SQL thread +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=1; +--let $row_count_initial=`select count(*) from ti` + +--connection master +--source include/save_master_gtid.inc +BEGIN; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +COMMIT; + +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +--connection slave +LOCK TABLES ti WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to begin executing the first transaction +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $row_count_end=`select count(*) from ti` +--let $row_count_diff=`select ($row_count_end-$row_count_initial)` +--let $assert_text= No new rows should have been inserted +--let $assert_cond= $row_count_diff = 0 +--source include/assert.inc + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should not change +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Common Test Case 2: +--echo # Using multiple parallel replication threads (two) on workload {T,T}, +--echo # ensure both transactions are rolled back if stop slave is issued +--echo # in the middle of the first transaction. + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=2; +--let $row_count_initial=`select count(*) from ti` + +--connection master +--source include/save_master_gtid.inc +BEGIN; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +COMMIT; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +--connection slave +LOCK TABLES ti WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to begin executing the first transaction +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--echo # Wait for second transaction to begin +--connection slave +--let $wait_condition= SELECT count(*)=0 FROM information_schema.processlist WHERE state LIKE 'Waiting for work from SQL thread' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $row_count_end=`select count(*) from ti` +--let $row_count_diff=`select ($row_count_end-$row_count_initial)` +--let $assert_text= No insertions should have committed +--let $assert_cond= $row_count_diff = 0 +--source include/assert.inc + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should not change +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +--echo # Slave should be error-free +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +--let $assert_text= Slave should be error free +--let $assert_cond= $last_error = 0 +--source include/assert.inc + +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Common Test Case 3: +--echo # Using multiple parallel replication threads (two) on workload {T,T}, +--echo # with the same commit id (cid), ensure both transactions are rolled +--echo # back if stop slave is issued + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_mode=AGGRESSIVE; +set @@global.slave_parallel_threads=2; +--let $row_count_initial=`select count(*) from ti` + +--connection master +--source include/save_master_gtid.inc +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10000; +BEGIN; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +COMMIT; +--eval insert into ti2 values ($ti2_ctr) +--inc $ti2_ctr + +SET @@SESSION.debug_dbug=@old_dbug; + +--connection slave +LOCK TABLES ti WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to begin executing the first transactions +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--echo # Wait for second transaction to start group commit +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $row_count_end=`select count(*) from ti` +--let $row_count_diff=`select ($row_count_end-$row_count_initial)` +--let $assert_text= No insertions should have committed +--let $assert_cond= $row_count_diff = 0 +--source include/assert.inc + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should not change +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +--connection master +--source include/save_master_gtid.inc + +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Common Test Case 4: +--echo # Using multiple parallel replication threads (4) on workload +--echo # T (long running); should commit +--echo # N (waiting for prior commit); should commit +--echo # T (long running); should rollback +--echo # T (waiting for prior commit); should rollback +--echo # Issuing STOP SLAVE should allow the first two transactions to commit +--echo # while preventing and rolling back the third +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_mode=optimistic; +set @@global.slave_parallel_threads=4; + +--connection master +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10001; +BEGIN; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +COMMIT; + +--connection master +--eval insert into tm values ($tm_ctr) +--inc $tm_ctr +--source include/save_master_gtid.inc + +--eval insert into ti2 values ($ti2_ctr) +--inc $ti2_ctr + +--eval insert into ti3 values ($ti3_ctr) +--inc $ti3_ctr + +SET @@SESSION.debug_dbug=@old_dbug; + +--connection slave +LOCK TABLES ti WRITE, ti2 WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +--let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--echo # Wait for replica to progress until unblocked transactions are queued for group commit.. +--connection slave +--let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should reach first N transaction +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +set @@global.slave_parallel_mode=CONSERVATIVE; + +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Common Test Case 5: +--echo # Using multiple parallel replication threads (5) on workload +--echo # T (long running); should commit +--echo # N (waiting for prior commit); should commit +--echo # T (waiting for prior commit); should commit +--echo # N (waiting for prior commit); should commit +--echo # T (long running); should rollback +--echo # Issuing STOP SLAVE should allow all transactions up to and including +--echo # the last N (4th) to commit, while preventing and rolling back the +--echo # final transaction (5th) + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_mode=optimistic; +set @@global.slave_parallel_threads=5; + +--connection master +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10002; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +--eval insert into tm values ($tm_ctr) +--inc $tm_ctr + +--eval insert into ti2 values ($ti2_ctr) +--inc $ti2_ctr + +--eval insert into tm2 values ($tm2_ctr) +--inc $tm2_ctr +--source include/save_master_gtid.inc + +--eval insert into ti3 values ($ti3_ctr) +--inc $ti3_ctr + +SET @@SESSION.debug_dbug=@old_dbug; + +--connection slave +LOCK TABLES ti WRITE, ti3 WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +--let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--echo # Wait for replica to progress until unblocked transactions are queued for group commit.. +--connection slave +--let $wait_condition= SELECT count(*)=3 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should reach second N transaction +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +set @@global.slave_parallel_mode=CONSERVATIVE; + +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Common Test Case 6: +--echo # If retrying a T transaction while STOP SLAVE is issued, the +--echo # transaction should be rolled back and the slave abruptly stopped + +--connection master +--eval insert into ti values ($ti_ctr) +--source include/save_master_gtid.inc + +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +set @@global.slave_parallel_threads=1; + +--let $save_innodb_lock_wait_timeout= `SELECT @@global.innodb_lock_wait_timeout` +# 2 second buffer to give ample time to wait for transaction and issue stop slave +set @@global.innodb_lock_wait_timeout= 2; +BEGIN; +--eval SELECT * FROM ti WHERE a=$ti_ctr FOR UPDATE + +--connection master +--source include/save_master_gtid.inc +--eval update ti set a=a+1 where a=$ti_ctr +--inc $ti_ctr +--inc $ti_ctr + +--connection slave +--source include/start_slave.inc +--let $retried_tx_initial= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1) + +if (`SELECT @@global.binlog_format = 'ROW'`) +{ + --let $update_state=Update_rows_log_event::find_row(-1) +} +if (`SELECT @@global.binlog_format = 'STATEMENT'`) +{ + --let $update_state=Updating +} +--echo # Wait for replicating transaction to wait for innodb table lock +--source include/start_slave.inc +--let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state LIKE "$update_state" and command like 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +connection slave; +--source include/wait_for_slave_sql_to_stop.inc +--let $retried_tx_test= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1) +if ($retried_tx_initial != $retried_tx_test) +{ + --echo T transaction should have been rolled back without retry + --die T transaction should have been rolled back without retry +} + +# End the SELECT ... FOR UPDATE +ROLLBACK; + +--connection slave1 +--reap +--connection slave + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= The retried T transaction should have been rolled back +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +--eval set @@global.innodb_lock_wait_timeout= $save_innodb_lock_wait_timeout + +--echo # +--echo # Common Test Case 7: +--echo # Using multiple parallel replication threads on a workload with a +--echo # non-transactional transaction in-between transactional transactions.. +--echo # 7a: with AGGRESSIVE replication where the N statement has been +--echo # executed already, all transactions up to and including N should +--echo # be replicated, and all transactions afterwards should be rolled +--echo # back. +--echo # 7b: with MINIMAL replication, the N statement should not execute +--echo # concurrently, but should wait along with the other later +--echo # transactions, and all future transactions except the first should +--echo # be rolled back. + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=4; + +--let $mode_ctr=2 +while ($mode_ctr) +{ + --connection slave + if ($mode_ctr == 2) + { + --echo # + --echo # 7a: slave_parallel_mode=AGGRESSIVE + set @@global.slave_parallel_mode=AGGRESSIVE; + } + if ($mode_ctr == 1) + { + --echo # + --echo # 7b: slave_parallel_mode=MINIMAL + set @@global.slave_parallel_mode=MINIMAL; + } + + --connection slave + --let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from ti2 UNION ALL select * from tm2 UNION ALL select * from ti3) t` + + --connection master + if ($mode_ctr == 1) + { + --let $master_gtid_cmp= `select @@global.gtid_binlog_pos` + } + + --connection master + --eval insert into ti values ($ti_ctr) + --inc $ti_ctr + + --eval insert into tm values ($tm_ctr) + if ($mode_ctr == 2) + { + # AGGRESSIVE mode should allow N trx to complete + --let $master_gtid_cmp= `select @@global.gtid_binlog_pos` + } + --eval insert into ti2 values ($ti2_ctr) + --inc $ti2_ctr + --eval insert into ti values ($ti_ctr) + --inc $ti_ctr + --source include/save_master_gtid.inc + + --connection slave + LOCK TABLES ti WRITE; + --connection slave_lock_extra + LOCK TABLES ti2 WRITE; + + --source include/start_slave.inc + + --echo # Wait for replica to halt due to locks and dependency requirements + --connection slave + + if ($mode_ctr == 2) + { + # AGGRESSIVE allows for more concurrency that we need to wait for + --let $wait_condition= SELECT count(*)=3 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; + --source include/wait_condition.inc + --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; + --source include/wait_condition.inc + } + if ($mode_ctr == 1) + { + # MINIMAL will only have the first transaction begun + --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; + --source include/wait_condition.inc + --let $wait_condition= SELECT count(*)=3 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to start commit%' and command LIKE 'Slave_worker'; + --source include/wait_condition.inc + } + + --connection slave1 + --send STOP SLAVE; + + --connection slave + --echo # Wait for replica to signal worker threads to stop + --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; + --source include/wait_condition.inc + + UNLOCK TABLES; + --connection slave_lock_extra + UNLOCK TABLES; + + --connection slave1 + --reap + --connection slave + --source include/wait_for_slave_sql_to_stop.inc + + --let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from ti2 UNION ALL select * from tm2 UNION ALL select * from ti3) t` + --let $row_count_diff=`select ($row_count_end-$row_count_initial)` + + if ($mode_ctr == 2) + { + --let $assert_text= The entirety of the first two transactions should have committed with AGGRESSIVE parallelization + --let $assert_cond= $row_count_diff = 2 + } + if ($mode_ctr == 1) + { + --let $assert_text= All transactions should have rolled back with MINIMAL parallelization + --let $assert_cond= $row_count_diff = 0 + } + + --source include/assert.inc + + --let $slave_gtid= `select @@global.gtid_slave_pos` + --let $assert_text= Slave state should be consistent + --let $assert_cond= $master_gtid_cmp = $slave_gtid + --source include/assert.inc + + --connection master + --source include/save_master_gtid.inc + --connection slave + --source include/start_slave.inc + --source include/sync_with_master_gtid.inc + + --source include/stop_slave.inc + --dec $mode_ctr +} +--source include/start_slave.inc + +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result index 9b2e68d366e..4f4a1c7dbcd 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-test/suite/rpl/r/rpl_parallel.result @@ -731,7 +731,7 @@ SET debug_sync='now WAIT_FOR t3_waiting'; SET debug_sync='now SIGNAL d2_cont'; SET debug_sync='now WAIT_FOR t4_waiting'; KILL THD_ID; -SET debug_sync='now WAIT_FOR t3_killed'; +# Wait for replica to signal worker threads to stop SET debug_sync='now SIGNAL t1_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -741,7 +741,6 @@ a b 61 61 62 62 63 63 -64 64 68 68 69 69 70 70 @@ -815,6 +814,7 @@ connection server_2; SET debug_sync='now WAIT_FOR wait_queue_ready'; KILL THD_ID; SET debug_sync='now WAIT_FOR wait_queue_killed'; +# Wait for replica to signal worker threads to stop SET debug_sync='now SIGNAL query_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -826,6 +826,8 @@ SET binlog_format=@old_format; connection server_2; SET debug_sync='RESET'; include/start_slave.inc +SET debug_sync='now WAIT_FOR query_waiting'; +SET debug_sync='now SIGNAL query_cont'; SELECT * FROM t3 WHERE a >= 80 ORDER BY a; a b 80 0 @@ -1214,6 +1216,7 @@ connection server_2; include/wait_for_slave_sql_to_stop.inc SELECT * FROM t2 WHERE a >= 40 ORDER BY a; a +40 41 42 include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel2.result b/mysql-test/suite/rpl/r/rpl_parallel2.result index 559c56271b8..aeedb4bafee 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel2.result +++ b/mysql-test/suite/rpl/r/rpl_parallel2.result @@ -1,6 +1,7 @@ include/rpl_init.inc [topology=1->2] *** MDEV-5509: Incorrect value for Seconds_Behind_Master if parallel replication *** connection server_2; +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; set @old_parallel_mode= @@GLOBAL.slave_parallel_mode; include/stop_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result b/mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result new file mode 100644 index 00000000000..6fd5b448b47 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result @@ -0,0 +1,507 @@ +include/master-slave.inc +[connection master] +# +# Setup +connection slave; +include/stop_slave.inc +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Can't find record"); +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure"); +set @@global.slave_parallel_mode=CONSERVATIVE; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +connect slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT; +CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS; +include/start_slave.inc +# +# Initialize test data +connection master; +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +create sequence s1; +create table ti (a int) engine=innodb; +create table ti2 (a int) engine=innodb; +create table ti3 (a int) engine=innodb; +create table tm (a int) engine=myisam; +create table tm2 (a int) engine=myisam; +connection slave; +# Run binlog format independent test cases +# +# Common Test Case 1: +# Using one parallel replication worker thread on workload {T,T}, ensure +# the replica immediately rolls back the transaction and stops the +# SQL thread +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +connection master; +include/save_master_gtid.inc +BEGIN; +insert into ti values (100); +insert into ti values (101); +COMMIT; +insert into ti values (102); +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transaction +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No new rows should have been inserted] +include/assert.inc [GTID slave state should not change] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 2: +# Using multiple parallel replication threads (two) on workload {T,T}, +# ensure both transactions are rolled back if stop slave is issued +# in the middle of the first transaction. +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=2; +connection master; +include/save_master_gtid.inc +BEGIN; +insert into ti values (103); +insert into ti values (104); +COMMIT; +insert into ti values (105); +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transaction +connection slave; +# Wait for second transaction to begin +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No insertions should have committed] +include/assert.inc [GTID slave state should not change] +# Slave should be error-free +include/assert.inc [Slave should be error free] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 3: +# Using multiple parallel replication threads (two) on workload {T,T}, +# with the same commit id (cid), ensure both transactions are rolled +# back if stop slave is issued +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=AGGRESSIVE; +set @@global.slave_parallel_threads=2; +connection master; +include/save_master_gtid.inc +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10000; +BEGIN; +insert into ti values (106); +insert into ti values (107); +COMMIT; +insert into ti2 values (400); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transactions +connection slave; +# Wait for second transaction to start group commit +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No insertions should have committed] +include/assert.inc [GTID slave state should not change] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 4: +# Using multiple parallel replication threads (4) on workload +# T (long running); should commit +# N (waiting for prior commit); should commit +# T (long running); should rollback +# T (waiting for prior commit); should rollback +# Issuing STOP SLAVE should allow the first two transactions to commit +# while preventing and rolling back the third +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=optimistic; +set @@global.slave_parallel_threads=4; +connection master; +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10001; +BEGIN; +insert into ti values (108); +insert into ti values (109); +COMMIT; +connection master; +insert into tm values (200); +include/save_master_gtid.inc +insert into ti2 values (401); +insert into ti3 values (500); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti WRITE, ti2 WRITE; +include/start_slave.inc +# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +# Wait for replica to progress until unblocked transactions are queued for group commit.. +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [GTID slave state should reach first N transaction] +set @@global.slave_parallel_mode=CONSERVATIVE; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 5: +# Using multiple parallel replication threads (5) on workload +# T (long running); should commit +# N (waiting for prior commit); should commit +# T (waiting for prior commit); should commit +# N (waiting for prior commit); should commit +# T (long running); should rollback +# Issuing STOP SLAVE should allow all transactions up to and including +# the last N (4th) to commit, while preventing and rolling back the +# final transaction (5th) +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=optimistic; +set @@global.slave_parallel_threads=5; +connection master; +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10002; +insert into ti values (110); +insert into tm values (201); +insert into ti2 values (402); +insert into tm2 values (300); +include/save_master_gtid.inc +insert into ti3 values (501); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti WRITE, ti3 WRITE; +include/start_slave.inc +# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +# Wait for replica to progress until unblocked transactions are queued for group commit.. +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [GTID slave state should reach second N transaction] +set @@global.slave_parallel_mode=CONSERVATIVE; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 6: +# If retrying a T transaction while STOP SLAVE is issued, the +# transaction should be rolled back and the slave abruptly stopped +connection master; +insert into ti values (111); +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +include/sync_with_master_gtid.inc +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +set @@global.innodb_lock_wait_timeout= 2; +BEGIN; +SELECT * FROM ti WHERE a=111 FOR UPDATE; +a +111 +connection master; +include/save_master_gtid.inc +update ti set a=a+1 where a=111; +connection slave; +include/start_slave.inc +# Wait for replicating transaction to wait for innodb table lock +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +connection slave1; +STOP SLAVE;; +connection slave; +include/wait_for_slave_sql_to_stop.inc +ROLLBACK; +connection slave1; +connection slave; +include/assert.inc [The retried T transaction should have been rolled back] +set @@global.innodb_lock_wait_timeout= 50; +# +# Common Test Case 7: +# Using multiple parallel replication threads on a workload with a +# non-transactional transaction in-between transactional transactions.. +# 7a: with AGGRESSIVE replication where the N statement has been +# executed already, all transactions up to and including N should +# be replicated, and all transactions afterwards should be rolled +# back. +# 7b: with MINIMAL replication, the N statement should not execute +# concurrently, but should wait along with the other later +# transactions, and all future transactions except the first should +# be rolled back. +connection slave; +include/stop_slave.inc +Warnings: +Note 1255 Slave already has been stopped +set @@global.slave_parallel_threads=4; +connection slave; +# +# 7a: slave_parallel_mode=AGGRESSIVE +set @@global.slave_parallel_mode=AGGRESSIVE; +connection slave; +connection master; +connection master; +insert into ti values (113); +insert into tm values (202); +insert into ti2 values (403); +insert into ti values (114); +include/save_master_gtid.inc +connection slave; +LOCK TABLES ti WRITE; +connection slave_lock_extra; +LOCK TABLES ti2 WRITE; +include/start_slave.inc +# Wait for replica to halt due to locks and dependency requirements +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +connection slave_lock_extra; +UNLOCK TABLES; +connection slave1; +connection slave; +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [The entirety of the first two transactions should have committed with AGGRESSIVE parallelization] +include/assert.inc [Slave state should be consistent] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection slave; +# +# 7b: slave_parallel_mode=MINIMAL +set @@global.slave_parallel_mode=MINIMAL; +connection slave; +connection master; +connection master; +insert into ti values (115); +insert into tm values (202); +insert into ti2 values (404); +insert into ti values (116); +include/save_master_gtid.inc +connection slave; +LOCK TABLES ti WRITE; +connection slave_lock_extra; +LOCK TABLES ti2 WRITE; +include/start_slave.inc +# Wait for replica to halt due to locks and dependency requirements +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +connection slave_lock_extra; +UNLOCK TABLES; +connection slave1; +connection slave; +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [All transactions should have rolled back with MINIMAL parallelization] +include/assert.inc [Slave state should be consistent] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +include/start_slave.inc +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +include/sync_with_master_gtid.inc +# +# ROW Test Case 1: +# Using an N multi-statement transaction, ensure if STOP SLAVE is +# issued in-between row updates, that the transaction is finished. +connection master; +truncate table ti; +truncate table tm; +# Set up multiple rows to allow a multi-statement update rows event +insert into tm values (202); +insert into tm values (203); +connection slave; +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +connection master; +# Next-to-commit non-transactional transaction should finish +update tm set a=a+1; +include/save_master_gtid.inc +# This should not be committed because it is after next-to-commit +insert into ti values (117); +connection slave; +set @@global.debug_dbug="+d,pause_after_next_row_exec"; +START SLAVE; +set debug_sync= "now WAIT_FOR row_executed"; +connection slave1; +STOP SLAVE;; +connection slave; +set @@global.debug_dbug=""; +set debug_sync= "now SIGNAL continue_row_execution"; +connection slave1; +include/wait_for_slave_sql_to_stop.inc +# Slave should be error-free +include/assert.inc [Slave should be error free] +set debug_sync= "RESET"; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# ROW Test Case 2: +# Using a T multi-statement transaction, ensure if STOP SLAVE is +# issued in-between row updates, that the transaction is rolled back. +connection master; +truncate table ti; +truncate table ti2; +truncate table tm; +insert into ti values (118); +insert into ti values (119); +connection slave; +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +connection master; +# Next-to-commit transactional multi-row event should be rolled back +include/save_master_gtid.inc +update ti set a=a+1; +insert into ti values (120); +connection slave; +set @@global.debug_dbug="+d,pause_after_next_row_exec"; +START SLAVE; +set debug_sync= "now WAIT_FOR row_executed"; +connection slave1; +STOP SLAVE;; +connection slave; +set @@global.debug_dbug=""; +set debug_sync= "now SIGNAL continue_row_execution"; +connection slave1; +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [No new rows should have been inserted] +# Comparing master gtid 0-1-42 to slaves 0-1-42 +include/assert.inc [No transactions should have committed] +# Slave should be error-free +include/assert.inc [Slave should be error free] +connection master; +include/save_master_gtid.inc +connection slave; +set debug_sync= "RESET"; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Row Test Case 3: +# A workload with a later transaction that updates a sequence table +# should complete all transactions up to the sequence table update. +# Workload: +# T (long running); should commit +# S (waiting for prior commit); should commit +# T (long running); should rollback +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=AGGRESSIVE; +set @@global.slave_parallel_threads=3; +connection master; +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10002; +insert into ti values (121); +select next value for s1; +next value for s1 +1 +include/save_master_gtid.inc +insert into ti2 values (405); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti write, ti2 WRITE; +include/start_slave.inc +# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +# Wait for replica to progress until unblocked transactions are queued for group commit.. +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [GTID slave state should not change] +set @@global.slave_parallel_mode=CONSERVATIVE; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Cleanup +connection master; +DROP TABLE ti, ti2, ti3, tm, tm2, s1; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +set @@global.debug_dbug=""; +set @@global.slave_parallel_threads=0; +set @@global.slave_parallel_mode=conservative; +include/start_slave.inc +include/rpl_end.inc +# End of tests diff --git a/mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result b/mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result new file mode 100644 index 00000000000..18b06f5054f --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result @@ -0,0 +1,461 @@ +include/master-slave.inc +[connection master] +# +# Setup +connection slave; +include/stop_slave.inc +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); +set @@global.slave_parallel_mode=CONSERVATIVE; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +change master to master_use_gtid=slave_pos; +include/start_slave.inc +connect slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT; +# +# Initialize test data +connection master; +set statement sql_log_bin=0 for call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +create table ti (a int primary key) engine=innodb; +create table ti2 (a int) engine=innodb; +create table ti3 (a int) engine=innodb; +create table tm (a int) engine=myisam; +create table tm2 (a int) engine=myisam; +connection slave; +# Run binlog format independent test cases +# +# Common Test Case 1: +# Using one parallel replication worker thread on workload {T,T}, ensure +# the replica immediately rolls back the transaction and stops the +# SQL thread +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +connection master; +include/save_master_gtid.inc +BEGIN; +insert into ti values (100); +insert into ti values (101); +COMMIT; +insert into ti values (102); +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transaction +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No new rows should have been inserted] +include/assert.inc [GTID slave state should not change] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 2: +# Using multiple parallel replication threads (two) on workload {T,T}, +# ensure both transactions are rolled back if stop slave is issued +# in the middle of the first transaction. +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=2; +connection master; +include/save_master_gtid.inc +BEGIN; +insert into ti values (103); +insert into ti values (104); +COMMIT; +insert into ti values (105); +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transaction +connection slave; +# Wait for second transaction to begin +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No insertions should have committed] +include/assert.inc [GTID slave state should not change] +# Slave should be error-free +include/assert.inc [Slave should be error free] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 3: +# Using multiple parallel replication threads (two) on workload {T,T}, +# with the same commit id (cid), ensure both transactions are rolled +# back if stop slave is issued +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=AGGRESSIVE; +set @@global.slave_parallel_threads=2; +connection master; +include/save_master_gtid.inc +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10000; +BEGIN; +insert into ti values (106); +insert into ti values (107); +COMMIT; +insert into ti2 values (400); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transactions +connection slave; +# Wait for second transaction to start group commit +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No insertions should have committed] +include/assert.inc [GTID slave state should not change] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 4: +# Using multiple parallel replication threads (4) on workload +# T (long running); should commit +# N (waiting for prior commit); should commit +# T (long running); should rollback +# T (waiting for prior commit); should rollback +# Issuing STOP SLAVE should allow the first two transactions to commit +# while preventing and rolling back the third +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=optimistic; +set @@global.slave_parallel_threads=4; +connection master; +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10001; +BEGIN; +insert into ti values (108); +insert into ti values (109); +COMMIT; +connection master; +insert into tm values (200); +include/save_master_gtid.inc +insert into ti2 values (401); +insert into ti3 values (500); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti WRITE, ti2 WRITE; +include/start_slave.inc +# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +# Wait for replica to progress until unblocked transactions are queued for group commit.. +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [GTID slave state should reach first N transaction] +set @@global.slave_parallel_mode=CONSERVATIVE; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 5: +# Using multiple parallel replication threads (5) on workload +# T (long running); should commit +# N (waiting for prior commit); should commit +# T (waiting for prior commit); should commit +# N (waiting for prior commit); should commit +# T (long running); should rollback +# Issuing STOP SLAVE should allow all transactions up to and including +# the last N (4th) to commit, while preventing and rolling back the +# final transaction (5th) +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_mode=optimistic; +set @@global.slave_parallel_threads=5; +connection master; +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10002; +insert into ti values (110); +insert into tm values (201); +insert into ti2 values (402); +insert into tm2 values (300); +include/save_master_gtid.inc +insert into ti3 values (501); +SET @@SESSION.debug_dbug=@old_dbug; +connection slave; +LOCK TABLES ti WRITE, ti3 WRITE; +include/start_slave.inc +# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +# Wait for replica to progress until unblocked transactions are queued for group commit.. +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [GTID slave state should reach second N transaction] +set @@global.slave_parallel_mode=CONSERVATIVE; +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Common Test Case 6: +# If retrying a T transaction while STOP SLAVE is issued, the +# transaction should be rolled back and the slave abruptly stopped +connection master; +insert into ti values (111); +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +include/sync_with_master_gtid.inc +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +set @@global.innodb_lock_wait_timeout= 2; +BEGIN; +SELECT * FROM ti WHERE a=111 FOR UPDATE; +a +111 +connection master; +include/save_master_gtid.inc +update ti set a=a+1 where a=111; +connection slave; +include/start_slave.inc +# Wait for replicating transaction to wait for innodb table lock +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +connection slave1; +STOP SLAVE;; +connection slave; +include/wait_for_slave_sql_to_stop.inc +ROLLBACK; +connection slave1; +connection slave; +include/assert.inc [The retried T transaction should have been rolled back] +set @@global.innodb_lock_wait_timeout= 50; +# +# Common Test Case 7: +# Using multiple parallel replication threads on a workload with a +# non-transactional transaction in-between transactional transactions.. +# 7a: with AGGRESSIVE replication where the N statement has been +# executed already, all transactions up to and including N should +# be replicated, and all transactions afterwards should be rolled +# back. +# 7b: with MINIMAL replication, the N statement should not execute +# concurrently, but should wait along with the other later +# transactions, and all future transactions except the first should +# be rolled back. +connection slave; +include/stop_slave.inc +Warnings: +Note 1255 Slave already has been stopped +set @@global.slave_parallel_threads=4; +connection slave; +# +# 7a: slave_parallel_mode=AGGRESSIVE +set @@global.slave_parallel_mode=AGGRESSIVE; +connection slave; +connection master; +connection master; +insert into ti values (113); +insert into tm values (202); +insert into ti2 values (403); +insert into ti values (114); +include/save_master_gtid.inc +connection slave; +LOCK TABLES ti WRITE; +connection slave_lock_extra; +LOCK TABLES ti2 WRITE; +include/start_slave.inc +# Wait for replica to halt due to locks and dependency requirements +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +connection slave_lock_extra; +UNLOCK TABLES; +connection slave1; +connection slave; +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [The entirety of the first two transactions should have committed with AGGRESSIVE parallelization] +include/assert.inc [Slave state should be consistent] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +connection slave; +# +# 7b: slave_parallel_mode=MINIMAL +set @@global.slave_parallel_mode=MINIMAL; +connection slave; +connection master; +connection master; +insert into ti values (115); +insert into tm values (202); +insert into ti2 values (404); +insert into ti values (116); +include/save_master_gtid.inc +connection slave; +LOCK TABLES ti WRITE; +connection slave_lock_extra; +LOCK TABLES ti2 WRITE; +include/start_slave.inc +# Wait for replica to halt due to locks and dependency requirements +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +connection slave_lock_extra; +UNLOCK TABLES; +connection slave1; +connection slave; +include/wait_for_slave_sql_to_stop.inc +include/assert.inc [All transactions should have rolled back with MINIMAL parallelization] +include/assert.inc [Slave state should be consistent] +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +include/stop_slave.inc +include/start_slave.inc +connection master; +include/save_master_gtid.inc +connection slave; +include/start_slave.inc +Warnings: +Note 1254 Slave is already running +include/sync_with_master_gtid.inc +# +# Statement Test Case 1: +# Using one parallel replication worker thread on workload {N,T}, ensure +# the replica finishes the non-transactional transaction, and does not +# start the next +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +connection master; +SET @@session.binlog_direct_non_transactional_updates= 0; +BEGIN; +insert into ti values (117); +insert into tm values (202); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction +insert into tm2 values (301); +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction +COMMIT; +include/save_master_gtid.inc +insert into ti values (118); +connection slave; +lock tables tm2 write; +START SLAVE; +# Wait for replica to get stuck on held lock +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +# Unlock row-level lock holding transaction +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [Transaction should have committed] +include/assert.inc [N should have been applied] +# Slave should be error-free +include/assert.inc [Slave should be error free] +connection master; +include/save_master_gtid.inc +SET @@session.binlog_direct_non_transactional_updates= 1; +connection slave; +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Statement Test Case 2: +# If STOP SLAVE is issued on a parallel slave, such that the next to +# commit transaction is T; even if the next event from the group will +# commit the transaction (e.g. XID_EVENT), the transaction should be +# stopped and rolled back. +connection slave; +include/stop_slave.inc +set @@global.slave_parallel_threads=1; +connection master; +insert into ti values (119); +insert into ti values (120); +include/save_master_gtid.inc +connection slave; +LOCK TABLES ti WRITE; +include/start_slave.inc +# Wait for replica to begin executing the first transaction +connection slave; +connection slave1; +STOP SLAVE;; +connection slave; +# Wait for replica to signal worker threads to stop +UNLOCK TABLES; +include/wait_for_slave_sql_to_stop.inc +connection slave1; +connection slave; +include/assert.inc [No insertions should have committed] +include/assert.inc [GTID slave state should increment to the first transaction] +include/start_slave.inc +include/sync_with_master_gtid.inc +# +# Cleanup +connection master; +DROP TABLE ti, tm, ti2, tm2, ti3; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +include/stop_slave.inc +set @@global.slave_parallel_threads=0; +set @@global.slave_domain_parallel_threads=0; +set @@global.slave_parallel_mode=conservative; +set @@global.debug_dbug=""; +include/start_slave.inc +include/rpl_end.inc +# End of tests diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index 9ba7a30f2eb..433e7c9d8c4 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -949,8 +949,9 @@ SET debug_sync='now WAIT_FOR t4_waiting'; --replace_result $d1_thd_id THD_ID eval KILL $d1_thd_id; -# Wait until T3 has reacted on the kill. -SET debug_sync='now WAIT_FOR t3_killed'; +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc # Now we can allow T1 to proceed. SET debug_sync='now SIGNAL t1_cont'; @@ -959,7 +960,7 @@ SET debug_sync='now SIGNAL t1_cont'; --source include/wait_for_slave_sql_error.inc STOP SLAVE IO_THREAD; # Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time -# to commit or not before the stop. However, T1 should commit, and T3/T4 may +# to commit or not before the stop. However, T1 should rollback, and T3/T4 may # not have committed. (After slave restart we check that all become committed # eventually). SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a; @@ -1058,6 +1059,11 @@ SET debug_sync='now WAIT_FOR wait_queue_ready'; eval KILL $thd_id; SET debug_sync='now WAIT_FOR wait_queue_killed'; + +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + SET debug_sync='now SIGNAL query_cont'; --let $slave_sql_errno= 1317,1927,1964 @@ -1075,6 +1081,14 @@ SET binlog_format=@old_format; --connection server_2 SET debug_sync='RESET'; --source include/start_slave.inc + +# Test amendment from MDEV-13915: +# A worker thread's event queue is no longer executed on replica stop. +# The signal query_cont needs to be re-sent because the transaction was +# aborted. +SET debug_sync='now WAIT_FOR query_waiting'; +SET debug_sync='now SIGNAL query_cont'; + --sync_with_master SELECT * FROM t3 WHERE a >= 80 ORDER BY a; diff --git a/mysql-test/suite/rpl/t/rpl_parallel2.test b/mysql-test/suite/rpl/t/rpl_parallel2.test index 8934b15e546..506e074110c 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel2.test +++ b/mysql-test/suite/rpl/t/rpl_parallel2.test @@ -7,6 +7,7 @@ --echo *** MDEV-5509: Incorrect value for Seconds_Behind_Master if parallel replication *** --connection server_2 +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; set @old_parallel_mode= @@GLOBAL.slave_parallel_mode; --source include/stop_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test index 27f38d47bdb..35f28073a74 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test @@ -122,10 +122,10 @@ SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema --echo # Slave_SQL_Running YES = $status # B. In the fixed version W3 is waiting for W2,... ---let $wait_condition= SELECT count(*) = 1 as "W4 is waiting" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" +--let $wait_condition= SELECT count(*) = 1 as "W3 is waiting" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" --source include/wait_condition.inc --echo # while W2 is held back ... ---let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" +--let $wait_condition= SELECT count(*) >= 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" --source include/wait_condition.inc # C. # ...until NOW. @@ -143,7 +143,7 @@ if ($old_version_regression) --let $wait_condition= SELECT count(*) = 0 as "W3 does not wait on W2" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" --source include/wait_condition.inc - --let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" + --let $wait_condition= SELECT count(*) >= 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" --source include/wait_condition.inc # Like above, but signaling is done after W4 is done to violate the commit order diff --git a/mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test b/mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test new file mode 100644 index 00000000000..56ad9e34a93 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test @@ -0,0 +1,268 @@ +# +# Validate that STOP SLAVE works in a timely manner on a parallel replica with +# ROW binary logging format. +# +--source include/have_debug.inc +--source include/have_debug_sync.inc +--source include/master-slave.inc +--source include/have_innodb.inc +--source include/have_binlog_format_row.inc + +--echo # +--echo # Setup +--connection slave +--source include/stop_slave.inc +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Can't find record"); +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure"); +--let $old_debug= `SELECT @@global.debug_dbug` +--let $old_threads= `SELECT @@global.slave_parallel_threads` +--let $old_slave_mode= `SELECT @@global.slave_parallel_mode` +set @@global.slave_parallel_mode=CONSERVATIVE; +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +--connect(slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT) +CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS; +--source include/start_slave.inc + +--echo # +--echo # Initialize test data +--connection master +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); + +# Needed by this test and include/rpl_par_stop_slave_quick.inc + +create sequence s1; +create table ti (a int) engine=innodb; +create table ti2 (a int) engine=innodb; +create table ti3 (a int) engine=innodb; +create table tm (a int) engine=myisam; +create table tm2 (a int) engine=myisam; +--let $ti_ctr= 100 +--let $tm_ctr= 200 +--let $tm2_ctr= 300 +--let $ti2_ctr= 400 +--let $ti3_ctr= 500 +--sync_slave_with_master + +--echo # Run binlog format independent test cases +--source include/rpl_par_stop_slave_quick_common.test + +--echo # +--echo # ROW Test Case 1: +--echo # Using an N multi-statement transaction, ensure if STOP SLAVE is +--echo # issued in-between row updates, that the transaction is finished. + +--connection master +truncate table ti; +truncate table tm; +--echo # Set up multiple rows to allow a multi-statement update rows event +--eval insert into tm values ($tm_ctr) +--inc $tm_ctr +--eval insert into tm values ($tm_ctr) +--inc $tm_ctr +--sync_slave_with_master + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=1; +--let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm) t` + +--connection master + +--echo # Next-to-commit non-transactional transaction should finish +--eval update tm set a=a+1 +--source include/save_master_gtid.inc +--let $master_gtid_after_update= `select @@global.gtid_binlog_pos` + +--echo # This should not be committed because it is after next-to-commit +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +--connection slave +set @@global.debug_dbug="+d,pause_after_next_row_exec"; + +START SLAVE; +set debug_sync= "now WAIT_FOR row_executed"; + +--connection slave1 +--send STOP SLAVE; + +--connection slave +set @@global.debug_dbug=""; +set debug_sync= "now SIGNAL continue_row_execution"; + +--connection slave1 +--reap +--source include/wait_for_slave_sql_to_stop.inc + +--echo # Slave should be error-free +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +--let $assert_text= Slave should be error free +--let $assert_cond= $last_error = 0 +--source include/assert.inc + +set debug_sync= "RESET"; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # ROW Test Case 2: +--echo # Using a T multi-statement transaction, ensure if STOP SLAVE is +--echo # issued in-between row updates, that the transaction is rolled back. + +--connection master +truncate table ti; +truncate table ti2; +truncate table tm; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--sync_slave_with_master + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=1; +--let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm) t` + +--connection master + +--echo # Next-to-commit transactional multi-row event should be rolled back +--source include/save_master_gtid.inc +--let $master_gtid_initial= `select @@global.gtid_binlog_pos` +--eval update ti set a=a+1 + +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +--connection slave +set @@global.debug_dbug="+d,pause_after_next_row_exec"; +START SLAVE; +set debug_sync= "now WAIT_FOR row_executed"; + +--connection slave1 +--send STOP SLAVE; + +--connection slave +set @@global.debug_dbug=""; +set debug_sync= "now SIGNAL continue_row_execution"; + +--connection slave1 +--reap +--source include/wait_for_slave_sql_to_stop.inc + +--let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm) t` +--let $row_count_diff=`select ($row_count_end-$row_count_initial)` +--let $assert_text= No new rows should have been inserted +--let $assert_cond= $row_count_diff = 0 +--source include/assert.inc + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--echo # Comparing master gtid $master_pos to slaves $slave_gtid +--let $assert_text= No transactions should have committed +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +--echo # Slave should be error-free +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +--let $assert_text= Slave should be error free +--let $assert_cond= $last_error = 0 +--source include/assert.inc + +--connection master +--source include/save_master_gtid.inc + +--connection slave +set debug_sync= "RESET"; +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Row Test Case 3: +--echo # A workload with a later transaction that updates a sequence table +--echo # should complete all transactions up to the sequence table update. +--echo # Workload: +--echo # T (long running); should commit +--echo # S (waiting for prior commit); should commit +--echo # T (long running); should rollback + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_mode=AGGRESSIVE; +set @@global.slave_parallel_threads=3; + +--connection master +SET @old_dbug= @@SESSION.debug_dbug; +SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; +SET @commit_id= 10002; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +select next value for s1; +--source include/save_master_gtid.inc + +--eval insert into ti2 values ($ti2_ctr) +--inc $ti2_ctr + +SET @@SESSION.debug_dbug=@old_dbug; + +--connection slave +LOCK TABLES ti write, ti2 WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. +--let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--echo # Wait for replica to progress until unblocked transactions are queued for group commit.. +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should not change +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +set @@global.slave_parallel_mode=CONSERVATIVE; + +--connection master +--source include/save_master_gtid.inc +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Cleanup +--connection master +DROP TABLE ti, ti2, ti3, tm, tm2, s1; +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +--eval set @@global.debug_dbug="$old_debug" +--eval set @@global.slave_parallel_threads=$old_threads +--eval set @@global.slave_parallel_mode=$old_slave_mode +--source include/start_slave.inc + +--source include/rpl_end.inc + +--echo # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test b/mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test new file mode 100644 index 00000000000..b76979c62da --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test @@ -0,0 +1,200 @@ +# +# Validate that STOP SLAVE works in a timely manner on a parallel replica with +# STATEMENT binary logging format. +# +--source include/have_debug.inc +--source include/master-slave.inc +--source include/have_innodb.inc +--source include/have_binlog_format_statement.inc + +--echo # +--echo # Setup +--connection slave +--source include/stop_slave.inc +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); +--let $old_threads= `SELECT @@global.slave_parallel_threads` +--let $old_domain_threads= `SELECT @@global.slave_domain_parallel_threads` +--let $old_slave_mode= `SELECT @@global.slave_parallel_mode` +--let $old_debug_dbug= `SELECT @@global.debug_dbug` +set @@global.slave_parallel_mode=CONSERVATIVE; + +ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; +change master to master_use_gtid=slave_pos; +--source include/start_slave.inc +--connect(slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT) + +--echo # +--echo # Initialize test data +--connection master +set statement sql_log_bin=0 for call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); +create table ti (a int primary key) engine=innodb; +create table ti2 (a int) engine=innodb; +create table ti3 (a int) engine=innodb; +create table tm (a int) engine=myisam; +create table tm2 (a int) engine=myisam; +--let $ti_ctr= 100 +--let $tm_ctr= 200 +--let $tm2_ctr= 300 +--let $ti2_ctr= 400 +--let $ti3_ctr= 500 +--sync_slave_with_master + +--echo # Run binlog format independent test cases +--source include/rpl_par_stop_slave_quick_common.test + +--echo # +--echo # Statement Test Case 1: +--echo # Using one parallel replication worker thread on workload {N,T}, ensure +--echo # the replica finishes the non-transactional transaction, and does not +--echo # start the next + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=1; +--let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from tm2) t` + +--connection master +--let $old_binlog_direct= `SELECT @@global.binlog_direct_non_transactional_updates` +SET @@session.binlog_direct_non_transactional_updates= 0; +BEGIN; +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into tm values ($tm_ctr) +--inc $tm_ctr +--eval insert into tm2 values ($tm2_ctr) +--inc $tm_ctr +COMMIT; +--source include/save_master_gtid.inc + +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr + +--connection slave +lock tables tm2 write; +START SLAVE; + +--echo # Wait for replica to get stuck on held lock +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc + +--echo # Unlock row-level lock holding transaction +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from tm2) t` +--let $row_count_diff=`select ($row_count_end-$row_count_initial)` +--let $assert_text= Transaction should have committed +--let $assert_cond= $row_count_diff = 3 +--source include/assert.inc + +--let $slave_gtid= `select @@global.gtid_slave_pos` +# N is the non-transactional transaction +--let $assert_text= N should have been applied +--let $assert_cond= $master_pos = $slave_gtid +--source include/assert.inc + +--echo # Slave should be error-free +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +--let $assert_text= Slave should be error free +--let $assert_cond= $last_error = 0 +--source include/assert.inc + +--connection master +--source include/save_master_gtid.inc +--eval SET @@session.binlog_direct_non_transactional_updates= $old_binlog_direct + +--connection slave +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Statement Test Case 2: +--echo # If STOP SLAVE is issued on a parallel slave, such that the next to +--echo # commit transaction is T; even if the next event from the group will +--echo # commit the transaction (e.g. XID_EVENT), the transaction should be +--echo # stopped and rolled back. + +--connection slave +--source include/stop_slave.inc +set @@global.slave_parallel_threads=1; +--let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm) t` + +--connection master +--let $master_gtid_cmp= `select @@global.gtid_binlog_pos` +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--eval insert into ti values ($ti_ctr) +--inc $ti_ctr +--source include/save_master_gtid.inc + +--connection slave +LOCK TABLES ti WRITE; +--source include/start_slave.inc + +--echo # Wait for replica to begin executing the first transaction +--connection slave +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; +--source include/wait_condition.inc + +--connection slave1 +--send STOP SLAVE; + +--connection slave +--echo # Wait for replica to signal worker threads to stop +--let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; +--source include/wait_condition.inc +UNLOCK TABLES; +--source include/wait_for_slave_sql_to_stop.inc + +--connection slave1 +--reap +--connection slave + +--let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm) t` +--let $row_count_diff=`select ($row_count_end-$row_count_initial)` +--let $assert_text= No insertions should have committed +--let $assert_cond= $row_count_diff = 0 +--source include/assert.inc + +--let $slave_gtid= `select @@global.gtid_slave_pos` +--let $assert_text= GTID slave state should increment to the first transaction +--let $assert_cond= $master_gtid_cmp = $slave_gtid +--source include/assert.inc + +--source include/start_slave.inc +--source include/sync_with_master_gtid.inc + + +--echo # +--echo # Cleanup +--connection master +DROP TABLE ti, tm, ti2, tm2, ti3; +--source include/save_master_gtid.inc + +--connection slave +--source include/sync_with_master_gtid.inc +--source include/stop_slave.inc +--eval set @@global.slave_parallel_threads=$old_threads +--eval set @@global.slave_domain_parallel_threads=$old_domain_threads +--eval set @@global.slave_parallel_mode=$old_slave_mode +--eval set @@global.debug_dbug="$old_debug_dbug" +--source include/start_slave.inc + +--source include/rpl_end.inc + +--echo # End of tests diff --git a/sql/log_event.cc b/sql/log_event.cc index bafcf34cc2e..0bd1e28abfe 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -8013,7 +8013,10 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg, thd_arg->transaction.all.has_created_dropped_temp_table() || thd_arg->transaction.all.trans_executed_admin_cmd()) flags2|= FL_DDL; - else if (is_transactional && !is_tmp_table) + else if (is_transactional && !is_tmp_table && + !(thd_arg->transaction.all.modified_non_trans_table && + thd->variables.binlog_direct_non_trans_update == 0 && + !thd->is_current_stmt_binlog_format_row())) flags2|= FL_TRANSACTIONAL; if (!(thd_arg->variables.option_bits & OPTION_RPL_SKIP_PARALLEL)) flags2|= FL_ALLOW_PARALLEL; @@ -8144,7 +8147,6 @@ Gtid_log_event::do_apply_event(rpl_group_info *rgi) thd->variables.server_id= this->server_id; thd->variables.gtid_domain_id= this->domain_id; thd->variables.gtid_seq_no= this->seq_no; - rgi->gtid_ev_flags2= flags2; thd->reset_for_next_command(); if (opt_gtid_strict_mode && opt_bin_log && opt_log_slave_updates) @@ -11672,8 +11674,27 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) if (!table->in_use) table->in_use= thd; + /* + Exit early, and let the Event-level exit logic take care of the cleanup + and rollback. + */ + if (rgi->rli->mi->using_parallel() && + rgi->parallel_entry->stop_abrupt(rgi->rli) && + rgi->parallel_entry->rgi_is_safe_to_terminate(rgi)) + break; + error= do_exec_row(rgi); + + DBUG_EXECUTE_IF( + "pause_after_next_row_exec", + { + DBUG_ASSERT(!debug_sync_set_action( + thd, + STRING_WITH_LEN( + "now SIGNAL row_executed WAIT_FOR continue_row_execution"))); + }); + if (unlikely(error)) DBUG_PRINT("info", ("error: %s", HA_ERR(error))); DBUG_ASSERT(error != HA_ERR_RECORD_DELETED); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c110baa9634..b18f14d1de3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9560,6 +9560,7 @@ PSI_stage_info stage_waiting_for_work_from_sql_thread= { 0, "Waiting for work fr PSI_stage_info stage_waiting_for_prior_transaction_to_commit= { 0, "Waiting for prior transaction to commit", 0}; PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit= { 0, "Waiting for prior transaction to start commit before starting next transaction", 0}; PSI_stage_info stage_waiting_for_room_in_worker_thread= { 0, "Waiting for room in worker thread event queue", 0}; +PSI_stage_info stage_waiting_for_worker_stop= { 0, "Waiting for worker thread to stop", 0}; PSI_stage_info stage_waiting_for_workers_idle= { 0, "Waiting for worker threads to be idle", 0}; PSI_stage_info stage_waiting_for_ftwrl= { 0, "Waiting due to global read lock", 0}; PSI_stage_info stage_waiting_for_ftwrl_threads_to_pause= { 0, "Waiting for worker threads to pause for global read lock", 0}; diff --git a/sql/mysqld.h b/sql/mysqld.h index f521ea23638..0c80792168e 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -535,6 +535,7 @@ extern PSI_stage_info stage_waiting_for_work_from_sql_thread; extern PSI_stage_info stage_waiting_for_prior_transaction_to_commit; extern PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit; extern PSI_stage_info stage_waiting_for_room_in_worker_thread; +extern PSI_stage_info stage_waiting_for_worker_stop; extern PSI_stage_info stage_waiting_for_workers_idle; extern PSI_stage_info stage_waiting_for_ftwrl; extern PSI_stage_info stage_waiting_for_ftwrl_threads_to_pause; diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 6ca582e4f21..2dce2880218 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -96,7 +96,7 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev) rli= qev->rgi->rli; e= qev->entry_for_queued; if (e->stop_on_error_sub_id < (uint64)ULONGLONG_MAX || - (e->force_abort && !rli->stop_for_until)) + (e->stop_abrupt(rli))) return; mysql_mutex_lock(&rli->data_lock); @@ -173,7 +173,7 @@ finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id, mark_start_commit() calls can be made and it is safe to de-allocate the GCO. */ - err= wfc->wait_for_prior_commit(thd); + err= wfc->wait_for_prior_commit(thd, true); if (unlikely(err) && !rgi->worker_error) signal_error_to_sql_driver_thread(thd, rgi, err); thd->wait_for_commit_ptr= NULL; @@ -395,13 +395,14 @@ do_gco_wait(rpl_group_info *rgi, group_commit_orderer *gco, } while (wait_count > entry->count_committing_event_groups); } - if (entry->force_abort && wait_count > entry->stop_count) + if (entry->force_abort && wait_count >= entry->stop_count) { /* We are stopping (STOP SLAVE), and this event group is beyond the point where we can safely stop. So return a flag that will cause us to skip, rather than execute, the following events. */ + DBUG_ASSERT(entry->rgi_is_safe_to_terminate(rgi)); return true; } else @@ -461,6 +462,16 @@ do_ftwrl_wait(rpl_group_info *rgi, if (sub_id > entry->largest_started_sub_id) entry->largest_started_sub_id= sub_id; + /* + If this rgi is non-transactional, and the state of our current entry + (incorrectly) views the rgi as safe to terminate, we change our state + to disallow this rgi from stop/rollback in the event of STOP SLAVE. + */ + if (!(rgi->gtid_ev_flags2 & Gtid_log_event::FL_TRANSACTIONAL) && + entry->unsafe_rollback_marker_sub_id.load(std::memory_order_relaxed) < + rgi->gtid_sub_id) + entry->unsafe_rollback_marker_sub_id= sub_id; + DBUG_RETURN(aborted); } @@ -1370,7 +1381,9 @@ handle_rpl_parallel_thread(void *arg) if (!err) #endif { - if (unlikely(thd->check_killed())) + if (unlikely(thd->check_killed()) || + (entry->stop_abrupt(rgi->rli) && + entry->rgi_is_safe_to_terminate(rgi))) { thd->clear_error(); thd->get_stmt_da()->reset_diagnostics_area(); @@ -2339,6 +2352,7 @@ rpl_parallel::wait_for_done(THD *thd, Relay_log_info *rli) struct rpl_parallel_entry *e; rpl_parallel_thread *rpt; uint32 i, j; + PSI_stage_info old_stage; /* First signal all workers that they must force quit; no more events will @@ -2399,9 +2413,11 @@ rpl_parallel::wait_for_done(THD *thd, Relay_log_info *rli) if ((rpt= e->rpl_threads[j])) { mysql_mutex_lock(&rpt->LOCK_rpl_thread); + thd->ENTER_COND(&rpt->COND_rpl_thread_stop, &rpt->LOCK_rpl_thread, + &stage_waiting_for_worker_stop, &old_stage); while (rpt->current_owner == &e->rpl_threads[j]) mysql_cond_wait(&rpt->COND_rpl_thread_stop, &rpt->LOCK_rpl_thread); - mysql_mutex_unlock(&rpt->LOCK_rpl_thread); + thd->EXIT_COND(&old_stage); } } } @@ -2501,6 +2517,17 @@ rpl_parallel_entry::queue_master_restart(rpl_group_info *rgi, return 0; } +bool rpl_parallel_entry::stop_abrupt(Relay_log_info *rli) +{ + return force_abort.load(std::memory_order_relaxed) && !rli->stop_for_until; +} + +bool rpl_parallel_entry::rgi_is_safe_to_terminate(rpl_group_info *rgi) +{ + return unsafe_rollback_marker_sub_id.load(std::memory_order_relaxed) < + rgi->gtid_sub_id; +} + int rpl_parallel::wait_for_workers_idle(THD *thd) diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 650aa06e504..9ad9b0b61dd 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -272,7 +272,7 @@ struct rpl_parallel_entry { so worker threads must force abort any current transactions without waiting for event groups to complete. */ - bool force_abort; + std::atomic force_abort; /* At STOP SLAVE (force_abort=true), we do not want to process all events in the queue (which could unnecessarily delay stop, if a lot of events happen @@ -349,10 +349,34 @@ struct rpl_parallel_entry { /* The group_commit_orderer object for the events currently being queued. */ group_commit_orderer *current_gco; + /* + Marks the highest sub id that all transactions up to it must be executed to + allow for a consistent replication state; and all active transactions + afterwards can safely be stopped and rolled back. + */ + std::atomic unsafe_rollback_marker_sub_id; + rpl_parallel_thread * choose_thread(rpl_group_info *rgi, bool *did_enter_cond, PSI_stage_info *old_stage, bool reuse); int queue_master_restart(rpl_group_info *rgi, Format_description_log_event *fdev); + + /* + Check if we are stopping the slave as a direct command from the user, as + opposed to force_abort being set due to the UNTIL clause from START SLAVE. + + Returns 1 if the slave has been explicitly ordered to stop, 0 otherwise. + */ + bool stop_abrupt(Relay_log_info *rli); + + /* + Check if the rgi is safe to stop and rollback in the event of an abrupt + stop of the parallel slave. + + Returns 1 if we can safely terminate and rollback the transaction, 0 + otherwise + */ + bool rgi_is_safe_to_terminate(rpl_group_info *rgi); }; struct rpl_parallel { HASH domain_hash; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 04fddb3e74b..48fd9b1f435 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -2188,6 +2188,7 @@ event_group_new_gtid(rpl_group_info *rgi, Gtid_log_event *gev) rgi->current_gtid.server_id= gev->server_id; rgi->current_gtid.seq_no= gev->seq_no; rgi->commit_id= gev->commit_id; + rgi->gtid_ev_flags2= gev->flags2; rgi->gtid_pending= true; return 0; } diff --git a/sql/slave.cc b/sql/slave.cc index f43240a8866..647756482d5 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3631,6 +3631,8 @@ int has_temporary_error(THD *thd) { uint current_errno; + rpl_group_info *rgi= thd->rgi_slave; + Relay_log_info *rli= rgi->rli; DBUG_ENTER("has_temporary_error"); DBUG_EXECUTE_IF("all_errors_are_temporary_errors", @@ -3648,6 +3650,11 @@ has_temporary_error(THD *thd) if (!likely(thd->is_error())) DBUG_RETURN(0); + if (rgi->rli->mi->using_parallel() && + rgi->parallel_entry->stop_abrupt(rli) && + rgi->parallel_entry->rgi_is_safe_to_terminate(rgi)) + DBUG_RETURN(0); + current_errno= thd->get_stmt_da()->sql_errno(); for (uint i= 0; i < slave_transaction_retry_error_length; i++) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index dc58d2a250a..81fcfa272a3 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -7639,7 +7639,7 @@ wait_for_commit::register_wait_for_prior_commit(wait_for_commit *waitee) */ int -wait_for_commit::wait_for_prior_commit2(THD *thd) +wait_for_commit::wait_for_prior_commit2(THD *thd, bool force_wait) { PSI_stage_info old_stage; wait_for_commit *loc_waitee; @@ -7664,9 +7664,24 @@ wait_for_commit::wait_for_prior_commit2(THD *thd) &stage_waiting_for_prior_transaction_to_commit, &old_stage); while ((loc_waitee= this->waitee.load(std::memory_order_relaxed)) && - likely(!thd->check_killed(1))) + (likely(!thd->check_killed(1)) || force_wait)) mysql_cond_wait(&COND_wait_commit, &LOCK_wait_commit); - if (!loc_waitee) + if (!loc_waitee +#ifndef EMBEDDED_LIBRARY + /* + If a worker has been killed prior to this wait, e.g. in do_gco_wait(), + then it should not perform thread cleanup if there are threads which + have yet to commit. This is to prevent the cleanup of resources that + the prior RGI may need, e.g. its GCO. This is achieved by skipping + the unregistration of the waitee, such that each subsequent call to + wait_for_prior_commit() will exit early (while maintaining the + dependence), thus allowing the final call to + thd->wait_for_prior_commit() within finish_event_group() to wait. + */ + || (thd->rgi_slave && (thd->rgi_slave->worker_error && + !thd->rgi_slave->did_mark_start_commit)) +#endif + ) { if (wakeup_error) my_error(ER_PRIOR_COMMIT_FAILED, MYF(0)); diff --git a/sql/sql_class.h b/sql/sql_class.h index 4e5aba33443..e177fc55d9d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2144,14 +2144,14 @@ struct wait_for_commit bool commit_started; void register_wait_for_prior_commit(wait_for_commit *waitee); - int wait_for_prior_commit(THD *thd) + int wait_for_prior_commit(THD *thd, bool force_wait= false) { /* Quick inline check, to avoid function call and locking in the common case where no wakeup is registered, or a registered wait was already signalled. */ if (waitee.load(std::memory_order_acquire)) - return wait_for_prior_commit2(thd); + return wait_for_prior_commit2(thd, force_wait); else { if (wakeup_error) @@ -2205,7 +2205,7 @@ struct wait_for_commit void wakeup(int wakeup_error); - int wait_for_prior_commit2(THD *thd); + int wait_for_prior_commit2(THD *thd, bool force_wait= false); void wakeup_subsequent_commits2(int wakeup_error); void unregister_wait_for_prior_commit2(); From 677d6f0f23355b1c3d7bdb71b3f881dfef60d489 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Jun 2023 16:44:35 +0200 Subject: [PATCH 54/80] MDEV-31183 binlog_encryption.encrypted_master_switch_to_unencrypted_gtid fails in BB with UBSAN runtime error: downcast of address sql/log.cc:11101:56: runtime error: downcast of address 0x7f9dc801e9c8 which does not point to an object of type 'Gtid_list_log_event' sql/sql_repl.cc:1429:12: runtime error: member call on address 0x7f1ca401ea48 which does not point to an object of type 'Gtid_list_log_event' --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 38ab6db746c..67e2d2f5b2a 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -10788,7 +10788,7 @@ get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list) if (fdle->start_decryption((Start_encryption_log_event*) ev)) { errormsg= "Could not set up decryption for binlog."; - break; + typ= UNKNOWN_EVENT; // to cleanup and abort below } } delete ev; From 8ed88e3455a20a72e6abdc5ff08d6d5cb612013e Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 6 Jun 2023 08:11:38 -0600 Subject: [PATCH 55/80] Revert "MDEV-13915: STOP SLAVE takes very long time on a busy system" This reverts commit 0a99d457b3cff4d08d01c2a5a74dcf81f45d79ec because it should go into only 10.5+ --- .../binlog_encryption/rpl_parallel.result | 7 +- .../rpl_par_stop_slave_quick_common.test | 608 ------------------ mysql-test/suite/rpl/r/rpl_parallel.result | 7 +- mysql-test/suite/rpl/r/rpl_parallel2.result | 1 - .../rpl/r/rpl_row_par_stop_slave_quick.result | 507 --------------- .../rpl/r/rpl_stm_par_stop_slave_quick.result | 461 ------------- mysql-test/suite/rpl/t/rpl_parallel.test | 20 +- mysql-test/suite/rpl/t/rpl_parallel2.test | 1 - .../t/rpl_parallel_optimistic_error_stop.test | 6 +- .../rpl/t/rpl_row_par_stop_slave_quick.test | 268 -------- .../rpl/t/rpl_stm_par_stop_slave_quick.test | 200 ------ sql/log_event.cc | 25 +- sql/mysqld.cc | 1 - sql/mysqld.h | 1 - sql/rpl_parallel.cc | 37 +- sql/rpl_parallel.h | 26 +- sql/rpl_rli.cc | 1 - sql/slave.cc | 7 - sql/sql_class.cc | 21 +- sql/sql_class.h | 6 +- 20 files changed, 24 insertions(+), 2187 deletions(-) delete mode 100644 mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test delete mode 100644 mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result delete mode 100644 mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result delete mode 100644 mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test delete mode 100644 mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test diff --git a/mysql-test/suite/binlog_encryption/rpl_parallel.result b/mysql-test/suite/binlog_encryption/rpl_parallel.result index 610e87e850e..b75a66a634a 100644 --- a/mysql-test/suite/binlog_encryption/rpl_parallel.result +++ b/mysql-test/suite/binlog_encryption/rpl_parallel.result @@ -732,7 +732,7 @@ SET debug_sync='now WAIT_FOR t3_waiting'; SET debug_sync='now SIGNAL d2_cont'; SET debug_sync='now WAIT_FOR t4_waiting'; KILL THD_ID; -# Wait for replica to signal worker threads to stop +SET debug_sync='now WAIT_FOR t3_killed'; SET debug_sync='now SIGNAL t1_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -742,6 +742,7 @@ a b 61 61 62 62 63 63 +64 64 68 68 69 69 70 70 @@ -815,7 +816,6 @@ connection server_2; SET debug_sync='now WAIT_FOR wait_queue_ready'; KILL THD_ID; SET debug_sync='now WAIT_FOR wait_queue_killed'; -# Wait for replica to signal worker threads to stop SET debug_sync='now SIGNAL query_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -827,8 +827,6 @@ SET binlog_format=@old_format; connection server_2; SET debug_sync='RESET'; include/start_slave.inc -SET debug_sync='now WAIT_FOR query_waiting'; -SET debug_sync='now SIGNAL query_cont'; SELECT * FROM t3 WHERE a >= 80 ORDER BY a; a b 80 0 @@ -1217,7 +1215,6 @@ connection server_2; include/wait_for_slave_sql_to_stop.inc SELECT * FROM t2 WHERE a >= 40 ORDER BY a; a -40 41 42 include/start_slave.inc diff --git a/mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test b/mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test deleted file mode 100644 index deac78660e8..00000000000 --- a/mysql-test/suite/rpl/include/rpl_par_stop_slave_quick_common.test +++ /dev/null @@ -1,608 +0,0 @@ -# -# The stop_slave_quick suite of tests aims to validate that stopping a replica -# with parallelization enabled will stop in a timely manner. That is, a -# parallel replica should try to immediately stop and roll-back any ongoing -# transactions. If any threads have a non-transactional workload, then it -# along with all prior transactions are executed before stopping. -# -# This file provides test cases that should be binlog format independent. There -# is, however, behavior that is specific to either statement or row format, -# which each have their own test files that include this file. -# -# Requirements: -# 1. Tables named `ti`, `ti2`, and `ti3` have already been created with -# storage engine InnoDB; and a table named `tm` has been created with -# storage engine MyIsam. -# 2. Test variables ti_ctr, ti2_ctr, ti3_ctr, and tm_ctr have been created -# to serve as dynamic values to insert into their respective tables -# -# References: -# MDEV-13915: STOP SLAVE takes very long time on a busy system -# - ---echo # ---echo # Common Test Case 1: ---echo # Using one parallel replication worker thread on workload {T,T}, ensure ---echo # the replica immediately rolls back the transaction and stops the ---echo # SQL thread ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=1; ---let $row_count_initial=`select count(*) from ti` - ---connection master ---source include/save_master_gtid.inc -BEGIN; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr -COMMIT; - ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - ---connection slave -LOCK TABLES ti WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to begin executing the first transaction ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $row_count_end=`select count(*) from ti` ---let $row_count_diff=`select ($row_count_end-$row_count_initial)` ---let $assert_text= No new rows should have been inserted ---let $assert_cond= $row_count_diff = 0 ---source include/assert.inc - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should not change ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - ---connection master ---source include/save_master_gtid.inc ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Common Test Case 2: ---echo # Using multiple parallel replication threads (two) on workload {T,T}, ---echo # ensure both transactions are rolled back if stop slave is issued ---echo # in the middle of the first transaction. - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=2; ---let $row_count_initial=`select count(*) from ti` - ---connection master ---source include/save_master_gtid.inc -BEGIN; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr -COMMIT; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - ---connection slave -LOCK TABLES ti WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to begin executing the first transaction ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---echo # Wait for second transaction to begin ---connection slave ---let $wait_condition= SELECT count(*)=0 FROM information_schema.processlist WHERE state LIKE 'Waiting for work from SQL thread' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $row_count_end=`select count(*) from ti` ---let $row_count_diff=`select ($row_count_end-$row_count_initial)` ---let $assert_text= No insertions should have committed ---let $assert_cond= $row_count_diff = 0 ---source include/assert.inc - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should not change ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - ---echo # Slave should be error-free -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); ---let $assert_text= Slave should be error free ---let $assert_cond= $last_error = 0 ---source include/assert.inc - ---connection master ---source include/save_master_gtid.inc ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Common Test Case 3: ---echo # Using multiple parallel replication threads (two) on workload {T,T}, ---echo # with the same commit id (cid), ensure both transactions are rolled ---echo # back if stop slave is issued - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_mode=AGGRESSIVE; -set @@global.slave_parallel_threads=2; ---let $row_count_initial=`select count(*) from ti` - ---connection master ---source include/save_master_gtid.inc -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10000; -BEGIN; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr -COMMIT; ---eval insert into ti2 values ($ti2_ctr) ---inc $ti2_ctr - -SET @@SESSION.debug_dbug=@old_dbug; - ---connection slave -LOCK TABLES ti WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to begin executing the first transactions ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---echo # Wait for second transaction to start group commit ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $row_count_end=`select count(*) from ti` ---let $row_count_diff=`select ($row_count_end-$row_count_initial)` ---let $assert_text= No insertions should have committed ---let $assert_cond= $row_count_diff = 0 ---source include/assert.inc - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should not change ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - ---connection master ---source include/save_master_gtid.inc - ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Common Test Case 4: ---echo # Using multiple parallel replication threads (4) on workload ---echo # T (long running); should commit ---echo # N (waiting for prior commit); should commit ---echo # T (long running); should rollback ---echo # T (waiting for prior commit); should rollback ---echo # Issuing STOP SLAVE should allow the first two transactions to commit ---echo # while preventing and rolling back the third ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_mode=optimistic; -set @@global.slave_parallel_threads=4; - ---connection master -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10001; -BEGIN; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr -COMMIT; - ---connection master ---eval insert into tm values ($tm_ctr) ---inc $tm_ctr ---source include/save_master_gtid.inc - ---eval insert into ti2 values ($ti2_ctr) ---inc $ti2_ctr - ---eval insert into ti3 values ($ti3_ctr) ---inc $ti3_ctr - -SET @@SESSION.debug_dbug=@old_dbug; - ---connection slave -LOCK TABLES ti WRITE, ti2 WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. ---let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---echo # Wait for replica to progress until unblocked transactions are queued for group commit.. ---connection slave ---let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should reach first N transaction ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - -set @@global.slave_parallel_mode=CONSERVATIVE; - ---connection master ---source include/save_master_gtid.inc ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Common Test Case 5: ---echo # Using multiple parallel replication threads (5) on workload ---echo # T (long running); should commit ---echo # N (waiting for prior commit); should commit ---echo # T (waiting for prior commit); should commit ---echo # N (waiting for prior commit); should commit ---echo # T (long running); should rollback ---echo # Issuing STOP SLAVE should allow all transactions up to and including ---echo # the last N (4th) to commit, while preventing and rolling back the ---echo # final transaction (5th) - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_mode=optimistic; -set @@global.slave_parallel_threads=5; - ---connection master -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10002; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - ---eval insert into tm values ($tm_ctr) ---inc $tm_ctr - ---eval insert into ti2 values ($ti2_ctr) ---inc $ti2_ctr - ---eval insert into tm2 values ($tm2_ctr) ---inc $tm2_ctr ---source include/save_master_gtid.inc - ---eval insert into ti3 values ($ti3_ctr) ---inc $ti3_ctr - -SET @@SESSION.debug_dbug=@old_dbug; - ---connection slave -LOCK TABLES ti WRITE, ti3 WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. ---let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---echo # Wait for replica to progress until unblocked transactions are queued for group commit.. ---connection slave ---let $wait_condition= SELECT count(*)=3 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should reach second N transaction ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - -set @@global.slave_parallel_mode=CONSERVATIVE; - ---connection master ---source include/save_master_gtid.inc ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Common Test Case 6: ---echo # If retrying a T transaction while STOP SLAVE is issued, the ---echo # transaction should be rolled back and the slave abruptly stopped - ---connection master ---eval insert into ti values ($ti_ctr) ---source include/save_master_gtid.inc - ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc -set @@global.slave_parallel_threads=1; - ---let $save_innodb_lock_wait_timeout= `SELECT @@global.innodb_lock_wait_timeout` -# 2 second buffer to give ample time to wait for transaction and issue stop slave -set @@global.innodb_lock_wait_timeout= 2; -BEGIN; ---eval SELECT * FROM ti WHERE a=$ti_ctr FOR UPDATE - ---connection master ---source include/save_master_gtid.inc ---eval update ti set a=a+1 where a=$ti_ctr ---inc $ti_ctr ---inc $ti_ctr - ---connection slave ---source include/start_slave.inc ---let $retried_tx_initial= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1) - -if (`SELECT @@global.binlog_format = 'ROW'`) -{ - --let $update_state=Update_rows_log_event::find_row(-1) -} -if (`SELECT @@global.binlog_format = 'STATEMENT'`) -{ - --let $update_state=Updating -} ---echo # Wait for replicating transaction to wait for innodb table lock ---source include/start_slave.inc ---let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state LIKE "$update_state" and command like 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - -connection slave; ---source include/wait_for_slave_sql_to_stop.inc ---let $retried_tx_test= query_get_value(SHOW ALL SLAVES STATUS, Retried_transactions, 1) -if ($retried_tx_initial != $retried_tx_test) -{ - --echo T transaction should have been rolled back without retry - --die T transaction should have been rolled back without retry -} - -# End the SELECT ... FOR UPDATE -ROLLBACK; - ---connection slave1 ---reap ---connection slave - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= The retried T transaction should have been rolled back ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - ---eval set @@global.innodb_lock_wait_timeout= $save_innodb_lock_wait_timeout - ---echo # ---echo # Common Test Case 7: ---echo # Using multiple parallel replication threads on a workload with a ---echo # non-transactional transaction in-between transactional transactions.. ---echo # 7a: with AGGRESSIVE replication where the N statement has been ---echo # executed already, all transactions up to and including N should ---echo # be replicated, and all transactions afterwards should be rolled ---echo # back. ---echo # 7b: with MINIMAL replication, the N statement should not execute ---echo # concurrently, but should wait along with the other later ---echo # transactions, and all future transactions except the first should ---echo # be rolled back. - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=4; - ---let $mode_ctr=2 -while ($mode_ctr) -{ - --connection slave - if ($mode_ctr == 2) - { - --echo # - --echo # 7a: slave_parallel_mode=AGGRESSIVE - set @@global.slave_parallel_mode=AGGRESSIVE; - } - if ($mode_ctr == 1) - { - --echo # - --echo # 7b: slave_parallel_mode=MINIMAL - set @@global.slave_parallel_mode=MINIMAL; - } - - --connection slave - --let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from ti2 UNION ALL select * from tm2 UNION ALL select * from ti3) t` - - --connection master - if ($mode_ctr == 1) - { - --let $master_gtid_cmp= `select @@global.gtid_binlog_pos` - } - - --connection master - --eval insert into ti values ($ti_ctr) - --inc $ti_ctr - - --eval insert into tm values ($tm_ctr) - if ($mode_ctr == 2) - { - # AGGRESSIVE mode should allow N trx to complete - --let $master_gtid_cmp= `select @@global.gtid_binlog_pos` - } - --eval insert into ti2 values ($ti2_ctr) - --inc $ti2_ctr - --eval insert into ti values ($ti_ctr) - --inc $ti_ctr - --source include/save_master_gtid.inc - - --connection slave - LOCK TABLES ti WRITE; - --connection slave_lock_extra - LOCK TABLES ti2 WRITE; - - --source include/start_slave.inc - - --echo # Wait for replica to halt due to locks and dependency requirements - --connection slave - - if ($mode_ctr == 2) - { - # AGGRESSIVE allows for more concurrency that we need to wait for - --let $wait_condition= SELECT count(*)=3 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; - --source include/wait_condition.inc - --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; - --source include/wait_condition.inc - } - if ($mode_ctr == 1) - { - # MINIMAL will only have the first transaction begun - --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; - --source include/wait_condition.inc - --let $wait_condition= SELECT count(*)=3 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to start commit%' and command LIKE 'Slave_worker'; - --source include/wait_condition.inc - } - - --connection slave1 - --send STOP SLAVE; - - --connection slave - --echo # Wait for replica to signal worker threads to stop - --let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; - --source include/wait_condition.inc - - UNLOCK TABLES; - --connection slave_lock_extra - UNLOCK TABLES; - - --connection slave1 - --reap - --connection slave - --source include/wait_for_slave_sql_to_stop.inc - - --let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from ti2 UNION ALL select * from tm2 UNION ALL select * from ti3) t` - --let $row_count_diff=`select ($row_count_end-$row_count_initial)` - - if ($mode_ctr == 2) - { - --let $assert_text= The entirety of the first two transactions should have committed with AGGRESSIVE parallelization - --let $assert_cond= $row_count_diff = 2 - } - if ($mode_ctr == 1) - { - --let $assert_text= All transactions should have rolled back with MINIMAL parallelization - --let $assert_cond= $row_count_diff = 0 - } - - --source include/assert.inc - - --let $slave_gtid= `select @@global.gtid_slave_pos` - --let $assert_text= Slave state should be consistent - --let $assert_cond= $master_gtid_cmp = $slave_gtid - --source include/assert.inc - - --connection master - --source include/save_master_gtid.inc - --connection slave - --source include/start_slave.inc - --source include/sync_with_master_gtid.inc - - --source include/stop_slave.inc - --dec $mode_ctr -} ---source include/start_slave.inc - ---connection master ---source include/save_master_gtid.inc ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result index 4f4a1c7dbcd..9b2e68d366e 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel.result +++ b/mysql-test/suite/rpl/r/rpl_parallel.result @@ -731,7 +731,7 @@ SET debug_sync='now WAIT_FOR t3_waiting'; SET debug_sync='now SIGNAL d2_cont'; SET debug_sync='now WAIT_FOR t4_waiting'; KILL THD_ID; -# Wait for replica to signal worker threads to stop +SET debug_sync='now WAIT_FOR t3_killed'; SET debug_sync='now SIGNAL t1_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -741,6 +741,7 @@ a b 61 61 62 62 63 63 +64 64 68 68 69 69 70 70 @@ -814,7 +815,6 @@ connection server_2; SET debug_sync='now WAIT_FOR wait_queue_ready'; KILL THD_ID; SET debug_sync='now WAIT_FOR wait_queue_killed'; -# Wait for replica to signal worker threads to stop SET debug_sync='now SIGNAL query_cont'; include/wait_for_slave_sql_error.inc [errno=1317,1927,1964] STOP SLAVE IO_THREAD; @@ -826,8 +826,6 @@ SET binlog_format=@old_format; connection server_2; SET debug_sync='RESET'; include/start_slave.inc -SET debug_sync='now WAIT_FOR query_waiting'; -SET debug_sync='now SIGNAL query_cont'; SELECT * FROM t3 WHERE a >= 80 ORDER BY a; a b 80 0 @@ -1216,7 +1214,6 @@ connection server_2; include/wait_for_slave_sql_to_stop.inc SELECT * FROM t2 WHERE a >= 40 ORDER BY a; a -40 41 42 include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_parallel2.result b/mysql-test/suite/rpl/r/rpl_parallel2.result index aeedb4bafee..559c56271b8 100644 --- a/mysql-test/suite/rpl/r/rpl_parallel2.result +++ b/mysql-test/suite/rpl/r/rpl_parallel2.result @@ -1,7 +1,6 @@ include/rpl_init.inc [topology=1->2] *** MDEV-5509: Incorrect value for Seconds_Behind_Master if parallel replication *** connection server_2; -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; set @old_parallel_mode= @@GLOBAL.slave_parallel_mode; include/stop_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result b/mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result deleted file mode 100644 index 6fd5b448b47..00000000000 --- a/mysql-test/suite/rpl/r/rpl_row_par_stop_slave_quick.result +++ /dev/null @@ -1,507 +0,0 @@ -include/master-slave.inc -[connection master] -# -# Setup -connection slave; -include/stop_slave.inc -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Can't find record"); -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure"); -set @@global.slave_parallel_mode=CONSERVATIVE; -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; -connect slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT; -CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS; -include/start_slave.inc -# -# Initialize test data -connection master; -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); -create sequence s1; -create table ti (a int) engine=innodb; -create table ti2 (a int) engine=innodb; -create table ti3 (a int) engine=innodb; -create table tm (a int) engine=myisam; -create table tm2 (a int) engine=myisam; -connection slave; -# Run binlog format independent test cases -# -# Common Test Case 1: -# Using one parallel replication worker thread on workload {T,T}, ensure -# the replica immediately rolls back the transaction and stops the -# SQL thread -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -connection master; -include/save_master_gtid.inc -BEGIN; -insert into ti values (100); -insert into ti values (101); -COMMIT; -insert into ti values (102); -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transaction -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No new rows should have been inserted] -include/assert.inc [GTID slave state should not change] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 2: -# Using multiple parallel replication threads (two) on workload {T,T}, -# ensure both transactions are rolled back if stop slave is issued -# in the middle of the first transaction. -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=2; -connection master; -include/save_master_gtid.inc -BEGIN; -insert into ti values (103); -insert into ti values (104); -COMMIT; -insert into ti values (105); -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transaction -connection slave; -# Wait for second transaction to begin -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No insertions should have committed] -include/assert.inc [GTID slave state should not change] -# Slave should be error-free -include/assert.inc [Slave should be error free] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 3: -# Using multiple parallel replication threads (two) on workload {T,T}, -# with the same commit id (cid), ensure both transactions are rolled -# back if stop slave is issued -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=AGGRESSIVE; -set @@global.slave_parallel_threads=2; -connection master; -include/save_master_gtid.inc -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10000; -BEGIN; -insert into ti values (106); -insert into ti values (107); -COMMIT; -insert into ti2 values (400); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transactions -connection slave; -# Wait for second transaction to start group commit -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No insertions should have committed] -include/assert.inc [GTID slave state should not change] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 4: -# Using multiple parallel replication threads (4) on workload -# T (long running); should commit -# N (waiting for prior commit); should commit -# T (long running); should rollback -# T (waiting for prior commit); should rollback -# Issuing STOP SLAVE should allow the first two transactions to commit -# while preventing and rolling back the third -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=optimistic; -set @@global.slave_parallel_threads=4; -connection master; -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10001; -BEGIN; -insert into ti values (108); -insert into ti values (109); -COMMIT; -connection master; -insert into tm values (200); -include/save_master_gtid.inc -insert into ti2 values (401); -insert into ti3 values (500); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti WRITE, ti2 WRITE; -include/start_slave.inc -# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. -# Wait for replica to progress until unblocked transactions are queued for group commit.. -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [GTID slave state should reach first N transaction] -set @@global.slave_parallel_mode=CONSERVATIVE; -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 5: -# Using multiple parallel replication threads (5) on workload -# T (long running); should commit -# N (waiting for prior commit); should commit -# T (waiting for prior commit); should commit -# N (waiting for prior commit); should commit -# T (long running); should rollback -# Issuing STOP SLAVE should allow all transactions up to and including -# the last N (4th) to commit, while preventing and rolling back the -# final transaction (5th) -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=optimistic; -set @@global.slave_parallel_threads=5; -connection master; -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10002; -insert into ti values (110); -insert into tm values (201); -insert into ti2 values (402); -insert into tm2 values (300); -include/save_master_gtid.inc -insert into ti3 values (501); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti WRITE, ti3 WRITE; -include/start_slave.inc -# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. -# Wait for replica to progress until unblocked transactions are queued for group commit.. -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [GTID slave state should reach second N transaction] -set @@global.slave_parallel_mode=CONSERVATIVE; -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 6: -# If retrying a T transaction while STOP SLAVE is issued, the -# transaction should be rolled back and the slave abruptly stopped -connection master; -insert into ti values (111); -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -Warnings: -Note 1254 Slave is already running -include/sync_with_master_gtid.inc -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -set @@global.innodb_lock_wait_timeout= 2; -BEGIN; -SELECT * FROM ti WHERE a=111 FOR UPDATE; -a -111 -connection master; -include/save_master_gtid.inc -update ti set a=a+1 where a=111; -connection slave; -include/start_slave.inc -# Wait for replicating transaction to wait for innodb table lock -include/start_slave.inc -Warnings: -Note 1254 Slave is already running -connection slave1; -STOP SLAVE;; -connection slave; -include/wait_for_slave_sql_to_stop.inc -ROLLBACK; -connection slave1; -connection slave; -include/assert.inc [The retried T transaction should have been rolled back] -set @@global.innodb_lock_wait_timeout= 50; -# -# Common Test Case 7: -# Using multiple parallel replication threads on a workload with a -# non-transactional transaction in-between transactional transactions.. -# 7a: with AGGRESSIVE replication where the N statement has been -# executed already, all transactions up to and including N should -# be replicated, and all transactions afterwards should be rolled -# back. -# 7b: with MINIMAL replication, the N statement should not execute -# concurrently, but should wait along with the other later -# transactions, and all future transactions except the first should -# be rolled back. -connection slave; -include/stop_slave.inc -Warnings: -Note 1255 Slave already has been stopped -set @@global.slave_parallel_threads=4; -connection slave; -# -# 7a: slave_parallel_mode=AGGRESSIVE -set @@global.slave_parallel_mode=AGGRESSIVE; -connection slave; -connection master; -connection master; -insert into ti values (113); -insert into tm values (202); -insert into ti2 values (403); -insert into ti values (114); -include/save_master_gtid.inc -connection slave; -LOCK TABLES ti WRITE; -connection slave_lock_extra; -LOCK TABLES ti2 WRITE; -include/start_slave.inc -# Wait for replica to halt due to locks and dependency requirements -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -connection slave_lock_extra; -UNLOCK TABLES; -connection slave1; -connection slave; -include/wait_for_slave_sql_to_stop.inc -include/assert.inc [The entirety of the first two transactions should have committed with AGGRESSIVE parallelization] -include/assert.inc [Slave state should be consistent] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -include/stop_slave.inc -connection slave; -# -# 7b: slave_parallel_mode=MINIMAL -set @@global.slave_parallel_mode=MINIMAL; -connection slave; -connection master; -connection master; -insert into ti values (115); -insert into tm values (202); -insert into ti2 values (404); -insert into ti values (116); -include/save_master_gtid.inc -connection slave; -LOCK TABLES ti WRITE; -connection slave_lock_extra; -LOCK TABLES ti2 WRITE; -include/start_slave.inc -# Wait for replica to halt due to locks and dependency requirements -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -connection slave_lock_extra; -UNLOCK TABLES; -connection slave1; -connection slave; -include/wait_for_slave_sql_to_stop.inc -include/assert.inc [All transactions should have rolled back with MINIMAL parallelization] -include/assert.inc [Slave state should be consistent] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -include/stop_slave.inc -include/start_slave.inc -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -Warnings: -Note 1254 Slave is already running -include/sync_with_master_gtid.inc -# -# ROW Test Case 1: -# Using an N multi-statement transaction, ensure if STOP SLAVE is -# issued in-between row updates, that the transaction is finished. -connection master; -truncate table ti; -truncate table tm; -# Set up multiple rows to allow a multi-statement update rows event -insert into tm values (202); -insert into tm values (203); -connection slave; -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -connection master; -# Next-to-commit non-transactional transaction should finish -update tm set a=a+1; -include/save_master_gtid.inc -# This should not be committed because it is after next-to-commit -insert into ti values (117); -connection slave; -set @@global.debug_dbug="+d,pause_after_next_row_exec"; -START SLAVE; -set debug_sync= "now WAIT_FOR row_executed"; -connection slave1; -STOP SLAVE;; -connection slave; -set @@global.debug_dbug=""; -set debug_sync= "now SIGNAL continue_row_execution"; -connection slave1; -include/wait_for_slave_sql_to_stop.inc -# Slave should be error-free -include/assert.inc [Slave should be error free] -set debug_sync= "RESET"; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# ROW Test Case 2: -# Using a T multi-statement transaction, ensure if STOP SLAVE is -# issued in-between row updates, that the transaction is rolled back. -connection master; -truncate table ti; -truncate table ti2; -truncate table tm; -insert into ti values (118); -insert into ti values (119); -connection slave; -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -connection master; -# Next-to-commit transactional multi-row event should be rolled back -include/save_master_gtid.inc -update ti set a=a+1; -insert into ti values (120); -connection slave; -set @@global.debug_dbug="+d,pause_after_next_row_exec"; -START SLAVE; -set debug_sync= "now WAIT_FOR row_executed"; -connection slave1; -STOP SLAVE;; -connection slave; -set @@global.debug_dbug=""; -set debug_sync= "now SIGNAL continue_row_execution"; -connection slave1; -include/wait_for_slave_sql_to_stop.inc -include/assert.inc [No new rows should have been inserted] -# Comparing master gtid 0-1-42 to slaves 0-1-42 -include/assert.inc [No transactions should have committed] -# Slave should be error-free -include/assert.inc [Slave should be error free] -connection master; -include/save_master_gtid.inc -connection slave; -set debug_sync= "RESET"; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Row Test Case 3: -# A workload with a later transaction that updates a sequence table -# should complete all transactions up to the sequence table update. -# Workload: -# T (long running); should commit -# S (waiting for prior commit); should commit -# T (long running); should rollback -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=AGGRESSIVE; -set @@global.slave_parallel_threads=3; -connection master; -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10002; -insert into ti values (121); -select next value for s1; -next value for s1 -1 -include/save_master_gtid.inc -insert into ti2 values (405); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti write, ti2 WRITE; -include/start_slave.inc -# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. -# Wait for replica to progress until unblocked transactions are queued for group commit.. -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [GTID slave state should not change] -set @@global.slave_parallel_mode=CONSERVATIVE; -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Cleanup -connection master; -DROP TABLE ti, ti2, ti3, tm, tm2, s1; -include/save_master_gtid.inc -connection slave; -include/sync_with_master_gtid.inc -include/stop_slave.inc -set @@global.debug_dbug=""; -set @@global.slave_parallel_threads=0; -set @@global.slave_parallel_mode=conservative; -include/start_slave.inc -include/rpl_end.inc -# End of tests diff --git a/mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result b/mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result deleted file mode 100644 index 18b06f5054f..00000000000 --- a/mysql-test/suite/rpl/r/rpl_stm_par_stop_slave_quick.result +++ /dev/null @@ -1,461 +0,0 @@ -include/master-slave.inc -[connection master] -# -# Setup -connection slave; -include/stop_slave.inc -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); -set @@global.slave_parallel_mode=CONSERVATIVE; -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; -change master to master_use_gtid=slave_pos; -include/start_slave.inc -connect slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT; -# -# Initialize test data -connection master; -set statement sql_log_bin=0 for call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); -create table ti (a int primary key) engine=innodb; -create table ti2 (a int) engine=innodb; -create table ti3 (a int) engine=innodb; -create table tm (a int) engine=myisam; -create table tm2 (a int) engine=myisam; -connection slave; -# Run binlog format independent test cases -# -# Common Test Case 1: -# Using one parallel replication worker thread on workload {T,T}, ensure -# the replica immediately rolls back the transaction and stops the -# SQL thread -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -connection master; -include/save_master_gtid.inc -BEGIN; -insert into ti values (100); -insert into ti values (101); -COMMIT; -insert into ti values (102); -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transaction -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No new rows should have been inserted] -include/assert.inc [GTID slave state should not change] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 2: -# Using multiple parallel replication threads (two) on workload {T,T}, -# ensure both transactions are rolled back if stop slave is issued -# in the middle of the first transaction. -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=2; -connection master; -include/save_master_gtid.inc -BEGIN; -insert into ti values (103); -insert into ti values (104); -COMMIT; -insert into ti values (105); -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transaction -connection slave; -# Wait for second transaction to begin -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No insertions should have committed] -include/assert.inc [GTID slave state should not change] -# Slave should be error-free -include/assert.inc [Slave should be error free] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 3: -# Using multiple parallel replication threads (two) on workload {T,T}, -# with the same commit id (cid), ensure both transactions are rolled -# back if stop slave is issued -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=AGGRESSIVE; -set @@global.slave_parallel_threads=2; -connection master; -include/save_master_gtid.inc -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10000; -BEGIN; -insert into ti values (106); -insert into ti values (107); -COMMIT; -insert into ti2 values (400); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transactions -connection slave; -# Wait for second transaction to start group commit -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No insertions should have committed] -include/assert.inc [GTID slave state should not change] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 4: -# Using multiple parallel replication threads (4) on workload -# T (long running); should commit -# N (waiting for prior commit); should commit -# T (long running); should rollback -# T (waiting for prior commit); should rollback -# Issuing STOP SLAVE should allow the first two transactions to commit -# while preventing and rolling back the third -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=optimistic; -set @@global.slave_parallel_threads=4; -connection master; -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10001; -BEGIN; -insert into ti values (108); -insert into ti values (109); -COMMIT; -connection master; -insert into tm values (200); -include/save_master_gtid.inc -insert into ti2 values (401); -insert into ti3 values (500); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti WRITE, ti2 WRITE; -include/start_slave.inc -# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. -# Wait for replica to progress until unblocked transactions are queued for group commit.. -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [GTID slave state should reach first N transaction] -set @@global.slave_parallel_mode=CONSERVATIVE; -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 5: -# Using multiple parallel replication threads (5) on workload -# T (long running); should commit -# N (waiting for prior commit); should commit -# T (waiting for prior commit); should commit -# N (waiting for prior commit); should commit -# T (long running); should rollback -# Issuing STOP SLAVE should allow all transactions up to and including -# the last N (4th) to commit, while preventing and rolling back the -# final transaction (5th) -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_mode=optimistic; -set @@global.slave_parallel_threads=5; -connection master; -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10002; -insert into ti values (110); -insert into tm values (201); -insert into ti2 values (402); -insert into tm2 values (300); -include/save_master_gtid.inc -insert into ti3 values (501); -SET @@SESSION.debug_dbug=@old_dbug; -connection slave; -LOCK TABLES ti WRITE, ti3 WRITE; -include/start_slave.inc -# Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. -# Wait for replica to progress until unblocked transactions are queued for group commit.. -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [GTID slave state should reach second N transaction] -set @@global.slave_parallel_mode=CONSERVATIVE; -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Common Test Case 6: -# If retrying a T transaction while STOP SLAVE is issued, the -# transaction should be rolled back and the slave abruptly stopped -connection master; -insert into ti values (111); -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -Warnings: -Note 1254 Slave is already running -include/sync_with_master_gtid.inc -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -set @@global.innodb_lock_wait_timeout= 2; -BEGIN; -SELECT * FROM ti WHERE a=111 FOR UPDATE; -a -111 -connection master; -include/save_master_gtid.inc -update ti set a=a+1 where a=111; -connection slave; -include/start_slave.inc -# Wait for replicating transaction to wait for innodb table lock -include/start_slave.inc -Warnings: -Note 1254 Slave is already running -connection slave1; -STOP SLAVE;; -connection slave; -include/wait_for_slave_sql_to_stop.inc -ROLLBACK; -connection slave1; -connection slave; -include/assert.inc [The retried T transaction should have been rolled back] -set @@global.innodb_lock_wait_timeout= 50; -# -# Common Test Case 7: -# Using multiple parallel replication threads on a workload with a -# non-transactional transaction in-between transactional transactions.. -# 7a: with AGGRESSIVE replication where the N statement has been -# executed already, all transactions up to and including N should -# be replicated, and all transactions afterwards should be rolled -# back. -# 7b: with MINIMAL replication, the N statement should not execute -# concurrently, but should wait along with the other later -# transactions, and all future transactions except the first should -# be rolled back. -connection slave; -include/stop_slave.inc -Warnings: -Note 1255 Slave already has been stopped -set @@global.slave_parallel_threads=4; -connection slave; -# -# 7a: slave_parallel_mode=AGGRESSIVE -set @@global.slave_parallel_mode=AGGRESSIVE; -connection slave; -connection master; -connection master; -insert into ti values (113); -insert into tm values (202); -insert into ti2 values (403); -insert into ti values (114); -include/save_master_gtid.inc -connection slave; -LOCK TABLES ti WRITE; -connection slave_lock_extra; -LOCK TABLES ti2 WRITE; -include/start_slave.inc -# Wait for replica to halt due to locks and dependency requirements -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -connection slave_lock_extra; -UNLOCK TABLES; -connection slave1; -connection slave; -include/wait_for_slave_sql_to_stop.inc -include/assert.inc [The entirety of the first two transactions should have committed with AGGRESSIVE parallelization] -include/assert.inc [Slave state should be consistent] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -include/stop_slave.inc -connection slave; -# -# 7b: slave_parallel_mode=MINIMAL -set @@global.slave_parallel_mode=MINIMAL; -connection slave; -connection master; -connection master; -insert into ti values (115); -insert into tm values (202); -insert into ti2 values (404); -insert into ti values (116); -include/save_master_gtid.inc -connection slave; -LOCK TABLES ti WRITE; -connection slave_lock_extra; -LOCK TABLES ti2 WRITE; -include/start_slave.inc -# Wait for replica to halt due to locks and dependency requirements -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -connection slave_lock_extra; -UNLOCK TABLES; -connection slave1; -connection slave; -include/wait_for_slave_sql_to_stop.inc -include/assert.inc [All transactions should have rolled back with MINIMAL parallelization] -include/assert.inc [Slave state should be consistent] -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -include/stop_slave.inc -include/start_slave.inc -connection master; -include/save_master_gtid.inc -connection slave; -include/start_slave.inc -Warnings: -Note 1254 Slave is already running -include/sync_with_master_gtid.inc -# -# Statement Test Case 1: -# Using one parallel replication worker thread on workload {N,T}, ensure -# the replica finishes the non-transactional transaction, and does not -# start the next -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -connection master; -SET @@session.binlog_direct_non_transactional_updates= 0; -BEGIN; -insert into ti values (117); -insert into tm values (202); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction -insert into tm2 values (301); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction -COMMIT; -include/save_master_gtid.inc -insert into ti values (118); -connection slave; -lock tables tm2 write; -START SLAVE; -# Wait for replica to get stuck on held lock -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -# Unlock row-level lock holding transaction -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [Transaction should have committed] -include/assert.inc [N should have been applied] -# Slave should be error-free -include/assert.inc [Slave should be error free] -connection master; -include/save_master_gtid.inc -SET @@session.binlog_direct_non_transactional_updates= 1; -connection slave; -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Statement Test Case 2: -# If STOP SLAVE is issued on a parallel slave, such that the next to -# commit transaction is T; even if the next event from the group will -# commit the transaction (e.g. XID_EVENT), the transaction should be -# stopped and rolled back. -connection slave; -include/stop_slave.inc -set @@global.slave_parallel_threads=1; -connection master; -insert into ti values (119); -insert into ti values (120); -include/save_master_gtid.inc -connection slave; -LOCK TABLES ti WRITE; -include/start_slave.inc -# Wait for replica to begin executing the first transaction -connection slave; -connection slave1; -STOP SLAVE;; -connection slave; -# Wait for replica to signal worker threads to stop -UNLOCK TABLES; -include/wait_for_slave_sql_to_stop.inc -connection slave1; -connection slave; -include/assert.inc [No insertions should have committed] -include/assert.inc [GTID slave state should increment to the first transaction] -include/start_slave.inc -include/sync_with_master_gtid.inc -# -# Cleanup -connection master; -DROP TABLE ti, tm, ti2, tm2, ti3; -include/save_master_gtid.inc -connection slave; -include/sync_with_master_gtid.inc -include/stop_slave.inc -set @@global.slave_parallel_threads=0; -set @@global.slave_domain_parallel_threads=0; -set @@global.slave_parallel_mode=conservative; -set @@global.debug_dbug=""; -include/start_slave.inc -include/rpl_end.inc -# End of tests diff --git a/mysql-test/suite/rpl/t/rpl_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test index 433e7c9d8c4..9ba7a30f2eb 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel.test +++ b/mysql-test/suite/rpl/t/rpl_parallel.test @@ -949,9 +949,8 @@ SET debug_sync='now WAIT_FOR t4_waiting'; --replace_result $d1_thd_id THD_ID eval KILL $d1_thd_id; ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc +# Wait until T3 has reacted on the kill. +SET debug_sync='now WAIT_FOR t3_killed'; # Now we can allow T1 to proceed. SET debug_sync='now SIGNAL t1_cont'; @@ -960,7 +959,7 @@ SET debug_sync='now SIGNAL t1_cont'; --source include/wait_for_slave_sql_error.inc STOP SLAVE IO_THREAD; # Since T2, T3, and T4 run in parallel, we can not be sure if T2 will have time -# to commit or not before the stop. However, T1 should rollback, and T3/T4 may +# to commit or not before the stop. However, T1 should commit, and T3/T4 may # not have committed. (After slave restart we check that all become committed # eventually). SELECT * FROM t3 WHERE a >= 60 AND a != 65 ORDER BY a; @@ -1059,11 +1058,6 @@ SET debug_sync='now WAIT_FOR wait_queue_ready'; eval KILL $thd_id; SET debug_sync='now WAIT_FOR wait_queue_killed'; - ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - SET debug_sync='now SIGNAL query_cont'; --let $slave_sql_errno= 1317,1927,1964 @@ -1081,14 +1075,6 @@ SET binlog_format=@old_format; --connection server_2 SET debug_sync='RESET'; --source include/start_slave.inc - -# Test amendment from MDEV-13915: -# A worker thread's event queue is no longer executed on replica stop. -# The signal query_cont needs to be re-sent because the transaction was -# aborted. -SET debug_sync='now WAIT_FOR query_waiting'; -SET debug_sync='now SIGNAL query_cont'; - --sync_with_master SELECT * FROM t3 WHERE a >= 80 ORDER BY a; diff --git a/mysql-test/suite/rpl/t/rpl_parallel2.test b/mysql-test/suite/rpl/t/rpl_parallel2.test index 506e074110c..8934b15e546 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel2.test +++ b/mysql-test/suite/rpl/t/rpl_parallel2.test @@ -7,7 +7,6 @@ --echo *** MDEV-5509: Incorrect value for Seconds_Behind_Master if parallel replication *** --connection server_2 -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads; set @old_parallel_mode= @@GLOBAL.slave_parallel_mode; --source include/stop_slave.inc diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test index 35f28073a74..27f38d47bdb 100644 --- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test +++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_error_stop.test @@ -122,10 +122,10 @@ SELECT COUNT(*) = 1 as "W4 remains with the same status" FROM information_schema --echo # Slave_SQL_Running YES = $status # B. In the fixed version W3 is waiting for W2,... ---let $wait_condition= SELECT count(*) = 1 as "W3 is waiting" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" +--let $wait_condition= SELECT count(*) = 1 as "W4 is waiting" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" --source include/wait_condition.inc --echo # while W2 is held back ... ---let $wait_condition= SELECT count(*) >= 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" +--let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" --source include/wait_condition.inc # C. # ...until NOW. @@ -143,7 +143,7 @@ if ($old_version_regression) --let $wait_condition= SELECT count(*) = 0 as "W3 does not wait on W2" FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit%" --source include/wait_condition.inc - --let $wait_condition= SELECT count(*) >= 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" + --let $wait_condition= SELECT count(*) = 1 as "W2 simulates slowness" FROM information_schema.processlist WHERE state LIKE "debug sync point: now" --source include/wait_condition.inc # Like above, but signaling is done after W4 is done to violate the commit order diff --git a/mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test b/mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test deleted file mode 100644 index 56ad9e34a93..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_par_stop_slave_quick.test +++ /dev/null @@ -1,268 +0,0 @@ -# -# Validate that STOP SLAVE works in a timely manner on a parallel replica with -# ROW binary logging format. -# ---source include/have_debug.inc ---source include/have_debug_sync.inc ---source include/master-slave.inc ---source include/have_innodb.inc ---source include/have_binlog_format_row.inc - ---echo # ---echo # Setup ---connection slave ---source include/stop_slave.inc -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Can't find record"); -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure"); ---let $old_debug= `SELECT @@global.debug_dbug` ---let $old_threads= `SELECT @@global.slave_parallel_threads` ---let $old_slave_mode= `SELECT @@global.slave_parallel_mode` -set @@global.slave_parallel_mode=CONSERVATIVE; -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; ---connect(slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT) -CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS; ---source include/start_slave.inc - ---echo # ---echo # Initialize test data ---connection master -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); - -# Needed by this test and include/rpl_par_stop_slave_quick.inc - -create sequence s1; -create table ti (a int) engine=innodb; -create table ti2 (a int) engine=innodb; -create table ti3 (a int) engine=innodb; -create table tm (a int) engine=myisam; -create table tm2 (a int) engine=myisam; ---let $ti_ctr= 100 ---let $tm_ctr= 200 ---let $tm2_ctr= 300 ---let $ti2_ctr= 400 ---let $ti3_ctr= 500 ---sync_slave_with_master - ---echo # Run binlog format independent test cases ---source include/rpl_par_stop_slave_quick_common.test - ---echo # ---echo # ROW Test Case 1: ---echo # Using an N multi-statement transaction, ensure if STOP SLAVE is ---echo # issued in-between row updates, that the transaction is finished. - ---connection master -truncate table ti; -truncate table tm; ---echo # Set up multiple rows to allow a multi-statement update rows event ---eval insert into tm values ($tm_ctr) ---inc $tm_ctr ---eval insert into tm values ($tm_ctr) ---inc $tm_ctr ---sync_slave_with_master - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=1; ---let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm) t` - ---connection master - ---echo # Next-to-commit non-transactional transaction should finish ---eval update tm set a=a+1 ---source include/save_master_gtid.inc ---let $master_gtid_after_update= `select @@global.gtid_binlog_pos` - ---echo # This should not be committed because it is after next-to-commit ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - ---connection slave -set @@global.debug_dbug="+d,pause_after_next_row_exec"; - -START SLAVE; -set debug_sync= "now WAIT_FOR row_executed"; - ---connection slave1 ---send STOP SLAVE; - ---connection slave -set @@global.debug_dbug=""; -set debug_sync= "now SIGNAL continue_row_execution"; - ---connection slave1 ---reap ---source include/wait_for_slave_sql_to_stop.inc - ---echo # Slave should be error-free -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); ---let $assert_text= Slave should be error free ---let $assert_cond= $last_error = 0 ---source include/assert.inc - -set debug_sync= "RESET"; ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # ROW Test Case 2: ---echo # Using a T multi-statement transaction, ensure if STOP SLAVE is ---echo # issued in-between row updates, that the transaction is rolled back. - ---connection master -truncate table ti; -truncate table ti2; -truncate table tm; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---sync_slave_with_master - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=1; ---let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm) t` - ---connection master - ---echo # Next-to-commit transactional multi-row event should be rolled back ---source include/save_master_gtid.inc ---let $master_gtid_initial= `select @@global.gtid_binlog_pos` ---eval update ti set a=a+1 - ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - ---connection slave -set @@global.debug_dbug="+d,pause_after_next_row_exec"; -START SLAVE; -set debug_sync= "now WAIT_FOR row_executed"; - ---connection slave1 ---send STOP SLAVE; - ---connection slave -set @@global.debug_dbug=""; -set debug_sync= "now SIGNAL continue_row_execution"; - ---connection slave1 ---reap ---source include/wait_for_slave_sql_to_stop.inc - ---let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm) t` ---let $row_count_diff=`select ($row_count_end-$row_count_initial)` ---let $assert_text= No new rows should have been inserted ---let $assert_cond= $row_count_diff = 0 ---source include/assert.inc - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---echo # Comparing master gtid $master_pos to slaves $slave_gtid ---let $assert_text= No transactions should have committed ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - ---echo # Slave should be error-free -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); ---let $assert_text= Slave should be error free ---let $assert_cond= $last_error = 0 ---source include/assert.inc - ---connection master ---source include/save_master_gtid.inc - ---connection slave -set debug_sync= "RESET"; ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Row Test Case 3: ---echo # A workload with a later transaction that updates a sequence table ---echo # should complete all transactions up to the sequence table update. ---echo # Workload: ---echo # T (long running); should commit ---echo # S (waiting for prior commit); should commit ---echo # T (long running); should rollback - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_mode=AGGRESSIVE; -set @@global.slave_parallel_threads=3; - ---connection master -SET @old_dbug= @@SESSION.debug_dbug; -SET @@SESSION.debug_dbug="+d,binlog_force_commit_id"; -SET @commit_id= 10002; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - -select next value for s1; ---source include/save_master_gtid.inc - ---eval insert into ti2 values ($ti2_ctr) ---inc $ti2_ctr - -SET @@SESSION.debug_dbug=@old_dbug; - ---connection slave -LOCK TABLES ti write, ti2 WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to progress until the transactions targeting locked tables are stuck on their locks.. ---let $wait_condition= SELECT count(*)=2 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---echo # Wait for replica to progress until unblocked transactions are queued for group commit.. ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for prior transaction to commit' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should not change ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - -set @@global.slave_parallel_mode=CONSERVATIVE; - ---connection master ---source include/save_master_gtid.inc ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Cleanup ---connection master -DROP TABLE ti, ti2, ti3, tm, tm2, s1; ---source include/save_master_gtid.inc - ---connection slave ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc ---eval set @@global.debug_dbug="$old_debug" ---eval set @@global.slave_parallel_threads=$old_threads ---eval set @@global.slave_parallel_mode=$old_slave_mode ---source include/start_slave.inc - ---source include/rpl_end.inc - ---echo # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test b/mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test deleted file mode 100644 index b76979c62da..00000000000 --- a/mysql-test/suite/rpl/t/rpl_stm_par_stop_slave_quick.test +++ /dev/null @@ -1,200 +0,0 @@ -# -# Validate that STOP SLAVE works in a timely manner on a parallel replica with -# STATEMENT binary logging format. -# ---source include/have_debug.inc ---source include/master-slave.inc ---source include/have_innodb.inc ---source include/have_binlog_format_statement.inc - ---echo # ---echo # Setup ---connection slave ---source include/stop_slave.inc -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); -SET STATEMENT sql_log_bin=0 FOR call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); ---let $old_threads= `SELECT @@global.slave_parallel_threads` ---let $old_domain_threads= `SELECT @@global.slave_domain_parallel_threads` ---let $old_slave_mode= `SELECT @@global.slave_parallel_mode` ---let $old_debug_dbug= `SELECT @@global.debug_dbug` -set @@global.slave_parallel_mode=CONSERVATIVE; - -ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB; -change master to master_use_gtid=slave_pos; ---source include/start_slave.inc ---connect(slave_lock_extra,127.0.0.1,root,,test,$SLAVE_MYPORT) - ---echo # ---echo # Initialize test data ---connection master -set statement sql_log_bin=0 for call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.'); -create table ti (a int primary key) engine=innodb; -create table ti2 (a int) engine=innodb; -create table ti3 (a int) engine=innodb; -create table tm (a int) engine=myisam; -create table tm2 (a int) engine=myisam; ---let $ti_ctr= 100 ---let $tm_ctr= 200 ---let $tm2_ctr= 300 ---let $ti2_ctr= 400 ---let $ti3_ctr= 500 ---sync_slave_with_master - ---echo # Run binlog format independent test cases ---source include/rpl_par_stop_slave_quick_common.test - ---echo # ---echo # Statement Test Case 1: ---echo # Using one parallel replication worker thread on workload {N,T}, ensure ---echo # the replica finishes the non-transactional transaction, and does not ---echo # start the next - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=1; ---let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from tm2) t` - ---connection master ---let $old_binlog_direct= `SELECT @@global.binlog_direct_non_transactional_updates` -SET @@session.binlog_direct_non_transactional_updates= 0; -BEGIN; ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into tm values ($tm_ctr) ---inc $tm_ctr ---eval insert into tm2 values ($tm2_ctr) ---inc $tm_ctr -COMMIT; ---source include/save_master_gtid.inc - ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr - ---connection slave -lock tables tm2 write; -START SLAVE; - ---echo # Wait for replica to get stuck on held lock ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc - ---echo # Unlock row-level lock holding transaction -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm UNION ALL select * from tm2) t` ---let $row_count_diff=`select ($row_count_end-$row_count_initial)` ---let $assert_text= Transaction should have committed ---let $assert_cond= $row_count_diff = 3 ---source include/assert.inc - ---let $slave_gtid= `select @@global.gtid_slave_pos` -# N is the non-transactional transaction ---let $assert_text= N should have been applied ---let $assert_cond= $master_pos = $slave_gtid ---source include/assert.inc - ---echo # Slave should be error-free -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); ---let $assert_text= Slave should be error free ---let $assert_cond= $last_error = 0 ---source include/assert.inc - ---connection master ---source include/save_master_gtid.inc ---eval SET @@session.binlog_direct_non_transactional_updates= $old_binlog_direct - ---connection slave ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Statement Test Case 2: ---echo # If STOP SLAVE is issued on a parallel slave, such that the next to ---echo # commit transaction is T; even if the next event from the group will ---echo # commit the transaction (e.g. XID_EVENT), the transaction should be ---echo # stopped and rolled back. - ---connection slave ---source include/stop_slave.inc -set @@global.slave_parallel_threads=1; ---let $row_count_initial=`select count(*) from (select * from ti UNION ALL select * from tm) t` - ---connection master ---let $master_gtid_cmp= `select @@global.gtid_binlog_pos` ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---eval insert into ti values ($ti_ctr) ---inc $ti_ctr ---source include/save_master_gtid.inc - ---connection slave -LOCK TABLES ti WRITE; ---source include/start_slave.inc - ---echo # Wait for replica to begin executing the first transaction ---connection slave ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for table metadata lock' and command LIKE 'Slave_worker'; ---source include/wait_condition.inc - ---connection slave1 ---send STOP SLAVE; - ---connection slave ---echo # Wait for replica to signal worker threads to stop ---let $wait_condition= SELECT count(*)=1 FROM information_schema.processlist WHERE state LIKE 'Waiting for worker thread to stop'; ---source include/wait_condition.inc -UNLOCK TABLES; ---source include/wait_for_slave_sql_to_stop.inc - ---connection slave1 ---reap ---connection slave - ---let $row_count_end=`select count(*) from (select * from ti UNION ALL select * from tm) t` ---let $row_count_diff=`select ($row_count_end-$row_count_initial)` ---let $assert_text= No insertions should have committed ---let $assert_cond= $row_count_diff = 0 ---source include/assert.inc - ---let $slave_gtid= `select @@global.gtid_slave_pos` ---let $assert_text= GTID slave state should increment to the first transaction ---let $assert_cond= $master_gtid_cmp = $slave_gtid ---source include/assert.inc - ---source include/start_slave.inc ---source include/sync_with_master_gtid.inc - - ---echo # ---echo # Cleanup ---connection master -DROP TABLE ti, tm, ti2, tm2, ti3; ---source include/save_master_gtid.inc - ---connection slave ---source include/sync_with_master_gtid.inc ---source include/stop_slave.inc ---eval set @@global.slave_parallel_threads=$old_threads ---eval set @@global.slave_domain_parallel_threads=$old_domain_threads ---eval set @@global.slave_parallel_mode=$old_slave_mode ---eval set @@global.debug_dbug="$old_debug_dbug" ---source include/start_slave.inc - ---source include/rpl_end.inc - ---echo # End of tests diff --git a/sql/log_event.cc b/sql/log_event.cc index 0bd1e28abfe..bafcf34cc2e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -8013,10 +8013,7 @@ Gtid_log_event::Gtid_log_event(THD *thd_arg, uint64 seq_no_arg, thd_arg->transaction.all.has_created_dropped_temp_table() || thd_arg->transaction.all.trans_executed_admin_cmd()) flags2|= FL_DDL; - else if (is_transactional && !is_tmp_table && - !(thd_arg->transaction.all.modified_non_trans_table && - thd->variables.binlog_direct_non_trans_update == 0 && - !thd->is_current_stmt_binlog_format_row())) + else if (is_transactional && !is_tmp_table) flags2|= FL_TRANSACTIONAL; if (!(thd_arg->variables.option_bits & OPTION_RPL_SKIP_PARALLEL)) flags2|= FL_ALLOW_PARALLEL; @@ -8147,6 +8144,7 @@ Gtid_log_event::do_apply_event(rpl_group_info *rgi) thd->variables.server_id= this->server_id; thd->variables.gtid_domain_id= this->domain_id; thd->variables.gtid_seq_no= this->seq_no; + rgi->gtid_ev_flags2= flags2; thd->reset_for_next_command(); if (opt_gtid_strict_mode && opt_bin_log && opt_log_slave_updates) @@ -11674,27 +11672,8 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) if (!table->in_use) table->in_use= thd; - /* - Exit early, and let the Event-level exit logic take care of the cleanup - and rollback. - */ - if (rgi->rli->mi->using_parallel() && - rgi->parallel_entry->stop_abrupt(rgi->rli) && - rgi->parallel_entry->rgi_is_safe_to_terminate(rgi)) - break; - error= do_exec_row(rgi); - - DBUG_EXECUTE_IF( - "pause_after_next_row_exec", - { - DBUG_ASSERT(!debug_sync_set_action( - thd, - STRING_WITH_LEN( - "now SIGNAL row_executed WAIT_FOR continue_row_execution"))); - }); - if (unlikely(error)) DBUG_PRINT("info", ("error: %s", HA_ERR(error))); DBUG_ASSERT(error != HA_ERR_RECORD_DELETED); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b18f14d1de3..c110baa9634 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9560,7 +9560,6 @@ PSI_stage_info stage_waiting_for_work_from_sql_thread= { 0, "Waiting for work fr PSI_stage_info stage_waiting_for_prior_transaction_to_commit= { 0, "Waiting for prior transaction to commit", 0}; PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit= { 0, "Waiting for prior transaction to start commit before starting next transaction", 0}; PSI_stage_info stage_waiting_for_room_in_worker_thread= { 0, "Waiting for room in worker thread event queue", 0}; -PSI_stage_info stage_waiting_for_worker_stop= { 0, "Waiting for worker thread to stop", 0}; PSI_stage_info stage_waiting_for_workers_idle= { 0, "Waiting for worker threads to be idle", 0}; PSI_stage_info stage_waiting_for_ftwrl= { 0, "Waiting due to global read lock", 0}; PSI_stage_info stage_waiting_for_ftwrl_threads_to_pause= { 0, "Waiting for worker threads to pause for global read lock", 0}; diff --git a/sql/mysqld.h b/sql/mysqld.h index 0c80792168e..f521ea23638 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -535,7 +535,6 @@ extern PSI_stage_info stage_waiting_for_work_from_sql_thread; extern PSI_stage_info stage_waiting_for_prior_transaction_to_commit; extern PSI_stage_info stage_waiting_for_prior_transaction_to_start_commit; extern PSI_stage_info stage_waiting_for_room_in_worker_thread; -extern PSI_stage_info stage_waiting_for_worker_stop; extern PSI_stage_info stage_waiting_for_workers_idle; extern PSI_stage_info stage_waiting_for_ftwrl; extern PSI_stage_info stage_waiting_for_ftwrl_threads_to_pause; diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index 2dce2880218..6ca582e4f21 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -96,7 +96,7 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev) rli= qev->rgi->rli; e= qev->entry_for_queued; if (e->stop_on_error_sub_id < (uint64)ULONGLONG_MAX || - (e->stop_abrupt(rli))) + (e->force_abort && !rli->stop_for_until)) return; mysql_mutex_lock(&rli->data_lock); @@ -173,7 +173,7 @@ finish_event_group(rpl_parallel_thread *rpt, uint64 sub_id, mark_start_commit() calls can be made and it is safe to de-allocate the GCO. */ - err= wfc->wait_for_prior_commit(thd, true); + err= wfc->wait_for_prior_commit(thd); if (unlikely(err) && !rgi->worker_error) signal_error_to_sql_driver_thread(thd, rgi, err); thd->wait_for_commit_ptr= NULL; @@ -395,14 +395,13 @@ do_gco_wait(rpl_group_info *rgi, group_commit_orderer *gco, } while (wait_count > entry->count_committing_event_groups); } - if (entry->force_abort && wait_count >= entry->stop_count) + if (entry->force_abort && wait_count > entry->stop_count) { /* We are stopping (STOP SLAVE), and this event group is beyond the point where we can safely stop. So return a flag that will cause us to skip, rather than execute, the following events. */ - DBUG_ASSERT(entry->rgi_is_safe_to_terminate(rgi)); return true; } else @@ -462,16 +461,6 @@ do_ftwrl_wait(rpl_group_info *rgi, if (sub_id > entry->largest_started_sub_id) entry->largest_started_sub_id= sub_id; - /* - If this rgi is non-transactional, and the state of our current entry - (incorrectly) views the rgi as safe to terminate, we change our state - to disallow this rgi from stop/rollback in the event of STOP SLAVE. - */ - if (!(rgi->gtid_ev_flags2 & Gtid_log_event::FL_TRANSACTIONAL) && - entry->unsafe_rollback_marker_sub_id.load(std::memory_order_relaxed) < - rgi->gtid_sub_id) - entry->unsafe_rollback_marker_sub_id= sub_id; - DBUG_RETURN(aborted); } @@ -1381,9 +1370,7 @@ handle_rpl_parallel_thread(void *arg) if (!err) #endif { - if (unlikely(thd->check_killed()) || - (entry->stop_abrupt(rgi->rli) && - entry->rgi_is_safe_to_terminate(rgi))) + if (unlikely(thd->check_killed())) { thd->clear_error(); thd->get_stmt_da()->reset_diagnostics_area(); @@ -2352,7 +2339,6 @@ rpl_parallel::wait_for_done(THD *thd, Relay_log_info *rli) struct rpl_parallel_entry *e; rpl_parallel_thread *rpt; uint32 i, j; - PSI_stage_info old_stage; /* First signal all workers that they must force quit; no more events will @@ -2413,11 +2399,9 @@ rpl_parallel::wait_for_done(THD *thd, Relay_log_info *rli) if ((rpt= e->rpl_threads[j])) { mysql_mutex_lock(&rpt->LOCK_rpl_thread); - thd->ENTER_COND(&rpt->COND_rpl_thread_stop, &rpt->LOCK_rpl_thread, - &stage_waiting_for_worker_stop, &old_stage); while (rpt->current_owner == &e->rpl_threads[j]) mysql_cond_wait(&rpt->COND_rpl_thread_stop, &rpt->LOCK_rpl_thread); - thd->EXIT_COND(&old_stage); + mysql_mutex_unlock(&rpt->LOCK_rpl_thread); } } } @@ -2517,17 +2501,6 @@ rpl_parallel_entry::queue_master_restart(rpl_group_info *rgi, return 0; } -bool rpl_parallel_entry::stop_abrupt(Relay_log_info *rli) -{ - return force_abort.load(std::memory_order_relaxed) && !rli->stop_for_until; -} - -bool rpl_parallel_entry::rgi_is_safe_to_terminate(rpl_group_info *rgi) -{ - return unsafe_rollback_marker_sub_id.load(std::memory_order_relaxed) < - rgi->gtid_sub_id; -} - int rpl_parallel::wait_for_workers_idle(THD *thd) diff --git a/sql/rpl_parallel.h b/sql/rpl_parallel.h index 9ad9b0b61dd..650aa06e504 100644 --- a/sql/rpl_parallel.h +++ b/sql/rpl_parallel.h @@ -272,7 +272,7 @@ struct rpl_parallel_entry { so worker threads must force abort any current transactions without waiting for event groups to complete. */ - std::atomic force_abort; + bool force_abort; /* At STOP SLAVE (force_abort=true), we do not want to process all events in the queue (which could unnecessarily delay stop, if a lot of events happen @@ -349,34 +349,10 @@ struct rpl_parallel_entry { /* The group_commit_orderer object for the events currently being queued. */ group_commit_orderer *current_gco; - /* - Marks the highest sub id that all transactions up to it must be executed to - allow for a consistent replication state; and all active transactions - afterwards can safely be stopped and rolled back. - */ - std::atomic unsafe_rollback_marker_sub_id; - rpl_parallel_thread * choose_thread(rpl_group_info *rgi, bool *did_enter_cond, PSI_stage_info *old_stage, bool reuse); int queue_master_restart(rpl_group_info *rgi, Format_description_log_event *fdev); - - /* - Check if we are stopping the slave as a direct command from the user, as - opposed to force_abort being set due to the UNTIL clause from START SLAVE. - - Returns 1 if the slave has been explicitly ordered to stop, 0 otherwise. - */ - bool stop_abrupt(Relay_log_info *rli); - - /* - Check if the rgi is safe to stop and rollback in the event of an abrupt - stop of the parallel slave. - - Returns 1 if we can safely terminate and rollback the transaction, 0 - otherwise - */ - bool rgi_is_safe_to_terminate(rpl_group_info *rgi); }; struct rpl_parallel { HASH domain_hash; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 48fd9b1f435..04fddb3e74b 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -2188,7 +2188,6 @@ event_group_new_gtid(rpl_group_info *rgi, Gtid_log_event *gev) rgi->current_gtid.server_id= gev->server_id; rgi->current_gtid.seq_no= gev->seq_no; rgi->commit_id= gev->commit_id; - rgi->gtid_ev_flags2= gev->flags2; rgi->gtid_pending= true; return 0; } diff --git a/sql/slave.cc b/sql/slave.cc index 647756482d5..f43240a8866 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3631,8 +3631,6 @@ int has_temporary_error(THD *thd) { uint current_errno; - rpl_group_info *rgi= thd->rgi_slave; - Relay_log_info *rli= rgi->rli; DBUG_ENTER("has_temporary_error"); DBUG_EXECUTE_IF("all_errors_are_temporary_errors", @@ -3650,11 +3648,6 @@ has_temporary_error(THD *thd) if (!likely(thd->is_error())) DBUG_RETURN(0); - if (rgi->rli->mi->using_parallel() && - rgi->parallel_entry->stop_abrupt(rli) && - rgi->parallel_entry->rgi_is_safe_to_terminate(rgi)) - DBUG_RETURN(0); - current_errno= thd->get_stmt_da()->sql_errno(); for (uint i= 0; i < slave_transaction_retry_error_length; i++) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 81fcfa272a3..dc58d2a250a 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -7639,7 +7639,7 @@ wait_for_commit::register_wait_for_prior_commit(wait_for_commit *waitee) */ int -wait_for_commit::wait_for_prior_commit2(THD *thd, bool force_wait) +wait_for_commit::wait_for_prior_commit2(THD *thd) { PSI_stage_info old_stage; wait_for_commit *loc_waitee; @@ -7664,24 +7664,9 @@ wait_for_commit::wait_for_prior_commit2(THD *thd, bool force_wait) &stage_waiting_for_prior_transaction_to_commit, &old_stage); while ((loc_waitee= this->waitee.load(std::memory_order_relaxed)) && - (likely(!thd->check_killed(1)) || force_wait)) + likely(!thd->check_killed(1))) mysql_cond_wait(&COND_wait_commit, &LOCK_wait_commit); - if (!loc_waitee -#ifndef EMBEDDED_LIBRARY - /* - If a worker has been killed prior to this wait, e.g. in do_gco_wait(), - then it should not perform thread cleanup if there are threads which - have yet to commit. This is to prevent the cleanup of resources that - the prior RGI may need, e.g. its GCO. This is achieved by skipping - the unregistration of the waitee, such that each subsequent call to - wait_for_prior_commit() will exit early (while maintaining the - dependence), thus allowing the final call to - thd->wait_for_prior_commit() within finish_event_group() to wait. - */ - || (thd->rgi_slave && (thd->rgi_slave->worker_error && - !thd->rgi_slave->did_mark_start_commit)) -#endif - ) + if (!loc_waitee) { if (wakeup_error) my_error(ER_PRIOR_COMMIT_FAILED, MYF(0)); diff --git a/sql/sql_class.h b/sql/sql_class.h index e177fc55d9d..4e5aba33443 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2144,14 +2144,14 @@ struct wait_for_commit bool commit_started; void register_wait_for_prior_commit(wait_for_commit *waitee); - int wait_for_prior_commit(THD *thd, bool force_wait= false) + int wait_for_prior_commit(THD *thd) { /* Quick inline check, to avoid function call and locking in the common case where no wakeup is registered, or a registered wait was already signalled. */ if (waitee.load(std::memory_order_acquire)) - return wait_for_prior_commit2(thd, force_wait); + return wait_for_prior_commit2(thd); else { if (wakeup_error) @@ -2205,7 +2205,7 @@ struct wait_for_commit void wakeup(int wakeup_error); - int wait_for_prior_commit2(THD *thd, bool force_wait= false); + int wait_for_prior_commit2(THD *thd); void wakeup_subsequent_commits2(int wakeup_error); void unregister_wait_for_prior_commit2(); From 7e17a88e75ea4a818fab7a706ac6415106dc56d1 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 25 May 2023 12:52:38 +1000 Subject: [PATCH 56/80] MDEV-30435 MDEV-30981 Fix ubsan errors w.r.t. memcpy in spd_trx.cc Extract the indexed string memcopy pattern in spd_trx.cc to a static inline function. Also updated the ubsan check in mdev_26541.test (h/t roel). --- .../spider/bugfix/r/mdev_30981.result | 12 ++ .../spider/bugfix/t/mdev_26541.test | 2 +- .../spider/bugfix/t/mdev_30981.test | 24 +++ storage/spider/spd_trx.cc | 193 +++++++----------- 4 files changed, 106 insertions(+), 125 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_30981.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_30981.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_30981.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_30981.result new file mode 100644 index 00000000000..6db36e2b46c --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_30981.result @@ -0,0 +1,12 @@ +# +# MDEV-30981 Spider UBSAN: null pointer passed as argument 2, which is declared to never be null in spider_create_trx_alter_table on ALTER +# +for master_1 +for child2 +for child3 +CREATE TABLE t (c INT) ENGINE=Spider PARTITION BY LIST (c) (PARTITION p VALUES IN (1,2)); +ALTER TABLE t ENGINE=InnoDB; +drop table t; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test index ffd99390748..b32e1630494 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test @@ -2,7 +2,7 @@ --echo # MDEV-26541 Undefined symbol: _ZTI12ha_partition when attempting to use ha_spider.so in UBSAN builds --echo # -if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="UBSAN"`) +if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "%UBSAN%"`) { --skip test needs to be run with UBSAN } diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_30981.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_30981.test new file mode 100644 index 00000000000..cc24ce82ce4 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_30981.test @@ -0,0 +1,24 @@ +--echo # +--echo # MDEV-30981 Spider UBSAN: null pointer passed as argument 2, which is declared to never be null in spider_create_trx_alter_table on ALTER +--echo # + +if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "%UBSAN%"`) +{ +--skip test needs to be run with UBSAN +} + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +CREATE TABLE t (c INT) ENGINE=Spider PARTITION BY LIST (c) (PARTITION p VALUES IN (1,2)); +ALTER TABLE t ENGINE=InnoDB; +drop table t; + +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_query_log +--enable_result_log diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc index b0b1e9c36bd..d64393fb445 100644 --- a/storage/spider/spd_trx.cc +++ b/storage/spider/spd_trx.cc @@ -482,12 +482,28 @@ int spider_free_trx_alter_table( DBUG_RETURN(0); } +/** Copy a string from one array to another */ +static inline void spider_maybe_memcpy_indexed_string( + char **dests, + char **srcs, + const uint* lengths, + const int idx, + char *&ptr) +{ + if (size_t len= sizeof(char) * lengths[idx]) + { + dests[idx]= ptr; + memcpy(ptr, srcs[idx], len); + ptr+= len + 1; + } +} + int spider_create_trx_alter_table( SPIDER_TRX *trx, SPIDER_SHARE *share, bool now_create ) { - int error_num, roop_count; + int error_num, link_idx; SPIDER_ALTER_TABLE *alter_table, *share_alter; char *tmp_name; char **tmp_server_names; @@ -682,145 +698,74 @@ int spider_create_trx_alter_table( alter_table->tmp_tgt_default_groups_lengths = tmp_tgt_default_groups_lengths; alter_table->tmp_static_link_ids_lengths = tmp_static_link_ids_lengths; - size_t len; - for(roop_count = 0; roop_count < (int) share->all_link_count; roop_count++) + for(link_idx = 0; link_idx < (int) share->all_link_count; link_idx++) { - if ((len= - sizeof(char) * share_alter->tmp_server_names_lengths[roop_count])) - { - tmp_server_names[roop_count]= tmp_server_names_char; - memcpy(tmp_server_names_char, share_alter->tmp_server_names[roop_count], - len); - tmp_server_names_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_server_names, share_alter->tmp_server_names, + share_alter->tmp_server_names_lengths, link_idx, tmp_server_names_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_table_names_lengths[roop_count])) - { - tmp_tgt_table_names[roop_count]= tmp_tgt_table_names_char; - memcpy(tmp_tgt_table_names_char, - share_alter->tmp_tgt_table_names[roop_count], len); - tmp_tgt_table_names_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_table_names, share_alter->tmp_tgt_table_names, + share_alter->tmp_tgt_table_names_lengths, link_idx, tmp_tgt_table_names_char); - if ((len= sizeof(char) * share_alter->tmp_tgt_dbs_lengths[roop_count])) - { - tmp_tgt_dbs[roop_count]= tmp_tgt_dbs_char; - memcpy(tmp_tgt_dbs_char, share_alter->tmp_tgt_dbs[roop_count], len); - tmp_tgt_dbs_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_dbs, share_alter->tmp_tgt_dbs, + share_alter->tmp_tgt_dbs_lengths, link_idx, tmp_tgt_dbs_char); - if ((len= sizeof(char) * share_alter->tmp_tgt_hosts_lengths[roop_count])) - { - tmp_tgt_hosts[roop_count]= tmp_tgt_hosts_char; - memcpy(tmp_tgt_hosts_char, share_alter->tmp_tgt_hosts[roop_count], len); - tmp_tgt_hosts_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_hosts, share_alter->tmp_tgt_hosts, + share_alter->tmp_tgt_hosts_lengths, link_idx, tmp_tgt_hosts_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_usernames_lengths[roop_count])) - { - tmp_tgt_usernames[roop_count]= tmp_tgt_usernames_char; - memcpy(tmp_tgt_usernames_char, - share_alter->tmp_tgt_usernames[roop_count], len); - tmp_tgt_usernames_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_usernames, share_alter->tmp_tgt_usernames, + share_alter->tmp_tgt_usernames_lengths, link_idx, tmp_tgt_usernames_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_passwords_lengths[roop_count])) - { - tmp_tgt_passwords[roop_count]= tmp_tgt_passwords_char; - memcpy(tmp_tgt_passwords_char, - share_alter->tmp_tgt_passwords[roop_count], len); - tmp_tgt_passwords_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_passwords, share_alter->tmp_tgt_passwords, + share_alter->tmp_tgt_passwords_lengths, link_idx, tmp_tgt_passwords_char); - if ((len= sizeof(char) * share_alter->tmp_tgt_sockets_lengths[roop_count])) - { - tmp_tgt_sockets[roop_count]= tmp_tgt_sockets_char; - memcpy(tmp_tgt_sockets_char, share_alter->tmp_tgt_sockets[roop_count], - len); - tmp_tgt_sockets_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_sockets, share_alter->tmp_tgt_sockets, + share_alter->tmp_tgt_sockets_lengths, link_idx, tmp_tgt_sockets_char); - if ((len= - sizeof(char) * share_alter->tmp_tgt_wrappers_lengths[roop_count])) - { - tmp_tgt_wrappers[roop_count]= tmp_tgt_wrappers_char; - memcpy(tmp_tgt_wrappers_char, share_alter->tmp_tgt_wrappers[roop_count], - len); - tmp_tgt_wrappers_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_wrappers, share_alter->tmp_tgt_wrappers, + share_alter->tmp_tgt_wrappers_lengths, link_idx, tmp_tgt_wrappers_char); - if ((len= sizeof(char) * share_alter->tmp_tgt_ssl_cas_lengths[roop_count])) - { - tmp_tgt_ssl_cas[roop_count]= tmp_tgt_ssl_cas_char; - memcpy(tmp_tgt_ssl_cas_char, share_alter->tmp_tgt_ssl_cas[roop_count], - len); - tmp_tgt_ssl_cas_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_ssl_cas, share_alter->tmp_tgt_ssl_cas, + share_alter->tmp_tgt_ssl_cas_lengths, link_idx, tmp_tgt_ssl_cas_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_ssl_capaths_lengths[roop_count])) - { - tmp_tgt_ssl_capaths[roop_count]= tmp_tgt_ssl_capaths_char; - memcpy(tmp_tgt_ssl_capaths_char, - share_alter->tmp_tgt_ssl_capaths[roop_count], len); - tmp_tgt_ssl_capaths_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_ssl_capaths, share_alter->tmp_tgt_ssl_capaths, + share_alter->tmp_tgt_ssl_capaths_lengths, link_idx, tmp_tgt_ssl_capaths_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_ssl_certs_lengths[roop_count])) - { - tmp_tgt_ssl_certs[roop_count]= tmp_tgt_ssl_certs_char; - memcpy(tmp_tgt_ssl_certs_char, - share_alter->tmp_tgt_ssl_certs[roop_count], len); - tmp_tgt_ssl_certs_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_ssl_certs, share_alter->tmp_tgt_ssl_certs, + share_alter->tmp_tgt_ssl_certs_lengths, link_idx, tmp_tgt_ssl_certs_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_ssl_ciphers_lengths[roop_count])) - { - tmp_tgt_ssl_ciphers[roop_count]= tmp_tgt_ssl_ciphers_char; - memcpy(tmp_tgt_ssl_ciphers_char, - share_alter->tmp_tgt_ssl_ciphers[roop_count], len); - tmp_tgt_ssl_ciphers_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_ssl_ciphers, share_alter->tmp_tgt_ssl_ciphers, + share_alter->tmp_tgt_ssl_ciphers_lengths, link_idx, tmp_tgt_ssl_ciphers_char); - if ((len= sizeof(char) * share_alter->tmp_tgt_ssl_keys_lengths[roop_count])) - { - tmp_tgt_ssl_keys[roop_count]= tmp_tgt_ssl_keys_char; - memcpy(tmp_tgt_ssl_keys_char, share_alter->tmp_tgt_ssl_keys[roop_count], - len); - tmp_tgt_ssl_keys_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_ssl_keys, share_alter->tmp_tgt_ssl_keys, + share_alter->tmp_tgt_ssl_keys_lengths, link_idx, tmp_tgt_ssl_keys_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_default_files_lengths[roop_count])) - { - tmp_tgt_default_files[roop_count]= tmp_tgt_default_files_char; - memcpy(tmp_tgt_default_files_char, - share_alter->tmp_tgt_default_files[roop_count], len); - tmp_tgt_default_files_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_default_files, share_alter->tmp_tgt_default_files, + share_alter->tmp_tgt_default_files_lengths, link_idx, tmp_tgt_default_files_char); - if ((len= sizeof(char) * - share_alter->tmp_tgt_default_groups_lengths[roop_count])) - { - tmp_tgt_default_groups[roop_count]= tmp_tgt_default_groups_char; - memcpy(tmp_tgt_default_groups_char, - share_alter->tmp_tgt_default_groups[roop_count], len); - tmp_tgt_default_groups_char+= len + 1; - } + spider_maybe_memcpy_indexed_string( + tmp_tgt_default_groups, share_alter->tmp_tgt_default_groups, + share_alter->tmp_tgt_default_groups_lengths, link_idx, tmp_tgt_default_groups_char); - if ((len= sizeof(char) * - share_alter->tmp_static_link_ids_lengths[roop_count])) - { - tmp_static_link_ids[roop_count] = tmp_static_link_ids_char; - memcpy(tmp_static_link_ids_char, - share_alter->tmp_static_link_ids[roop_count], len); - tmp_static_link_ids_char += len + 1; - } + /* Notes on merge conflicts (remove this comment after merging): + for 10.5 see 3b2d1d135155fe3adf1bc28f8b0be1ecc2ea4f40 + for 10.6+ see d74103292c7be236f3da71c86249d37295f57bbc */ + spider_maybe_memcpy_indexed_string( + tmp_static_link_ids, share_alter->tmp_static_link_ids, + share_alter->tmp_static_link_ids_lengths, link_idx, tmp_static_link_ids_char); } memcpy(tmp_tgt_ports, share_alter->tmp_tgt_ports, From 78a1f3ce81162cb25d78f4667b36adc30eed898b Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Wed, 7 Jun 2023 08:09:02 -0400 Subject: [PATCH 57/80] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 91b253ca00c..8c23df65833 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=4 -MYSQL_VERSION_PATCH=30 +MYSQL_VERSION_PATCH=31 SERVER_MATURITY=stable From 2165c30486da10b6e889acc127ee87ee2d888626 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 8 Jun 2023 11:35:21 +0300 Subject: [PATCH 58/80] Fix testcase for MDEV-31240 to work with --view-protocol. --- mysql-test/main/derived_cond_pushdown.result | 22 ++++++-------------- mysql-test/main/derived_cond_pushdown.test | 2 +- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index a4fc7a7447d..1e23b1aa3a9 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -18384,7 +18384,7 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as SUBQ from t1 limit 5; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 @@ -18398,14 +18398,9 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as SUBQ from t1 limit 5; -a ( select concat(t3.a,'=',dt.s) -from -(select a, sum(b) as s from t2 group by a) as dt, -t3 -where dt.a=t1.a and t3.a < 3 -) +a SUBQ 1 1=804 2 1=1056 3 1=846 @@ -18424,7 +18419,7 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as SUBQ from t1 limit 5; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 @@ -18438,14 +18433,9 @@ from (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 -) +) as SUBQ from t1 limit 5; -a ( select concat(t3.a,'=',dt.s) -from -(select a, sum(b) as s from t2 group by a) as dt, -t3 -where dt.a=t1.a and t3.a < 3 -) +a SUBQ 1 1=11858 2 1=11380 3 1=11588 diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index 7a4d9b4ad7d..fa22ba9513b 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3997,7 +3997,7 @@ select (select a, sum(b) as s from t2 group by a) as dt, t3 where dt.a=t1.a and t3.a < 3 - ) + ) as SUBQ from t1 limit 5; eval explain $q; From f5dceafd0ba211405e04be4c778d69e8a7533d8d Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 29 Mar 2023 19:42:21 +0300 Subject: [PATCH 59/80] MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace Add printing --- mysql-test/main/opt_trace.result | 41 ++++++++++++++++++++++++++++++++ mysql-test/main/opt_trace.test | 33 +++++++++++++++++++++++++ sql/opt_range.cc | 7 ++++++ 3 files changed, 81 insertions(+) diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 7856f9248ba..fc29d128bd4 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -8515,6 +8515,47 @@ SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d); a DROP TABLE t1; # +# MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace +# +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +key(c1,c2,c3,c4,c5,c6,c7,c8) +); +insert into t1 () values (),(),(); +explain select * +from t1 +where +(c1 in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) and c2=1) and +c3 in (1,2,3,4,5,6,7,8,9,10) and +c4 in (1,2,3,4,5,6,7,8,9,10) and +c5 in (1,2,3,4,5,6,7,8,9,10) and +c6 in (1,2,3,4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index c1 c1 40 NULL 3 Using where; Using index +select +json_detailed(json_extract(trace, '$**.setup_range_conditions')) +from +information_schema.optimizer_trace; +json_detailed(json_extract(trace, '$**.setup_range_conditions')) +[ + [ + { + "sel_arg_alloc_limit_hit": + { + "alloced_sel_args": 16001 + } + } + ] +] +drop table t1; +# # MDEV-31085: multi-update using view with optimizer trace enabled # SET SESSION optimizer_trace = 'enabled=on'; diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test index 5f73e076fec..52b3bee0fe4 100644 --- a/mysql-test/main/opt_trace.test +++ b/mysql-test/main/opt_trace.test @@ -677,6 +677,39 @@ INSERT INTO t1 VALUES (0,0); SELECT a FROM t1 WHERE (a,b) in (SELECT @c,@d); DROP TABLE t1; + +--echo # +--echo # MDEV-30964: MAX_SEL_ARG memory exhaustion is not visible in the optimizer trace +--echo # +create table t1 ( + c1 int, + c2 int, + c3 int, + c4 int, + c5 int, + c6 int, + c7 int, + c8 int, + key(c1,c2,c3,c4,c5,c6,c7,c8) +); +insert into t1 () values (),(),(); + +explain select * +from t1 +where + (c1 in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) and c2=1) and + c3 in (1,2,3,4,5,6,7,8,9,10) and + c4 in (1,2,3,4,5,6,7,8,9,10) and + c5 in (1,2,3,4,5,6,7,8,9,10) and + c6 in (1,2,3,4); + +select + json_detailed(json_extract(trace, '$**.setup_range_conditions')) +from + information_schema.optimizer_trace; + +drop table t1; + --echo # --echo # MDEV-31085: multi-update using view with optimizer trace enabled --echo # diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 69a95f8da44..6ada4675ae6 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2853,6 +2853,13 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, Json_writer_array trace_range_summary(thd, "setup_range_conditions"); tree= cond->get_mm_tree(¶m, &cond); + if (thd->trace_started() && + param.alloced_sel_args >= SEL_ARG::MAX_SEL_ARGS) + { + Json_writer_object wrapper(thd); + Json_writer_object obj(thd, "sel_arg_alloc_limit_hit"); + obj.add("alloced_sel_args", param.alloced_sel_args); + } } if (tree) { From d32fc5b8e073bf5b4ec5c68875477ae6c8ca8721 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Jun 2023 22:16:49 +0200 Subject: [PATCH 60/80] MDEV-31461 mariadb SIGSEGV when built with -DCLIENT_PLUGIN_DIALOG=STATIC --- client/mysql.cc | 4 ++-- client/mysql_upgrade.c | 2 +- client/mysqladmin.cc | 6 +++--- client/mysqlbinlog.cc | 2 +- client/mysqlcheck.c | 2 +- client/mysqldump.c | 2 +- client/mysqlimport.c | 2 +- client/mysqlshow.c | 2 +- client/mysqlslap.c | 2 +- client/mysqltest.cc | 2 +- include/my_sys.h | 2 +- libmysqld/libmysqld.c | 4 ++++ mysys/get_password.c | 8 ++++---- tests/async_queries.c | 2 +- tests/mysql_client_fw.c | 2 +- tests/thread_test.c | 2 +- 16 files changed, 25 insertions(+), 21 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index b1042d1be00..214b0d51a32 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1958,7 +1958,7 @@ static int get_options(int argc, char **argv) current_db= my_strdup(*argv, MYF(MY_WME)); } if (tty_password) - opt_password= get_tty_password(NullS); + opt_password= my_get_tty_password(NullS); if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; if (debug_check_flag) @@ -4659,7 +4659,7 @@ char *mysql_authentication_dialog_ask(MYSQL *mysql, int type, if (type == 2) /* password */ { - s= get_tty_password(""); + s= my_get_tty_password(""); strnmov(buf, s, buf_len); buf[buf_len-1]= 0; my_free(s); diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 78297320b6e..ea18c1c5ba7 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -1350,7 +1350,7 @@ int main(int argc, char **argv) if (tty_password) { - opt_password= get_tty_password(NullS); + opt_password= my_get_tty_password(NullS); /* add password to defaults file */ add_one_option_cnf_file(&ds_args, "password", opt_password); } diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index fadefaed449..0b31ca3a5ce 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -339,7 +339,7 @@ int main(int argc,char *argv[]) } commands = temp_argv; if (tty_password) - opt_password = get_tty_password(NullS); + opt_password = my_get_tty_password(NullS); (void) signal(SIGINT,endprog); /* Here if abort */ (void) signal(SIGTERM,endprog); /* Here if abort */ @@ -1128,8 +1128,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) else if (argc == 1) { /* prompt for password */ - typed_password= get_tty_password("New password: "); - verified= get_tty_password("Confirm new password: "); + typed_password= my_get_tty_password("New password: "); + verified= my_get_tty_password("Confirm new password: "); if (strcmp(typed_password, verified) != 0) { my_printf_error(0,"Passwords don't match",MYF(ME_BELL)); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ec0cae5328c..269ed6a1f00 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2095,7 +2095,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; } if (tty_password) - pass= get_tty_password(NullS); + pass= my_get_tty_password(NullS); return 0; } diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index b32e21ff18f..9c0fa3e9f4e 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -458,7 +458,7 @@ static int get_options(int *argc, char ***argv) DBUG_RETURN(1); } if (tty_password) - opt_password = get_tty_password(NullS); + opt_password = my_get_tty_password(NullS); if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; if (debug_check_flag) diff --git a/client/mysqldump.c b/client/mysqldump.c index cf943918084..a961071bf79 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1233,7 +1233,7 @@ static int get_options(int *argc, char ***argv) return EX_USAGE; } if (tty_password) - opt_password=get_tty_password(NullS); + opt_password=my_get_tty_password(NullS); return(0); } /* get_options */ diff --git a/client/mysqlimport.c b/client/mysqlimport.c index ac0ad793c3f..ff77b6cc555 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -299,7 +299,7 @@ static int get_options(int *argc, char ***argv) current_db= *((*argv)++); (*argc)--; if (tty_password) - opt_password=get_tty_password(NullS); + opt_password=my_get_tty_password(NullS); return(0); } diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 0a59f6ac54f..93bdc5cb7e3 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -352,7 +352,7 @@ get_options(int *argc,char ***argv) exit(ho_error); if (tty_password) - opt_password=get_tty_password(NullS); + opt_password=my_get_tty_password(NullS); if (opt_count) { /* diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 78e9b6aa646..60499411ebf 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -1523,7 +1523,7 @@ get_options(int *argc,char ***argv) } if (tty_password) - opt_password= get_tty_password(NullS); + opt_password= my_get_tty_password(NullS); DBUG_RETURN(0); } diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 219b5532a70..6558436bbca 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -7293,7 +7293,7 @@ int parse_args(int argc, char **argv) if (argc == 1) opt_db= *argv; if (tty_password) - opt_pass= get_tty_password(NullS); /* purify tested */ + opt_pass= my_get_tty_password(NullS); /* purify tested */ if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; if (debug_check_flag) diff --git a/include/my_sys.h b/include/my_sys.h index 87df04c6087..017968ab6ce 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -1058,7 +1058,7 @@ extern void add_compiled_collation(struct charset_info_st *cs); extern size_t escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, size_t to_length, const char *from, size_t length); -extern char *get_tty_password(const char *opt_message); +extern char *my_get_tty_password(const char *opt_message); #ifdef __WIN__ #define BACKSLASH_MBTAIL /* File system character set */ diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 6de86927a38..1c7ab651a7e 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -226,3 +226,7 @@ error: DBUG_RETURN(0); } +char *get_tty_password(const char *opt_message) +{ + return my_get_tty_password(opt_message); +} diff --git a/mysys/get_password.c b/mysys/get_password.c index e20800f4213..1d60ec3d2d6 100644 --- a/mysys/get_password.c +++ b/mysys/get_password.c @@ -60,11 +60,11 @@ /* were just going to fake it here and get input from the keyboard */ -char *get_tty_password(const char *opt_message) +char *my_get_tty_password(const char *opt_message) { char to[80]; char *pos=to,*end=to+sizeof(to)-1; - DBUG_ENTER("get_tty_password"); + DBUG_ENTER("my_get_tty_password"); _cputs(opt_message ? opt_message : "Enter password: "); for (;;) { @@ -145,7 +145,7 @@ static void get_password(char *to,uint length,int fd, my_bool echo) #endif /* ! HAVE_GETPASS */ -char *get_tty_password(const char *opt_message) +char *my_get_tty_password(const char *opt_message) { #ifdef HAVE_GETPASS char *passbuff; @@ -154,7 +154,7 @@ char *get_tty_password(const char *opt_message) #endif /* HAVE_GETPASS */ char buff[80]; - DBUG_ENTER("get_tty_password"); + DBUG_ENTER("my_get_tty_password"); #ifdef HAVE_GETPASS passbuff = getpass(opt_message ? opt_message : "Enter password: "); diff --git a/tests/async_queries.c b/tests/async_queries.c index a8889fc8d5a..d11a9ccfbbf 100644 --- a/tests/async_queries.c +++ b/tests/async_queries.c @@ -371,7 +371,7 @@ main(int argc, char *argv[]) if (err) exit(err); if (tty_password) - opt_password= get_tty_password(NullS); + opt_password= my_get_tty_password(NullS); if (opt_query_file) { diff --git a/tests/mysql_client_fw.c b/tests/mysql_client_fw.c index e8d628e7b52..75425aa98e4 100644 --- a/tests/mysql_client_fw.c +++ b/tests/mysql_client_fw.c @@ -1362,7 +1362,7 @@ static void get_options(int *argc, char ***argv) exit(ho_error); if (tty_password) - opt_password= get_tty_password(NullS); + opt_password= my_get_tty_password(NullS); return; } diff --git a/tests/thread_test.c b/tests/thread_test.c index 0fa92d505a3..d0c33b47b9c 100644 --- a/tests/thread_test.c +++ b/tests/thread_test.c @@ -174,7 +174,7 @@ static void get_options(int argc, char **argv) free_defaults(argv); if (tty_password) - password=get_tty_password(NullS); + password=my_get_tty_password(NullS); return; } From 1f72450260ed345dc5a0abec2870399acac61d41 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 22 Jun 2023 15:24:09 +0200 Subject: [PATCH 61/80] Revert "MDEV-23925: Fixed warnings generated during compilation of mysys_ssl/openssl.c on MacOS" This reverts commit a1b6691f93e50ad4a8a53dbf89ba578d6a64b2cb. because #ifdef checks the symbol defined in ssl_compat.h, so #include cannot be inside #ifdef --- mysys_ssl/openssl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysys_ssl/openssl.c b/mysys_ssl/openssl.c index b38d4ba309c..e0f3d646ca9 100644 --- a/mysys_ssl/openssl.c +++ b/mysys_ssl/openssl.c @@ -15,6 +15,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include +#include /* The check is only done for OpenSSL 1.1.x. @@ -24,14 +25,12 @@ */ #ifndef HAVE_OPENSSL11 -#include int check_openssl_compatibility() { return 0; } #else #include -#include static uint testing; size_t alloc_size, alloc_count; From 9c0e91a27cc58d1b5076435e125c70cd277fd989 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 22 Jun 2023 15:26:23 +0200 Subject: [PATCH 62/80] Adjust OpenSSL context sizes for CiscoSSL also, add static --- include/ssl_compat.h | 4 ++-- mysys_ssl/openssl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ssl_compat.h b/include/ssl_compat.h index 9541a68cbdc..7b4a828a4d9 100644 --- a/include/ssl_compat.h +++ b/include/ssl_compat.h @@ -24,8 +24,8 @@ #define HAVE_OPENSSL11 1 #define SSL_LIBRARY OpenSSL_version(OPENSSL_VERSION) #define ERR_remove_state(X) ERR_clear_error() -#define EVP_CIPHER_CTX_SIZE 176 -#define EVP_MD_CTX_SIZE 48 +#define EVP_CIPHER_CTX_SIZE 200 +#define EVP_MD_CTX_SIZE 80 #undef EVP_MD_CTX_init #define EVP_MD_CTX_init(X) do { memset((X), 0, EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0) #undef EVP_CIPHER_CTX_init diff --git a/mysys_ssl/openssl.c b/mysys_ssl/openssl.c index e0f3d646ca9..340ba34ba78 100644 --- a/mysys_ssl/openssl.c +++ b/mysys_ssl/openssl.c @@ -33,7 +33,7 @@ int check_openssl_compatibility() #include static uint testing; -size_t alloc_size, alloc_count; +static size_t alloc_size, alloc_count; static void *coc_malloc(size_t size, const char *f __attribute__((unused)), int l __attribute__((unused))) From b37357eb4613b20ad00dad49184739fc113a8206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 26 Jun 2023 11:03:15 +0300 Subject: [PATCH 63/80] Fix GCC 13 -Wmaybe-uninitialized --- libmariadb | 2 +- sql/item_xmlfunc.cc | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libmariadb b/libmariadb index a3bba4639f5..d543bed61ba 160000 --- a/libmariadb +++ b/libmariadb @@ -1 +1 @@ -Subproject commit a3bba4639f55148c59a28a506df8a2b88e5e83ab +Subproject commit d543bed61ba9a117e95764dd1429b21c3e0579d1 diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 28bddb75df2..cdaa8177cb1 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -2638,19 +2638,21 @@ static int my_xpath_parse_VariableReference(MY_XPATH *xpath) { LEX_CSTRING name; - int user_var; - const char *dollar_pos; THD *thd= xpath->thd; - if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DOLLAR) || - (!(dollar_pos= xpath->prevtok.beg)) || - (!((user_var= my_xpath_parse_term(xpath, MY_XPATH_LEX_AT) && + if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_DOLLAR)) + return 0; + const char *dollar_pos= xpath->prevtok.beg; + if (!dollar_pos) + return 0; + int user_var= my_xpath_parse_term(xpath, MY_XPATH_LEX_AT); + if (!((user_var && my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT))) && - !my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT))) + !my_xpath_parse_term(xpath, MY_XPATH_LEX_IDENT)) return 0; name.length= xpath->prevtok.end - xpath->prevtok.beg; name.str= (char*) xpath->prevtok.beg; - + if (user_var) xpath->item= new (thd->mem_root) Item_func_get_user_var(thd, &name); else From 423c28f0aa47df796ac4eda5a2288b9fd12d5d31 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Tue, 3 Jan 2023 16:24:04 +1100 Subject: [PATCH 64/80] MDEV-29447 MDEV-26285 MDEV-31338 Refactor spider_db_mbase_util::open_item_func spider_db_mbase_util::open_item_func() is a monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added. We split the function into two distinct functions: one handles the case of str != NULL and the other handles the case of str == NULL. This refactoring was done in a conservative way because we do not have comprehensive tests on the function. It also fixes MDEV-29447 and MDEV-31338 where field items that are arguments of a func item may be used before created / initialised. Note this commit is adapted from a patch by Nayuta for MDEV-26285. --- .../spider/bugfix/r/mdev_29447.result | 33 + .../spider/bugfix/r/mdev_31338.result | 15 + .../mysql-test/spider/bugfix/t/mdev_29447.cnf | 3 + .../spider/bugfix/t/mdev_29447.test | 37 + .../spider/bugfix/t/mdev_31338.test | 22 + storage/spider/spd_db_mysql.cc | 1078 ++++++++--------- storage/spider/spd_db_mysql.h | 19 + 7 files changed, 645 insertions(+), 562 deletions(-) create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result create mode 100644 storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test create mode 100644 storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result new file mode 100644 index 00000000000..358e131fcf2 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_29447.result @@ -0,0 +1,33 @@ +# +# MDEV-29447 SIGSEGV in spider_db_open_item_field and SIGSEGV spider_db_print_item_type, on SELECT +# +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +connection child2_1; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +CREATE TABLE tbl_a ( +a INT +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +connection master_1; +CREATE DATABASE auto_test_local; +USE auto_test_local; +CREATE TABLE tbl_a ( +a INT +) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; +SELECT TRIM(LEADING 'c' FROM a) FROM tbl_a; +TRIM(LEADING 'c' FROM a) +connection child2_1; +DROP DATABASE auto_test_remote; +connection master_1; +DROP DATABASE auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result new file mode 100644 index 00000000000..dd951933fff --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_31338.result @@ -0,0 +1,15 @@ +# +# MDEV-31338 UBSAN: runtime error: member access within null pointer of type 'struct SPIDER_FIELD_CHAIN' and SIGSEGV in spider_db_open_item_ident on SELECT +# +for master_1 +for child2 +for child3 +CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +CREATE TABLE t (c BLOB) ENGINE=InnoDB; +CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"'; +SELECT TRIM(BOTH ' ' FROM c) FROM ts ORDER BY c; +TRIM(BOTH ' ' FROM c) +drop table t, ts; +for master_1 +for child2 +for child3 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf new file mode 100644 index 00000000000..05dfd8a0bce --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.cnf @@ -0,0 +1,3 @@ +!include include/default_mysqld.cnf +!include ../my_1_1.cnf +!include ../my_2_1.cnf diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test new file mode 100644 index 00000000000..60250be6481 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_29447.test @@ -0,0 +1,37 @@ +--echo # +--echo # MDEV-29447 SIGSEGV in spider_db_open_item_field and SIGSEGV spider_db_print_item_type, on SELECT +--echo # + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +--connection child2_1 +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +eval CREATE TABLE tbl_a ( + a INT +) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; + +--connection master_1 +CREATE DATABASE auto_test_local; +USE auto_test_local; +eval CREATE TABLE tbl_a ( + a INT +) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"'; + +SELECT TRIM(LEADING 'c' FROM a) FROM tbl_a; + +--connection child2_1 +DROP DATABASE auto_test_remote; + +--connection master_1 +DROP DATABASE auto_test_local; + +--disable_query_log +--disable_result_log +--source ../t/test_deinit.inc +--enable_query_log +--enable_result_log diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test new file mode 100644 index 00000000000..95ca7c1253c --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_31338.test @@ -0,0 +1,22 @@ +--echo # +--echo # MDEV-31338 UBSAN: runtime error: member access within null pointer of type 'struct SPIDER_FIELD_CHAIN' and SIGSEGV in spider_db_open_item_ident on SELECT +--echo # +--source include/have_innodb.inc + +--disable_query_log +--disable_result_log +--source ../../t/test_init.inc +--enable_result_log +--enable_query_log + +evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); +CREATE TABLE t (c BLOB) ENGINE=InnoDB; +CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"'; +SELECT TRIM(BOTH ' ' FROM c) FROM ts ORDER BY c; +drop table t, ts; + +--disable_query_log +--disable_result_log +--source ../../t/test_deinit.inc +--enable_result_log +--enable_query_log diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index a51c1497b02..e2f31b537e9 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -5501,6 +5501,13 @@ int spider_db_mbase_util::append_unlock_table( DBUG_RETURN(0); } +/** + The function check if the given item_func and its arguments can be pushed + down to a data node. If so and str != NULL, the function also print, to str, + the string corresponding to the item_func. + + @return 0: success, otherwise: error + */ int spider_db_mbase_util::open_item_func( Item_func *item_func, ha_spider *spider, @@ -5509,6 +5516,174 @@ int spider_db_mbase_util::open_item_func( uint alias_length, bool use_fields, spider_fields *fields +) { + DBUG_ENTER("spider_db_mbase_util::open_item_func"); + + int error = check_item_func(item_func, spider, alias, + alias_length, use_fields, fields); + if (error) + DBUG_RETURN(error); + if (!str) + DBUG_RETURN(0); + + DBUG_RETURN(print_item_func(item_func, spider, str, alias, + alias_length, use_fields, fields)); +} + +static bool item_func_is_timestampdiff( + const char *func_name, + int func_name_length +) { + return func_name_length == 13 && + !strncasecmp("timestampdiff", func_name, func_name_length); +} + +static bool not_func_should_be_skipped( + Item_func *item_func +){ + DBUG_ENTER("not_func_should_be_skipped"); + DBUG_ASSERT(item_func->functype() == Item_func::NOT_FUNC); + Item **item_list = item_func->arguments(); + + if (item_list[0]->type() == Item::COND_ITEM) + { + DBUG_PRINT("info",("spider item_list[0] is COND_ITEM")); + Item_cond *item_cond = (Item_cond *) item_list[0]; + if (item_cond->functype() == Item_func::COND_AND_FUNC) + { + DBUG_PRINT("info",("spider item_cond is COND_AND_FUNC")); + List_iterator_fast lif(*(item_cond->argument_list())); + bool has_expr_cache_item = FALSE; + bool has_isnotnull_func = FALSE; + bool has_other_item = FALSE; + while(Item *item = lif++) + { + if ( + item->type() == Item::EXPR_CACHE_ITEM + ) { + DBUG_PRINT("info",("spider EXPR_CACHE_ITEM")); + has_expr_cache_item = TRUE; + } else + if ( + item->type() == Item::FUNC_ITEM && + ((Item_func *) item)->functype() == Item_func::ISNOTNULL_FUNC + ) { + DBUG_PRINT("info",("spider ISNOTNULL_FUNC")); + has_isnotnull_func = TRUE; + } else { + DBUG_PRINT("info",("spider has other item")); + DBUG_PRINT("info",("spider COND type=%d", item->type())); + has_other_item = TRUE; + } + } + if (has_expr_cache_item && has_isnotnull_func && !has_other_item) + { + DBUG_PRINT("info",("spider NOT EXISTS skip")); + DBUG_RETURN(TRUE); + } + } + } + DBUG_RETURN(FALSE); +} + +/** + Check if the given item_func and its arguments can be pushed down to + a data node. This function is recursive because we need to also check + the arguments of the item_func. + + @return 0: success, otherwise: error + */ +int spider_db_mbase_util::check_item_func( + Item_func *item_func, + ha_spider *spider, + const char *alias, + uint alias_length, + bool use_fields, + spider_fields *fields +) { + int use_pushdown_udf; + DBUG_ENTER("spider_db_mbase_util::check_item_func"); + + Item_func::Functype func_type = item_func->functype(); + DBUG_PRINT("info",("spider functype = %d", func_type)); + + const char *func_name = (char*) item_func->func_name(); + int func_name_length = strlen(func_name); + DBUG_PRINT("info",("spider func_name = %s", func_name)); + + /* The blacklist of the functions that cannot be pushed down */ + switch (func_type) + { + case Item_func::TRIG_COND_FUNC: + case Item_func::CASE_SEARCHED_FUNC: + case Item_func::CASE_SIMPLE_FUNC: + DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); + case Item_func::NOT_FUNC: + /* Why the following check is necessary? */ + if (not_func_should_be_skipped(item_func)) + DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); + break; + case Item_func::FUNC_SP: + case Item_func::UDF_FUNC: + /* Notes on merging regarding MDEV-29447: please refer to the + following commits for build error or merge conflicts: + 10.5: d7b564da2a634dcf86798d6b86bd127e7eef9286 + 10.6: 1ed20b993b0dd4e95450cab2e8347e5bf4617a69 + 10.9: dd316b6e20265cfd832bb5585cb4c96e716387c8 + 10.10-11: 3f67f110ba1b23a89c5ede0fbeeb203cf5e164f4 + 11.0-1: 17ba6748afa8834df5658361088e6c8e65aca16f + Please remove this comment after merging. */ + use_pushdown_udf= spider_param_use_pushdown_udf( + spider->trx->thd, spider->share->use_pushdown_udf); + if (!use_pushdown_udf) + DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); + break; + case Item_func::FT_FUNC: + if (spider_db_check_ft_idx(item_func, spider) == MAX_KEY) + DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); + break; +#ifndef ITEM_FUNC_TIMESTAMPDIFF_ARE_PUBLIC + case Item_func::UNKNOWN_FUNC: + if (item_func_is_timestampdiff(func_name, func_name_length)) + DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); + break; +#endif + default: + break; + } + /* End of the blacklist */ + + /* Check the arguments recursively */ + if (uint item_count = item_func->argument_count()) + { + Item **item_list = item_func->arguments(); + for (uint roop_count = 0; roop_count < item_count; roop_count++) + { + Item *item = item_list[roop_count]; + if (int error_num = spider_db_print_item_type(item, NULL, spider, NULL, + alias, alias_length, dbton_id, use_fields, fields)) + DBUG_RETURN(error_num); + } + } + + DBUG_RETURN(0); +} + +/** + The function print the string corresponding to the given item_func to str. + The function is assumed to be called only when the check by the function + check_item_func() has passed. + + @return 0: success, otherwise: error + */ +int spider_db_mbase_util::print_item_func( + Item_func *item_func, + ha_spider *spider, + spider_string *str, + const char *alias, + uint alias_length, + bool use_fields, + spider_fields *fields ) { int error_num; Item *item, **item_list = item_func->arguments(); @@ -5523,13 +5698,15 @@ int spider_db_mbase_util::open_item_func( last_str_length = SPIDER_SQL_NULL_CHAR_LEN; int use_pushdown_udf; bool merge_func = FALSE; - DBUG_ENTER("spider_db_mbase_util::open_item_func"); - if (str) - { - if (str->reserve(SPIDER_SQL_OPEN_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - } + DBUG_ENTER("spider_db_mbase_util::print_item_func"); + DBUG_ASSERT(!check_item_func(item_func, spider, alias, alias_length, + use_fields, fields)); + DBUG_ASSERT(str); + + if (str->reserve(SPIDER_SQL_OPEN_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); + DBUG_PRINT("info",("spider functype = %d", item_func->functype())); switch (item_func->functype()) { @@ -5577,14 +5754,9 @@ int spider_db_mbase_util::open_item_func( { if ( !strncasecmp("rand", func_name, func_name_length) && -#ifdef SPIDER_Item_args_arg_count_IS_PROTECTED !item_func->argument_count() -#else - !item_func->arg_count -#endif ) { - if (str) - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); DBUG_RETURN(spider_db_open_item_int(item_func, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields)); } else if ( @@ -5594,38 +5766,36 @@ int spider_db_mbase_util::open_item_func( /* item_count == 1 means this TRIM() is without a remove_str */ item = item_list[0]; Item *item_tmp = item_list[1]; - if (str) + + if (item_tmp->is_of_type(Item::CONST_ITEM, STRING_RESULT)) { - if (item_tmp->is_of_type(Item::CONST_ITEM, STRING_RESULT)) - { - /* 1. append 'TRIM(BOTH ' */ - if (str->reserve(SPIDER_SQL_TRIM_LEN + SPIDER_SQL_OPEN_PAREN_LEN + - SPIDER_SQL_TRIM_BOTH_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_TRIM_STR, SPIDER_SQL_TRIM_LEN); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, - SPIDER_SQL_OPEN_PAREN_LEN); - str->q_append(SPIDER_SQL_TRIM_BOTH_STR, SPIDER_SQL_TRIM_BOTH_LEN); - /* 2. append "remove_str"*/ - if ((error_num = spider_db_print_item_type( - item_tmp, NULL, spider, str, alias, alias_length, dbton_id, - use_fields, fields))) - DBUG_RETURN(error_num); - /* 3. append ' FROM ' */ - if (str->reserve(SPIDER_SQL_FROM_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_FROM_STR, SPIDER_SQL_FROM_LEN); - /* 4. append `field` */ - if ((error_num = spider_db_print_item_type( - item, NULL, spider, str, alias, alias_length, dbton_id, - use_fields, fields))) - DBUG_RETURN(error_num); - /* 5. append ')' */ - if (str->reserve(SPIDER_SQL_CLOSE_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, - SPIDER_SQL_CLOSE_PAREN_LEN); - } + /* 1. append 'TRIM(BOTH ' */ + if (str->reserve(SPIDER_SQL_TRIM_LEN + SPIDER_SQL_OPEN_PAREN_LEN + + SPIDER_SQL_TRIM_BOTH_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_TRIM_STR, SPIDER_SQL_TRIM_LEN); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, + SPIDER_SQL_OPEN_PAREN_LEN); + str->q_append(SPIDER_SQL_TRIM_BOTH_STR, SPIDER_SQL_TRIM_BOTH_LEN); + /* 2. append "remove_str"*/ + if ((error_num = spider_db_print_item_type( + item_tmp, NULL, spider, str, alias, alias_length, dbton_id, + use_fields, fields))) + DBUG_RETURN(error_num); + /* 3. append ' FROM ' */ + if (str->reserve(SPIDER_SQL_FROM_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_FROM_STR, SPIDER_SQL_FROM_LEN); + /* 4. append `field` */ + if ((error_num = spider_db_print_item_type( + item, NULL, spider, str, alias, alias_length, dbton_id, + use_fields, fields))) + DBUG_RETURN(error_num); + /* 5. append ')' */ + if (str->reserve(SPIDER_SQL_CLOSE_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, + SPIDER_SQL_CLOSE_PAREN_LEN); } item_count -= 2; break; @@ -5641,50 +5811,47 @@ int spider_db_mbase_util::open_item_func( /* item_count == 2 means this TRIM(LEADING/TRAILING ...) is with a remove_str */ item = item_list[0]; Item *item_tmp = item_list[1]; - if (str) + if (item_tmp->is_of_type(Item::CONST_ITEM, STRING_RESULT)) { - if (item_tmp->is_of_type(Item::CONST_ITEM, STRING_RESULT)) - { - /* 1. append 'TRIM(LEADING ' or 'TRIM(TRAILING ' */ - if (func_name[0] == 'l' || func_name[0] == 'L') - { /* ltrim */ - if (str->reserve(SPIDER_SQL_TRIM_LEN + SPIDER_SQL_OPEN_PAREN_LEN + - SPIDER_SQL_TRIM_LEADING_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_TRIM_STR, SPIDER_SQL_TRIM_LEN); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, - SPIDER_SQL_OPEN_PAREN_LEN); - str->q_append(SPIDER_SQL_TRIM_LEADING_STR, SPIDER_SQL_TRIM_LEADING_LEN); - } else - { /* rtrim */ - if (str->reserve(SPIDER_SQL_TRIM_LEN + SPIDER_SQL_OPEN_PAREN_LEN + - SPIDER_SQL_TRIM_TRAILING_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_TRIM_STR, SPIDER_SQL_TRIM_LEN); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, - SPIDER_SQL_OPEN_PAREN_LEN); - str->q_append(SPIDER_SQL_TRIM_TRAILING_STR, SPIDER_SQL_TRIM_TRAILING_LEN); - } - /* 2. append "remove_str"*/ - if ((error_num = spider_db_print_item_type( - item_tmp, NULL, spider, str, alias, alias_length, dbton_id, - use_fields, fields))) - DBUG_RETURN(error_num); - /* 3. append ' FROM ' */ - if (str->reserve(SPIDER_SQL_FROM_LEN)) + /* 1. append 'TRIM(LEADING ' or 'TRIM(TRAILING ' */ + if (func_name[0] == 'l' || func_name[0] == 'L') + { /* ltrim */ + if (str->reserve(SPIDER_SQL_TRIM_LEN + SPIDER_SQL_OPEN_PAREN_LEN + + SPIDER_SQL_TRIM_LEADING_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_FROM_STR, SPIDER_SQL_FROM_LEN); - /* 4. append `field` */ - if ((error_num = spider_db_print_item_type( - item, NULL, spider, str, alias, alias_length, dbton_id, - use_fields, fields))) - DBUG_RETURN(error_num); - /* 5. append ')' */ - if (str->reserve(SPIDER_SQL_CLOSE_PAREN_LEN)) + str->q_append(SPIDER_SQL_TRIM_STR, SPIDER_SQL_TRIM_LEN); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, + SPIDER_SQL_OPEN_PAREN_LEN); + str->q_append(SPIDER_SQL_TRIM_LEADING_STR, SPIDER_SQL_TRIM_LEADING_LEN); + } else + { /* rtrim */ + if (str->reserve(SPIDER_SQL_TRIM_LEN + SPIDER_SQL_OPEN_PAREN_LEN + + SPIDER_SQL_TRIM_TRAILING_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, - SPIDER_SQL_CLOSE_PAREN_LEN); + str->q_append(SPIDER_SQL_TRIM_STR, SPIDER_SQL_TRIM_LEN); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, + SPIDER_SQL_OPEN_PAREN_LEN); + str->q_append(SPIDER_SQL_TRIM_TRAILING_STR, SPIDER_SQL_TRIM_TRAILING_LEN); } + /* 2. append "remove_str"*/ + if ((error_num = spider_db_print_item_type( + item_tmp, NULL, spider, str, alias, alias_length, dbton_id, + use_fields, fields))) + DBUG_RETURN(error_num); + /* 3. append ' FROM ' */ + if (str->reserve(SPIDER_SQL_FROM_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_FROM_STR, SPIDER_SQL_FROM_LEN); + /* 4. append `field` */ + if ((error_num = spider_db_print_item_type( + item, NULL, spider, str, alias, alias_length, dbton_id, + use_fields, fields))) + DBUG_RETURN(error_num); + /* 5. append ')' */ + if (str->reserve(SPIDER_SQL_CLOSE_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, + SPIDER_SQL_CLOSE_PAREN_LEN); } item_count -= 2; break; @@ -5707,23 +5874,19 @@ int spider_db_mbase_util::open_item_func( !strncasecmp("curdate", func_name, func_name_length) || !strncasecmp("curtime", func_name, func_name_length) ) { - if (str) - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); DBUG_RETURN(spider_db_open_item_string(item_func, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields)); } else if ( !strncasecmp("convert", func_name, func_name_length) ) { - if (str) - { - if (str->reserve(func_name_length * 2 + SPIDER_SQL_OPEN_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, - SPIDER_SQL_OPEN_PAREN_LEN); - last_str = SPIDER_SQL_CLOSE_PAREN_STR; - last_str_length = SPIDER_SQL_CLOSE_PAREN_LEN; - } + if (str->reserve(func_name_length * 2 + SPIDER_SQL_OPEN_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, + SPIDER_SQL_OPEN_PAREN_LEN); + last_str = SPIDER_SQL_CLOSE_PAREN_STR; + last_str_length = SPIDER_SQL_CLOSE_PAREN_LEN; break; } } else if (func_name_length == 8 && @@ -5732,8 +5895,7 @@ int spider_db_mbase_util::open_item_func( !strncasecmp("utc_time", func_name, func_name_length) ) ) { - if (str) - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); DBUG_RETURN(spider_db_open_item_string(item_func, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields)); } else if (func_name_length == 9 && @@ -5751,14 +5913,12 @@ int spider_db_mbase_util::open_item_func( break; } else if (!strncasecmp("column_get", func_name, func_name_length)) { - if (str) - { - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - } + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); + func_name = SPIDER_SQL_COMMA_STR; func_name_length = SPIDER_SQL_COMMA_LEN; separator_str = SPIDER_SQL_COMMA_STR; @@ -5792,15 +5952,12 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } + if (str->reserve(SPIDER_SQL_CAST_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } last_str = SPIDER_SQL_AS_DATE_STR; last_str_length = SPIDER_SQL_AS_DATE_LEN; @@ -5830,15 +5987,12 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } + if (str->reserve(SPIDER_SQL_CAST_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } last_str = SPIDER_SQL_AS_TIME_STR; last_str_length = SPIDER_SQL_AS_TIME_LEN; @@ -5848,8 +6002,7 @@ int spider_db_mbase_util::open_item_func( { if (!strncasecmp("utc_timestamp", func_name, func_name_length)) { - if (str) - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); DBUG_RETURN(spider_db_open_item_string(item_func, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields)); } else if (!strncasecmp("timestampdiff", func_name, func_name_length)) @@ -5857,64 +6010,62 @@ int spider_db_mbase_util::open_item_func( #ifdef ITEM_FUNC_TIMESTAMPDIFF_ARE_PUBLIC Item_func_timestamp_diff *item_func_timestamp_diff = (Item_func_timestamp_diff *) item_func; - if (str) + const char *interval_str; + uint interval_len; + switch (item_func_timestamp_diff->int_type) { - const char *interval_str; - uint interval_len; - switch (item_func_timestamp_diff->int_type) - { - case INTERVAL_YEAR: - interval_str = SPIDER_SQL_YEAR_STR; - interval_len = SPIDER_SQL_YEAR_LEN; - break; - case INTERVAL_QUARTER: - interval_str = SPIDER_SQL_QUARTER_STR; - interval_len = SPIDER_SQL_QUARTER_LEN; - break; - case INTERVAL_MONTH: - interval_str = SPIDER_SQL_MONTH_STR; - interval_len = SPIDER_SQL_MONTH_LEN; - break; - case INTERVAL_WEEK: - interval_str = SPIDER_SQL_WEEK_STR; - interval_len = SPIDER_SQL_WEEK_LEN; - break; - case INTERVAL_DAY: - interval_str = SPIDER_SQL_DAY_STR; - interval_len = SPIDER_SQL_DAY_LEN; - break; - case INTERVAL_HOUR: - interval_str = SPIDER_SQL_HOUR_STR; - interval_len = SPIDER_SQL_HOUR_LEN; - break; - case INTERVAL_MINUTE: - interval_str = SPIDER_SQL_MINUTE_STR; - interval_len = SPIDER_SQL_MINUTE_LEN; - break; - case INTERVAL_SECOND: - interval_str = SPIDER_SQL_SECOND_STR; - interval_len = SPIDER_SQL_SECOND_LEN; - break; - case INTERVAL_MICROSECOND: - interval_str = SPIDER_SQL_MICROSECOND_STR; - interval_len = SPIDER_SQL_MICROSECOND_LEN; - break; - default: - interval_str = ""; - interval_len = 0; - break; - } - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN + - interval_len + SPIDER_SQL_COMMA_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - str->q_append(interval_str, interval_len); - str->q_append(SPIDER_SQL_COMMA_STR, SPIDER_SQL_COMMA_LEN); + case INTERVAL_YEAR: + interval_str = SPIDER_SQL_YEAR_STR; + interval_len = SPIDER_SQL_YEAR_LEN; + break; + case INTERVAL_QUARTER: + interval_str = SPIDER_SQL_QUARTER_STR; + interval_len = SPIDER_SQL_QUARTER_LEN; + break; + case INTERVAL_MONTH: + interval_str = SPIDER_SQL_MONTH_STR; + interval_len = SPIDER_SQL_MONTH_LEN; + break; + case INTERVAL_WEEK: + interval_str = SPIDER_SQL_WEEK_STR; + interval_len = SPIDER_SQL_WEEK_LEN; + break; + case INTERVAL_DAY: + interval_str = SPIDER_SQL_DAY_STR; + interval_len = SPIDER_SQL_DAY_LEN; + break; + case INTERVAL_HOUR: + interval_str = SPIDER_SQL_HOUR_STR; + interval_len = SPIDER_SQL_HOUR_LEN; + break; + case INTERVAL_MINUTE: + interval_str = SPIDER_SQL_MINUTE_STR; + interval_len = SPIDER_SQL_MINUTE_LEN; + break; + case INTERVAL_SECOND: + interval_str = SPIDER_SQL_SECOND_STR; + interval_len = SPIDER_SQL_SECOND_LEN; + break; + case INTERVAL_MICROSECOND: + interval_str = SPIDER_SQL_MICROSECOND_STR; + interval_len = SPIDER_SQL_MICROSECOND_LEN; + break; + default: + interval_str = ""; + interval_len = 0; + break; } + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN + + interval_len + SPIDER_SQL_COMMA_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); + str->q_append(interval_str, interval_len); + str->q_append(SPIDER_SQL_COMMA_STR, SPIDER_SQL_COMMA_LEN); + if ((error_num = spider_db_print_item_type(item_list[0], NULL, spider, - str, alias, alias_length, dbton_id, use_fields, fields))) + str, alias, alias_length, dbton_id, use_fields, fields))) DBUG_RETURN(error_num); if (str) { @@ -5923,14 +6074,14 @@ int spider_db_mbase_util::open_item_func( str->q_append(SPIDER_SQL_COMMA_STR, SPIDER_SQL_COMMA_LEN); } if ((error_num = spider_db_print_item_type(item_list[1], NULL, spider, - str, alias, alias_length, dbton_id, use_fields, fields))) + str, alias, alias_length, dbton_id, use_fields, fields))) DBUG_RETURN(error_num); if (str) { if (str->reserve(SPIDER_SQL_CLOSE_PAREN_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, - SPIDER_SQL_CLOSE_PAREN_LEN); + SPIDER_SQL_CLOSE_PAREN_LEN); } DBUG_RETURN(0); #else @@ -5964,35 +6115,28 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + char *tmp_ptr, *tmp_ptr2; + DBUG_ASSERT(tmp_str.length() == 0); + tmp_str.set_charset(str->charset()); + tmp_str.init_calc_mem(123); + tmp_str.reserve(MAX_FIELD_WIDTH); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - char *tmp_ptr, *tmp_ptr2; - DBUG_ASSERT(tmp_str.length() == 0); - tmp_str.set_charset(str->charset()); - tmp_str.init_calc_mem(123); - tmp_str.reserve(MAX_FIELD_WIDTH); - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } -#if MYSQL_VERSION_ID < 50500 - item_func->print(tmp_str.get_str(), QT_IS); -#else - item_func->print(tmp_str.get_str(), QT_TO_SYSTEM_CHARSET); -#endif - tmp_str.mem_calc(); - if (tmp_str.reserve(1)) + if (str->reserve(SPIDER_SQL_CAST_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); - tmp_ptr = tmp_str.c_ptr_quick(); - DBUG_PRINT("info",("spider tmp_ptr = %s", tmp_ptr)); - while ((tmp_ptr2 = strstr(tmp_ptr, SPIDER_SQL_AS_BINARY_STR))) - tmp_ptr = tmp_ptr2 + 1; - last_str = tmp_ptr - 1; - last_str_length = strlen(last_str) - SPIDER_SQL_CLOSE_PAREN_LEN; + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } + item_func->print(tmp_str.get_str(), QT_TO_SYSTEM_CHARSET); + tmp_str.mem_calc(); + if (tmp_str.reserve(1)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + tmp_ptr = tmp_str.c_ptr_quick(); + DBUG_PRINT("info",("spider tmp_ptr = %s", tmp_ptr)); + while ((tmp_ptr2 = strstr(tmp_ptr, SPIDER_SQL_AS_BINARY_STR))) + tmp_ptr = tmp_ptr2 + 1; + last_str = tmp_ptr - 1; + last_str_length = strlen(last_str) - SPIDER_SQL_CLOSE_PAREN_LEN; break; } else if (!strncasecmp("cast_as_signed", func_name, func_name_length)) { @@ -6019,15 +6163,12 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } + if (str->reserve(SPIDER_SQL_CAST_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } last_str = SPIDER_SQL_AS_SIGNED_STR; last_str_length = SPIDER_SQL_AS_SIGNED_LEN; @@ -6060,15 +6201,12 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } + if (str->reserve(SPIDER_SQL_CAST_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } last_str = SPIDER_SQL_AS_UNSIGNED_STR; last_str_length = SPIDER_SQL_AS_UNSIGNED_LEN; @@ -6099,35 +6237,28 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + char *tmp_ptr, *tmp_ptr2; + DBUG_ASSERT(tmp_str.length() == 0); + tmp_str.set_charset(str->charset()); + tmp_str.init_calc_mem(124); + tmp_str.reserve(MAX_FIELD_WIDTH); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - char *tmp_ptr, *tmp_ptr2; - DBUG_ASSERT(tmp_str.length() == 0); - tmp_str.set_charset(str->charset()); - tmp_str.init_calc_mem(124); - tmp_str.reserve(MAX_FIELD_WIDTH); - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } -#if MYSQL_VERSION_ID < 50500 - item_func->print(tmp_str.get_str(), QT_IS); -#else - item_func->print(tmp_str.get_str(), QT_TO_SYSTEM_CHARSET); -#endif - tmp_str.mem_calc(); - if (tmp_str.reserve(1)) + if (str->reserve(SPIDER_SQL_CAST_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); - tmp_ptr = tmp_str.c_ptr_quick(); - DBUG_PRINT("info",("spider tmp_ptr = %s", tmp_ptr)); - while ((tmp_ptr2 = strstr(tmp_ptr, SPIDER_SQL_AS_DECIMAL_STR))) - tmp_ptr = tmp_ptr2 + 1; - last_str = tmp_ptr - 1; - last_str_length = strlen(last_str) - SPIDER_SQL_CLOSE_PAREN_LEN; + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } + item_func->print(tmp_str.get_str(), QT_TO_SYSTEM_CHARSET); + tmp_str.mem_calc(); + if (tmp_str.reserve(1)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + tmp_ptr = tmp_str.c_ptr_quick(); + DBUG_PRINT("info",("spider tmp_ptr = %s", tmp_ptr)); + while ((tmp_ptr2 = strstr(tmp_ptr, SPIDER_SQL_AS_DECIMAL_STR))) + tmp_ptr = tmp_ptr2 + 1; + last_str = tmp_ptr - 1; + last_str_length = strlen(last_str) - SPIDER_SQL_CLOSE_PAREN_LEN; break; } else if (!strncasecmp("cast_as_datetime", func_name, func_name_length)) @@ -6155,15 +6286,12 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } + if (str->reserve(SPIDER_SQL_CAST_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } last_str = SPIDER_SQL_AS_DATETIME_STR; last_str_length = SPIDER_SQL_AS_DATETIME_LEN; @@ -6181,41 +6309,32 @@ int spider_db_mbase_util::open_item_func( if ((error_num = spider_db_print_item_type(item_list[0], NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields))) DBUG_RETURN(error_num); - if (str) + if (item_date_add_interval->date_sub_interval) { - if (item_date_add_interval->date_sub_interval) - { - if (str->reserve(SPIDER_SQL_NEGINTERVAL_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_NEGINTERVAL_STR, - SPIDER_SQL_NEGINTERVAL_LEN); - } else { - if (str->reserve(SPIDER_SQL_INTERVAL_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_INTERVAL_STR, SPIDER_SQL_INTERVAL_LEN); - } + if (str->reserve(SPIDER_SQL_NEGINTERVAL_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_NEGINTERVAL_STR, + SPIDER_SQL_NEGINTERVAL_LEN); + } else { + if (str->reserve(SPIDER_SQL_INTERVAL_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_INTERVAL_STR, SPIDER_SQL_INTERVAL_LEN); } if ((error_num = spider_db_print_item_type(item_list[1], NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields))) DBUG_RETURN(error_num); - if (str) - { - if (str->reserve(func_name_length + SPIDER_SQL_CLOSE_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, - SPIDER_SQL_CLOSE_PAREN_LEN); - } + if (str->reserve(func_name_length + SPIDER_SQL_CLOSE_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, + SPIDER_SQL_CLOSE_PAREN_LEN); DBUG_RETURN(0); } } - if (str) - { - if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - } + if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); func_name = SPIDER_SQL_COMMA_STR; func_name_length = SPIDER_SQL_COMMA_LEN; separator_str = SPIDER_SQL_COMMA_STR; @@ -6224,8 +6343,7 @@ int spider_db_mbase_util::open_item_func( last_str_length = SPIDER_SQL_CLOSE_PAREN_LEN; break; case Item_func::NOW_FUNC: - if (str) - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); DBUG_RETURN(spider_db_open_item_string(item_func, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields)); case Item_func::CHAR_TYPECAST_FUNC: @@ -6254,99 +6372,48 @@ int spider_db_mbase_util::open_item_func( } } - if (str) + char *tmp_ptr, *tmp_ptr2; + DBUG_ASSERT(tmp_str.length() == 0); + tmp_str.set_charset(str->charset()); + tmp_str.init_calc_mem(125); + tmp_str.reserve(MAX_FIELD_WIDTH); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + if (!merge_func) { - char *tmp_ptr, *tmp_ptr2; - DBUG_ASSERT(tmp_str.length() == 0); - tmp_str.set_charset(str->charset()); - tmp_str.init_calc_mem(125); - tmp_str.reserve(MAX_FIELD_WIDTH); - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); - if (!merge_func) - { - if (str->reserve(SPIDER_SQL_CAST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); - } -#if MYSQL_VERSION_ID < 50500 - item_func->print(tmp_str.get_str(), QT_IS); -#else - item_func->print(tmp_str.get_str(), QT_TO_SYSTEM_CHARSET); -#endif - tmp_str.mem_calc(); - if (tmp_str.reserve(1)) + if (str->reserve(SPIDER_SQL_CAST_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); - tmp_ptr = tmp_str.c_ptr_quick(); - DBUG_PRINT("info",("spider tmp_ptr = %s", tmp_ptr)); - while ((tmp_ptr2 = strstr(tmp_ptr, SPIDER_SQL_AS_CHAR_STR))) - tmp_ptr = tmp_ptr2 + 1; - last_str = tmp_ptr - 1; - last_str_length = strlen(last_str) - SPIDER_SQL_CLOSE_PAREN_LEN; + str->q_append(SPIDER_SQL_CAST_STR, SPIDER_SQL_CAST_LEN); } + item_func->print(tmp_str.get_str(), QT_TO_SYSTEM_CHARSET); + tmp_str.mem_calc(); + if (tmp_str.reserve(1)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + tmp_ptr = tmp_str.c_ptr_quick(); + DBUG_PRINT("info",("spider tmp_ptr = %s", tmp_ptr)); + while ((tmp_ptr2 = strstr(tmp_ptr, SPIDER_SQL_AS_CHAR_STR))) + tmp_ptr = tmp_ptr2 + 1; + last_str = tmp_ptr - 1; + last_str_length = strlen(last_str) - SPIDER_SQL_CLOSE_PAREN_LEN; } break; case Item_func::NOT_FUNC: DBUG_PRINT("info",("spider NOT_FUNC")); - if (item_list[0]->type() == Item::COND_ITEM) - { - DBUG_PRINT("info",("spider item_list[0] is COND_ITEM")); - Item_cond *item_cond = (Item_cond *) item_list[0]; - if (item_cond->functype() == Item_func::COND_AND_FUNC) - { - DBUG_PRINT("info",("spider item_cond is COND_AND_FUNC")); - List_iterator_fast lif(*(item_cond->argument_list())); - bool has_expr_cache_item = FALSE; - bool has_isnotnull_func = FALSE; - bool has_other_item = FALSE; - while((item = lif++)) - { -#ifdef SPIDER_HAS_EXPR_CACHE_ITEM - if ( - item->type() == Item::EXPR_CACHE_ITEM - ) { - DBUG_PRINT("info",("spider EXPR_CACHE_ITEM")); - has_expr_cache_item = TRUE; - } else -#endif - if ( - item->type() == Item::FUNC_ITEM && - ((Item_func *) item)->functype() == Item_func::ISNOTNULL_FUNC - ) { - DBUG_PRINT("info",("spider ISNOTNULL_FUNC")); - has_isnotnull_func = TRUE; - } else { - DBUG_PRINT("info",("spider has other item")); - DBUG_PRINT("info",("spider COND type=%d", item->type())); - has_other_item = TRUE; - } - } - if (has_expr_cache_item && has_isnotnull_func && !has_other_item) - { - DBUG_PRINT("info",("spider NOT EXISTS skip")); - DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); - } - } - } - if (str) - { - func_name = (char*) item_func->func_name(); - func_name_length = strlen(func_name); - if (str->reserve(func_name_length + SPIDER_SQL_SPACE_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); - } + if (not_func_should_be_skipped(item_func)) + DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); + func_name = (char*) item_func->func_name(); + func_name_length = strlen(func_name); + if (str->reserve(func_name_length + SPIDER_SQL_SPACE_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); break; case Item_func::NEG_FUNC: - if (str) - { - func_name = (char*) item_func->func_name(); - func_name_length = strlen(func_name); - if (str->reserve(func_name_length + SPIDER_SQL_SPACE_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); - } + func_name = (char*) item_func->func_name(); + func_name_length = strlen(func_name); + if (str->reserve(func_name_length + SPIDER_SQL_SPACE_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); break; case Item_func::IN_FUNC: if (((Item_func_opt_neg *) item_func)->negated) @@ -6391,17 +6458,14 @@ int spider_db_mbase_util::open_item_func( definition). Users can turn it on if they know what they are doing. */ DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); - if (str) - { - func_name = (char*) item_func->func_name(); - func_name_length = strlen(func_name); - DBUG_PRINT("info",("spider func_name = %s", func_name)); - DBUG_PRINT("info",("spider func_name_length = %d", func_name_length)); - if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - } + func_name = (char*) item_func->func_name(); + func_name_length = strlen(func_name); + DBUG_PRINT("info",("spider func_name = %s", func_name)); + DBUG_PRINT("info",("spider func_name_length = %d", func_name_length)); + if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); func_name = SPIDER_SQL_COMMA_STR; func_name_length = SPIDER_SQL_COMMA_LEN; separator_str = SPIDER_SQL_COMMA_STR; @@ -6412,8 +6476,7 @@ int spider_db_mbase_util::open_item_func( case Item_func::TRIG_COND_FUNC: DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); case Item_func::GUSERVAR_FUNC: - if (str) - str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); + str->length(str->length() - SPIDER_SQL_OPEN_PAREN_LEN); if (item_func->result_type() == STRING_RESULT) DBUG_RETURN(spider_db_open_item_string(item_func, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields)); @@ -6424,28 +6487,22 @@ int spider_db_mbase_util::open_item_func( if (spider_db_check_ft_idx(item_func, spider) == MAX_KEY) DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); start_item = 1; - if (str) - { - if (str->reserve(SPIDER_SQL_MATCH_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_MATCH_STR, SPIDER_SQL_MATCH_LEN); - } + if (str->reserve(SPIDER_SQL_MATCH_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_MATCH_STR, SPIDER_SQL_MATCH_LEN); separator_str = SPIDER_SQL_COMMA_STR; separator_str_length = SPIDER_SQL_COMMA_LEN; last_str = SPIDER_SQL_CLOSE_PAREN_STR; last_str_length = SPIDER_SQL_CLOSE_PAREN_LEN; break; case Item_func::SP_EQUALS_FUNC: - if (str) - { - func_name = SPIDER_SQL_MBR_EQUAL_STR; - func_name_length = SPIDER_SQL_MBR_EQUAL_LEN; - DBUG_PRINT("info",("spider func_name = %s", func_name)); - DBUG_PRINT("info",("spider func_name_length = %d", func_name_length)); - if (str->reserve(func_name_length)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - } + func_name = SPIDER_SQL_MBR_EQUAL_STR; + func_name_length = SPIDER_SQL_MBR_EQUAL_LEN; + DBUG_PRINT("info",("spider func_name = %s", func_name)); + DBUG_PRINT("info",("spider func_name_length = %d", func_name_length)); + if (str->reserve(func_name_length)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); func_name = SPIDER_SQL_COMMA_STR; func_name_length = SPIDER_SQL_COMMA_LEN; separator_str = SPIDER_SQL_COMMA_STR; @@ -6460,24 +6517,14 @@ int spider_db_mbase_util::open_item_func( case Item_func::SP_WITHIN_FUNC: case Item_func::SP_CONTAINS_FUNC: case Item_func::SP_OVERLAPS_FUNC: - if (str) - { - func_name = (char*) item_func->func_name(); - func_name_length = strlen(func_name); - DBUG_PRINT("info",("spider func_name = %s", func_name)); - DBUG_PRINT("info",("spider func_name_length = %d", func_name_length)); - if (str->reserve( -#ifndef SPIDER_ITEM_GEOFUNC_NAME_HAS_MBR - SPIDER_SQL_MBR_LEN + -#endif - func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) + func_name = (char*) item_func->func_name(); + func_name_length = strlen(func_name); + DBUG_PRINT("info",("spider func_name = %s", func_name)); + DBUG_PRINT("info",("spider func_name_length = %d", func_name_length)); + if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) DBUG_RETURN(HA_ERR_OUT_OF_MEM); -#ifndef SPIDER_ITEM_GEOFUNC_NAME_HAS_MBR - str->q_append(SPIDER_SQL_MBR_STR, SPIDER_SQL_MBR_LEN); -#endif - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - } + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); func_name = SPIDER_SQL_COMMA_STR; func_name_length = SPIDER_SQL_COMMA_LEN; separator_str = SPIDER_SQL_COMMA_STR; @@ -6493,107 +6540,32 @@ int spider_db_mbase_util::open_item_func( case Item_func::GE_FUNC: case Item_func::GT_FUNC: case Item_func::XOR_FUNC: - if (str) + func_name = (char*) item_func->func_name(); + func_name_length = strlen(func_name); + break; + case Item_func::LIKE_FUNC: + if (((Item_func_like *)item_func)->get_negated()) { - func_name = (char*) item_func->func_name(); + func_name = SPIDER_SQL_NOT_LIKE_STR; + func_name_length = SPIDER_SQL_NOT_LIKE_LEN; + } + else + { + func_name = (char*)item_func->func_name(); func_name_length = strlen(func_name); } break; - case Item_func::LIKE_FUNC: -#ifdef SPIDER_LIKE_FUNC_HAS_GET_NEGATED - if (str) - { - if (((Item_func_like *)item_func)->get_negated()) - { - func_name = SPIDER_SQL_NOT_LIKE_STR; - func_name_length = SPIDER_SQL_NOT_LIKE_LEN; - } - else - { - func_name = (char*)item_func->func_name(); - func_name_length = strlen(func_name); - } - } - break; -#else DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); -#endif case Item_func::CASE_SEARCHED_FUNC: case Item_func::CASE_SIMPLE_FUNC: -#ifdef ITEM_FUNC_CASE_PARAMS_ARE_PUBLIC - Item_func_case *item_func_case = (Item_func_case *) item_func; - if (str) - { - if (str->reserve(SPIDER_SQL_CASE_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_CASE_STR, SPIDER_SQL_CASE_LEN); - } - if (item_func_case->first_expr_num != -1) - { - if ((error_num = spider_db_print_item_type( - item_list[item_func_case->first_expr_num], NULL, spider, str, - alias, alias_length, dbton_id, use_fields, fields))) - DBUG_RETURN(error_num); - } - for (roop_count = 0; roop_count < item_func_case->ncases; - roop_count += 2) - { - if (str) - { - if (str->reserve(SPIDER_SQL_WHEN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_WHEN_STR, SPIDER_SQL_WHEN_LEN); - } - if ((error_num = spider_db_print_item_type( - item_list[roop_count], NULL, spider, str, - alias, alias_length, dbton_id, use_fields, fields))) - DBUG_RETURN(error_num); - if (str) - { - if (str->reserve(SPIDER_SQL_THEN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_THEN_STR, SPIDER_SQL_THEN_LEN); - } - if ((error_num = spider_db_print_item_type( - item_list[roop_count + 1], NULL, spider, str, - alias, alias_length, dbton_id, use_fields, fields))) - DBUG_RETURN(error_num); - } - if (item_func_case->else_expr_num != -1) - { - if (str) - { - if (str->reserve(SPIDER_SQL_ELSE_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_ELSE_STR, SPIDER_SQL_ELSE_LEN); - } - if ((error_num = spider_db_print_item_type( - item_list[item_func_case->else_expr_num], NULL, spider, str, - alias, alias_length, dbton_id, use_fields, fields))) - DBUG_RETURN(error_num); - } - if (str) - { - if (str->reserve(SPIDER_SQL_END_LEN + SPIDER_SQL_CLOSE_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_END_STR, SPIDER_SQL_END_LEN); - str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, - SPIDER_SQL_CLOSE_PAREN_LEN); - } - DBUG_RETURN(0); -#else DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); -#endif case Item_func::JSON_EXTRACT_FUNC: func_name = (char*) item_func->func_name(); func_name_length = strlen(func_name); - if (str) - { - if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); - } + if (str->reserve(func_name_length + SPIDER_SQL_OPEN_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_OPEN_PAREN_STR, SPIDER_SQL_OPEN_PAREN_LEN); func_name = SPIDER_SQL_COMMA_STR; func_name_length = SPIDER_SQL_COMMA_LEN; separator_str = SPIDER_SQL_COMMA_STR; @@ -6607,11 +6579,8 @@ int spider_db_mbase_util::open_item_func( if (spider_param_skip_default_condition(thd, share->skip_default_condition)) DBUG_RETURN(ER_SPIDER_COND_SKIP_NUM); - if (str) - { - func_name = (char*) item_func->func_name(); - func_name_length = strlen(func_name); - } + func_name = (char*) item_func->func_name(); + func_name_length = strlen(func_name); break; } DBUG_PRINT("info",("spider func_name = %s", func_name)); @@ -6644,14 +6613,11 @@ int spider_db_mbase_util::open_item_func( func_name = separator_str; func_name_length = separator_str_length; } - if (str) - { - if (str->reserve(func_name_length + SPIDER_SQL_SPACE_LEN * 2)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); - str->q_append(func_name, func_name_length); - str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); - } + if (str->reserve(func_name_length + SPIDER_SQL_SPACE_LEN * 2)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); + str->q_append(func_name, func_name_length); + str->q_append(SPIDER_SQL_SPACE_STR, SPIDER_SQL_SPACE_LEN); } /* Print the last operand value */ @@ -6664,61 +6630,49 @@ int spider_db_mbase_util::open_item_func( if (item_func->functype() == Item_func::FT_FUNC) { Item_func_match *item_func_match = (Item_func_match *)item_func; - if (str) - { - if (str->reserve(SPIDER_SQL_AGAINST_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_AGAINST_STR, SPIDER_SQL_AGAINST_LEN); - } + if (str->reserve(SPIDER_SQL_AGAINST_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_AGAINST_STR, SPIDER_SQL_AGAINST_LEN); item = item_list[0]; if ((error_num = spider_db_print_item_type(item, NULL, spider, str, alias, alias_length, dbton_id, use_fields, fields))) DBUG_RETURN(error_num); - if (str) - { - if (str->reserve( - ((item_func_match->flags & FT_BOOL) ? - SPIDER_SQL_IN_BOOLEAN_MODE_LEN : 0) + - ((item_func_match->flags & FT_EXPAND) ? - SPIDER_SQL_WITH_QUERY_EXPANSION_LEN : 0) - )) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - if (item_func_match->flags & FT_BOOL) - str->q_append(SPIDER_SQL_IN_BOOLEAN_MODE_STR, - SPIDER_SQL_IN_BOOLEAN_MODE_LEN); - if (item_func_match->flags & FT_EXPAND) - str->q_append(SPIDER_SQL_WITH_QUERY_EXPANSION_STR, - SPIDER_SQL_WITH_QUERY_EXPANSION_LEN); - } + if (str->reserve( + ((item_func_match->flags & FT_BOOL) ? + SPIDER_SQL_IN_BOOLEAN_MODE_LEN : 0) + + ((item_func_match->flags & FT_EXPAND) ? + SPIDER_SQL_WITH_QUERY_EXPANSION_LEN : 0) + )) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + if (item_func_match->flags & FT_BOOL) + str->q_append(SPIDER_SQL_IN_BOOLEAN_MODE_STR, + SPIDER_SQL_IN_BOOLEAN_MODE_LEN); + if (item_func_match->flags & FT_EXPAND) + str->q_append(SPIDER_SQL_WITH_QUERY_EXPANSION_STR, + SPIDER_SQL_WITH_QUERY_EXPANSION_LEN); } else if (item_func->functype() == Item_func::UNKNOWN_FUNC) { if ( func_name_length == 7 && !strncasecmp("convert", func_name, func_name_length) ) { - if (str) - { - Item_func_conv_charset *item_func_conv_charset = - (Item_func_conv_charset *)item_func; - CHARSET_INFO *conv_charset = - item_func_conv_charset->SPIDER_Item_func_conv_charset_conv_charset; - uint cset_length = strlen(conv_charset->csname); - if (str->reserve(SPIDER_SQL_USING_LEN + cset_length)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(SPIDER_SQL_USING_STR, SPIDER_SQL_USING_LEN); - str->q_append(conv_charset->csname, cset_length); - } + Item_func_conv_charset *item_func_conv_charset = + (Item_func_conv_charset *)item_func; + CHARSET_INFO *conv_charset = + item_func_conv_charset->SPIDER_Item_func_conv_charset_conv_charset; + uint cset_length = strlen(conv_charset->csname); + if (str->reserve(SPIDER_SQL_USING_LEN + cset_length)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(SPIDER_SQL_USING_STR, SPIDER_SQL_USING_LEN); + str->q_append(conv_charset->csname, cset_length); } } - if (str) - { - if (merge_func) - str->length(str->length() - SPIDER_SQL_CLOSE_PAREN_LEN); - if (str->reserve(last_str_length + SPIDER_SQL_CLOSE_PAREN_LEN)) - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - str->q_append(last_str, last_str_length); - str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, SPIDER_SQL_CLOSE_PAREN_LEN); - } + if (merge_func) + str->length(str->length() - SPIDER_SQL_CLOSE_PAREN_LEN); + if (str->reserve(last_str_length + SPIDER_SQL_CLOSE_PAREN_LEN)) + DBUG_RETURN(HA_ERR_OUT_OF_MEM); + str->q_append(last_str, last_str_length); + str->q_append(SPIDER_SQL_CLOSE_PAREN_STR, SPIDER_SQL_CLOSE_PAREN_LEN); DBUG_RETURN(0); } diff --git a/storage/spider/spd_db_mysql.h b/storage/spider/spd_db_mysql.h index bc7b0baa9b5..c866376095a 100644 --- a/storage/spider/spd_db_mysql.h +++ b/storage/spider/spd_db_mysql.h @@ -122,6 +122,25 @@ public: bool use_fields, spider_fields *fields ) override; +protected: + int check_item_func( + Item_func *item_func, + ha_spider *spider, + const char *alias, + uint alias_length, + bool use_fields, + spider_fields *fields + ); + int print_item_func( + Item_func *item_func, + ha_spider *spider, + spider_string *str, + const char *alias, + uint alias_length, + bool use_fields, + spider_fields *fields + ); +public: #ifdef HANDLER_HAS_DIRECT_AGGREGATE int open_item_sum_func( Item_sum *item_sum, From 5f09b53bdb4e973e7c7ec2c53a24c98321223f98 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Mon, 5 Jun 2023 19:09:38 +0530 Subject: [PATCH 65/80] MDEV-31086 MODIFY COLUMN can break FK constraints, and lead to unrestorable dumps - When foreign_key_check is disabled, allowing to modify the column which is part of foreign key constraint can lead to refusal of TRUNCATE TABLE, OPTIMIZE TABLE later. So it make sense to block the column modify operation when foreign key is involved irrespective of foreign_key_check variable. Correct way to modify the charset of the column when fk is involved: SET foreign_key_checks=OFF; ALTER TABLE child DROP FOREIGN KEY fk, MODIFY m VARCHAR(200) CHARSET utf8mb4; ALTER TABLE parent MODIFY m VARCHAR(200) CHARSET utf8mb4; ALTER TABLE child ADD CONSTRAINT FOREIGN KEY (m) REFERENCES PARENT(m); SET foreign_key_checks=ON; fk_check_column_changes(): Remove the FOREIGN_KEY_CHECKS while checking the column change for foreign key constraint. This is the partial revert of commit 5f1f2fc0e443f098af24d21f7d1ec1a8166a4030 and it changes the behaviour of copy alter algorithm ha_innobase::prepare_inplace_alter_table(): Find the modified column and check whether it is part of existing and newly added foreign key constraint. --- mysql-test/suite/innodb/r/fk_col_alter.result | 77 +++++++++++++ mysql-test/suite/innodb/r/foreign_key.result | 3 + mysql-test/suite/innodb/r/innodb.result | 2 + mysql-test/suite/innodb/t/fk_col_alter.test | 106 ++++++++++++++++++ mysql-test/suite/innodb/t/foreign_key.test | 3 + mysql-test/suite/innodb/t/innodb.test | 2 + sql/sql_table.cc | 17 +-- storage/innobase/handler/handler0alter.cc | 102 ++++++++++++++++- 8 files changed, 298 insertions(+), 14 deletions(-) create mode 100644 mysql-test/suite/innodb/r/fk_col_alter.result create mode 100644 mysql-test/suite/innodb/t/fk_col_alter.test diff --git a/mysql-test/suite/innodb/r/fk_col_alter.result b/mysql-test/suite/innodb/r/fk_col_alter.result new file mode 100644 index 00000000000..edd90e05ecd --- /dev/null +++ b/mysql-test/suite/innodb/r/fk_col_alter.result @@ -0,0 +1,77 @@ +# +# MDEV-31086 MODIFY COLUMN can break FK constraints, and +# lead to unrestorable dumps +# +CREATE TABLE t1( +id SERIAL, +msg VARCHAR(100) CHARACTER SET utf8mb3, +KEY(msg))ENGINE=InnoDB; +CREATE TABLE t2( +id SERIAL, +msg varchar(100) CHARACTER SET utf8mb4, +CONSTRAINT fk_t1 FOREIGN KEY (msg) REFERENCES t1 (msg))ENGINE=InnoDB; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +CREATE TABLE t2( +id SERIAL, +msg varchar(100) CHARACTER SET utf8mb3, +msg_1 varchar(100) CHARACTER SET utf8mb3, +INDEX (msg_1), +INDEX (msg), +CONSTRAINT fk_t1 FOREIGN KEY (msg) REFERENCES t1 (msg) +ON DELETE CASCADE)ENGINE=InnoDB; +SET FOREIGN_KEY_CHECKS=1; +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(200) character set utf8mb3, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(200) character set utf8mb3, ALGORITHM=INPLACE; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'test/fk_t1' +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(200) character set utf8mb3, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(400) character set utf8mb3, ALGORITHM=INPLACE; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'test/fk_t1' +SET FOREIGN_KEY_CHECKS=1; +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4,ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4,ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +SET FOREIGN_KEY_CHECKS=1; +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=COPY; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Adding foreign keys needs foreign_key_checks=OFF. Try ALGORITHM=COPY +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=COPY; +ERROR HY000: Can't create table `test`.`t2` (errno: 150 "Foreign key constraint is incorrectly formed") +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(200) CHARACTER SET utf8mb3, ALGORITHM=INPLACE; +ERROR HY000: Cannot change column 'msg_1': used in a foreign key constraint 'test/t2_ibfk_0' +SET FOREIGN_KEY_CHECKS=1; +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb3, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' of table 'test.t2' +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb3, ALGORITHM=INPLACE; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'test/fk_t1' of table 'test/t2' +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' of table 'test.t2' +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb3, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' of table 'test.t2' +ALTER TABLE t1 MODIFY msg VARCHAR(400) CHARSET utf8mb3, ALGORITHM=INPLACE; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'test/fk_t1' of table 'test/t2' +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +ERROR HY000: Cannot change column 'msg': used in a foreign key constraint 'fk_t1' of table 'test.t2' +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t2 DROP FOREIGN KEY fk_t1, MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY (msg) REFERENCES t1(msg), aLGORITHM=INPLACE; +SET FOREIGN_KEY_CHECKS=1; +DROP TABLE t2, t1; diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 802019d493e..68a54344519 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -246,8 +246,11 @@ CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB; ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a); SET SESSION FOREIGN_KEY_CHECKS = OFF; ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL; +ERROR HY000: Cannot change column 'a': used in a foreign key constraint 't1_ibfk_1' of table 'test.t1' ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY; ALTER TABLE t1 CHANGE COLUMN a b TIME; +ERROR 0A000: ALGORITHM=COPY is not supported. Reason: Columns participating in a foreign key are renamed. Try ALGORITHM=INPLACE +ALTER TABLE t1 CHANGE COLUMN a b TIME, DROP FOREIGN KEY t1_ibfk_1; SET SESSION FOREIGN_KEY_CHECKS = ON; DROP TABLE t1; # diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index 23f9ac89495..5e0f231d419 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -2544,12 +2544,14 @@ set foreign_key_checks=0; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; create table t1(a varchar(10) primary key) engine = innodb; alter table t1 modify column a int; +ERROR HY000: Cannot change column 'a': used in a foreign key constraint 't2_ibfk_1' of table 'test.t2' set foreign_key_checks=1; drop table t2,t1; set foreign_key_checks=0; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; alter table t1 convert to character set utf8; +ERROR HY000: Cannot change column 'a': used in a foreign key constraint 't2_ibfk_1' of table 'test.t2' set foreign_key_checks=1; drop table t2,t1; call mtr.add_suppression("\\[Warning\\] InnoDB: In ALTER TABLE `test`.`t1` has or is referenced in foreign key constraints which are not compatible with the new table definition."); diff --git a/mysql-test/suite/innodb/t/fk_col_alter.test b/mysql-test/suite/innodb/t/fk_col_alter.test new file mode 100644 index 00000000000..d8b9afc92ad --- /dev/null +++ b/mysql-test/suite/innodb/t/fk_col_alter.test @@ -0,0 +1,106 @@ +--source include/have_innodb.inc +--echo # +--echo # MDEV-31086 MODIFY COLUMN can break FK constraints, and +--echo # lead to unrestorable dumps +--echo # +CREATE TABLE t1( + id SERIAL, + msg VARCHAR(100) CHARACTER SET utf8mb3, + KEY(msg))ENGINE=InnoDB; + +--error ER_CANT_CREATE_TABLE +CREATE TABLE t2( +id SERIAL, +msg varchar(100) CHARACTER SET utf8mb4, +CONSTRAINT fk_t1 FOREIGN KEY (msg) REFERENCES t1 (msg))ENGINE=InnoDB; + +CREATE TABLE t2( +id SERIAL, +msg varchar(100) CHARACTER SET utf8mb3, +msg_1 varchar(100) CHARACTER SET utf8mb3, +INDEX (msg_1), +INDEX (msg), +CONSTRAINT fk_t1 FOREIGN KEY (msg) REFERENCES t1 (msg) +ON DELETE CASCADE)ENGINE=InnoDB; + +# Changing column used in FK constraint +SET FOREIGN_KEY_CHECKS=1; +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(200) character set utf8mb3, ALGORITHM=COPY; +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(200) character set utf8mb3, ALGORITHM=INPLACE; + +SET FOREIGN_KEY_CHECKS=0; +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(200) character set utf8mb3, ALGORITHM=COPY; +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(400) character set utf8mb3, ALGORITHM=INPLACE; + +# Changing column charset used in FK constraint +SET FOREIGN_KEY_CHECKS=1; +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=COPY; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=INPLACE; + +SET FOREIGN_KEY_CHECKS=0; +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4,ALGORITHM=COPY; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t2 MODIFY COLUMN msg VARCHAR(100) CHARACTER SET utf8mb4,ALGORITHM=INPLACE; + +# Modify the column in the newly added foreign constraint +SET FOREIGN_KEY_CHECKS=1; +--error ER_CANT_CREATE_TABLE +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=COPY; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=INPLACE; + + +SET FOREIGN_KEY_CHECKS=0; +--error ER_CANT_CREATE_TABLE +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=COPY; + +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(100) CHARACTER SET utf8mb4, ALGORITHM=INPLACE; + +--error ER_FK_COLUMN_CANNOT_CHANGE +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY(msg_1) REFERENCES t1(msg),MODIFY COLUMN msg_1 VARCHAR(200) CHARACTER SET utf8mb3, ALGORITHM=INPLACE; + +# Change referenced table column +SET FOREIGN_KEY_CHECKS=1; +# Change referenced column length +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb3, ALGORITHM=COPY; +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb3, ALGORITHM=INPLACE; +# Change referenced column character set +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=INPLACE; + +SET FOREIGN_KEY_CHECKS=0; +# Change referenced column length +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb3, ALGORITHM=COPY; +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD +ALTER TABLE t1 MODIFY msg VARCHAR(400) CHARSET utf8mb3, ALGORITHM=INPLACE; + +# Change referenced column character set +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=INPLACE; + +# Correct way to change character set in foreign key constraint +SET FOREIGN_KEY_CHECKS=0; +ALTER TABLE t2 DROP FOREIGN KEY fk_t1, MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +ALTER TABLE t1 MODIFY msg VARCHAR(200) CHARSET utf8mb4, ALGORITHM=COPY; +ALTER TABLE t2 ADD CONSTRAINT FOREIGN KEY (msg) REFERENCES t1(msg), aLGORITHM=INPLACE; +SET FOREIGN_KEY_CHECKS=1; + +DROP TABLE t2, t1; diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index 4f3f07757d5..4caa4cc2431 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -239,9 +239,12 @@ DROP TABLE t3,t1; CREATE TABLE t1 (a INT, UNIQUE(a), KEY(a)) ENGINE=InnoDB; ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES t1 (a); SET SESSION FOREIGN_KEY_CHECKS = OFF; +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD ALTER TABLE t1 CHANGE COLUMN a a TIME NOT NULL; ALTER TABLE t1 ADD pk INT NOT NULL AUTO_INCREMENT PRIMARY KEY; +--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON ALTER TABLE t1 CHANGE COLUMN a b TIME; +ALTER TABLE t1 CHANGE COLUMN a b TIME, DROP FOREIGN KEY t1_ibfk_1; SET SESSION FOREIGN_KEY_CHECKS = ON; DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index ba5126e4757..b50fd995e83 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1626,6 +1626,7 @@ drop table t1; set foreign_key_checks=0; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb; create table t1(a varchar(10) primary key) engine = innodb; +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD alter table t1 modify column a int; set foreign_key_checks=1; drop table t2,t1; @@ -1635,6 +1636,7 @@ drop table t2,t1; set foreign_key_checks=0; create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1; create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1; +--error ER_FK_COLUMN_CANNOT_CHANGE_CHILD alter table t1 convert to character set utf8; set foreign_key_checks=1; drop table t2,t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b0f7d848068..100436ae1ef 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9143,17 +9143,12 @@ fk_check_column_changes(THD *thd, Alter_info *alter_info, ((new_field->flags & NOT_NULL_FLAG) && !(old_field->flags & NOT_NULL_FLAG))) { - if (!(thd->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS)) - { - /* - Column in a FK has changed significantly. Unless - foreign_key_checks are off we prohibit this since this - means values in this column might be changed by ALTER - and thus referential integrity might be broken, - */ - *bad_column_name= column->str; - return FK_COLUMN_DATA_CHANGE; - } + /* + Column in a FK has changed significantly and it + may break referential intergrity. + */ + *bad_column_name= column->str; + return FK_COLUMN_DATA_CHANGE; } } else diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 17fe6014fea..9ec025d6141 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -7662,6 +7662,71 @@ static bool alter_templ_needs_rebuild(const TABLE* altered_table, const Alter_inplace_info* ha_alter_info, const dict_table_t* table); +/** Check whether the column is present in table foreign key +relations. +@param table table which has foreign key relation +@param col column to be checked +@param col_name column name to be display during error +@param drop_fk Drop foreign key constraint +@param n_drop_fk number of drop foreign keys +@param add_fk Newly added foreign key constraint +@param n_add_fk number of newly added foreign constraint */ +static +bool check_col_is_in_fk_indexes( + const dict_table_t *table, const dict_col_t *col, + const char* col_name, + span drop_fk, + span add_fk) +{ + char *fk_id= nullptr; + + for (dict_foreign_set::iterator it= table->foreign_set.begin(); + it!= table->foreign_set.end();) + { + if (std::find(drop_fk.begin(), drop_fk.end(), (*it)) + != drop_fk.end()) + goto next_item; + for (ulint i= 0; i < (*it)->n_fields; i++) + if ((*it)->foreign_index->fields[i].col == col) + { + fk_id= (*it)->id; + goto err_exit; + } +next_item: + it++; + } + + for (const auto &a : add_fk) + { + for (ulint i= 0; i < a->n_fields; i++) + { + if (a->foreign_index->fields[i].col == col) + { + fk_id= a->id; + goto err_exit; + } + } + } + + for (const auto &f : table->referenced_set) + { + for (ulint i= 0; i < f->n_fields; i++) + { + if (f->referenced_index->fields[i].col == col) + { + my_error(ER_FK_COLUMN_CANNOT_CHANGE_CHILD, MYF(0), + col_name, f->id, f->foreign_table_name); + return true; + } + } + } + return false; +err_exit: + my_error(ER_FK_COLUMN_CANNOT_CHANGE, MYF(0), col_name, + fk_id ? fk_id : + (std::string(table->name.m_name) + "_ibfk_0").c_str()); + return true; +} /** Allows InnoDB to update internal structures with concurrent writes blocked (provided that check_if_supported_inplace_alter() @@ -7687,7 +7752,7 @@ ha_innobase::prepare_inplace_alter_table( dict_foreign_t**drop_fk; /*!< Foreign key constraints to drop */ ulint n_drop_fk; /*!< Number of foreign keys to drop */ dict_foreign_t**add_fk = NULL; /*!< Foreign key constraints to drop */ - ulint n_add_fk; /*!< Number of foreign keys to drop */ + ulint n_add_fk= 0; /*!< Number of foreign keys to drop */ dict_table_t* indexed_table; /*!< Table where indexes are created */ mem_heap_t* heap; const char** col_names; @@ -8204,8 +8269,6 @@ check_if_can_drop_indexes: } } - n_add_fk = 0; - if (ha_alter_info->handler_flags & ALTER_ADD_FOREIGN_KEY) { ut_ad(!m_prebuilt->trx->check_foreigns); @@ -8239,6 +8302,12 @@ err_exit: m_prebuilt->trx); } + for (uint i = 0; i < n_add_fk; i++) { + if (add_fk[i]) { + dict_foreign_free(add_fk[i]); + } + } + if (heap) { mem_heap_free(heap); } @@ -8257,6 +8326,33 @@ err_exit: } } + /** Alter shouldn't support if the foreign and referenced + index columns are modified */ + if (ha_alter_info->handler_flags + & ALTER_COLUMN_TYPE_CHANGE_BY_ENGINE) { + List_iterator it( + ha_alter_info->alter_info->create_list); + for (uint i = 0; i < table->s->fields; i++) { + Field* field = table->field[i]; + Create_field *f= it++; + if (!f->field || field->is_equal(*f)) + continue; + + const char* col_name= field->field_name.str; + dict_col_t *col= dict_table_get_nth_col( + m_prebuilt->table, i); + if (check_col_is_in_fk_indexes( + m_prebuilt->table, col, col_name, + span( + const_cast( + drop_fk), n_drop_fk), + span( + const_cast( + add_fk), n_add_fk))) + goto err_exit; + } + } + if (ha_alter_info->handler_flags & ALTER_RENAME_INDEX) { for (const Alter_inplace_info::Rename_key_pair& pair : ha_alter_info->rename_keys) { From d214628af47b2335a9da03a3f7ae54d7ea3241f0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 May 2023 11:33:07 +0200 Subject: [PATCH 66/80] mtr: fix the help text for debuggers --- mysql-test/lib/My/Debugger.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm index e7428572ca4..b1a287d660d 100644 --- a/mysql-test/lib/My/Debugger.pm +++ b/mysql-test/lib/My/Debugger.pm @@ -116,19 +116,19 @@ for my $k (sort keys %debuggers) { my $v = $debuggers{$k}; $v = $debuggers{$k} = $debuggers{$v} if not ref $v; # resolve aliases - sub register_opt($$) { - my ($name, $msg) = @_; - $opts{"$name=s"} = \$opt_vals{$name}; - $help .= wrap(sprintf(" %-23s", $name), ' 'x25, "$msg under $name\n"); + sub register_opt($$$) { + my ($prefix, $name, $msg) = @_; + $opts{"$prefix$name=s"} = \$opt_vals{$prefix.$name}; + $help .= wrap(sprintf(" %-23s", $prefix.$name), ' 'x25, "$msg under $name\n"); } $v->{script} = '' unless $v->{script}; $v->{options} =~ s/(\{exe\}|$)/ {options} $&/ unless $v->{options} =~ /\{options\}/; - register_opt "$k" => "Start mysqld"; - register_opt "client-$k" => "Start mysqltest client"; - register_opt "boot-$k" => "Start bootstrap server"; - register_opt "manual-$k" => "Before running test(s) let user manually start mysqld"; + register_opt "", $k, "Start mysqld"; + register_opt "client-", $k, "Start mysqltest client"; + register_opt "boot-", $k, "Start bootstrap server"; + register_opt "manual-", "$k", "Before running test(s) let user manually start mysqld"; } sub subst($%) { From ea4b8d4ce99d0f427dd7ed40b5eeb15e41eec01e Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 28 Jun 2023 14:41:24 +1000 Subject: [PATCH 67/80] MDEV-31101 Spider: temporarily disable mdev_29904.test Will re-enable once MDEV-31101 is no longer blocked by MDEV-22979, as the patch for the latter might fix the former. --- storage/spider/mysql-test/spider/bugfix/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/spider/mysql-test/spider/bugfix/disabled.def b/storage/spider/mysql-test/spider/bugfix/disabled.def index e19ea07b76b..99443c854e5 100644 --- a/storage/spider/mysql-test/spider/bugfix/disabled.def +++ b/storage/spider/mysql-test/spider/bugfix/disabled.def @@ -1 +1,2 @@ wait_timeout : MDEV-26045 +mdev_29904 : MDEV-31101 From 428c7964a23a63eeb0155e46a2e94948391cb981 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 29 Jun 2023 11:22:13 +1000 Subject: [PATCH 68/80] MDEV-30370 [fixup] Spider: mdev_30370.test needs wsrep to run. --- storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test index 788ea2323f7..955e77b4175 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test @@ -1,3 +1,4 @@ +--source include/have_wsrep.inc --echo # --echo # MDEV-30370 mariadbd hangs when running with --wsrep-recover and --plugin-load-add=ha_spider.so --echo # From 67657a01bff98ac19c4188f13b52509a255a0daf Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 28 Jun 2023 16:47:27 +0400 Subject: [PATCH 69/80] MDEV-30932 UBSAN: negation of -X cannot be represented in type .. 'long long int'; cast to an unsigned type to negate this value .. to itself in Item_func_mul::int_op and Item_func_round::int_op Problems: The code in multiple places in the following methods: - Item_func_mul::int_op() - longlong Item_func_int_div::val_int() - Item_func_mod::int_op() - Item_func_round::int_op() did not properly check for corner values LONGLONG_MIN and (LONGLONG_MAX+1) before doing negation. This cuased UBSAN to complain about undefined behaviour. Fix summary: - Adding helper classes ULonglong, ULonglong_null, ULonglong_hybrid (in addition to their signed couterparts in sql/sql_type_int.h). - Moving the code performing multiplication of ulonglong numbers from Item_func_mul::int_op() to ULonglong_hybrid::ullmul(). - Moving the code responsible for extracting absolute values from negative numbers to Longlong::abs(). It makes sure to perform negation without undefinite behavior: LONGLONG_MIN is handled in a special way. - Moving negation related code to ULonglong::operator-(). It makes sure to perform negation without undefinite behavior: (LONGLONG_MAX + 1) is handled in a special way. - Moving signed<=>unsigned conversion code to Longlong_hybrid::val_int() and ULonglong_hybrid::val_int(). - Reusing old and new sql_type_int.h classes in multiple places in Item_func_xxx::int_op(). Fix details (explain how sql_type_int.h classes are reused): - Instead of straight negation of negative "longlong" arguments *before* performing unsigned multiplication, Item_func_mul::int_op() now calls ULonglong_null::ullmul() using Longlong_hybrid_null::abs() to pass arguments. This fixes undefined behavior N1. - Instead of straight negation of "ulonglong" result *after* performing unsigned multiplication, Item_func_mul::int_op() now calls ULonglong_hybrid::val_int(), which recursively calls ULonglong::operator-(). This fixes undefined behavior N2. - Removing duplicate negating code from Item_func_mod::int_op(). Using ULonglong_hybrid::val_int() instead. This fixes undefinite behavior N3. - Removing literal "longlong" negation from Item_func_round::int_op(). Using Longlong::abs() instead, which correctly handler LONGLONG_MIN. This fixes undefinite behavior N4. - Removing the duplicate (negation related) code from Item_func_int_div::val_int(). Reusing class ULonglong_hybrid. There were no undefinite behavior in here. However, this change allowed to reveal a bug in "-9223372036854775808 DIV 1". The removed negation code appeared to be incorrect when negating +9223372036854775808. It returned the "out of range" error. ULonglong_hybrid::operator-() now handles all values correctly and returns +9223372036854775808 as a negation for -9223372036854775808. Re-recording wrong results for SELECT -9223372036854775808 DIV 1; Now instead of "out of range", it returns -9223372036854775808, which is the smallest possible value for the expression data type (signed) BIGINT. - Removing "no UBSAN" branch from Item_func_splus::int_opt() and Item_func_minus::int_opt(), as it made UBSAN happy but in RelWithDebInfo some MTR tests started to fail. --- mysql-test/main/func_math.result | 29 +++++- mysql-test/main/func_math.test | 27 ++++- sql/item_func.cc | 102 +++---------------- sql/item_func.h | 21 +++- sql/sql_type_int.h | 163 ++++++++++++++++++++++++++++++- 5 files changed, 245 insertions(+), 97 deletions(-) diff --git a/mysql-test/main/func_math.result b/mysql-test/main/func_math.result index 47de1170691..c3d7ee20f50 100644 --- a/mysql-test/main/func_math.result +++ b/mysql-test/main/func_math.result @@ -972,7 +972,8 @@ SELECT 9223372036854775808 DIV 1; SELECT 9223372036854775808 DIV -1; ERROR 22003: BIGINT UNSIGNED value is out of range in '9223372036854775808 DIV -1' SELECT -9223372036854775808 DIV 1; -ERROR 22003: BIGINT value is out of range in '-9223372036854775808 DIV 1' +-9223372036854775808 DIV 1 +-9223372036854775808 SELECT -9223372036854775808 DIV -1; ERROR 22003: BIGINT value is out of range in '-9223372036854775808 DIV -1' SELECT 9223372036854775808 MOD 1; @@ -3546,5 +3547,31 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci DROP TABLE t1,t2; # +# MDEV-30932 UBSAN: negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in Item_func_mul::int_op and Item_func_round::int_op +# +SELECT (1 DIV(-1/POW(807,14))*1); +ERROR 22003: BIGINT value is out of range in '1 DIV (-1 / pow(807,14))' +DO((-9223372036854775808)*(1)); +SELECT (-9223372036854775808)*(1); +(-9223372036854775808)*(1) +-9223372036854775808 +SELECT (GET_FORMAT(TIME,'JIS'))DIV(POW(-40,65)DIV(1)*2); +ERROR 22003: BIGINT value is out of range in 'pow(-40,65) DIV 1' +SELECT -9223372036854775808 MOD 9223372036854775810; +-9223372036854775808 MOD 9223372036854775810 +-9223372036854775808 +CREATE TABLE t1 (c INT); +INSERT INTO t1 VALUES(TRUNCATE(0,-1.e+30)); +DROP TABLE t1; +SELECT TRUNCATE(0, -9223372036854775808); +TRUNCATE(0, -9223372036854775808) +0 +SELECT GET_FORMAT(TIME,'JIS') DIV ATAN (TRUNCATE (0,'2000000000000000' DIV SIN(1500)*NOW(5))); +GET_FORMAT(TIME,'JIS') DIV ATAN (TRUNCATE (0,'2000000000000000' DIV SIN(1500)*NOW(5))) +NULL +SELECT (GET_FORMAT(TIME,'JIS') DIV ATAN (TRUNCATE (0,'2000000000000000' DIV SIN(1500)*NOW(5))/ROUND(-1)))DIV(-1-LOG2(1))-(-1*POWER(-1,0)); +(GET_FORMAT(TIME,'JIS') DIV ATAN (TRUNCATE (0,'2000000000000000' DIV SIN(1500)*NOW(5))/ROUND(-1)))DIV(-1-LOG2(1))-(-1*POWER(-1,0)) +NULL +# # End of 10.4 tests # diff --git a/mysql-test/main/func_math.test b/mysql-test/main/func_math.test index 51452d3e6af..4007f81fbee 100644 --- a/mysql-test/main/func_math.test +++ b/mysql-test/main/func_math.test @@ -710,7 +710,6 @@ DROP TABLE t1; SELECT 9223372036854775808 DIV 1; --error ER_DATA_OUT_OF_RANGE SELECT 9223372036854775808 DIV -1; ---error ER_DATA_OUT_OF_RANGE SELECT -9223372036854775808 DIV 1; --error ER_DATA_OUT_OF_RANGE SELECT -9223372036854775808 DIV -1; @@ -1867,6 +1866,32 @@ SELECT * FROM t2; SHOW CREATE TABLE t2; DROP TABLE t1,t2; +--echo # +--echo # MDEV-30932 UBSAN: negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in Item_func_mul::int_op and Item_func_round::int_op +--echo # + +--error ER_DATA_OUT_OF_RANGE +SELECT (1 DIV(-1/POW(807,14))*1); + +DO((-9223372036854775808)*(1)); + +SELECT (-9223372036854775808)*(1); + +--error ER_DATA_OUT_OF_RANGE +SELECT (GET_FORMAT(TIME,'JIS'))DIV(POW(-40,65)DIV(1)*2); + +SELECT -9223372036854775808 MOD 9223372036854775810; + +CREATE TABLE t1 (c INT); +INSERT INTO t1 VALUES(TRUNCATE(0,-1.e+30)); +DROP TABLE t1; +SELECT TRUNCATE(0, -9223372036854775808); + +--disable_warnings +SELECT GET_FORMAT(TIME,'JIS') DIV ATAN (TRUNCATE (0,'2000000000000000' DIV SIN(1500)*NOW(5))); +SELECT (GET_FORMAT(TIME,'JIS') DIV ATAN (TRUNCATE (0,'2000000000000000' DIV SIN(1500)*NOW(5))/ROUND(-1)))DIV(-1-LOG2(1))-(-1*POWER(-1,0)); +--enable_warnings + --echo # --echo # End of 10.4 tests --echo # diff --git a/sql/item_func.cc b/sql/item_func.cc index e0d30b94067..4575990a7a2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -78,7 +78,7 @@ bool check_reserved_words(const LEX_CSTRING *name) */ static inline bool test_if_sum_overflows_ull(ulonglong arg1, ulonglong arg2) { - return ULONGLONG_MAX - arg1 < arg2; + return ULonglong::test_if_sum_overflows_ull(arg1, arg2); } @@ -1157,14 +1157,10 @@ longlong Item_func_plus::int_op() } } -#ifndef WITH_UBSAN - res= val0 + val1; -#else if (res_unsigned) res= (longlong) ((ulonglong) val0 + (ulonglong) val1); else res= val0+val1; -#endif /* WITH_UBSAN */ return check_integer_overflow(res, res_unsigned); @@ -1325,14 +1321,10 @@ longlong Item_func_minus::int_op() goto err; } } -#ifndef WITH_UBSAN - res= val0 - val1; -#else if (res_unsigned) res= (longlong) ((ulonglong) val0 - (ulonglong) val1); else res= val0 - val1; -#endif /* WITH_UBSAN */ return check_integer_overflow(res, res_unsigned); @@ -1375,79 +1367,23 @@ double Item_func_mul::real_op() longlong Item_func_mul::int_op() { DBUG_ASSERT(fixed == 1); - longlong a= args[0]->val_int(); - longlong b= args[1]->val_int(); - longlong res; - ulonglong res0, res1; - ulong a0, a1, b0, b1; - bool res_unsigned= FALSE; - bool a_negative= FALSE, b_negative= FALSE; - - if ((null_value= args[0]->null_value || args[1]->null_value)) - return 0; - /* - First check whether the result can be represented as a - (bool unsigned_flag, longlong value) pair, then check if it is compatible - with this Item's unsigned_flag by calling check_integer_overflow(). - - Let a = a1 * 2^32 + a0 and b = b1 * 2^32 + b0. Then - a * b = (a1 * 2^32 + a0) * (b1 * 2^32 + b0) = a1 * b1 * 2^64 + - + (a1 * b0 + a0 * b1) * 2^32 + a0 * b0; - We can determine if the above sum overflows the ulonglong range by - sequentially checking the following conditions: - 1. If both a1 and b1 are non-zero. - 2. Otherwise, if (a1 * b0 + a0 * b1) is greater than ULONG_MAX. - 3. Otherwise, if (a1 * b0 + a0 * b1) * 2^32 + a0 * b0 is greater than - ULONGLONG_MAX. - Since we also have to take the unsigned_flag for a and b into account, it is easier to first work with absolute values and set the correct sign later. */ - if (!args[0]->unsigned_flag && a < 0) - { - a_negative= TRUE; - a= -a; - } - if (!args[1]->unsigned_flag && b < 0) - { - b_negative= TRUE; - b= -b; - } + Longlong_hybrid_null ha= args[0]->to_longlong_hybrid_null(); + Longlong_hybrid_null hb= args[1]->to_longlong_hybrid_null(); - a0= 0xFFFFFFFFUL & a; - a1= ((ulonglong) a) >> 32; - b0= 0xFFFFFFFFUL & b; - b1= ((ulonglong) b) >> 32; + if ((null_value= ha.is_null() || hb.is_null())) + return 0; - if (a1 && b1) - goto err; + ULonglong_null ures= ULonglong_null::ullmul(ha.abs(), hb.abs()); + if (ures.is_null()) + return raise_integer_overflow(); - res1= (ulonglong) a1 * b0 + (ulonglong) a0 * b1; - if (res1 > 0xFFFFFFFFUL) - goto err; - - res1= res1 << 32; - res0= (ulonglong) a0 * b0; - - if (test_if_sum_overflows_ull(res1, res0)) - goto err; - res= res1 + res0; - - if (a_negative != b_negative) - { - if ((ulonglong) res > (ulonglong) LONGLONG_MIN + 1) - goto err; - res= -res; - } - else - res_unsigned= TRUE; - - return check_integer_overflow(res, res_unsigned); - -err: - return raise_integer_overflow(); + return check_integer_overflow(ULonglong_hybrid(ures.value(), + ha.neg() != hb.neg())); } @@ -1645,15 +1581,8 @@ longlong Item_func_int_div::val_int() return 0; } - bool res_negative= val0.neg() != val1.neg(); - ulonglong res= val0.abs() / val1.abs(); - if (res_negative) - { - if (res > (ulonglong) LONGLONG_MAX) - return raise_integer_overflow(); - res= (ulonglong) (-(longlong) res); - } - return check_integer_overflow(res, !res_negative); + return check_integer_overflow(ULonglong_hybrid(val0.abs() / val1.abs(), + val0.neg() != val1.neg())); } @@ -1687,9 +1616,8 @@ longlong Item_func_mod::int_op() LONGLONG_MIN by -1 generates SIGFPE, we calculate using unsigned values and then adjust the sign appropriately. */ - ulonglong res= val0.abs() % val1.abs(); - return check_integer_overflow(val0.neg() ? -(longlong) res : res, - !val0.neg()); + return check_integer_overflow(ULonglong_hybrid(val0.abs() % val1.abs(), + val0.neg())); } double Item_func_mod::real_op() @@ -2669,7 +2597,7 @@ longlong Item_func_round::int_op() if ((dec >= 0) || args[1]->unsigned_flag) return value; // integer have not digits after point - abs_dec= -dec; + abs_dec= Longlong(dec).abs(); // Avoid undefined behavior longlong tmp; if(abs_dec >= array_elements(log_10_int)) diff --git a/sql/item_func.h b/sql/item_func.h index 3afe0d00661..7828078ac7b 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -252,12 +252,23 @@ public: */ inline longlong check_integer_overflow(longlong value, bool val_unsigned) { - if ((unsigned_flag && !val_unsigned && value < 0) || - (!unsigned_flag && val_unsigned && - (ulonglong) value > (ulonglong) LONGLONG_MAX)) - return raise_integer_overflow(); - return value; + return check_integer_overflow(Longlong_hybrid(value, val_unsigned)); } + + // Check if the value is compatible with Item::unsigned_flag. + inline longlong check_integer_overflow(const Longlong_hybrid &sval) + { + Longlong_null res= sval.val_int(unsigned_flag); + return res.is_null() ? raise_integer_overflow() : res.value(); + } + + // Check if the value is compatible with Item::unsigned_flag. + longlong check_integer_overflow(const ULonglong_hybrid &uval) + { + Longlong_null res= uval.val_int(unsigned_flag); + return res.is_null() ? raise_integer_overflow() : res.value(); + } + /** Throw an error if the error code of a DECIMAL operation is E_DEC_OVERFLOW. */ diff --git a/sql/sql_type_int.h b/sql/sql_type_int.h index d3e9d0318cf..7bb9200c4e1 100644 --- a/sql/sql_type_int.h +++ b/sql/sql_type_int.h @@ -34,6 +34,12 @@ protected: public: longlong value() const { return m_value; } Longlong(longlong nr) :m_value(nr) { } + ulonglong abs() + { + if (m_value == LONGLONG_MIN) // avoid undefined behavior + return ((ulonglong) LONGLONG_MAX) + 1; + return m_value < 0 ? -m_value : m_value; + } }; @@ -46,6 +52,86 @@ public: }; +class ULonglong +{ +protected: + ulonglong m_value; +public: + ulonglong value() const { return m_value; } + explicit ULonglong(ulonglong nr) :m_value(nr) { } + + static bool test_if_sum_overflows_ull(ulonglong arg1, ulonglong arg2) + { + return ULONGLONG_MAX - arg1 < arg2; + } + + Longlong_null operator-() const + { + if (m_value > (ulonglong) LONGLONG_MAX) // Avoid undefined behaviour + { + return m_value == (ulonglong) LONGLONG_MAX + 1 ? + Longlong_null(LONGLONG_MIN, false) : + Longlong_null(0, true); + } + return Longlong_null(-(longlong) m_value, false); + } + + // Convert to Longlong_null with the range check + Longlong_null to_longlong_null() const + { + if (m_value > (ulonglong) LONGLONG_MAX) + return Longlong_null(0, true); + return Longlong_null((longlong) m_value, false); + } + +}; + + +class ULonglong_null: public ULonglong, public Null_flag +{ +public: + ULonglong_null(ulonglong nr, bool is_null) + :ULonglong(nr), Null_flag(is_null) + { } + + /* + Multiply two ulonglong values. + + Let a = a1 * 2^32 + a0 and b = b1 * 2^32 + b0. Then + a * b = (a1 * 2^32 + a0) * (b1 * 2^32 + b0) = a1 * b1 * 2^64 + + + (a1 * b0 + a0 * b1) * 2^32 + a0 * b0; + We can determine if the above sum overflows the ulonglong range by + sequentially checking the following conditions: + 1. If both a1 and b1 are non-zero. + 2. Otherwise, if (a1 * b0 + a0 * b1) is greater than ULONG_MAX. + 3. Otherwise, if (a1 * b0 + a0 * b1) * 2^32 + a0 * b0 is greater than + ULONGLONG_MAX. + */ + static ULonglong_null ullmul(ulonglong a, ulonglong b) + { + ulong a1= a >> 32; + ulong b1= b >> 32; + + if (a1 && b1) + return ULonglong_null(0, true); + + ulong a0= 0xFFFFFFFFUL & a; + ulong b0= 0xFFFFFFFFUL & b; + + ulonglong res1= (ulonglong) a1 * b0 + (ulonglong) a0 * b1; + if (res1 > 0xFFFFFFFFUL) + return ULonglong_null(0, true); + + res1= res1 << 32; + ulonglong res0= (ulonglong) a0 * b0; + + if (test_if_sum_overflows_ull(res1, res0)) + return ULonglong_null(0, true); + return ULonglong_null(res1 + res0, false); + } +}; + + // A longlong/ulonglong hybrid. Good to store results of val_int(). class Longlong_hybrid: public Longlong { @@ -74,9 +160,7 @@ public: { if (m_unsigned) return (ulonglong) m_value; - if (m_value == LONGLONG_MIN) // avoid undefined behavior - return ((ulonglong) LONGLONG_MAX) + 1; - return m_value < 0 ? -m_value : m_value; + return Longlong(m_value).abs(); } /* Convert to an unsigned number: @@ -94,6 +178,33 @@ public: { return (uint) to_ulonglong(upper_bound); } + + + Longlong_null val_int_signed() const + { + if (m_unsigned) + return ULonglong((ulonglong) m_value).to_longlong_null(); + return Longlong_null(m_value, false); + } + + Longlong_null val_int_unsigned() const + { + if (!m_unsigned && m_value < 0) + return Longlong_null(0, true); + return Longlong_null(m_value, false); + } + + /* + Return in Item compatible val_int() format: + - signed numbers as a straight longlong value + - unsigned numbers as a ulonglong value reinterpreted to longlong + */ + Longlong_null val_int(bool want_unsigned_value) const + { + return want_unsigned_value ? val_int_unsigned() : + val_int_signed(); + } + int cmp(const Longlong_hybrid& other) const { if (m_unsigned == other.m_unsigned) @@ -143,4 +254,50 @@ public: }; +/* + Stores the absolute value of a number, and the sign. + Value range: -ULONGLONG_MAX .. +ULONGLONG_MAX. + + Provides a wider range for negative numbers than Longlong_hybrid does. + Usefull to store intermediate results of an expression whose value + is further needed to be negated. For example, these methods: + - Item_func_mul::int_op() + - Item_func_int_div::val_int() + - Item_func_mod::int_op() + calculate the result of absolute values of the arguments, + then optionally negate the result. +*/ +class ULonglong_hybrid: public ULonglong +{ + bool m_neg; +public: + ULonglong_hybrid(ulonglong value, bool neg) + :ULonglong(value), m_neg(neg) + { + if (m_neg && !m_value) + m_neg= false; // convert -0 to +0 + } + Longlong_null val_int_unsigned() const + { + return m_neg ? Longlong_null(0, true) : + Longlong_null((longlong) m_value, false); + } + Longlong_null val_int_signed() const + { + return m_neg ? -ULonglong(m_value) : ULonglong::to_longlong_null(); + } + + /* + Return in Item compatible val_int() format: + - signed numbers as a straight longlong value + - unsigned numbers as a ulonglong value reinterpreted to longlong + */ + Longlong_null val_int(bool want_unsigned_value) const + { + return want_unsigned_value ? val_int_unsigned() : + val_int_signed(); + } +}; + + #endif // SQL_TYPE_INT_INCLUDED From e146940ab3532ae324ff5c596a1222f7cdb1e3f7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 30 Jun 2023 01:28:29 +0200 Subject: [PATCH 70/80] MDEV-31480 RPM packages fail to install because they require /bin/sh for %pretrans workaround cmake bug #25044 https://gitlab.kitware.com/cmake/cmake/-/issues/25044 --- cmake/cpack_rpm.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 713141e2349..642b699c6a5 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -106,6 +106,8 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE " %define restart_flag_dir %{_localstatedir}/lib/rpm-state/mariadb %define restart_flag %{restart_flag_dir}/need-restart +%define pretrans %{nil} + %{?filter_setup: %filter_provides_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$ %filter_requires_in \\\\.\\\\(test\\\\|result\\\\|h\\\\|cc\\\\|c\\\\|inc\\\\|opt\\\\|ic\\\\|cnf\\\\|rdiff\\\\|cpp\\\\)$ From 77a229cd2d6bfa288d0da96cbd6c2856c279489c Mon Sep 17 00:00:00 2001 From: Anel Husakovic Date: Tue, 30 May 2023 16:08:41 +0200 Subject: [PATCH 71/80] MDEV-31358: Update description for MariaDB debian/rpm packages Reviewer: --- cmake/cpack_rpm.cmake | 2 +- debian/control | 65 ++++++++++--------- plugin/cracklib_password_check/CMakeLists.txt | 4 +- storage/cassandra/CMakeLists.txt | 10 +-- storage/connect/CMakeLists.txt | 2 +- storage/oqgraph/CMakeLists.txt | 2 +- storage/rocksdb/CMakeLists.txt | 2 +- storage/tokudb/CMakeLists.txt | 2 +- 8 files changed, 47 insertions(+), 42 deletions(-) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 642b699c6a5..87a84a1361b 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -71,7 +71,7 @@ It was originally forked from Percona XtraBackup 2.3.8.") # Packages with default description SET(CPACK_RPM_client_PACKAGE_SUMMARY "MariaDB database client binaries") SET(CPACK_RPM_client_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}") -SET(CPACK_RPM_common_PACKAGE_SUMMARY "MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)") +SET(CPACK_RPM_common_PACKAGE_SUMMARY "MariaDB database common configuration files (e.g. /etc/mysql/conf.d/mariadb.cnf)") SET(CPACK_RPM_common_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}") SET(CPACK_RPM_compat_PACKAGE_SUMMARY "MariaDB database client library MySQL compat package") SET(CPACK_RPM_compat_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_DESCRIPTION}") diff --git a/debian/control b/debian/control index c14a6f7dd93..f927ba0c5ea 100644 --- a/debian/control +++ b/debian/control @@ -103,9 +103,9 @@ Description: MariaDB database development files language in the world. The main goals of MariaDB are speed, robustness and ease of use. . - This package includes development libraries and header files. To allow sources + This package includes development libraries and header files to allow sources expecting the MariaDB Connector/C to build. Sources that expect the MySQL - Client libraries should use files from the libmariadb-dev-compat package. + client libraries should use files from the libmariadb-dev-compat package. Package: libmariadb-dev-compat Architecture: any @@ -198,19 +198,19 @@ Depends: libmariadb-dev (= ${binary:Version}), Breaks: libmysqld-dev, libmariadbd-dev (<= 10.2) Replaces: libmysqld-dev -Description: MariaDB embedded database, development files +Description: MariaDB embedded database, development files package MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and ease of use. . - This package includes the embedded server library development and header files. + This package includes the MariaDB embedded server library development and header files. Package: mysql-common Architecture: all Depends: ${misc:Depends}, ${shlibs:Depends} -Description: MariaDB database common files (e.g. /etc/mysql/my.cnf) +Description: MariaDB client common configuration files package (e.g. /etc/mysql/my.cnf) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and @@ -224,7 +224,7 @@ Architecture: all Depends: mysql-common, ${misc:Depends}, ${shlibs:Depends} -Description: MariaDB database common files (e.g. /etc/mysql/mariadb.conf.d/) +Description: MariaDB client common configuration files package (e.g. /etc/mysql/mariadb.conf.d/) MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and @@ -507,7 +507,7 @@ Package: mariadb-server Architecture: all Depends: mariadb-server-10.4 (>= ${source:Version}), ${misc:Depends} -Description: MariaDB database server (metapackage depending on the latest version) +Description: MariaDB database server binaries (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of mariadb-server (currently mariadb-server-10.4), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB @@ -523,11 +523,16 @@ Package: mariadb-client Architecture: all Depends: mariadb-client-10.4 (>= ${source:Version}), ${misc:Depends} -Description: MariaDB database client (metapackage depending on the latest version) +Description: MariaDB database client binaries (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of mariadb-client (currently mariadb-client-10.4), as determined by the MariaDB maintainers. Install this package if in doubt about which MariaDB version you want, as this is the one considered to be in the best shape. + . + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. Package: mariadb-backup Architecture: any @@ -539,8 +544,8 @@ Depends: mariadb-client-core-10.4 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Description: Backup tool for MariaDB server - This backup tool is guaranteed to be compatible with MariaDB. - Based on Xtrabackup, but improved to work with MariaDB. + Based on Xtrabackup, but improved to work with MariaDB server. + This backup tool is guaranteed to be compatible with MariaDB server. . Plese refer to the MariaDB Knowledge Base on more information on how to use this tool. @@ -559,11 +564,11 @@ Breaks: mariadb-connect-engine-10.1, Replaces: mariadb-connect-engine-10.1, mariadb-connect-engine-10.2, mariadb-connect-engine-10.3 -Description: Connect storage engine for MariaDB +Description: Connect storage engine for MariaDB server Connect engine supports a number of file formats (dbf, xml, txt, bin, etc), connections to ODBC tables and remote MySQL tables, as well as a number of other interesting features. - This package contains the Connect plugin for MariaDB. + This package contains the Connect plugin for MariaDB server. Package: mariadb-plugin-rocksdb Architecture: amd64 arm64 mips64el ppc64el @@ -575,10 +580,10 @@ Breaks: mariadb-rocksdb-engine-10.2, Replaces: mariadb-rocksdb-engine-10.2, mariadb-rocksdb-engine-10.3 Recommends: python-mysqldb -Description: RocksDB storage engine for MariaDB +Description: RocksDB storage engine for MariaDB server The RocksDB storage engine is a high performance storage engine, aimed at maximising storage efficiency while maintaining InnoDB-like performance. - This package contains the RocksDB plugin for MariaDB. + This package contains the RocksDB plugin for MariaDB server. Package: mariadb-plugin-oqgraph Architecture: any @@ -592,10 +597,10 @@ Breaks: mariadb-oqgraph-engine-10.1, Replaces: mariadb-oqgraph-engine-10.1, mariadb-oqgraph-engine-10.2, mariadb-oqgraph-engine-10.3 -Description: OQGraph storage engine for MariaDB +Description: OQGraph storage engine for MariaDB server The OQGraph engine is a computation engine plugin for handling hierarchies (trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL. - This package contains the OQGraph plugin for MariaDB. + This package contains the OQGraph plugin for MariaDB server. Package: mariadb-plugin-tokudb Architecture: amd64 @@ -611,11 +616,11 @@ Replaces: mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3 -Description: TokuDB storage engine for MariaDB +Description: TokuDB storage engine for MariaDB server The TokuDB storage engine is for use in high-performance and write-intensive environments, offering increased compression and better performance based on fractal indexes. - This package contains the TokuDB plugin for MariaDB. + This package contains the TokuDB plugin for MariaDB server. Package: mariadb-plugin-mroonga Architecture: any-alpha any-amd64 any-arm any-arm64 any-i386 any-ia64 any-mips64el any-mips64r6el any-mipsel any-mipsr6el any-nios2 any-powerpcel any-ppc64el any-sh3 any-sh4 any-tilegx @@ -630,10 +635,10 @@ Replaces: mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3 -Description: Mroonga storage engine for MariaDB +Description: Mroonga storage engine for MariaDB server Mroonga (formerly named Groonga Storage Engine) is a storage engine that provides fast CJK-ready full text searching using column store. - This package contains the Mroonga plugin for MariaDB. + This package contains the Mroonga plugin for MariaDB server. Package: mariadb-plugin-spider Architecture: any @@ -648,9 +653,9 @@ Replaces: mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3 -Description: Spider storage engine for MariaDB +Description: Spider storage engine for MariaDB server The Spider storage engine with built-in sharding features. It supports - partitioning and xa transactions, and allows tables of different MariaDB + partitioning and xa transactions, and allows tables of different MariaDB server instances to be handled as if they were on the same insctance. It refers to one possible implementation of ISO/IEC 9075-9:2008 SQL/MED. @@ -667,12 +672,12 @@ Replaces: mariadb-server-10.0, mariadb-server-10.1, mariadb-server-10.2, mariadb-server-10.3 -Description: Cassandra storage engine for MariaDB - The Cassandra Storage Engine allows access to data in a Cassandra cluster from - MariaDB, combining the best of SQL and no-SQL worlds. Cassandra SE (storage - engine) makes Cassandra's column family appear as a table in MariaDB that you +Description: Cassandra storage engine for MariaDB server + The Cassandra storage engine allows access to data in a Cassandra cluster from + MariaDB server, combining the best of SQL and no-SQL worlds. Cassandra SE (storage + engine) makes Cassandra's column family appear as a table in MariaDB server that you can insert to, update, and select from. You can write joins against this table, - it is possible to join data that's stored in MariaDB with data that's stored in + it is possible to join data that's stored in MariaDB server with data that's stored in Cassandra. Package: mariadb-plugin-gssapi-server @@ -717,11 +722,11 @@ Depends: libcrack2 (>= 2.9.0), mariadb-server-10.4 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} -Description: CrackLib Password Validation Plugin for MariaDB +Description: CrackLib Password Validation Plugin for MariaDB server This password validation plugin uses cracklib to allow only - sufficiently secure (as defined by cracklib) user passwords in MariaDB. + sufficiently secure (as defined by cracklib) user passwords in MariaDB server. . - Install and configure this to enforce stronger passwords for MariaDB users. + Install and configure this to enforce stronger passwords for MariaDB server users. Package: mariadb-test Architecture: any diff --git a/plugin/cracklib_password_check/CMakeLists.txt b/plugin/cracklib_password_check/CMakeLists.txt index 620234ccd3f..5d5466fb84e 100644 --- a/plugin/cracklib_password_check/CMakeLists.txt +++ b/plugin/cracklib_password_check/CMakeLists.txt @@ -1,9 +1,9 @@ INCLUDE (CheckIncludeFiles) INCLUDE (CheckLibraryExists) -SET(CPACK_RPM_cracklib-password-check_PACKAGE_SUMMARY "CrackLib Password Validation Plugin for MariaDB" PARENT_SCOPE) +SET(CPACK_RPM_cracklib-password-check_PACKAGE_SUMMARY "CrackLib Password Validation Plugin for MariaDB server" PARENT_SCOPE) SET(CPACK_RPM_cracklib-password-check_PACKAGE_DESCRIPTION "This password validation plugin uses cracklib to allow only -sufficiently secure (as defined by cracklib) user passwords in MariaDB." PARENT_SCOPE) +sufficiently secure (as defined by cracklib) user passwords in MariaDB server." PARENT_SCOPE) CHECK_LIBRARY_EXISTS(crack FascistCheckUser "" HAVE_LIBCRACK) diff --git a/storage/cassandra/CMakeLists.txt b/storage/cassandra/CMakeLists.txt index fe32f69c10b..1e696bcb1e9 100644 --- a/storage/cassandra/CMakeLists.txt +++ b/storage/cassandra/CMakeLists.txt @@ -1,10 +1,10 @@ -SET(CPACK_RPM_cassandra-engine_PACKAGE_SUMMARY "Cassandra storage engine for MariaDB" PARENT_SCOPE) -SET(CPACK_RPM_cassandra-engine_PACKAGE_DESCRIPTION "The Cassandra Storage Engine allows access to data in a Cassandra cluster from -MariaDB, combining the best of SQL and no-SQL worlds. Cassandra SE (storage -engine) makes Cassandra's column family appear as a table in MariaDB that you +SET(CPACK_RPM_cassandra-engine_PACKAGE_SUMMARY "Cassandra storage engine for MariaDB server" PARENT_SCOPE) +SET(CPACK_RPM_cassandra-engine_PACKAGE_DESCRIPTION "The Cassandra storage engine allows access to data in a Cassandra cluster from +MariaDB server, combining the best of SQL and no-SQL worlds. Cassandra SE (storage +engine) makes Cassandra's column family appear as a table in MariaDB server that you can insert to, update, and select from. You can write joins against this table, -it is possible to join data that's stored in MariaDB with data that's stored in +it is possible to join data that's stored in MariaDB server with data that's stored in Cassandra." PARENT_SCOPE) # use the first path that has Thrift.h included, if found diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 20cd4ad3ee1..1bef8f122f0 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -17,7 +17,7 @@ IF(WITHOUT_DYNAMIC_PLUGINS OR WITH_NONE OR ("${PLUGIN_CONNECT}" STREQUAL "NO")) RETURN() ENDIF() -SET(CPACK_RPM_connect-engine_PACKAGE_SUMMARY "Connect storage engine for MariaDB" PARENT_SCOPE) +SET(CPACK_RPM_connect-engine_PACKAGE_SUMMARY "Connect storage engine for MariaDB server" PARENT_SCOPE) SET(CPACK_RPM_connect-engine_PACKAGE_DESCRIPTION "Connect engine supports a number of file formats (dbf, xml, txt, bin, etc), connections to ODBC tables and remote MySQL tables, as well as a number of other interesting features." PARENT_SCOPE) diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index e725f9712ea..2cb02727a64 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -SET(CPACK_RPM_oqgraph-engine_PACKAGE_SUMMARY "OQGraph storage engine for MariaDB" PARENT_SCOPE) +SET(CPACK_RPM_oqgraph-engine_PACKAGE_SUMMARY "OQGraph storage engine for MariaDB server" PARENT_SCOPE) SET(CPACK_RPM_oqgraph-engine_PACKAGE_DESCRIPTION "The Open Query GRAPH computation engine, or OQGRAPH as the engine itself is called, allows you to handle hierarchies (tree structures) and complex graphs (nodes having many connections in several directions). diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt index 71259703e5a..cf8a821a3e4 100644 --- a/storage/rocksdb/CMakeLists.txt +++ b/storage/rocksdb/CMakeLists.txt @@ -1,6 +1,6 @@ # TODO: Copyrights -SET(CPACK_RPM_rocksdb-engine_PACKAGE_SUMMARY "RocksDB storage engine for MariaDB" PARENT_SCOPE) +SET(CPACK_RPM_rocksdb-engine_PACKAGE_SUMMARY "RocksDB storage engine for MariaDB server" PARENT_SCOPE) SET(CPACK_RPM_rocksdb-engine_PACKAGE_DESCRIPTION "The RocksDB storage engine is a high performance storage engine, aimed at maximising storage efficiency while maintaining InnoDB-like performance." PARENT_SCOPE) diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 65110f7d8bd..78e7fd88d7f 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -1,4 +1,4 @@ -SET(CPACK_RPM_tokudb-engine_PACKAGE_SUMMARY "TokuDB storage engine for MariaDB" PARENT_SCOPE) +SET(CPACK_RPM_tokudb-engine_PACKAGE_SUMMARY "TokuDB storage engine for MariaDB server" PARENT_SCOPE) SET(CPACK_RPM_tokudb-engine_PACKAGE_DESCRIPTION "The TokuDB storage engine is for use in high-performance and write-intensive environments, offering increased compression and better performance based on fractal indexes." PARENT_SCOPE) From 0105220e3bb939846459c068dc49e6fd89ee3279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 3 Jul 2023 16:06:10 +0300 Subject: [PATCH 72/80] Remove tests that duplicate innodb.max_record_size --- .../innodb/r/innodb_max_recordsize_32k.result | 338 ------------ .../innodb/r/innodb_max_recordsize_64k.result | 520 ------------------ .../innodb/t/innodb_max_recordsize_32k.opt | 4 - .../innodb/t/innodb_max_recordsize_32k.test | 327 ----------- .../innodb/t/innodb_max_recordsize_64k.opt | 4 - .../innodb/t/innodb_max_recordsize_64k.test | 508 ----------------- 6 files changed, 1701 deletions(-) delete mode 100644 mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result delete mode 100644 mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result delete mode 100644 mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt delete mode 100644 mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test delete mode 100644 mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt delete mode 100644 mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result deleted file mode 100644 index fc41d0b1471..00000000000 --- a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result +++ /dev/null @@ -1,338 +0,0 @@ -SELECT @@innodb_page_size; -@@innodb_page_size -32768 -SET innodb_strict_mode=ON; -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=FIXED; -ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -show warnings; -Level Code Message -Warning 1478 InnoDB: invalid ROW_FORMAT specifier. -Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; -ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -show warnings; -Level Code Message -Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. -Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB -SET @@innodb_strict_mode=OFF; -SELECT @@innodb_strict_mode; -@@innodb_strict_mode -0 -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPACT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL); -ERROR 42000: Row size too large (> 16318). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPACT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL); -ERROR 42000: Row size too large (> 16318). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL); -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL -DROP TABLE tab5; -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=DYNAMIC; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=DYNAMIC; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL); -ERROR 42000: Row size too large (> 16318). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL); -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL -DROP TABLE tab5; -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=REDUNDANT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255)); -ERROR 42000: Row size too large (> 16315). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=REDUNDANT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',89),NULL); -ERROR 42000: Row size too large (> 16315). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',88),NULL); -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; -Warnings: -Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=DYNAMIC. -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -DROP TABLE tab5; -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -SHOW WARNINGS; -Level Code Message -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -LENGTH(col) -16384 -32768 -65535 -FLUSH TABLE t; -ANALYZE TABLE t; -Table Op Msg_type Msg_text -test.t analyze status Engine-independent statistics collected -test.t analyze Warning Engine-independent statistics are not collected for column 'col' -test.t analyze status OK -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -clust_index_size -7 -DROP TABLE t; -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -SHOW WARNINGS; -Level Code Message -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -LENGTH(col) -16384 -32768 -65535 -FLUSH TABLE t; -ANALYZE TABLE t; -Table Op Msg_type Msg_text -test.t analyze status Engine-independent statistics collected -test.t analyze Warning Engine-independent statistics are not collected for column 'col' -test.t analyze status OK -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -clust_index_size -5 -DROP TABLE t; -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT; -SHOW WARNINGS; -Level Code Message -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -LENGTH(col) -16384 -32768 -65535 -FLUSH TABLE t; -ANALYZE TABLE t; -Table Op Msg_type Msg_text -test.t analyze status Engine-independent statistics collected -test.t analyze Warning Engine-independent statistics are not collected for column 'col' -test.t analyze status OK -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -clust_index_size -5 -DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result deleted file mode 100644 index a9683016925..00000000000 --- a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result +++ /dev/null @@ -1,520 +0,0 @@ -SELECT @@innodb_page_size; -@@innodb_page_size -65536 -SET innodb_strict_mode=ON; -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=FIXED; -ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -show warnings; -Level Code Message -Warning 1478 InnoDB: invalid ROW_FORMAT specifier. -Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; -ERROR HY000: Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -show warnings; -Level Code Message -Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > 16k. -Error 1005 Can't create table `test`.`tab5` (errno: 140 "Wrong create options") -Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB -SET @@innodb_strict_mode=OFF; -SELECT @@innodb_strict_mode; -@@innodb_strict_mode -0 -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255), -ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255), -ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255), -ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255), -ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255), -ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255), -ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255), -ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255), -ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255), -ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255), -ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255), -ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255) -) -ENGINE = innodb ROW_FORMAT=COMPACT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL); -ERROR 42000: Row size too large (> 16383). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65 -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255), -ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255), -ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255), -ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255), -ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255), -ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255), -ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255), -ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255), -ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255), -ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255), -ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255), -ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255) -) -ENGINE = innodb ROW_FORMAT=COMPACT; -Warnings: -Warning 139 Row size too large (> 32702). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -ERROR 42000: Row size too large (> 16383). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE tab5; -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255), -ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255), -ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255), -ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255), -ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255), -ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255), -ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255), -ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255), -ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255), -ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255), -ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255), -ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255) -) -ENGINE = innodb ROW_FORMAT=DYNAMIC; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255), -ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255), -ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255), -ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255), -ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255), -ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255), -ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255), -ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255), -ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255), -ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255), -ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255), -ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255) -) -ENGINE = innodb ROW_FORMAT=DYNAMIC; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -ERROR 42000: Row size too large (> 16383). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65 -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE tab5; -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255), -ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255), -ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255), -ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255), -ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255), -ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255), -ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255), -ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255), -ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255), -ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255), -ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255), -ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255) -) -ENGINE = innodb ROW_FORMAT=REDUNDANT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -ERROR 42000: Row size too large (> 16382). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 ccol55 ccol56 ccol57 ccol58 ccol59 ccol60 ccol61 ccol62 ccol63 ccol64 ccol65 -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255), -ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255), -ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255), -ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255), -ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255), -ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255), -ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255), -ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255), -ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255), -ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255), -ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255), -ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255) -) -ENGINE = innodb ROW_FORMAT=REDUNDANT; -Warnings: -Warning 139 Row size too large (> NNNN). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',27),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -ERROR 42000: Row size too large (> 16382). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',26),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); -SELECT * FROM tab5; -col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 ccol1 ccol2 ccol3 ccol4 ccol5 ccol6 ccol7 ccol8 ccol9 ccol10 ccol11 ccol12 ccol13 ccol14 ccol15 ccol16 ccol17 ccol18 ccol19 ccol20 ccol21 ccol22 ccol23 ccol24 ccol25 ccol26 ccol27 ccol28 ccol29 ccol30 ccol31 ccol32 ccol33 ccol34 ccol35 ccol36 ccol37 ccol38 ccol39 ccol40 ccol41 ccol42 ccol43 ccol44 ccol45 ccol46 ccol47 ccol48 ccol49 ccol50 ccol51 ccol52 ccol53 ccol54 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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaa NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE tab5; -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; -Warnings: -Warning 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=DYNAMIC. -DROP TABLE tab5; -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -SHOW WARNINGS; -Level Code Message -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -LENGTH(col) -16384 -32768 -65535 -FLUSH TABLE t; -ANALYZE TABLE t; -Table Op Msg_type Msg_text -test.t analyze status Engine-independent statistics collected -test.t analyze Warning Engine-independent statistics are not collected for column 'col' -test.t analyze status OK -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -clust_index_size -5 -DROP TABLE t; -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -SHOW WARNINGS; -Level Code Message -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -LENGTH(col) -16384 -32768 -65535 -FLUSH TABLE t; -ANALYZE TABLE t; -Table Op Msg_type Msg_text -test.t analyze status Engine-independent statistics collected -test.t analyze Warning Engine-independent statistics are not collected for column 'col' -test.t analyze status OK -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -clust_index_size -4 -DROP TABLE t; -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT; -SHOW WARNINGS; -Level Code Message -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -LENGTH(col) -16384 -32768 -65535 -FLUSH TABLE t; -ANALYZE TABLE t; -Table Op Msg_type Msg_text -test.t analyze status Engine-independent statistics collected -test.t analyze Warning Engine-independent statistics are not collected for column 'col' -test.t analyze status OK -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -clust_index_size -4 -DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt deleted file mode 100644 index 587a2d7e6c1..00000000000 --- a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.opt +++ /dev/null @@ -1,4 +0,0 @@ ---innodb-page-size=32K ---innodb_buffer_pool_size=32M ---skip-innodb-stats-persistent ---innodb-sys-tablestats diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test deleted file mode 100644 index 89bace5d9b1..00000000000 --- a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test +++ /dev/null @@ -1,327 +0,0 @@ ---source include/have_innodb.inc ---source include/have_innodb_32k.inc - -# Check page size 32k -SELECT @@innodb_page_size; - -SET innodb_strict_mode=ON; - -# FIXED not supported --- error 1005 -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=FIXED; -show warnings; - --- error 1005 -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; -show warnings; - ---disable_warnings -SET @@innodb_strict_mode=OFF; -SELECT @@innodb_strict_mode; ---enable_warnings - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPACT; - -# row size 16353 > 16K ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPACT; - -# row size 16318 : expected to fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL); - -# row size 16317 -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=DYNAMIC; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=DYNAMIC; - -# row size 16318 : expected to fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',156),NULL); - -# row size 16317 -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',155),NULL); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=REDUNDANT; - -# 65 * 255 = 16575 ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255)); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=REDUNDANT; - -# row size 16315 : expected to fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',89),NULL); - -# row size 16314 -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',88),NULL); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=COMPACT ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; - -DROP TABLE tab5; - -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -SHOW WARNINGS; -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -FLUSH TABLE t; -ANALYZE TABLE t; -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -DROP TABLE t; - -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -SHOW WARNINGS; -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -FLUSH TABLE t; -ANALYZE TABLE t; -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -DROP TABLE t; - -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT; -SHOW WARNINGS; -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -FLUSH TABLE t; -ANALYZE TABLE t; -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt deleted file mode 100644 index 1a8442b841f..00000000000 --- a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.opt +++ /dev/null @@ -1,4 +0,0 @@ ---innodb-page-size=64K ---innodb_buffer_pool_size=32M ---skip-innodb-stats-persistent ---innodb-sys-tablestats diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test deleted file mode 100644 index 4b4faf16f58..00000000000 --- a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test +++ /dev/null @@ -1,508 +0,0 @@ ---source include/have_innodb.inc ---source include/have_innodb_64k.inc - -# Check page size 64k -SELECT @@innodb_page_size; - -SET innodb_strict_mode=ON; - -# FIXED not supported --- error 1005 -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=FIXED; -show warnings; - --- error 1005 -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; -show warnings; - ---disable_warnings -SET @@innodb_strict_mode=OFF; -SELECT @@innodb_strict_mode; ---enable_warnings - -# Check the Warning | 139 | Row size too large ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255), -ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255), -ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255), -ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255), -ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255), -ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255), -ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255), -ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255), -ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255), -ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255), -ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255), -ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255) -) -ENGINE = innodb ROW_FORMAT=COMPACT; - -# row size 32936 : should fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),'a',NULL); - -SELECT * FROM tab5; -DROP TABLE tab5; - -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255), -ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255), -ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255), -ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255), -ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255), -ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255), -ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255), -ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255), -ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255), -ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255), -ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255), -ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255) -) -ENGINE = innodb ROW_FORMAT=COMPACT; - -# row size 16384 >= 16K : expected to fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -# row size 16383 < 16K : expected to pass -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255), -ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255), -ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255), -ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255), -ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255), -ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255), -ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255), -ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255), -ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255), -ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255), -ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255), -ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255) -) -ENGINE = innodb ROW_FORMAT=DYNAMIC; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large (> 16318) ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255), -ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255), -ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255), -ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255), -ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255), -ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255), -ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255), -ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255), -ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255), -ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255), -ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255), -ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255) -) -ENGINE = innodb ROW_FORMAT=DYNAMIC; - -# row size 16384 >= 16K : expected to fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',214),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -# row size 16383 < 16K : expected to pass -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',213),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 CHAR (255), col2 CHAR (255), col3 CHAR(255),col4 CHAR(255), col5 CHAR(255), -col6 CHAR(255), col7 CHAR(255), col8 CHAR(255), col9 CHAR(255),col10 CHAR(255), col11 CHAR(255), -col12 CHAR(255), col13 CHAR(255),col14 CHAR(255),col15 CHAR(255),col16 CHAR(255), col17 CHAR(255), -col18 CHAR(255),col19 CHAR(255),col20 CHAR(255),col21 CHAR(255),col22 CHAR(255), col23 CHAR(255), -col24 CHAR(255),col25 CHAR(255),col26 CHAR(255),col27 CHAR(255),col28 CHAR(255), col29 CHAR(255), -col30 CHAR(255),col31 CHAR(255),col32 CHAR(255),col33 CHAR(255),col34 CHAR(255), col35 CHAR(255), -col36 CHAR(255),col37 CHAR(255),col38 CHAR(255),col39 CHAR(255),col40 CHAR(255), col41 CHAR(255), -col42 CHAR(255),col43 CHAR(255),col44 CHAR(255),col45 CHAR(255),col46 CHAR(255), col47 CHAR(255), -col48 CHAR(255),col49 CHAR(255),col50 CHAR(255),col51 CHAR(255),col52 CHAR(255), col53 CHAR(255), -col54 CHAR(255),col55 CHAR(255),col56 CHAR(255),col57 CHAR(255),col58 CHAR(255), col59 CHAR(255), -col60 CHAR(255),col61 CHAR(255),col62 CHAR(255),col63 CHAR(255),col64 CHAR(255), col65 CHAR(255), -ccol1 CHAR(255),ccol2 CHAR(255),ccol3 CHAR(255),ccol4 CHAR(255),ccol5 CHAR(255), -ccol6 CHAR(255),ccol7 CHAR(255),ccol8 CHAR(255),ccol9 CHAR(255),ccol10 CHAR(255), ccol11 CHAR(255), -ccol12 CHAR(255),ccol13 CHAR(255),ccol14 CHAR(255),ccol15 CHAR(255),ccol16 CHAR(255), ccol17 CHAR(255), -ccol18 CHAR(255),ccol19 CHAR(255),ccol20 CHAR(255),ccol21 CHAR(255),ccol22 CHAR(255), ccol23 CHAR(255), -ccol24 CHAR(255),ccol25 CHAR(255),ccol26 CHAR(255),ccol27 CHAR(255),ccol28 CHAR(255), ccol29 CHAR(255), -ccol30 CHAR(255),ccol31 CHAR(255),ccol32 CHAR(255),ccol33 CHAR(255),ccol34 CHAR(255), ccol35 CHAR(255), -ccol36 CHAR(255),ccol37 CHAR(255),ccol38 CHAR(255),ccol39 CHAR(255),ccol40 CHAR(255), ccol41 CHAR(255), -ccol42 CHAR(255),ccol43 CHAR(255),ccol44 CHAR(255),ccol45 CHAR(255),ccol46 CHAR(255), ccol47 CHAR(255), -ccol48 CHAR(255),ccol49 CHAR(255),ccol50 CHAR(255),ccol51 CHAR(255),ccol52 CHAR(255), ccol53 CHAR(255), -ccol54 CHAR(255),ccol55 CHAR(255),ccol56 CHAR(255),ccol57 CHAR(255),ccol58 CHAR(255), ccol59 CHAR(255), -ccol60 CHAR(255),ccol61 CHAR(255),ccol62 CHAR(255),ccol63 CHAR(255),ccol64 CHAR(255), ccol65 CHAR(255) -) -ENGINE = innodb ROW_FORMAT=REDUNDANT; - -# 65 * 255 = 16575 ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 139 | Row size too large ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255), -ccol1 VARCHAR(255),ccol2 VARCHAR(255),ccol3 VARCHAR(255),ccol4 VARCHAR(255),ccol5 VARCHAR(255), -ccol6 VARCHAR(255),ccol7 VARCHAR(255),ccol8 VARCHAR(255),ccol9 VARCHAR(255),ccol10 VARCHAR(255), ccol11 VARCHAR(255), -ccol12 VARCHAR(255),ccol13 VARCHAR(255),ccol14 VARCHAR(255),ccol15 VARCHAR(255),ccol16 VARCHAR(255), ccol17 VARCHAR(255), -ccol18 VARCHAR(255),ccol19 VARCHAR(255),ccol20 VARCHAR(255),ccol21 VARCHAR(255),ccol22 VARCHAR(255), ccol23 VARCHAR(255), -ccol24 VARCHAR(255),ccol25 VARCHAR(255),ccol26 VARCHAR(255),ccol27 VARCHAR(255),ccol28 VARCHAR(255), ccol29 VARCHAR(255), -ccol30 VARCHAR(255),ccol31 VARCHAR(255),ccol32 VARCHAR(255),ccol33 VARCHAR(255),ccol34 VARCHAR(255), ccol35 VARCHAR(255), -ccol36 VARCHAR(255),ccol37 VARCHAR(255),ccol38 VARCHAR(255),ccol39 VARCHAR(255),ccol40 VARCHAR(255), ccol41 VARCHAR(255), -ccol42 VARCHAR(255),ccol43 VARCHAR(255),ccol44 VARCHAR(255),ccol45 VARCHAR(255),ccol46 VARCHAR(255), ccol47 VARCHAR(255), -ccol48 VARCHAR(255),ccol49 VARCHAR(255),ccol50 VARCHAR(255),ccol51 VARCHAR(255),ccol52 VARCHAR(255), ccol53 VARCHAR(255), -ccol54 VARCHAR(255),ccol55 VARCHAR(255),ccol56 VARCHAR(255),ccol57 VARCHAR(255),ccol58 VARCHAR(255), ccol59 VARCHAR(255), -ccol60 VARCHAR(255),ccol61 VARCHAR(255),ccol62 VARCHAR(255),ccol63 VARCHAR(255),ccol64 VARCHAR(255), ccol65 VARCHAR(255) -) -ENGINE = innodb ROW_FORMAT=REDUNDANT; - -# row size 16383 >= 16K-1 : expected to fail ---error ER_TOO_BIG_ROWSIZE -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',27),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -# row size 16382 < 16K-1 : expected to pass -INSERT INTO tab5 values(repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',255), -repeat('a',255),repeat('a',255),repeat('a',255),repeat('a',26),NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL, -NULL,NULL,NULL,NULL,NULL -); - -SELECT * FROM tab5; -DROP TABLE tab5; - -# Check the Warning | 1478 InnoDB: Cannot create a COMPRESSED table when innodb_page_size > NNNNk. Assuming ROW_FORMAT=COMPACT ---replace_regex /> [0-9]+/> NNNN/ -CREATE TABLE tab5(col1 VARCHAR (255), col2 VARCHAR (255), col3 VARCHAR(255),col4 VARCHAR(255), col5 VARCHAR(255), -col6 VARCHAR(255), col7 VARCHAR(255), col8 VARCHAR(255), col9 VARCHAR(255),col10 VARCHAR(255), col11 VARCHAR(255), -col12 VARCHAR(255), col13 VARCHAR(255),col14 VARCHAR(255),col15 VARCHAR(255),col16 VARCHAR(255), col17 VARCHAR(255), -col18 VARCHAR(255),col19 VARCHAR(255),col20 VARCHAR(255),col21 VARCHAR(255),col22 VARCHAR(255), col23 VARCHAR(255), -col24 VARCHAR(255),col25 VARCHAR(255),col26 VARCHAR(255),col27 VARCHAR(255),col28 VARCHAR(255), col29 VARCHAR(255), -col30 VARCHAR(255),col31 VARCHAR(255),col32 VARCHAR(255),col33 VARCHAR(255),col34 VARCHAR(255), col35 VARCHAR(255), -col36 VARCHAR(255),col37 VARCHAR(255),col38 VARCHAR(255),col39 VARCHAR(255),col40 VARCHAR(255), col41 VARCHAR(255), -col42 VARCHAR(255),col43 VARCHAR(255),col44 VARCHAR(255),col45 VARCHAR(255),col46 VARCHAR(255), col47 VARCHAR(255), -col48 VARCHAR(255),col49 VARCHAR(255),col50 VARCHAR(255),col51 VARCHAR(255),col52 VARCHAR(255), col53 VARCHAR(255), -col54 VARCHAR(255),col55 VARCHAR(255),col56 VARCHAR(255),col57 VARCHAR(255),col58 VARCHAR(255), col59 VARCHAR(255), -col60 VARCHAR(255),col61 VARCHAR(255),col62 VARCHAR(255),col63 VARCHAR(255),col64 VARCHAR(255), col65 VARCHAR(255)) -ENGINE = innodb ROW_FORMAT=COMPRESSED; - -DROP TABLE tab5; - -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -SHOW WARNINGS; -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -FLUSH TABLE t; -ANALYZE TABLE t; -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -DROP TABLE t; - -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -SHOW WARNINGS; -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -FLUSH TABLE t; -ANALYZE TABLE t; -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -DROP TABLE t; - -CREATE TABLE t(col BLOB) ENGINE=InnoDB ROW_FORMAT=COMPACT; -SHOW WARNINGS; -INSERT INTO t VALUES (REPEAT('a',16384)); -INSERT INTO t VALUES (REPEAT('a',32768)); -INSERT INTO t VALUES (REPEAT('a',65535)); -SELECT LENGTH(col) FROM t; -FLUSH TABLE t; -ANALYZE TABLE t; -SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS -WHERE name = 'test/t'; -DROP TABLE t; From b8088487e4067bcf78ddd510dd0bcefa3f9c72dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 3 Jul 2023 16:09:18 +0300 Subject: [PATCH 73/80] MDEV-19216 Assertion ...SYS_FOREIGN failed in btr_node_ptr_max_size btr_node_ptr_max_size(): Handle BINARY(0) and VARBINARY(0) as special cases, similar to CHAR(0) and VARCHAR(0). --- mysql-test/suite/innodb/r/data_types.result | 7 +++++++ mysql-test/suite/innodb/t/data_types.test | 10 ++++++++++ storage/innobase/btr/btr0cur.cc | 5 ++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/r/data_types.result b/mysql-test/suite/innodb/r/data_types.result index 1394431b09d..146f9bb080f 100644 --- a/mysql-test/suite/innodb/r/data_types.result +++ b/mysql-test/suite/innodb/r/data_types.result @@ -174,3 +174,10 @@ DROP TABLE t1; CREATE TABLE t1 (c VARCHAR(0), KEY(c)) ENGINE=InnoDB; INSERT INTO t1 VALUES (''); DROP TABLE t1; +# +# MDEV-19216 Assertion ...SYS_FOREIGN failed in btr_node_ptr_max_size +# +CREATE TABLE t1 (b BINARY(0), v VARBINARY(0), KEY(b), KEY(v)) ENGINE=InnoDB; +INSERT INTO t1 SET b='',v=''; +DROP TABLE t1; +# End of 10.4 tests diff --git a/mysql-test/suite/innodb/t/data_types.test b/mysql-test/suite/innodb/t/data_types.test index cfdd5201af2..eda6579ba4a 100644 --- a/mysql-test/suite/innodb/t/data_types.test +++ b/mysql-test/suite/innodb/t/data_types.test @@ -136,3 +136,13 @@ DROP TABLE t1; CREATE TABLE t1 (c VARCHAR(0), KEY(c)) ENGINE=InnoDB; INSERT INTO t1 VALUES (''); DROP TABLE t1; + +--echo # +--echo # MDEV-19216 Assertion ...SYS_FOREIGN failed in btr_node_ptr_max_size +--echo # + +CREATE TABLE t1 (b BINARY(0), v VARBINARY(0), KEY(b), KEY(v)) ENGINE=InnoDB; +INSERT INTO t1 SET b='',v=''; +DROP TABLE t1; + +--echo # End of 10.4 tests diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index d4e1497d9b3..0f6cdf25ca2 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1148,10 +1148,13 @@ static ulint btr_node_ptr_max_size(const dict_index_t* index) break; } /* fall through */ + case DATA_FIXBINARY: + case DATA_BINARY: case DATA_VARMYSQL: case DATA_CHAR: case DATA_MYSQL: - /* CHAR(0) and VARCHAR(0) are possible + /* BINARY(0), VARBINARY(0), + CHAR(0) and VARCHAR(0) are possible data type definitions in MariaDB. The InnoDB internal SQL parser maps CHAR to DATA_VARCHAR, so DATA_CHAR (or From d458136e7d38457e3e978d23ceceff8f18bc5d84 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 30 Jun 2023 19:22:21 +0200 Subject: [PATCH 74/80] cleanup: ER_QUERY_TIMEOUT -> ER_UNUSED_1 also make sure all unused error messages are "You should never see it" and have no translations --- sql/share/errmsg-utf8.txt | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 8bc2b784830..dff2319a99c 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -2476,7 +2476,6 @@ ER_TABLE_NOT_LOCKED swe "Tabell '%-.192s' är inte låst med LOCK TABLES" ukr "Таблицю '%-.192s' не було блоковано з LOCK TABLES" ER_UNUSED_17 - chi "你永远不应该看到它" eng "You should never see it" ER_WRONG_DB_NAME 42000 chi "数据库名称不正确'%-.100T'" @@ -4270,7 +4269,6 @@ ER_NEW_ABORTING_CONNECTION 08S01 swe "Avbröt länken för tråd %lld till db '%-.192s', användare '%-.48s', host '%-.64s' (%-.64s)" ukr "Перервано з'єднання %lld до бази данних: '%-.192s' користувач: '%-.48s' хост: '%-.64s' (%-.64s)" ER_UNUSED_10 - chi "你应当永远看不到这个" eng "You should never see it" ER_FLUSH_MASTER_BINLOG_CLOSED chi "Binlog 已关闭, 不能 RESET MASTER" @@ -6589,10 +6587,8 @@ ER_EVENT_NEITHER_M_EXPR_NOR_M_AT eng "No datetime expression provided" ger "Kein DATETIME-Ausdruck angegeben" ER_UNUSED_2 - chi "你永远不应该看到它" eng "You should never see it" ER_UNUSED_3 - chi "你永远不应该看到它" eng "You should never see it" ER_EVENT_CANNOT_DELETE chi "无法从mysql.event删除该事件" @@ -6630,7 +6626,6 @@ ER_CANT_LOCK_LOG_TABLE eng "You can't use locks with log tables" ger "Log-Tabellen können nicht gesperrt werden" ER_UNUSED_4 - chi "你永远不应该看到它" eng "You should never see it" ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE chi "mysql的列计数。%s是错误的。预期%d,找到%d。使用MariaDB%d创建,现在运行%d。请使用mysql_upgrade来修复此错误" @@ -6645,7 +6640,6 @@ ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT eng "Cannot change the binary logging format inside a stored function or trigger" ger "Das Binärlog-Format kann innerhalb einer gespeicherten Funktion oder eines Triggers nicht geändert werden" ER_UNUSED_13 - chi "你永远不应该看到它" eng "You should never see it" ER_PARTITION_NO_TEMPORARY chi "无法使用分区创建临时表" @@ -6866,7 +6860,6 @@ ER_CANT_CREATE_SROUTINE eng "Cannot create stored routine %`s. Check warnings" ger "Kann gespeicherte Routine %`s nicht erzeugen. Beachten Sie die Warnungen" ER_UNUSED_11 - chi "你永远不应该看到它" eng "You should never see it" ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT chi "类型%s的Binlog语句未在格式描述binlog语句之前" @@ -6930,7 +6923,6 @@ ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE chi "心跳周期的请求值是负的或超过允许的最大值(%u秒)" eng "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%u seconds)" ER_UNUSED_14 - chi "你永远不应该看到它" eng "You should never see it" ER_CONFLICT_FN_PARSE_ERROR chi "解析冲突功能时出错。消息:%-.64s" @@ -7319,11 +7311,9 @@ ER_BINLOG_UNSAFE_UPDATE_IGNORE eng "UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave" ER_UNUSED_15 - chi "你永远不应该看到它" eng "You should never see it" ER_UNUSED_16 - chi "你永远不应该看到它" eng "You should never see it" ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT @@ -7434,7 +7424,6 @@ ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET swe "Hittade en rad som inte passar i någon given partition" ER_UNUSED_5 - chi "你永远不应该看到它" eng "You should never see it" ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE @@ -7670,7 +7659,6 @@ ER_SLAVE_SILENT_RETRY_TRANSACTION eng "Slave must silently retry current transaction" ER_UNUSED_22 - chi "你永远不应该看到它" eng "You should never see it" ER_TABLE_SCHEMA_MISMATCH @@ -8006,12 +7994,12 @@ ER_LAST_MYSQL_ERROR_MESSAGE start-error-number 1900 ER_UNUSED_18 - eng "" + eng "You should never see it" ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED chi "函数或表达式'%s'不能用于%s的%`s" eng "Function or expression '%s' cannot be used in the %s clause of %`s" ER_UNUSED_19 - eng "" + eng "You should never see it" ER_PRIMARY_KEY_BASED_ON_GENERATED_COLUMN chi "主键无法在生成的列上定义" eng "Primary key cannot be defined upon a generated column" @@ -8028,9 +8016,9 @@ ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN chi "生成的列尚未支持这一点" eng "This is not yet supported for generated columns" ER_UNUSED_20 - eng "" + eng "You should never see it" ER_UNUSED_21 - eng "" + eng "You should never see it" ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS chi "%s存储引擎不支持生成的列" eng "%s storage engine does not support generated columns" @@ -8044,13 +8032,10 @@ ER_BAD_OPTION_VALUE eng "Incorrect value '%-.64T' for option '%-.64s'" hindi "गलत मान '%-.64T' विकल्प '%-.64s' के लिए" ER_UNUSED_6 - chi "你永远不应该看到它" eng "You should never see it" ER_UNUSED_7 - chi "你永远不应该看到它" eng "You should never see it" ER_UNUSED_8 - chi "你永远不应该看到它" eng "You should never see it" ER_DATA_OVERFLOW 22003 chi "转换'%-.128s'到%-.32s时溢出。值截断" @@ -8092,7 +8077,6 @@ ER_CONNECTION_KILLED 70100 eng "Connection was killed" hindi "कनेक्शन को समाप्त कर दिया गया है" ER_UNUSED_12 - chi "你永远不应该看到它" eng "You should never see it" ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION chi "无法修改事务中的@@session.skip_replication" @@ -8242,7 +8226,6 @@ ER_SET_STATEMENT_NOT_SUPPORTED 42000 chi "系统变量%.200s无法在set语句中设置。“" eng "The system variable %.200s cannot be set in SET STATEMENT." ER_UNUSED_9 - chi "你永远不应该看到它" eng "You should never see it" ER_USER_CREATE_EXISTS chi "无法创建用户'%-.64s'@'%-.64s';它已经存在" @@ -8390,9 +8373,8 @@ ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS chi "使用CHANGE MASTER TO master_log_file子句更改master,但没有master_log_pos子句可能不安全。旧位置值可能对新的二进制日志文件无效。" eng "CHANGE MASTER TO with a MASTER_LOG_FILE clause but no MASTER_LOG_POS clause may not be safe. The old position value may not be valid for the new binary log file." -ER_QUERY_TIMEOUT - chi "查询执行中断,超过了最大语句执行时间" - eng "Query execution was interrupted, maximum statement execution time exceeded" +ER_UNUSED_1 + eng "You should never see it" ER_NON_RO_SELECT_DISABLE_TIMER chi "SELECT不是只读语句,禁用计时器" @@ -8921,7 +8903,6 @@ ER_VERS_ENGINE_UNSUPPORTED eng "Transaction-precise system versioning for %`s is not supported" ER_UNUSED_23 - chi "你永远不应该看到它" eng "You should never see it" ER_PARTITION_WRONG_TYPE @@ -8941,7 +8922,6 @@ ER_VERS_DROP_PARTITION_INTERVAL eng "Can only drop oldest partitions when rotating by INTERVAL" ER_UNUSED_25 - chi "你永远不应该看到它" eng "You should never see it" WARN_VERS_PART_NON_HISTORICAL chi "分区%`s包含非历史数据" @@ -9016,7 +8996,6 @@ ER_VERS_ALREADY_VERSIONED eng "Table %`s is already system-versioned" ER_UNUSED_24 - chi "你永远不应该看到它" eng "You should never see it" ER_VERS_NOT_SUPPORTED From 22e5a5ff6eb5e92a049c688953115f8a4bae1a41 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 30 Jun 2023 20:51:17 +0200 Subject: [PATCH 75/80] generalize ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT make it "query reached result may be incomplete" --- include/mysql.h | 1 + mysql-test/main/information_schema.result | 2 +- mysql-test/main/limit_rows_examined.result | 124 ++++++++++----------- mysql-test/main/subselect4.result | 2 +- sql/share/errmsg-utf8.txt | 5 +- sql/sql_select.cc | 6 +- sql/sql_union.cc | 6 +- 7 files changed, 73 insertions(+), 73 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index 2a96effcf93..3bc07d9c480 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -148,6 +148,7 @@ typedef unsigned long long my_ulonglong; #define ER_WRONG_FK_OPTION_FOR_VIRTUAL_COLUMN ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN #define ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN #define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS +#define ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT ER_QUERY_RESULT_INCOMPLETE typedef struct st_mysql_rows { struct st_mysql_rows *next; /* list of rows */ diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result index 6686d451dd8..2160eee08a7 100644 --- a/mysql-test/main/information_schema.result +++ b/mysql-test/main/information_schema.result @@ -2228,7 +2228,7 @@ SCHEMA_NAME SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION Warnings: -Warning 1931 Query execution was interrupted. The query examined at least ### rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 10. The query result may be incomplete # # MDEV-24179: AAssertion `m_status == DA_ERROR || m_status == DA_OK || # m_status == DA_OK_BULK' failed in Diagnostics_area::message() diff --git a/mysql-test/main/limit_rows_examined.result b/mysql-test/main/limit_rows_examined.result index e87dd25cac9..dfeb61043f9 100644 --- a/mysql-test/main/limit_rows_examined.result +++ b/mysql-test/main/limit_rows_examined.result @@ -22,7 +22,7 @@ select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 2; c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete explain select * from t1i, t2i where c1 = c2 LIMIT ROWS EXAMINED 4; id select_type table type possible_keys key key_len ref rows Extra @@ -32,7 +32,7 @@ select * from t1i, t2i where c1 = c2 LIMIT ROWS EXAMINED 4; c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 5 rows, which exceeds LIMIT ROWS EXAMINED (4). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 4. The query result may be incomplete Blocked nested loops join, empty result set because of blocking set @@join_cache_level=1; explain @@ -44,7 +44,7 @@ select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 6; c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 7 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete explain select * from t1i, t2i where c1 = c2 LIMIT ROWS EXAMINED 6; id select_type table type possible_keys key key_len ref rows Extra @@ -55,7 +55,7 @@ c1 c2 bb bb cc cc Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 7 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete set @@join_cache_level=6; explain select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 3; @@ -65,7 +65,7 @@ id select_type table type possible_keys key key_len ref rows Extra select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 3; c1 c2 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 4 rows, which exceeds LIMIT ROWS EXAMINED (3). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 3. The query result may be incomplete explain select * from t1i, t2i where c1 = c2 LIMIT ROWS EXAMINED 6; id select_type table type possible_keys key key_len ref rows Extra @@ -76,7 +76,7 @@ c1 c2 bb bb cc cc Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 7 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete Mix LIMIT ROWS EXAMINED with LIMIT set @@join_cache_level=0; explain @@ -125,7 +125,7 @@ id select_type table type possible_keys key key_len ref rows Extra select * from t0, t1 where c0 = 'bb' and c1 > c0 LIMIT ROWS EXAMINED 0; c0 c1 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 2 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete set @@join_cache_level = @save_join_cache_level; drop table t0; ========================================================================= @@ -139,7 +139,7 @@ execute st1 using @l; c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete deallocate prepare st1; User variable (not supported for LIMIT in MariaDB 5.3/MySQL 5.1) select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED @l; @@ -153,7 +153,7 @@ call test_limit_rows(3); c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 4 rows, which exceeds LIMIT ROWS EXAMINED (3). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 3. The query result may be incomplete drop procedure test_limit_rows; set @@join_cache_level = @save_join_cache_level; ========================================================================= @@ -165,14 +165,14 @@ UNION c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete (select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0) UNION (select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 6); c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0 UNION select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 6; @@ -185,7 +185,7 @@ LIMIT ROWS EXAMINED 6; c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete (select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0) UNION (select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 0) @@ -193,7 +193,7 @@ LIMIT 1 ROWS EXAMINED 6; c1 c2 bb bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete (select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0) UNION (select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 0) @@ -202,7 +202,7 @@ c1 c2 bb bb cc cc Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (10). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 10. The query result may be incomplete ========================================================================= Subqueries (with several LIMIT ROWS EXAMINED clauses) ========================================================================= @@ -219,7 +219,7 @@ where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 11); c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (11). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete explain select * from t1 where c1 IN (select * from t2 where c2 > ' ') @@ -234,7 +234,7 @@ LIMIT ROWS EXAMINED 11; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (11). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete explain select * from t1 where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0) @@ -249,7 +249,7 @@ LIMIT ROWS EXAMINED 11; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (11). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete explain select * from t1i where c1 IN (select * from t2i where c2 > ' ') @@ -264,7 +264,7 @@ c1 bb cc Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 7 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete Subqueries with IN-TO-EXISTS set @@optimizer_switch='semijoin=off,in_to_exists=on,materialization=off'; explain @@ -278,7 +278,7 @@ where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 4); c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 5 rows, which exceeds LIMIT ROWS EXAMINED (4). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 4. The query result may be incomplete explain select * from t1 where c1 IN (select * from t2 where c2 > ' ') @@ -292,7 +292,7 @@ LIMIT ROWS EXAMINED 4; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 5 rows, which exceeds LIMIT ROWS EXAMINED (4). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 4. The query result may be incomplete explain select * from t1 where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0) @@ -306,7 +306,7 @@ LIMIT ROWS EXAMINED 4; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 5 rows, which exceeds LIMIT ROWS EXAMINED (4). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 4. The query result may be incomplete explain select * from t1i where c1 IN (select * from t2i where c2 > ' ') @@ -320,7 +320,7 @@ LIMIT ROWS EXAMINED 9; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (9). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 9. The query result may be incomplete Same as above, without subquery cache set @@optimizer_switch='subquery_cache=off'; select * from t1 @@ -328,28 +328,28 @@ where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 2); c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete select * from t1 where c1 IN (select * from t2 where c2 > ' ') LIMIT ROWS EXAMINED 2; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete select * from t1 where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0) LIMIT ROWS EXAMINED 2; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete select * from t1i where c1 IN (select * from t2i where c2 > ' ') LIMIT ROWS EXAMINED 5; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 7 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 5. The query result may be incomplete Subqueries with materialization set @@optimizer_switch='semijoin=off,in_to_exists=off,materialization=on,subquery_cache=on'; explain @@ -363,7 +363,7 @@ where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 13); c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 14 rows, which exceeds LIMIT ROWS EXAMINED (13). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 13. The query result may be incomplete explain select * from t1 where c1 IN (select * from t2 where c2 > ' ') LIMIT ROWS EXAMINED 13; @@ -375,7 +375,7 @@ where c1 IN (select * from t2 where c2 > ' ') LIMIT ROWS EXAMINED 13; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 14 rows, which exceeds LIMIT ROWS EXAMINED (13). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 13. The query result may be incomplete explain select * from t1 where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0) @@ -389,7 +389,7 @@ LIMIT ROWS EXAMINED 13; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 14 rows, which exceeds LIMIT ROWS EXAMINED (13). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 13. The query result may be incomplete explain select * from t1i where c1 IN (select * from t2i where c2 > ' ') LIMIT ROWS EXAMINED 17; @@ -401,7 +401,7 @@ where c1 IN (select * from t2i where c2 > ' ') LIMIT ROWS EXAMINED 17; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 18 rows, which exceeds LIMIT ROWS EXAMINED (17). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 17. The query result may be incomplete set @@optimizer_switch='default'; ========================================================================= Views and derived tables @@ -422,18 +422,18 @@ bb cc dd Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 18 rows, which exceeds LIMIT ROWS EXAMINED (17). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 17. The query result may be incomplete select * from v1 LIMIT ROWS EXAMINED 16; c1 bb cc Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 17 rows, which exceeds LIMIT ROWS EXAMINED (16). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 16. The query result may be incomplete select * from v1 LIMIT ROWS EXAMINED 11; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (11). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete drop view v1; explain select * @@ -451,7 +451,7 @@ LIMIT ROWS EXAMINED 11; c1 bb Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (11). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete ========================================================================= Aggregation ========================================================================= @@ -474,16 +474,16 @@ id select_type table type possible_keys key key_len ref rows Extra select c1, sum(c2) from t3 group by c1 LIMIT ROWS EXAMINED 0; c1 sum(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete select c1, sum(c2) from t3 group by c1 LIMIT ROWS EXAMINED 1; c1 sum(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (1). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 1. The query result may be incomplete select c1, sum(c2) from t3 group by c1 LIMIT ROWS EXAMINED 20; c1 sum(c2) aa 3 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 21 rows, which exceeds LIMIT ROWS EXAMINED (20). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 20. The query result may be incomplete select c1, sum(c2) from t3 group by c1 LIMIT ROWS EXAMINED 21; c1 sum(c2) aa 3 @@ -501,16 +501,16 @@ id select_type table type possible_keys key key_len ref rows Extra select c1, sum(c2) from t3i group by c1 LIMIT ROWS EXAMINED 0; c1 sum(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete select c1, sum(c2) from t3i group by c1 LIMIT ROWS EXAMINED 1; c1 sum(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (1). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 1. The query result may be incomplete select c1, sum(c2) from t3i group by c1 LIMIT ROWS EXAMINED 20; c1 sum(c2) aa 3 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 21 rows, which exceeds LIMIT ROWS EXAMINED (20). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 20. The query result may be incomplete select c1, sum(c2) from t3i group by c1 LIMIT ROWS EXAMINED 21; c1 sum(c2) aa 3 @@ -523,14 +523,14 @@ id select_type table type possible_keys key key_len ref rows Extra select min(c2) from t3 LIMIT ROWS EXAMINED 5; min(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 6 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 5. The query result may be incomplete select max(c2) from t3 LIMIT ROWS EXAMINED 6; max(c2) 5 select max(c2) from t3 LIMIT ROWS EXAMINED 0; max(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete explain select max(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 5; id select_type table type possible_keys key key_len ref rows Extra @@ -538,14 +538,14 @@ id select_type table type possible_keys key key_len ref rows Extra select max(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 5; max(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 6 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 5. The query result may be incomplete select max(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 6; max(c2) NULL select max(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 0; max(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete explain select count(c2) from t3 LIMIT ROWS EXAMINED 5; id select_type table type possible_keys key key_len ref rows Extra @@ -553,14 +553,14 @@ id select_type table type possible_keys key key_len ref rows Extra select count(c2) from t3 LIMIT ROWS EXAMINED 5; count(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 6 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 5. The query result may be incomplete select count(c2) from t3 LIMIT ROWS EXAMINED 6; count(c2) 5 select count(c2) from t3 LIMIT ROWS EXAMINED 0; count(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete explain select count(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 5; id select_type table type possible_keys key key_len ref rows Extra @@ -568,7 +568,7 @@ id select_type table type possible_keys key key_len ref rows Extra select count(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 5; count(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 6 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 5. The query result may be incomplete select count(c2) from t3 where c2 > 10 LIMIT ROWS EXAMINED 6; count(c2) 0 @@ -579,7 +579,7 @@ id select_type table type possible_keys key key_len ref rows Extra select sum(c2) from t3 LIMIT ROWS EXAMINED 5; sum(c2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 6 rows, which exceeds LIMIT ROWS EXAMINED (5). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 5. The query result may be incomplete select sum(c2) from t3 LIMIT ROWS EXAMINED 6; sum(c2) 15 @@ -618,7 +618,7 @@ c1 c2 aa 1 aa 2 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete explain select c1, c2 from t3i order by c2, c1 desc LIMIT ROWS EXAMINED 2; id select_type table type possible_keys key key_len ref rows Extra @@ -634,14 +634,14 @@ CREATE TABLE t4 (a int); INSERT INTO t4 values (1), (2); INSERT IGNORE INTO t4 SELECT a + 2 FROM t4 LIMIT ROWS EXAMINED 0; Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 0. The query result may be incomplete select * from t4; a 1 2 INSERT INTO t4 SELECT a + 2 FROM t4 LIMIT ROWS EXAMINED 6; Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 6. The query result may be incomplete select * from t4; a 1 @@ -692,7 +692,7 @@ WHERE EXISTS (SELECT c FROM t3 LEFT JOIN t2 ON b = d) HAVING field1 > 'aaa' LIMIT ROWS EXAMINED 20; field1 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 21 rows, which exceeds LIMIT ROWS EXAMINED (20). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 20. The query result may be incomplete EXPLAIN SELECT DISTINCT a FROM t1, t2 HAVING a > ' ' LIMIT ROWS EXAMINED 14; id select_type table type possible_keys key key_len ref rows Extra @@ -702,13 +702,13 @@ SELECT DISTINCT a FROM t1, t2 HAVING a > ' ' LIMIT ROWS EXAMINED 14; a USA Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 15 rows, which exceeds LIMIT ROWS EXAMINED (14). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 14. The query result may be incomplete SELECT DISTINCT a FROM t1, t2 HAVING a > ' ' LIMIT ROWS EXAMINED 15; a USA CAN Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 16 rows, which exceeds LIMIT ROWS EXAMINED (15). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 15. The query result may be incomplete SELECT DISTINCT a FROM t1, t2 HAVING a > ' ' LIMIT ROWS EXAMINED 16; a USA @@ -753,7 +753,7 @@ GROUP BY field1, field2, field3, field4, field5 LIMIT ROWS EXAMINED 120; field1 field2 field3 field4 field5 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 121 rows, which exceeds LIMIT ROWS EXAMINED (120). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 120. The query result may be incomplete SHOW STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 1 @@ -778,8 +778,8 @@ GROUP BY field1, field2, field3, field4, field5 LIMIT ROWS EXAMINED 124; field1 field2 field3 field4 field5 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 125 rows, which exceeds LIMIT ROWS EXAMINED (124). The query result may be incomplete -Warning 1931 Query execution was interrupted. The query examined at least 127 rows, which exceeds LIMIT ROWS EXAMINED (124). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 124. The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 124. The query result may be incomplete SHOW STATUS LIKE 'Handler_read%'; Variable_name Value Handler_read_first 1 @@ -822,7 +822,7 @@ WHERE b <= alias1.b OR e != alias2.c ) LIMIT ROWS EXAMINED 20; a b c Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 25 rows, which exceeds LIMIT ROWS EXAMINED (20). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 20. The query result may be incomplete drop table t1, t2, t3; MDEV-174: LIMIT ROWS EXAMINED: Assertion `0' failed in net_end_statement(THD*) @@ -839,7 +839,7 @@ WHERE c = (SELECT MAX(b) FROM t2) LIMIT ROWS EXAMINED 3; (SELECT MAX(c) FROM t1, t2) Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 12 rows, which exceeds LIMIT ROWS EXAMINED (3). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 3. The query result may be incomplete drop table t1, t2; MDEV-178: LIMIT ROWS EXAMINED: Assertion `0' failed in net_end_statement(THD*) on the @@ -856,12 +856,12 @@ EXECUTE ps; a 3 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 22 rows, which exceeds LIMIT ROWS EXAMINED (21). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 21. The query result may be incomplete EXECUTE ps; a 3 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 22 rows, which exceeds LIMIT ROWS EXAMINED (21). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 21. The query result may be incomplete drop view v; drop table t1, t2; # @@ -876,7 +876,7 @@ INSERT INTO t1 (k,c) VALUES(0,'0'), (0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,'0'),(0,' SET @@sql_mode='STRICT_TRANS_TABLES'; INSERT INTO t1 (c) SELECT k FROM t1 LIMIT ROWS EXAMINED 2; Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3 rows, which exceeds LIMIT ROWS EXAMINED (2). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 2. The query result may be incomplete SET @@sql_mode=@old_mode; DROP TABLE t1; # diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index 259337cf646..9dcf05c8565 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -2760,7 +2760,7 @@ from t2 join t1 on ('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 500; 1 Warnings: -Warning 1931 Query execution was interrupted. The query examined at least 3020 rows, which exceeds LIMIT ROWS EXAMINED (500). The query result may be incomplete +Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 500. The query result may be incomplete SET join_cache_level= @save_join_cache_level; DROP TABLE t1,t2,t3,t4; # diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index dff2319a99c..eda61fbe218 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -8084,9 +8084,8 @@ ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SKIP_REPLICATION ER_STORED_FUNCTION_PREVENTS_SWITCH_SKIP_REPLICATION chi "无法修改存储函数或触发器内的@@session.skip_replication" eng "Cannot modify @@session.skip_replication inside a stored function or trigger" -ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT - chi "查询执行被中断。查询检查至少%llu行,超过限制行(%llu)。查询结果可能是不完整的" - eng "Query execution was interrupted. The query examined at least %llu rows, which exceeds LIMIT ROWS EXAMINED (%llu). The query result may be incomplete" +ER_QUERY_RESULT_INCOMPLETE + eng "Query execution was interrupted. The query exceeded %s %llu. The query result may be incomplete" ER_NO_SUCH_TABLE_IN_ENGINE 42S02 chi "表'%-.192s.%-.192s'在引擎中不存在" eng "Table '%-.192s.%-.192s' doesn't exist in engine" diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 821394cf6d0..5955cbef8dd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -467,9 +467,9 @@ bool handle_select(THD *thd, LEX *lex, select_result *result, bool saved_abort_on_warning= thd->abort_on_warning; thd->abort_on_warning= false; push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT, - ER_THD(thd, ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT), - thd->accessed_rows_and_keys, + ER_QUERY_RESULT_INCOMPLETE, + ER_THD(thd, ER_QUERY_RESULT_INCOMPLETE), + "LIMIT ROWS EXAMINED", thd->lex->limit_rows_examined->val_uint()); thd->abort_on_warning= saved_abort_on_warning; thd->reset_killed(); diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0f218b73b16..bc33f827084 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -1658,9 +1658,9 @@ bool st_select_lex_unit::exec() the current result. */ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT, - ER_THD(thd, ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT), - thd->accessed_rows_and_keys, + ER_QUERY_RESULT_INCOMPLETE, + ER_THD(thd, ER_QUERY_RESULT_INCOMPLETE), + "LIMIT ROWS EXAMINED", thd->lex->limit_rows_examined->val_uint()); thd->reset_killed(); break; From 5c81c50f107896feb930cd3aaf795fe8e1635eec Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 30 Jun 2023 21:03:29 +0200 Subject: [PATCH 76/80] MDEV-31214 Recursive CTE execution is interrupted without errors or warnings --- mysql-test/main/cte_recursive.result | 4 ++++ sql/sql_derived.cc | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result index 8de8a571052..0b7b216f1fe 100644 --- a/mysql-test/main/cte_recursive.result +++ b/mysql-test/main/cte_recursive.result @@ -1214,6 +1214,8 @@ generation name 2 Grandma Ann 2 Grandma Sally 2 Grandpa Ben +Warnings: +Warning 1931 Query execution was interrupted. The query exceeded max_recursive_iterations = 1. The query result may be incomplete # query with recursive tables using key access alter table folks add primary key (id); explain @@ -2592,6 +2594,8 @@ select * from applied_modules; m m1 m2 +Warnings: +Warning 1931 Query execution was interrupted. The query exceeded max_recursive_iterations = 2. The query result may be incomplete drop table value_nodes, module_nodes, module_arguments, module_results; # # mdev-12519: recursive references in subqueries diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index c8a335497e9..107ac31cd4e 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -1142,7 +1142,14 @@ bool TABLE_LIST::fill_recursive(THD *thd) while (!rc && !with->all_are_stabilized()) { if (with->level > thd->variables.max_recursive_iterations) + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_QUERY_RESULT_INCOMPLETE, + ER_THD(thd, ER_QUERY_RESULT_INCOMPLETE), + "max_recursive_iterations =", + (ulonglong)thd->variables.max_recursive_iterations); break; + } with->prepare_for_next_iteration(); rc= unit->exec_recursive(); } From ea386c9d06ec6bb47e91258d7f0b1f5daf937463 Mon Sep 17 00:00:00 2001 From: Vicentiu Ciorbaru Date: Mon, 5 Jun 2023 11:00:44 +0300 Subject: [PATCH 77/80] Fix use of uninitialized variable The original code generated a warning in gcc 13.1 --- storage/maria/ma_blockrec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 667cc26758d..436f07ff7e3 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -4713,7 +4713,7 @@ int _ma_read_block_record2(MARIA_HA *info, uchar *record, uchar *data, uchar *end_of_data) { MARIA_SHARE *share= info->s; - uchar *UNINIT_VAR(field_length_data), *UNINIT_VAR(blob_buffer), *start_of_data; + uchar *field_length_data= 0, *UNINIT_VAR(blob_buffer), *start_of_data; uint flag, null_bytes, cur_null_bytes, row_extents, field_lengths; my_bool found_blob= 0; MARIA_EXTENT_CURSOR extent; From 922db0642b6321ece41adb3232c1616812143573 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 28 Jun 2023 14:25:53 +1000 Subject: [PATCH 78/80] MDEV-31421 Fix spider test cleanup This fixes mdev_26541.test, and the new clean_up_spider.inc will be useful for other tests where part of deinit_spider does not apply, e.g. those testing spider initialisation only. --- .../spider/bugfix/r/mdev_26541.result | 5 ++--- .../spider/bugfix/t/mdev_26541.test | 21 ++----------------- .../spider/include/clean_up_spider.inc | 15 +++++++++++++ .../spider/include/deinit_spider.inc | 17 +-------------- 4 files changed, 20 insertions(+), 38 deletions(-) create mode 100644 storage/spider/mysql-test/spider/include/clean_up_spider.inc diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result index b2edaff6918..72921d2e695 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result @@ -1,14 +1,13 @@ # # MDEV-26541 Undefined symbol: _ZTI12ha_partition when attempting to use ha_spider.so in UBSAN builds # -INSTALL PLUGIN spider SONAME 'ha_spider.so'; +INSTALL SONAME 'ha_spider.so'; DROP FUNCTION spider_flush_table_mon_cache; DROP FUNCTION spider_copy_tables; DROP FUNCTION spider_ping_table; DROP FUNCTION spider_bg_direct_sql; DROP FUNCTION spider_direct_sql; -UNINSTALL PLUGIN spider_alloc_mem; -UNINSTALL PLUGIN spider; +UNINSTALL SONAME IF EXISTS "ha_spider"; DROP TABLE IF EXISTS mysql.spider_xa; DROP TABLE IF EXISTS mysql.spider_xa_member; DROP TABLE IF EXISTS mysql.spider_xa_failed_log; diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test index b32e1630494..bf6cb255d02 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_26541.test @@ -9,7 +9,7 @@ if (`select not(count(*)) from information_schema.system_variables where variabl # init spider -INSTALL PLUGIN spider SONAME 'ha_spider.so'; +INSTALL SONAME 'ha_spider.so'; let $PLUGIN_NAME= spider_flush_table_mon_cache; let $PLUGIN_EXIST= @@ -20,21 +20,4 @@ while (!$PLUGIN_EXIST) `SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`; } -# deinit spider - -DROP FUNCTION spider_flush_table_mon_cache; -DROP FUNCTION spider_copy_tables; -DROP FUNCTION spider_ping_table; -DROP FUNCTION spider_bg_direct_sql; -DROP FUNCTION spider_direct_sql; -UNINSTALL PLUGIN spider_alloc_mem; -UNINSTALL PLUGIN spider; -DROP TABLE IF EXISTS mysql.spider_xa; -DROP TABLE IF EXISTS mysql.spider_xa_member; -DROP TABLE IF EXISTS mysql.spider_xa_failed_log; -DROP TABLE IF EXISTS mysql.spider_tables; -DROP TABLE IF EXISTS mysql.spider_link_mon_servers; -DROP TABLE IF EXISTS mysql.spider_link_failed_log; -DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; -DROP TABLE IF EXISTS mysql.spider_table_sts; -DROP TABLE IF EXISTS mysql.spider_table_crd; +--source ../../include/clean_up_spider.inc diff --git a/storage/spider/mysql-test/spider/include/clean_up_spider.inc b/storage/spider/mysql-test/spider/include/clean_up_spider.inc new file mode 100644 index 00000000000..1f0659dc98a --- /dev/null +++ b/storage/spider/mysql-test/spider/include/clean_up_spider.inc @@ -0,0 +1,15 @@ +DROP FUNCTION spider_flush_table_mon_cache; +DROP FUNCTION spider_copy_tables; +DROP FUNCTION spider_ping_table; +DROP FUNCTION spider_bg_direct_sql; +DROP FUNCTION spider_direct_sql; +UNINSTALL SONAME IF EXISTS "ha_spider"; +DROP TABLE IF EXISTS mysql.spider_xa; +DROP TABLE IF EXISTS mysql.spider_xa_member; +DROP TABLE IF EXISTS mysql.spider_xa_failed_log; +DROP TABLE IF EXISTS mysql.spider_tables; +DROP TABLE IF EXISTS mysql.spider_link_mon_servers; +DROP TABLE IF EXISTS mysql.spider_link_failed_log; +DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; +DROP TABLE IF EXISTS mysql.spider_table_sts; +DROP TABLE IF EXISTS mysql.spider_table_crd; diff --git a/storage/spider/mysql-test/spider/include/deinit_spider.inc b/storage/spider/mysql-test/spider/include/deinit_spider.inc index 51cc075edaa..71c198f95c2 100644 --- a/storage/spider/mysql-test/spider/include/deinit_spider.inc +++ b/storage/spider/mysql-test/spider/include/deinit_spider.inc @@ -28,22 +28,7 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`) DROP TABLE IF EXISTS mysql.spider_rewritten_tables; } } -DROP FUNCTION spider_flush_table_mon_cache; -DROP FUNCTION spider_copy_tables; -DROP FUNCTION spider_ping_table; -DROP FUNCTION spider_bg_direct_sql; -DROP FUNCTION spider_direct_sql; -UNINSTALL PLUGIN spider_alloc_mem; -UNINSTALL PLUGIN spider; -DROP TABLE IF EXISTS mysql.spider_xa; -DROP TABLE IF EXISTS mysql.spider_xa_member; -DROP TABLE IF EXISTS mysql.spider_xa_failed_log; -DROP TABLE IF EXISTS mysql.spider_tables; -DROP TABLE IF EXISTS mysql.spider_link_mon_servers; -DROP TABLE IF EXISTS mysql.spider_link_failed_log; -DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; -DROP TABLE IF EXISTS mysql.spider_table_sts; -DROP TABLE IF EXISTS mysql.spider_table_crd; +--source clean_up_spider.inc if ($VERSION_COMPILE_OS_WIN) { if ($CHILD2_1_MYPORT) From 9856bb4245177cb290f771f1010299acf221c869 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Sun, 2 Jul 2023 21:16:03 +0200 Subject: [PATCH 79/80] MDEV-31602: Race on rpl_global_gtid_slave_state when starting IO thread Fix that rpl_slave_state::load() was calling rpl_slave_state::update() without holding LOCK_slave_state. Reviewed-by: Monty Signed-off-by: Kristian Nielsen --- sql/rpl_gtid.cc | 17 ++++++++++++++--- sql/rpl_gtid.h | 2 ++ sql/rpl_rli.cc | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 6f2c01383ab..e7ff8924874 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -45,9 +45,7 @@ rpl_slave_state::update_state_hash(uint64 sub_id, rpl_gtid *gtid, void *hton, there will not be an attempt to delete the corresponding table row before it is even committed. */ - mysql_mutex_lock(&LOCK_slave_state); err= update(gtid->domain_id, gtid->server_id, sub_id, gtid->seq_no, hton, rgi); - mysql_mutex_unlock(&LOCK_slave_state); if (err) { sql_print_warning("Slave: Out of memory during slave state maintenance. " @@ -290,11 +288,24 @@ rpl_slave_state::truncate_hash() int rpl_slave_state::update(uint32 domain_id, uint32 server_id, uint64 sub_id, uint64 seq_no, void *hton, rpl_group_info *rgi) +{ + int res; + mysql_mutex_lock(&LOCK_slave_state); + res= update_nolock(domain_id, server_id, sub_id, seq_no, hton, rgi); + mysql_mutex_unlock(&LOCK_slave_state); + return res; +} + + +int +rpl_slave_state::update_nolock(uint32 domain_id, uint32 server_id, uint64 sub_id, + uint64 seq_no, void *hton, rpl_group_info *rgi) { element *elem= NULL; list_element *list_elem= NULL; DBUG_ASSERT(hton || !loaded); + mysql_mutex_assert_owner(&LOCK_slave_state); if (!(elem= get_element(domain_id))) return 1; @@ -308,7 +319,6 @@ rpl_slave_state::update(uint32 domain_id, uint32 server_id, uint64 sub_id, of all pending MASTER_GTID_WAIT(), so we do not slow down the replication SQL thread. */ - mysql_mutex_assert_owner(&LOCK_slave_state); elem->gtid_waiter= NULL; mysql_cond_broadcast(&elem->COND_wait_gtid); } @@ -1356,6 +1366,7 @@ rpl_slave_state::load(THD *thd, const char *state_from_master, size_t len, { const char *end= state_from_master + len; + mysql_mutex_assert_not_owner(&LOCK_slave_state); if (reset) { if (truncate_state_table(thd)) diff --git a/sql/rpl_gtid.h b/sql/rpl_gtid.h index 081f7e309f4..1a2fb2bae85 100644 --- a/sql/rpl_gtid.h +++ b/sql/rpl_gtid.h @@ -231,6 +231,8 @@ struct rpl_slave_state ulong count() const { return hash.records; } int update(uint32 domain_id, uint32 server_id, uint64 sub_id, uint64 seq_no, void *hton, rpl_group_info *rgi); + int update_nolock(uint32 domain_id, uint32 server_id, uint64 sub_id, + uint64 seq_no, void *hton, rpl_group_info *rgi); int truncate_state_table(THD *thd); void select_gtid_pos_table(THD *thd, LEX_CSTRING *out_tablename); int record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 04fddb3e74b..214650f1e29 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1927,7 +1927,7 @@ rpl_load_gtid_slave_state(THD *thd) for (i= 0; i < array.elements; ++i) { get_dynamic(&array, (uchar *)&tmp_entry, i); - if ((err= rpl_global_gtid_slave_state->update(tmp_entry.gtid.domain_id, + if ((err= rpl_global_gtid_slave_state->update_nolock(tmp_entry.gtid.domain_id, tmp_entry.gtid.server_id, tmp_entry.sub_id, tmp_entry.gtid.seq_no, From 23e252aef2260172c30740391ce2923ae9f59f9b Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Wed, 5 Jul 2023 16:35:01 +0530 Subject: [PATCH 80/80] MDEV-23187 misses resetting collation connection MDEV-23187 misses resetting collation connection causing test failures for 10.5+ bugs. --- mysql-test/main/func_json.result | 2 ++ mysql-test/main/func_json.test | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index ed719e7b453..a6a8f39bd2d 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -1293,10 +1293,12 @@ ERROR 42000: Incorrect parameter count in the call to native function 'json_leng SELECT JSON_LENGTH(); ERROR 42000: Incorrect parameter count in the call to native function 'JSON_LENGTH' # MDEV-23187: Assorted assertion failures in json_find_path with certain collations +SET @old_collation_connection= @@COLLATION_CONNECTION; SET COLLATION_CONNECTION= ucs2_unicode_ci; SELECT JSON_VALUE('["foo"]', '$**[0]') AS f; f foo +SET @@COLLATION_CONNECTION= @old_collation_connection; # # End of 10.4 tests # diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index 9cfde5489e7..ef747efb79d 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -823,9 +823,13 @@ SELECT JSON_LENGTH(); --echo # MDEV-23187: Assorted assertion failures in json_find_path with certain collations +SET @old_collation_connection= @@COLLATION_CONNECTION; + SET COLLATION_CONNECTION= ucs2_unicode_ci; SELECT JSON_VALUE('["foo"]', '$**[0]') AS f; +SET @@COLLATION_CONNECTION= @old_collation_connection; + --echo # --echo # End of 10.4 tests --echo #