Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä 2018-10-10 10:36:51 +03:00
commit 2a955c7a83
39 changed files with 386 additions and 198 deletions

View File

@ -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}"

View File

@ -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))
{

View File

@ -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 <derived2> hash_ALL key0 #hash#key0 5 test.t1.a 100 Using join buffer (flat, BNLH join)
1 PRIMARY <derived2> 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 <derived2> 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;

View File

@ -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;

View File

@ -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 <derived2> 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;

View File

@ -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;

View File

@ -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 <derived2> hash_ALL key0 #hash#key0 25 test.t1.id # Using join buffer (flat, BNLH join)
1 PRIMARY <derived2> 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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -1,3 +1,4 @@
FLUSH TABLES;
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),

View File

@ -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

View File

@ -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<Aws::KMS::KMSErrors>& 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();

View File

@ -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++)
{

View File

@ -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)
{

View File

@ -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);
/*

View File

@ -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,

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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.

View File

@ -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

View File

@ -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) {

View File

@ -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);

View File

@ -487,14 +487,6 @@ rw_lock_x_lock_wait_func(
lock->count_os_wait += static_cast<uint32_t>(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<uint32_t>(count_os_wait);
rw_lock_stats.rw_x_os_wait_count.add(count_os_wait);
}
}
#ifdef UNIV_DEBUG

View File

@ -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)
{

View File

@ -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()

View File

@ -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;

View File

@ -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;

View File

@ -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")

View File

@ -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)