diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake index 672a3affc1d..4181f4cd01e 100644 --- a/cmake/submodules.cmake +++ b/cmake/submodules.cmake @@ -1,4 +1,10 @@ # update submodules automatically + +OPTION(UPDATE_SUBMODULES "Update submodules automatically" ON) +IF(NOT UPDATE_SUBMODULES) + RETURN() +ENDIF() + IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git") EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" config --get cmake.update-submodules WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index b8854edbfd0..2076f8cc999 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -735,7 +735,7 @@ inline_mysql_socket_send MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags) { ssize_t result; - + DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET); #ifdef HAVE_PSI_SOCKET_INTERFACE if (psi_likely(mysql_socket.m_psi != NULL)) { @@ -776,7 +776,7 @@ inline_mysql_socket_recv MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags) { ssize_t result; - + DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET); #ifdef HAVE_PSI_SOCKET_INTERFACE if (psi_likely(mysql_socket.m_psi != NULL)) { diff --git a/mysql-test/main/derived_opt.result b/mysql-test/main/derived_opt.result index 6e4ea1b5d36..48ac7e62653 100644 --- a/mysql-test/main/derived_opt.result +++ b/mysql-test/main/derived_opt.result @@ -499,9 +499,45 @@ where D1.a= t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where -1 PRIMARY hash_ALL key0 #hash#key0 5 test.t1.a 100 Using join buffer (flat, BNLH join) +1 PRIMARY ref key0 key0 5 test.t1.a 10 2 DERIVED t2 ALL NULL NULL NULL NULL 100 Using filesort set join_cache_level=@tmp_jcl; set optimizer_switch=@tmp_os; drop table t1, t2; +# +# Bug mdev-17382: equi-join of derived table with join_cache_level=4 +# +CREATE TABLE t1 ( +id int NOT NULL, +amount decimal DEFAULT NULL, +PRIMARY KEY (id) +); +CREATE TABLE t2 ( +id int NOT NULL, +name varchar(50) DEFAULT NULL, +PRIMARY KEY (id) +); +INSERT INTO t1 VALUES +(1, 10.0000), (2, 20.0000), (3, 30.0000), (4, 40.0000), +(5, NULL), (6, NULL), (7, 70.0000), (8, 80.0000); +INSERT INTO t2 VALUES +(1,'A'), (2,'B'), (3,'C'), (4,'D'), (5, NULL), (6, NULL), +(7,'E'), (8,'F'), (9,'G'), (10,'H'), (11, NULL), (12, NULL); +set @save_optimizer_switch= @@optimizer_switch; +set optimizer_switch='split_materialized=off'; +set join_cache_level=4; +EXPLAIN +SELECT t2.id,t2.name,t.total_amt +FROM t2 +LEFT JOIN +(SELECT id, sum(amount) total_amt FROM t1 GROUP BY id) AS t +ON t2.id=t.id +WHERE t2.id < 3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 3 Using index condition +1 PRIMARY ref key0 key0 5 test.t2.id 2 +2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort +set join_cache_level=default; +set optimizer_switch= @save_optimizer_switch; +DROP TABLE t1,t2; set optimizer_switch=@exit_optimizer_switch; diff --git a/mysql-test/main/derived_opt.test b/mysql-test/main/derived_opt.test index 7f19553e4e5..eccf4c13020 100644 --- a/mysql-test/main/derived_opt.test +++ b/mysql-test/main/derived_opt.test @@ -363,5 +363,48 @@ set join_cache_level=@tmp_jcl; set optimizer_switch=@tmp_os; drop table t1, t2; +--echo # +--echo # Bug mdev-17382: equi-join of derived table with join_cache_level=4 +--echo # + +CREATE TABLE t1 ( + id int NOT NULL, + amount decimal DEFAULT NULL, +PRIMARY KEY (id) +); + +CREATE TABLE t2 ( + id int NOT NULL, + name varchar(50) DEFAULT NULL, +PRIMARY KEY (id) +); + +INSERT INTO t1 VALUES +(1, 10.0000), (2, 20.0000), (3, 30.0000), (4, 40.0000), +(5, NULL), (6, NULL), (7, 70.0000), (8, 80.0000); + +INSERT INTO t2 VALUES +(1,'A'), (2,'B'), (3,'C'), (4,'D'), (5, NULL), (6, NULL), +(7,'E'), (8,'F'), (9,'G'), (10,'H'), (11, NULL), (12, NULL); + +set @save_optimizer_switch= @@optimizer_switch; +set optimizer_switch='split_materialized=off'; + +set join_cache_level=4; + +EXPLAIN +SELECT t2.id,t2.name,t.total_amt + FROM t2 + LEFT JOIN + (SELECT id, sum(amount) total_amt FROM t1 GROUP BY id) AS t + ON t2.id=t.id + WHERE t2.id < 3; + +set join_cache_level=default; + +set optimizer_switch= @save_optimizer_switch; + +DROP TABLE t1,t2; + # The following command must be the last one the file set optimizer_switch=@exit_optimizer_switch; diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index 7e4ba8e67eb..21dbd494e4b 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -58,3 +58,44 @@ WHERE t2.id2=t.id2; id3 1 DROP TABLE t1,t2,t3; +# +# Bug mdev-17381: equi-join of derived table with join_cache_level=4 +# +CREATE TABLE t1 ( +id int NOT NULL, +amount decimal DEFAULT NULL, +PRIMARY KEY (id) +) ENGINE=INNODB; +CREATE TABLE t2 ( +id int NOT NULL, +name varchar(50) DEFAULT NULL, +PRIMARY KEY (id) +) ENGINE=INNODB; +INSERT INTO t1 VALUES +(1, 10.0000), (2, 20.0000), (3, 30.0000), (4, 40.0000), +(5, NULL), (6, NULL), (7, 70.0000), (8, 80.0000); +INSERT INTO t2 VALUES +(1,'A'), (2,'B'), (3,'C'), (4,'D'), (5, NULL), (6, NULL), +(7,'E'), (8,'F'), (9,'G'), (10,'H'), (11, NULL), (12, NULL); +set join_cache_level=4; +SELECT t2.id,t2.name,t.total_amt +FROM t2 +LEFT JOIN +(SELECT id, sum(amount) total_amt FROM t1 GROUP BY id) AS t +ON t2.id=t.id +WHERE t2.id < 3; +id name total_amt +1 A 10 +2 B 20 +EXPLAIN SELECT t2.id,t2.name,t.total_amt +FROM t2 +LEFT JOIN +(SELECT id, sum(amount) total_amt FROM t1 GROUP BY id) AS t +ON t2.id=t.id +WHERE t2.id < 3; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 Using where +1 PRIMARY ref key0 key0 5 test.t2.id 2 +2 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1 +set join_cache_level=default; +DROP TABLE t1,t2; diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test index 5e5e3d5d723..c3b3bcabede 100644 --- a/mysql-test/main/derived_split_innodb.test +++ b/mysql-test/main/derived_split_innodb.test @@ -53,3 +53,44 @@ eval EXPLAIN $q; eval $q; DROP TABLE t1,t2,t3; + +--echo # +--echo # Bug mdev-17381: equi-join of derived table with join_cache_level=4 +--echo # + +CREATE TABLE t1 ( + id int NOT NULL, + amount decimal DEFAULT NULL, +PRIMARY KEY (id) +) ENGINE=INNODB; + +CREATE TABLE t2 ( + id int NOT NULL, + name varchar(50) DEFAULT NULL, +PRIMARY KEY (id) +) ENGINE=INNODB; + +INSERT INTO t1 VALUES +(1, 10.0000), (2, 20.0000), (3, 30.0000), (4, 40.0000), +(5, NULL), (6, NULL), (7, 70.0000), (8, 80.0000); + +INSERT INTO t2 VALUES +(1,'A'), (2,'B'), (3,'C'), (4,'D'), (5, NULL), (6, NULL), +(7,'E'), (8,'F'), (9,'G'), (10,'H'), (11, NULL), (12, NULL); + +set join_cache_level=4; + +let $q= +SELECT t2.id,t2.name,t.total_amt + FROM t2 + LEFT JOIN + (SELECT id, sum(amount) total_amt FROM t1 GROUP BY id) AS t + ON t2.id=t.id + WHERE t2.id < 3; + +eval $q; +eval EXPLAIN $q; + +set join_cache_level=default; + +DROP TABLE t1,t2; diff --git a/mysql-test/main/innodb_mrr_cpk.result b/mysql-test/main/innodb_mrr_cpk.result index 28d7dd51df8..a2e43d7d127 100644 --- a/mysql-test/main/innodb_mrr_cpk.result +++ b/mysql-test/main/innodb_mrr_cpk.result @@ -226,7 +226,7 @@ set join_cache_level=3; explain SELECT 1 FROM (SELECT url, id FROM t2 LIMIT 1 OFFSET 20) derived RIGHT JOIN t1 ON t1.id = derived.id; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL # -1 PRIMARY hash_ALL key0 #hash#key0 25 test.t1.id # Using join buffer (flat, BNLH join) +1 PRIMARY ref key0 key0 25 test.t1.id # 2 DERIVED t2 ALL NULL NULL NULL NULL # set join_cache_level= @tmp_mdev5037; drop table t0,t1,t2; diff --git a/mysql-test/suite/gcol/r/gcol_partition_innodb.result b/mysql-test/suite/gcol/r/gcol_partition_innodb.result index 9a0e676e76f..7600c9792f1 100644 --- a/mysql-test/suite/gcol/r/gcol_partition_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_partition_innodb.result @@ -1,4 +1,6 @@ SET @@session.default_storage_engine = 'InnoDB'; +SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; drop table if exists t1; # Case 1. Partitioning by RANGE based on a non-stored generated column. CREATE TABLE t1 ( @@ -86,6 +88,20 @@ CHECK TABLE t EXTENDED; Table Op Msg_type Msg_text test.t check status OK DROP TABLE t; +# +# MDEV-16980 Wrongly set tablename len while opening the +# table for purge thread +# +CREATE TABLE t1(pk SERIAL, d DATE, vd DATE AS (d) VIRTUAL, +PRIMARY KEY(pk), KEY (vd))ENGINE=InnoDB +PARTITION BY HASH(pk) PARTITIONS 2; +INSERT IGNORE INTO t1 (d) VALUES ('2015-04-14'); +SET sql_mode= ''; +REPLACE INTO t1 SELECT * FROM t1; +Warnings: +Warning 1906 The value specified for generated column 'vd' in table 't1' ignored +DROP TABLE t1; +InnoDB 0 transactions not purged DROP VIEW IF EXISTS v1,v2; DROP TABLE IF EXISTS t1,t2,t3; DROP PROCEDURE IF EXISTS p1; @@ -93,3 +109,4 @@ DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS trg1; DROP TRIGGER IF EXISTS trg2; set sql_warnings = 0; +SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; diff --git a/mysql-test/suite/gcol/t/gcol_partition_innodb.test b/mysql-test/suite/gcol/t/gcol_partition_innodb.test index 06e6ccc1ba4..75e2f80af20 100644 --- a/mysql-test/suite/gcol/t/gcol_partition_innodb.test +++ b/mysql-test/suite/gcol/t/gcol_partition_innodb.test @@ -30,6 +30,8 @@ # Set the session storage engine --source include/have_innodb.inc eval SET @@session.default_storage_engine = 'InnoDB'; +SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency; +SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; ##### Workarounds for known open engine specific bugs # none @@ -41,6 +43,24 @@ eval SET @@session.default_storage_engine = 'InnoDB'; #------------------------------------------------------------------------------# # Execute storage engine specific tests +--echo # +--echo # MDEV-16980 Wrongly set tablename len while opening the +--echo # table for purge thread +--echo # + +CREATE TABLE t1(pk SERIAL, d DATE, vd DATE AS (d) VIRTUAL, + PRIMARY KEY(pk), KEY (vd))ENGINE=InnoDB + PARTITION BY HASH(pk) PARTITIONS 2; + +INSERT IGNORE INTO t1 (d) VALUES ('2015-04-14'); +SET sql_mode= ''; +REPLACE INTO t1 SELECT * FROM t1; + +# Cleanup +DROP TABLE t1; + +--source suite/innodb/include/wait_all_purged.inc #------------------------------------------------------------------------------# # Cleanup --source suite/gcol/inc/gcol_cleanup.inc +SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency; diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result index 9b24fddf9ef..87c89834ec1 100644 --- a/mysql-test/suite/innodb/r/alter_kill.result +++ b/mysql-test/suite/innodb/r/alter_kill.result @@ -2,10 +2,12 @@ # Bug#16720368 INNODB CRASHES ON BROKEN #SQL*.IBD FILE AT STARTUP # SET GLOBAL innodb_file_per_table=1; +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB; connect con1,localhost,root; CREATE TABLE bug16720368 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; INSERT INTO bug16720368 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); +InnoDB 0 transactions not purged connection default; # Cleanly shutdown mysqld disconnect con1; diff --git a/mysql-test/suite/innodb/r/innodb-index,debug.rdiff b/mysql-test/suite/innodb/r/innodb-index,debug.rdiff new file mode 100644 index 00000000000..2740e440cd5 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-index,debug.rdiff @@ -0,0 +1,10 @@ +--- innodb-index.result ++++ innodb-index.reject +@@ -1851,6 +1851,7 @@ + # + # MDEV-15325 Incomplete validation of missing tablespace during recovery + # ++SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus'; + CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB; + CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB; + # Kill the server diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test index 922378d2919..8de9781c972 100644 --- a/mysql-test/suite/innodb/t/alter_kill.test +++ b/mysql-test/suite/innodb/t/alter_kill.test @@ -27,12 +27,14 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile -- echo # SET GLOBAL innodb_file_per_table=1; +SET GLOBAL innodb_purge_rseg_truncate_frequency=1; CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB; connect (con1,localhost,root); CREATE TABLE bug16720368 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; INSERT INTO bug16720368 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8); +--source include/wait_all_purged.inc connection default; @@ -127,13 +129,14 @@ INSERT INTO t1 VALUES(42); CREATE TABLE bug16735660 (a INT PRIMARY KEY) ENGINE=InnoDB; XA START 'x'; +--source ../include/no_checkpoint_start.inc INSERT INTO bug16735660 VALUES(1),(2),(3); XA END 'x'; XA PREPARE 'x'; +--connection default +--let CLEANUP_IF_CHECKPOINT=XA ROLLBACK 'x';DROP TABLE bug16735660; +--source ../include/no_checkpoint_end.inc --- connection default - --- source include/kill_mysqld.inc -- disconnect con1 -- move_file $MYSQLD_DATADIR/test/bug16735660.ibd $MYSQLD_DATADIR/bug16735660.omg diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index b34133a92e9..97014d84ca7 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -1,6 +1,7 @@ -- source include/have_innodb.inc # Embedded server tests do not support restarting. -- source include/not_embedded.inc +-- source include/maybe_debug.inc let $MYSQLD_DATADIR= `select @@datadir`; @@ -1084,6 +1085,9 @@ drop table t1; --echo # --source include/no_checkpoint_start.inc +if ($have_debug) { +SET GLOBAL DEBUG_DBUG='+d,fil_names_write_bogus'; +} CREATE TABLE t1(f1 INT PRIMARY KEY)ENGINE=InnoDB; CREATE TABLE t2(f1 INT PRIMARY KEY)ENGINE=InnoDB; diff --git a/mysql-test/suite/innodb_fts/r/crash_recovery.result b/mysql-test/suite/innodb_fts/r/crash_recovery.result index 7bf86631d1e..7d596684344 100644 --- a/mysql-test/suite/innodb_fts/r/crash_recovery.result +++ b/mysql-test/suite/innodb_fts/r/crash_recovery.result @@ -1,3 +1,4 @@ +FLUSH TABLES; CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), diff --git a/mysql-test/suite/innodb_fts/t/crash_recovery.test b/mysql-test/suite/innodb_fts/t/crash_recovery.test index 63843ef8511..f39d6680dfb 100644 --- a/mysql-test/suite/innodb_fts/t/crash_recovery.test +++ b/mysql-test/suite/innodb_fts/t/crash_recovery.test @@ -7,6 +7,7 @@ # The embedded server tests do not support restarting. --source include/not_embedded.inc +FLUSH TABLES; # Following are test for crash recovery on FTS index, the first scenario # is for bug Bug #14586855 INNODB: FAILING ASSERTION: (DICT_INDEX_GET_N_UNIQUE( # PLAN->INDEX) <= PLAN->N_EXAC diff --git a/plugin/aws_key_management/aws_key_management_plugin.cc b/plugin/aws_key_management/aws_key_management_plugin.cc index 8a7c6e2361e..00a2e5f8778 100644 --- a/plugin/aws_key_management/aws_key_management_plugin.cc +++ b/plugin/aws_key_management/aws_key_management_plugin.cc @@ -106,6 +106,14 @@ static std::mutex mtx; static Aws::KMS::KMSClient *client; +static void print_kms_error(const char *func, const Aws::Client::AWSError& err) +{ + my_printf_error(ER_UNKNOWN_ERROR, + "AWS KMS plugin : KMS Client API '%s' failed : %s - %s", + ME_ERROR_LOG_ONLY, + func, err.GetExceptionName().c_str(), err.GetMessage().c_str()); +} + #if WITH_AWS_MOCK /* Mock routines to test plugin without actual AWS KMS interaction @@ -127,7 +135,7 @@ static int mock_generate_encrypted_key(Aws::Utils::ByteBuffer *result) } -static int mock_decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* output, Aws::String *errmsg) +static int mock_decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* output) { /* We do not encrypt or decrypt in mock mode.*/ *output = input; @@ -401,14 +409,14 @@ static unsigned int get_latest_key_version_nolock(unsigned int key_id) } /* Decrypt Byte buffer with AWS. */ -static int aws_decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* output, Aws::String *errmsg) +static int aws_decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* output) { DecryptRequest request; request.SetCiphertextBlob(input); DecryptOutcome outcome = client->Decrypt(request); if (!outcome.IsSuccess()) { - *errmsg = outcome.GetError().GetMessage(); + print_kms_error("Decrypt", outcome.GetError()); return -1; } *output= outcome.GetResult().GetPlaintext(); @@ -416,13 +424,13 @@ static int aws_decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* out } -static int decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* output, Aws::String *errmsg) +static int decrypt(Aws::Utils::ByteBuffer input, Aws::Utils::ByteBuffer* output) { #if WITH_AWS_MOCK if(mock) - return mock_decrypt(input,output, errmsg); + return mock_decrypt(input,output); #endif - return aws_decrypt(input, output, errmsg); + return aws_decrypt(input, output); } /* @@ -452,12 +460,9 @@ static int read_and_decrypt_key(const char *path, KEY_INFO *info) Aws::Utils::ByteBuffer input((unsigned char *)contents.data(), pos); Aws::Utils::ByteBuffer plaintext; - Aws::String errmsg; - if (decrypt(input, &plaintext, &errmsg)) + if (decrypt(input, &plaintext)) { - my_printf_error(ER_UNKNOWN_ERROR, "AWS KMS plugin: Decrypt failed for %s : %s", ME_ERROR_LOG_ONLY, path, - errmsg.c_str()); return -1; } @@ -491,9 +496,7 @@ int aws_generate_encrypted_key(Aws::Utils::ByteBuffer *result) outcome= client->GenerateDataKeyWithoutPlaintext(request); if (!outcome.IsSuccess()) { - my_printf_error(ER_UNKNOWN_ERROR, "AWS KMS plugin : GenerateDataKeyWithoutPlaintext failed : %s - %s", ME_ERROR_LOG_ONLY, - outcome.GetError().GetExceptionName().c_str(), - outcome.GetError().GetMessage().c_str()); + print_kms_error("GenerateDataKeyWithoutPlaintext", outcome.GetError()); return(-1); } *result = outcome.GetResult().GetCiphertextBlob(); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d0727293c5f..6c82c580858 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -603,7 +603,7 @@ String *Item_func_concat::val_str(String *str) goto null; if (res != str) - str->copy(res->ptr(), res->length(), res->charset()); + str->copy_or_move(res->ptr(), res->length(), res->charset()); for (uint i= 1 ; i < arg_count ; i++) { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0e517b28018..76455177a6e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2847,10 +2847,6 @@ static bool cache_thread(THD *thd) _db_pop_(); #endif - /* Clear warnings. */ - if (!thd->get_stmt_da()->is_warning_info_empty()) - thd->get_stmt_da()->clear_warning_info(thd->query_id); - set_timespec(abstime, THREAD_CACHE_TIMEOUT); while (!abort_loop && ! wake_thread && ! kill_cached_threads) { diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 5b38420223e..bf18581de4f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -12285,7 +12285,7 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio, const char *client_auth_plugin= ((st_mysql_auth *) (plugin_decl(mpvio->plugin)->info))->client_auth_plugin; - DBUG_EXECUTE_IF("auth_disconnect", { vio_close(net->vio); DBUG_RETURN(1); }); + DBUG_EXECUTE_IF("auth_disconnect", { DBUG_RETURN(1); }); DBUG_ASSERT(client_auth_plugin); /* diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 7f64a45fac4..a4ecdfb1297 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1363,6 +1363,11 @@ void THD::change_user(void) cleanup_done= 0; reset_killed(); thd_clear_errors(this); + + /* Clear warnings. */ + if (!get_stmt_da()->is_warning_info_empty()) + get_stmt_da()->clear_warning_info(0); + init(); stmt_map.reset(); my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ebe841daf6f..09d31470a00 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -3214,7 +3214,7 @@ static void mysql_stmt_execute_common(THD *thd, sp_cache_enforce_limit(thd->sp_package_body_cache, stored_program_cache_size); /* Close connection socket; for use with client testing (Bug#43560). */ - DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_close(thd->net.vio);); + DBUG_EXECUTE_IF("close_conn_after_stmt_execute", vio_shutdown(thd->net.vio,SHUT_RD);); DBUG_VOID_RETURN; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 33c8f529aea..ec2a2b1df0e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11672,7 +11672,15 @@ uint check_join_cache_usage(JOIN_TAB *tab, effort now. */ if (tab->table->pos_in_table_list->is_materialized_derived()) + { no_bka_cache= true; + /* + Don't use hash join algorithm if the temporary table for the rows + of the derived table will be created with an equi-join key. + */ + if (tab->table->s->keys) + no_hashed_cache= true; + } /* Don't use join buffering if we're dictated not to by no_jbuf_after diff --git a/sql/sql_string.cc b/sql/sql_string.cc index e7acabe8bee..39d9438d5bf 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -237,9 +237,9 @@ bool String::copy(const String &str) bool String::copy(const char *str,size_t arg_length, CHARSET_INFO *cs) { + DBUG_ASSERT(arg_length < UINT_MAX32); if (alloc(arg_length)) return TRUE; - DBUG_ASSERT(arg_length < UINT_MAX32); if (Ptr == str && arg_length == uint32(str_length)) { /* @@ -256,6 +256,24 @@ bool String::copy(const char *str,size_t arg_length, CHARSET_INFO *cs) return FALSE; } +/* + Copy string, where strings may overlap. + Same as String::copy, but use memmove instead of memcpy to avoid warnings + from valgrind +*/ + +bool String::copy_or_move(const char *str,size_t arg_length, CHARSET_INFO *cs) +{ + DBUG_ASSERT(arg_length < UINT_MAX32); + if (alloc(arg_length)) + return TRUE; + if ((str_length=uint32(arg_length))) + memmove(Ptr,str,arg_length); + Ptr[arg_length]=0; + str_charset=cs; + return FALSE; +} + /* Checks that the source string can be just copied to the destination string @@ -389,8 +407,9 @@ bool String::set_or_copy_aligned(const char *str, size_t arg_length, /* How many bytes are in incomplete character */ size_t offset= (arg_length % cs->mbminlen); - if (!offset) /* All characters are complete, just copy */ + if (!offset) { + /* All characters are complete, just use given string */ set(str, arg_length, cs); return FALSE; } diff --git a/sql/sql_string.h b/sql/sql_string.h index d9d3f10777c..0ae68cb3796 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -437,6 +437,7 @@ public: bool copy(); // Alloc string if not alloced bool copy(const String &s); // Allocate new string bool copy(const char *s,size_t arg_length, CHARSET_INFO *cs); // Allocate new string + bool copy_or_move(const char *s,size_t arg_length, CHARSET_INFO *cs); static bool needs_conversion(size_t arg_length, CHARSET_INFO *cs_from, CHARSET_INFO *cs_to, uint32 *offset); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 03d0b212364..b1fe5cbf7ad 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -817,10 +817,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 58 shift/reduce conflicts. + Currently there are 52 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 58 +%expect 52 /* Comments for TOKENS. @@ -1582,6 +1582,16 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT /* A dummy token to force the priority of table_ref production in a join. */ %left TABLE_REF_PRIORITY + +/* + Give ESCAPE (in LIKE) a very low precedence. + This allows the concatenation operator || to be used on the right + side of "LIKE" with sql_mode=PIPES_AS_CONCAT (without ORACLE): + SELECT 'ab' LIKE 'a'||'b'||'c'; +*/ +%left PREC_BELOW_ESCAPE +%left ESCAPE_SYM + %left SET_VAR %left OR_SYM OR2_SYM %left XOR @@ -1591,7 +1601,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left NOT_SYM %left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE -%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM +%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE SOUNDS_SYM REGEXP IN_SYM %left '|' %left '&' %left SHIFT_LEFT SHIFT_RIGHT @@ -1623,6 +1633,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); SELECT system FROM t1; ALTER TABLE DROP SYSTEM VERSIONIONG; + - USER: identifier, user: + SELECT user FROM t1; + KILL USER foo; + Note, we need here only tokens that cause shirt/reduce conflicts with keyword identifiers. For example: opt_clause1: %empty | KEYWORD ... ; @@ -1661,7 +1675,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); and until NEXT_SYM / PREVIOUS_SYM. */ %left PREC_BELOW_IDENTIFIER_OPT_SPECIAL_CASE -%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM +%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM USER /* @@ -12114,7 +12128,7 @@ opt_escape: Lex->escape_used= TRUE; $$= $2; } - | /* empty */ + | /* empty */ %prec PREC_BELOW_ESCAPE { Lex->escape_used= FALSE; $$= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? @@ -15842,7 +15856,7 @@ keyword_sp_var_and_label: | UNDOFILE_SYM | UNKNOWN_SYM | UNTIL_SYM - | USER_SYM + | USER_SYM %prec PREC_BELOW_CONTRACTION_TOKEN2 | USE_FRM | VARIABLES | VERSIONING_SYM diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 71689535fdc..5a789ac6fec 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -296,10 +296,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %parse-param { THD *thd } %lex-param { THD *thd } /* - Currently there are 59 shift/reduce conflicts. + Currently there are 53 shift/reduce conflicts. We should not introduce new conflicts any more. */ -%expect 59 +%expect 53 /* Comments for TOKENS. @@ -1061,6 +1061,16 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left JOIN_SYM INNER_SYM STRAIGHT_JOIN CROSS LEFT RIGHT /* A dummy token to force the priority of table_ref production in a join. */ %left TABLE_REF_PRIORITY + +/* + Give ESCAPE (in LIKE) a very low precedence. + This allows the concatenation operator || to be used on the right + side of "LIKE" with sql_mode=PIPES_AS_CONCAT (without ORACLE): + SELECT 'ab' LIKE 'a'||'b'||'c'; +*/ +%left PREC_BELOW_ESCAPE +%left ESCAPE_SYM + %left SET_VAR %left OR_SYM OR2_SYM %left XOR @@ -1070,7 +1080,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); %left NOT_SYM %left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE -%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE REGEXP IN_SYM +%left '=' EQUAL_SYM GE '>' LE '<' NE IS LIKE SOUNDS_SYM REGEXP IN_SYM %left '|' %left '&' %left SHIFT_LEFT SHIFT_RIGHT @@ -1102,6 +1112,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); SELECT system FROM t1; ALTER TABLE DROP SYSTEM VERSIONIONG; + - USER: identifier, user: + SELECT user FROM t1; + KILL USER foo; + Note, we need here only tokens that cause shirt/reduce conflicts with keyword identifiers. For example: opt_clause1: %empty | KEYWORD ... ; @@ -1140,7 +1154,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); and until NEXT_SYM / PREVIOUS_SYM. */ %left PREC_BELOW_IDENTIFIER_OPT_SPECIAL_CASE -%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM +%left TRANSACTION_SYM TIMESTAMP PERIOD_SYM SYSTEM USER /* @@ -12326,7 +12340,7 @@ opt_escape: Lex->escape_used= TRUE; $$= $2; } - | /* empty */ + | /* empty */ %prec PREC_BELOW_ESCAPE { Lex->escape_used= FALSE; $$= ((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) ? @@ -16121,7 +16135,7 @@ keyword_sp_var_and_label: | UNDOFILE_SYM | UNKNOWN_SYM | UNTIL_SYM - | USER_SYM + | USER_SYM %prec PREC_BELOW_CONTRACTION_TOKEN2 | USE_FRM | VARIABLES | VIEW_SYM diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 9a08ff08425..d47307f91c1 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -128,7 +128,6 @@ IF(WIN32) OPTION(CONNECT_WITH_MSXML "Compile CONNECT storage engine with MSXML support" ON) IF(CONNECT_WITH_MSXML) add_definitions(-DMSX6 -DDOMDOC_SUPPORT) - message(STATUS "MSXML library version: msxml6") SET(MSXML_FOUND 1) SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h) ENDIF(CONNECT_WITH_MSXML) diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index e145422c5bd..03446b18a8a 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -2012,86 +2012,6 @@ dict_create_add_foreign_to_dictionary( DBUG_RETURN(error); } -/** Check whether a column is in an index by the column name -@param[in] col_name column name for the column to be checked -@param[in] index the index to be searched -@return true if this column is in the index, otherwise, false */ -static -bool -dict_index_has_col_by_name( -/*=======================*/ - const char* col_name, - const dict_index_t* index) -{ - for (ulint i = 0; i < index->n_fields; i++) { - dict_field_t* field = dict_index_get_nth_field(index, i); - - if (strcmp(field->name, col_name) == 0) { - return(true); - } - } - return(false); -} - -/** Check whether the foreign constraint could be on a column that is -part of a virtual index (index contains virtual column) in the table -@param[in] fk_col_name FK column name to be checked -@param[in] table the table -@return true if this column is indexed with other virtual columns */ -bool -dict_foreign_has_col_in_v_index( - const char* fk_col_name, - const dict_table_t* table) -{ - /* virtual column can't be Primary Key, so start with secondary index */ - for (dict_index_t* index = dict_table_get_next_index( - dict_table_get_first_index(table)); - index; - index = dict_table_get_next_index(index)) { - - if (dict_index_has_virtual(index)) { - if (dict_index_has_col_by_name(fk_col_name, index)) { - return(true); - } - } - } - - return(false); -} - - -/** Check whether the foreign constraint could be on a column that is -a base column of some indexed virtual columns. -@param[in] col_name column name for the column to be checked -@param[in] table the table -@return true if this column is a base column, otherwise, false */ -bool -dict_foreign_has_col_as_base_col( - const char* col_name, - const dict_table_t* table) -{ - /* Loop through each virtual column and check if its base column has - the same name as the column name being checked */ - for (ulint i = 0; i < table->n_v_cols; i++) { - dict_v_col_t* v_col = dict_table_get_nth_v_col(table, i); - - /* Only check if the virtual column is indexed */ - if (!v_col->m_col.ord_part) { - continue; - } - - for (ulint j = 0; j < v_col->num_base; j++) { - if (strcmp(col_name, dict_table_get_col_name( - table, - v_col->base_col[j]->ind)) == 0) { - return(true); - } - } - } - - return(false); -} - /** Check if a foreign constraint is on the given column name. @param[in] col_name column name to be searched for fk constraint @param[in] table table to which foreign key constraint belongs @@ -2166,43 +2086,6 @@ dict_foreigns_has_s_base_col( return(false); } -/** Check if a column is in foreign constraint with CASCADE properties or -SET NULL -@param[in] table table -@param[in] fk_col_name name for the column to be checked -@return true if the column is in foreign constraint, otherwise, false */ -bool -dict_foreigns_has_this_col( - const dict_table_t* table, - const char* col_name) -{ - dict_foreign_t* foreign; - const dict_foreign_set* local_fk_set = &table->foreign_set; - - for (dict_foreign_set::const_iterator it = local_fk_set->begin(); - it != local_fk_set->end(); - ++it) { - foreign = *it; - ut_ad(foreign->id != NULL); - ulint type = foreign->type; - - type &= ~(DICT_FOREIGN_ON_DELETE_NO_ACTION - | DICT_FOREIGN_ON_UPDATE_NO_ACTION); - - if (type == 0) { - continue; - } - - for (ulint i = 0; i < foreign->n_fields; i++) { - if (strcmp(foreign->foreign_col_names[i], - col_name) == 0) { - return(true); - } - } - } - return(false); -} - /** Adds the given set of foreign key objects to the dictionary tables in the database. This function does not modify the dictionary cache. The caller must ensure that all foreign key objects contain a valid constraint diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index fc897af4b6e..9e0fcc4ed4b 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -20368,6 +20368,7 @@ static bool table_name_parse( if (char *is_part = strchr(tbl_buf, '#')) { *is_part = '\0'; + tblnamelen = is_part - tbl_buf; } filename_to_tablename(tbl_buf, tblname, MAX_TABLE_NAME_LEN + 1, true); @@ -20485,13 +20486,12 @@ static TABLE* innodb_find_table_for_vc(THD* thd, dict_table_t* table) } /** Get the computed value by supplying the base column values. -@param[in,out] table table whose virtual column template to be built */ -void -innobase_init_vc_templ( - dict_table_t* table) +@param[in,out] table table whose virtual column + template to be built */ +TABLE* innobase_init_vc_templ(dict_table_t* table) { if (table->vc_templ != NULL) { - return; + return NULL; } table->vc_templ = UT_NEW_NOKEY(dict_vcol_templ_t()); @@ -20500,12 +20500,13 @@ innobase_init_vc_templ( ut_ad(mysql_table); if (!mysql_table) { - return; + return NULL; } mutex_enter(&dict_sys->mutex); innobase_build_v_templ(mysql_table, table, table->vc_templ, NULL, true); mutex_exit(&dict_sys->mutex); + return mysql_table; } /** Change dbname and table name in table->vc_templ. diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 96454995e74..cabca5699c4 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -944,10 +944,9 @@ innobase_get_computed_value( dict_foreign_t* foreign); /** Get the computed value by supplying the base column values. -@param[in,out] table the table whose virtual column template to be built */ -void -innobase_init_vc_templ( - dict_table_t* table); +@param[in,out] table the table whose virtual column + template to be built */ +TABLE* innobase_init_vc_templ(dict_table_t* table); /** Change dbname and table name in table->vc_templ. @param[in,out] table the table whose virtual column template diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index 5a42f9db206..07d44596ada 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -3400,6 +3400,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) then there is a possiblity that hash table will not contain all space ids redo logs. Rescan the remaining unstored redo logs for the validation of missing tablespace. */ + ut_ad(rescan || !missing_tablespace); + while (missing_tablespace) { DBUG_PRINT("ib_log", ("Rescan of redo log to validate " "the missing tablespace. Scan " @@ -3423,6 +3425,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) log_mutex_exit(); return err; } + + rescan = true; } if (srv_operation == SRV_OPERATION_NORMAL) { diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc index b02343fd952..527cf0336d5 100644 --- a/storage/innobase/row/row0purge.cc +++ b/storage/innobase/row/row0purge.cc @@ -375,6 +375,13 @@ retry_purge_sec: ut_ad(mtr.has_committed()); + /* If the virtual column info is not used then reset the virtual column + info. */ + if (node->vcol_info.is_requested() + && !node->vcol_info.is_used()) { + node->vcol_info.reset(); + } + if (store_cur && !row_purge_restore_vsec_cur( node, index, sec_pcur, sec_mtr, is_tree)) { return false; @@ -1100,8 +1107,10 @@ try_again: goto try_again; } - /* Initialize the template for the table */ - innobase_init_vc_templ(node->table); + node->vcol_info.set_requested(); + node->vcol_info.set_used(); + node->vcol_info.set_table(innobase_init_vc_templ(node->table)); + node->vcol_info.set_used(); } clust_index = dict_table_get_first_index(node->table); diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc index d5b0537c095..787d6d8501d 100644 --- a/storage/innobase/sync/sync0rw.cc +++ b/storage/innobase/sync/sync0rw.cc @@ -487,14 +487,6 @@ rw_lock_x_lock_wait_func( lock->count_os_wait += static_cast(count_os_wait); rw_lock_stats.rw_x_os_wait_count.add(count_os_wait); } - - rw_lock_stats.rw_x_spin_round_count.add(n_spins); - - if (count_os_wait > 0) { - lock->count_os_wait += - static_cast(count_os_wait); - rw_lock_stats.rw_x_os_wait_count.add(count_os_wait); - } } #ifdef UNIV_DEBUG diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 73c8c96682e..6ec83294c7a 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -933,8 +933,6 @@ err: @retval 1 Error */ -long my_counter= 0; - uint _ma_apply_redo_index(MARIA_HA *info, LSN lsn, const uchar *header, uint head_length) { diff --git a/storage/mroonga/CMakeLists.txt b/storage/mroonga/CMakeLists.txt index c21eaf70536..cd50e7e022c 100644 --- a/storage/mroonga/CMakeLists.txt +++ b/storage/mroonga/CMakeLists.txt @@ -65,7 +65,7 @@ set(MRN_BUNDLED_GROONGA_DIR if(EXISTS "${MRN_BUNDLED_GROONGA_DIR}") set(MRN_GROONGA_BUNDLED TRUE) if(MSVC) - message(STATUS "Bundled Mroonga does not support MSVC yet") + # Bundled Mroonga does not support MSVC yet return() endif() else() diff --git a/storage/rocksdb/mysql-test/rocksdb/r/issue255.result b/storage/rocksdb/mysql-test/rocksdb/r/issue255.result index c1d9ef4574c..d9b8f0e0851 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/issue255.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/issue255.result @@ -2,7 +2,7 @@ CREATE TABLE t1 (pk BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT); INSERT INTO t1 VALUES (5); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 1 # # # # # 6 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 6 NULL NULL NULL latin1_swedish_ci NULL 0 N INSERT INTO t1 VALUES ('538647864786478647864'); Warnings: Warning 1264 Out of range value for column 'pk' at row 1 @@ -21,7 +21,7 @@ pk 9223372036854775807 SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 2 # # # # # 9223372036854775807 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 9223372036854775807 NULL NULL NULL latin1_swedish_ci NULL 0 N INSERT INTO t1 VALUES (); ERROR 23000: Duplicate entry '9223372036854775807' for key 'PRIMARY' SELECT * FROM t1; @@ -30,13 +30,13 @@ pk 9223372036854775807 SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 2 # # # # # 9223372036854775807 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 9223372036854775807 NULL NULL NULL latin1_swedish_ci NULL 0 N DROP TABLE t1; CREATE TABLE t1 (pk TINYINT NOT NULL PRIMARY KEY AUTO_INCREMENT); INSERT INTO t1 VALUES (5); SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 1 # # # # # 6 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 6 NULL NULL NULL latin1_swedish_ci NULL 0 N INSERT INTO t1 VALUES (1000); Warnings: Warning 1264 Out of range value for column 'pk' at row 1 @@ -46,7 +46,7 @@ pk 127 SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 2 # # # # # 127 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 127 NULL NULL NULL latin1_swedish_ci NULL 0 N INSERT INTO t1 VALUES (); ERROR 23000: Duplicate entry '127' for key 'PRIMARY' SELECT * FROM t1; @@ -55,7 +55,7 @@ pk 127 SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 2 # # # # # 127 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 127 NULL NULL NULL latin1_swedish_ci NULL 0 N INSERT INTO t1 VALUES (); ERROR 23000: Duplicate entry '127' for key 'PRIMARY' SELECT * FROM t1; @@ -64,5 +64,5 @@ pk 127 SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary -t1 ROCKSDB # Fixed 2 # # # # # 127 NULL NULL NULL latin1_swedish_ci NULL 0 N +t1 ROCKSDB # Fixed # # # # # # 127 NULL NULL NULL latin1_swedish_ci NULL 0 N DROP TABLE t1; diff --git a/storage/rocksdb/mysql-test/rocksdb/t/issue255.test b/storage/rocksdb/mysql-test/rocksdb/t/issue255.test index 588b28fbee6..370dece0c6c 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/issue255.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/issue255.test @@ -3,24 +3,24 @@ CREATE TABLE t1 (pk BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT); INSERT INTO t1 VALUES (5); ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; INSERT INTO t1 VALUES ('538647864786478647864'); ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SELECT * FROM t1; SHOW TABLE STATUS LIKE 't1'; --error ER_DUP_ENTRY INSERT INTO t1 VALUES (); SELECT * FROM t1; ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; --error ER_DUP_ENTRY INSERT INTO t1 VALUES (); SELECT * FROM t1; ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; DROP TABLE t1; @@ -28,24 +28,24 @@ DROP TABLE t1; CREATE TABLE t1 (pk TINYINT NOT NULL PRIMARY KEY AUTO_INCREMENT); INSERT INTO t1 VALUES (5); ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; INSERT INTO t1 VALUES (1000); SELECT * FROM t1; ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; --error ER_DUP_ENTRY INSERT INTO t1 VALUES (); SELECT * FROM t1; ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; --error ER_DUP_ENTRY INSERT INTO t1 VALUES (); SELECT * FROM t1; ---replace_column 3 # 6 # 7 # 8 # 9 # 10 # +--replace_column 3 # 5 # 6 # 7 # 8 # 9 # 10 # SHOW TABLE STATUS LIKE 't1'; DROP TABLE t1; diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 4d0589f1e7d..86463c2997e 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -1,6 +1,9 @@ SET(TOKUDB_VERSION 5.6.41-84.1) # PerconaFT only supports x86-64 and cmake-2.8.9+ -IF(CMAKE_VERSION VERSION_LESS "2.8.9") +IF(WIN32) + # tokudb never worked there + RETURN() +ELSEIF(CMAKE_VERSION VERSION_LESS "2.8.9") MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB") ELSEIF(NOT HAVE_DLOPEN) MESSAGE(STATUS "dlopen is required by TokuDB") diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 0abeab8de1c..cbf3dad0965 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16425,6 +16425,7 @@ static void test_change_user() const char *db= "mysqltest_user_test_database"; int rc; MYSQL* conn; + MYSQL_RES* res; DBUG_ENTER("test_change_user"); myheader("test_change_user"); @@ -16561,6 +16562,20 @@ static void test_change_user() rc= mysql_change_user(conn, user_pw, pw, ""); myquery(rc); + /* MDEV-14581 : Check that there are no warnings after change user.*/ + rc = mysql_query(conn,"SIGNAL SQLSTATE '01000'"); + myquery(rc); + + rc = mysql_change_user(conn, user_pw, pw, ""); + myquery(rc); + + rc = mysql_query(conn, "SHOW WARNINGS"); + myquery(rc); + res = mysql_store_result(conn); + rc = my_process_result_set(res); + DIE_UNLESS(rc == 0); + mysql_free_result(res); + rc= mysql_change_user(conn, user_no_pw, pw, db); DIE_UNLESS(rc); if (! opt_silent)