Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

This commit is contained in:
Alexander Barkov 2017-11-29 12:06:48 +04:00
commit 5b697c5a23
1904 changed files with 172586 additions and 108845 deletions
VERSION
client
cmake
extra/mariabackup
libmariadb
mysql-test
scripts
sql
storage

View file

@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=11
MYSQL_VERSION_PATCH=12

View file

@ -2952,10 +2952,11 @@ int main(int argc, char** argv)
if (!argc || opt_version)
{
if (!argc)
usage();
if (!opt_version)
{
usage();
retval= ERROR_STOP;
}
goto err;
}

View file

@ -42,7 +42,8 @@ MACRO(CHECK_DTRACE)
# On FreeBSD, dtrace does not handle userland tracing yet
IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD"
AND NOT BUGGY_GCC_NO_DTRACE_MODULES
AND NOT BUGGY_LINUX_DTRACE)
AND NOT BUGGY_LINUX_DTRACE
AND NOT CMAKE_SYSTEM_NAME MATCHES "SunOS")
SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace")
ENDIF()
SET(HAVE_DTRACE ${ENABLE_DTRACE})

View file

@ -26,7 +26,7 @@ ENDIF()
OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ${with_wsrep_default})
# Set the patch version
SET(WSREP_PATCH_VERSION "20")
SET(WSREP_PATCH_VERSION "21")
# Obtain wsrep API version
FILE(STRINGS "${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h" WSREP_API_VERSION

View file

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <mysql_version.h>
#include <fcntl.h>
#include <stdarg.h>
#include <my_sys.h>
# define fil_is_user_tablespace_id(i) ((i) > srv_undo_tablespaces_open)

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <string.h>
#include <zlib.h>
#if __GNUC__ >= 4 && defined(__x86_64__)
#if defined(__GNUC__) && defined(__x86_64__)
static int pclmul_enabled = 0;
#endif

View file

@ -212,24 +212,7 @@ xb_fil_cur_open(
posix_fadvise(cursor->file, 0, 0, POSIX_FADV_SEQUENTIAL);
/* Determine the page size */
ulint flags = xb_get_space_flags(cursor->file);
if (flags == ULINT_UNDEFINED) {
xb_fil_cur_close(cursor);
return(XB_FIL_CUR_SKIP);
}
if (!fsp_flags_is_valid(flags, cursor->space_id)) {
ulint cflags = fsp_flags_convert_from_101(flags);
if (cflags == ULINT_UNDEFINED) {
msg("[%02u] mariabackup: Error: Invalid "
"tablespace flags: %x.\n", thread_n, uint(flags));
return(XB_FIL_CUR_SKIP);
}
flags = cflags;
}
const page_size_t page_size(flags);
const page_size_t page_size(cursor->node->space->flags);
cursor->page_size = page_size;
/* Allocate read buffer */

View file

@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include "write_filt.h"
#include "fil_cur.h"
#include "xtrabackup.h"
#include <os0proc.h>
/************************************************************************
Write-through page write filter. */
@ -67,19 +68,22 @@ wf_incremental_init(xb_write_filt_ctxt_t *ctxt, char *dst_name,
xb_fil_cur_t *cursor)
{
char meta_name[FN_REFLEN];
ulint buf_size;
xb_wf_incremental_ctxt_t *cp =
&(ctxt->u.wf_incremental_ctxt);
ctxt->cursor = cursor;
/* allocate buffer for incremental backup (4096 pages) */
buf_size = (cursor->page_size.physical() / 4 + 1)
* cursor->page_size.physical();
cp->delta_buf_base = static_cast<byte *>(malloc(buf_size));
memset(cp->delta_buf_base, 0, buf_size);
cp->delta_buf = static_cast<byte *>
(ut_align(cp->delta_buf_base, cursor->page_size.physical()));
cp->delta_buf_size = (cursor->page_size.physical() / 4)
* cursor->page_size.physical();
cp->delta_buf = (unsigned char *)os_mem_alloc_large(&cp->delta_buf_size);
if (!cp->delta_buf) {
msg("[%02u] mariabackup: Error: "
"cannot allocate %zu bytes\n",
cursor->thread_n, (size_t) cp->delta_buf_size);
return (FALSE);
}
/* write delta meta info */
snprintf(meta_name, sizeof(meta_name), "%s%s", dst_name,
@ -183,8 +187,7 @@ static void
wf_incremental_deinit(xb_write_filt_ctxt_t *ctxt)
{
xb_wf_incremental_ctxt_t *cp = &(ctxt->u.wf_incremental_ctxt);
free(cp->delta_buf_base);
os_mem_free_large(cp->delta_buf, cp->delta_buf_size);
}
/************************************************************************

View file

@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
/* Incremental page filter context */
typedef struct {
byte *delta_buf_base;
ulint delta_buf_size;
byte *delta_buf;
ulint npages;
} xb_wf_incremental_ctxt_t;

View file

@ -2137,28 +2137,6 @@ check_if_skip_table(
return(FALSE);
}
/** @return the tablespace flags from a given data file
@retval ULINT_UNDEFINED if the file is not readable */
ulint xb_get_space_flags(pfs_os_file_t file)
{
byte *buf;
byte *page;
ulint flags;
buf = static_cast<byte *>(malloc(2 * UNIV_PAGE_SIZE));
page = static_cast<byte *>(ut_align(buf, UNIV_PAGE_SIZE));
if (os_file_read(IORequestRead, file, page, 0, UNIV_PAGE_SIZE)) {
flags = fsp_header_get_flags(page);
} else {
flags = ULINT_UNDEFINED;
}
free(buf);
return(flags);
}
const char*
xb_get_copy_action(const char *dflt)
{
@ -4313,12 +4291,12 @@ xtrabackup_apply_delta(
page_size = info.page_size.physical();
page_size_shift = get_bit_shift(page_size);
msg("mariabackup: page size for %s is %lu bytes\n",
msg("mariabackup: page size for %s is %zu bytes\n",
src_path, page_size);
if (page_size_shift < 10 ||
page_size_shift > UNIV_PAGE_SIZE_SHIFT_MAX) {
msg("mariabackup: error: invalid value of page_size "
"(%lu bytes) read from %s\n", page_size, meta_path);
"(%zu bytes) read from %s\n", page_size, meta_path);
goto error;
}
@ -4420,10 +4398,29 @@ xtrabackup_apply_delta(
if (off == 0) {
/* Read tablespace size from page 0,
and extend the file to specified size.*/
os_offset_t n_pages = mach_read_from_4(buf + FSP_HEADER_OFFSET + FSP_SIZE);
success = os_file_set_size(dst_path, dst_file, n_pages*page_size);
if (!success)
goto error;
os_offset_t n_pages = mach_read_from_4(
buf + FSP_HEADER_OFFSET + FSP_SIZE);
if (mach_read_from_4(buf
+ FIL_PAGE_SPACE_ID)) {
if (!os_file_set_size(
dst_path, dst_file,
n_pages * page_size))
goto error;
} else if (fil_space_t* space
= fil_space_acquire(0)) {
/* The system tablespace can
consist of multiple files. The
first one has full tablespace
size in page 0, but only the last
file should be extended. */
fil_node_t* n = UT_LIST_GET_FIRST(
space->chain);
bool fail = !strcmp(n->name, dst_path)
&& !fil_space_extend(
space, (ulint)n_pages);
fil_space_release(space);
if (fail) goto error;
}
}
success = os_file_write(IORequestWrite,

View file

@ -149,10 +149,6 @@ void xtrabackup_io_throttling(void);
my_bool xb_write_delta_metadata(const char *filename,
const xb_delta_info_t *info);
/** @return the tablespace flags from a given data file
@retval ULINT_UNDEFINED if the file is not readable */
ulint xb_get_space_flags(pfs_os_file_t file);
/************************************************************************
Checks if a table specified as a name in the form "database/name" (InnoDB 5.6)
or "./database/name.ibd" (InnoDB 5.5-) should be skipped from backup based on

@ -1 +1 @@
Subproject commit 9b7b25993f0f0c3e2c6502d94792f68fba2284b1
Subproject commit 63f841f78f520d7f3bcff1fe8cecec9d8c47829d

View file

@ -2,8 +2,3 @@
# suite.pm will make sure that all tests including this file
# will be skipped unless this is a debug build.
#
# The test below is redundant
if (`select version() not like '%debug%'`) {
--skip Needs a debug build
}

View file

@ -1,14 +1,4 @@
#
# Check if server has support for loading plugins
# suite.pm will make sure that all tests including this file
# will be skipped unless dynamic ha_example plugin is available
#
if (`SELECT @@have_dynamic_loading != 'YES'`) {
--skip Example plugin requires dynamic loading
}
#
# Check if the variable EXAMPLE_PLUGIN is set
#
if (!$HA_EXAMPLE_SO) {
--skip Need example plugin
}

View file

@ -2,9 +2,3 @@
# suite.pm will make sure that all tests including this file
# will be skipped unless innodb or xtradb is enabled
#
# The test below is redundant
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb' AND support IN ('YES', 'DEFAULT', 'ENABLED')`)
{
--skip Test requires InnoDB.
}

View file

@ -2,10 +2,3 @@
# suite.pm will make sure that all tests including this file
# will be skipped unless xtradb is enabled
#
# The test below is redundant
if (!`SELECT count(*) FROM information_schema.plugins WHERE
plugin_name = 'innodb' AND plugin_status = 'active' AND
plugin_description LIKE '%xtradb%'`){
skip Needs XtraDB engine;
}

View file

@ -2,9 +2,3 @@
# suite.pm will make sure that all tests including this file
# will be skipped unless this is an embedded test run
#
# The test below is redundant
if (`select version() like '%embedded%'`) {
This should never happen;
}

View file

@ -1,4 +1,4 @@
--require r/not_windows.require
disable_query_log;
select convert(@@version_compile_os using latin1) NOT IN ("Win32","Win64","Windows") as "TRUE";
enable_query_log;
#
# suite.pm will make sure that all tests including this file
# will be skipped unless this is on Windows
#

View file

@ -0,0 +1,15 @@
# ==== Purpose ====
#
# Extract Gtid_list info from SHOW BINLOG EVENTS output masking
# non-deterministic fields.
#
# ==== Usage ====
#
# [--let $binlog_file=filename
#
if ($binlog_file)
{
--let $_in_binlog_file=in '$binlog_file'
}
--replace_column 2 # 5 #
--eval show binlog events $_in_binlog_file limit 1,1

View file

@ -2804,7 +2804,7 @@ sub mysql_server_start($) {
# Some InnoDB options are incompatible with the default bootstrap.
# If they are used, re-bootstrap
if ( $extra_opts and
"@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)/ )
"@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)|data[-_]file[-_]path/ )
{
mysql_install_db($mysqld, undef, $extra_opts);
}

View file

@ -63,3 +63,61 @@ connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
#
# MDEV-13453: privileges checking for CTE
#
create database db;
use db;
create table t1 (i int);
insert into t1
values (3), (7), (1), (4), (2), (3), (1);
create table t2 (a int, b int);
insert into t2
values (3,10), (7,11), (1,17), (4,15), (2,11), (3,10), (1,15);
create user foo@localhost;
grant SELECT on db.t1 to foo@localhost;
grant SELECT(a) on db.t2 to foo@localhost;
connect con1,localhost,foo,,;
use db;
with cte as (select * from t1 where i < 4)
select * from cte;
i
3
1
2
3
1
with cte as (select * from t1 where i < 4 group by i)
select * from cte;
i
1
2
3
with cte as (select * from t1 where i < 4)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
i
1
3
with cte as (select * from t1 where i < 4 group by i)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
i
1
3
with cte as (select b from t2 where a < 4)
select * from cte cte1 where b < 15 union select * from cte cte2 where b > 15;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'b' in table 't2'
with cte as (select a from t2 where a < 4)
select * from cte cte1 where a < 2 union select * from cte cte2 where a > 2;
a
1
3
connection default;
revoke SELECT on db.t1 from foo@localhost;
connection con1;
with cte as (select * from t1 where i < 4)
select * from cte;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
disconnect con1;
connection default;
drop database db;
drop user foo@localhost;

View file

@ -1147,61 +1147,3 @@ SELECT * FROM cte_test;
a
1
DROP VIEW cte_test;
#
# MDEV-13453: privileges checking for CTE
#
create database db;
use db;
create table t1 (i int);
insert into t1
values (3), (7), (1), (4), (2), (3), (1);
create table t2 (a int, b int);
insert into t2
values (3,10), (7,11), (1,17), (4,15), (2,11), (3,10), (1,15);
create user foo@localhost;
grant SELECT on db.t1 to foo@localhost;
grant SELECT(a) on db.t2 to foo@localhost;
connect con1,localhost,foo,,;
use db;
with cte as (select * from t1 where i < 4)
select * from cte;
i
3
1
2
3
1
with cte as (select * from t1 where i < 4 group by i)
select * from cte;
i
1
2
3
with cte as (select * from t1 where i < 4)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
i
1
3
with cte as (select * from t1 where i < 4 group by i)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
i
1
3
with cte as (select b from t2 where a < 4)
select * from cte cte1 where b < 15 union select * from cte cte2 where b > 15;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'b' in table 't2'
with cte as (select a from t2 where a < 4)
select * from cte cte1 where a < 2 union select * from cte cte2 where a > 2;
a
1
3
connection default;
revoke SELECT on db.t1 from foo@localhost;
connection con1;
with cte as (select * from t1 where i < 4)
select * from cte;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
disconnect con1;
connection default;
drop database db;
drop user foo@localhost;

View file

@ -1258,3 +1258,4 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
mysqlbinlog Ver VER for OS at ARCH

View file

@ -1,2 +0,0 @@
TRUE
1

View file

@ -8116,6 +8116,18 @@ CALL p();
drop procedure p;
drop view v;
drop table t, tmp_t;
#
# MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
#
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(i) FROM v1 );
REPLACE INTO v1 VALUES (f1());
ERROR HY000: The target table v1 of the INSERT is not insertable-into
SET @aux = f1();
DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1;
#End of 10.1 tests
#
# MDEV-11081: CURSOR for query with GROUP BY

View file

@ -2329,6 +2329,23 @@ DROP TRIGGER t1_bi;
DROP TABLE t1;
SET TIMESTAMP=DEFAULT;
set time_zone= @@global.time_zone;
#
# MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
#
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
create trigger trg after insert on t2 for each row
INSERT INTO t3 SELECT MAX(i) FROM v1 UNION SELECT MAX(i) FROM v1;
drop table t1;
insert into t2 value (2);
ERROR 42S02: Table 'test.t1' doesn't exist
CREATE TABLE t1 (i INT);
insert into t2 value (2);
DROP VIEW v1;
DROP TABLE t1,t2,t3;
End of 10.1 tests.
create table t1 (i int);
create trigger tr1 after insert on t1 for each row set @a=@a+1;
create trigger tr2 after insert on t1 for each row set @a=@a+1;

View file

@ -0,0 +1,78 @@
RESET MASTER;
FLUSH BINARY LOGS DELETE_DOMAIN_ID = ();
and the command execution is effective thence rotates binlog as usual
show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
Non-existed domain is warned, the command completes without rotation
but with a warning
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
Warnings:
Warning 1076 The gtid domain being deleted ('99') is not in the current binlog state
show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
SET @@SESSION.gtid_domain_id=1;
SET @@SESSION.server_id=1;
CREATE TABLE t (a int);
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
FLUSH BINARY LOGS;
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
PURGE BINARY LOGS TO 'master-bin.000003';;
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
Gtid_list of the current binlog does not contain '1':
show binlog events in 'master-bin.000004' limit 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000004 # Gtid_list 1 # []
But the previous log's Gtid_list may have it which explains a warning from the following command
show binlog events in 'master-bin.000003' limit 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000003 # Gtid_list 1 # [1-1-1]
Already deleted domain in Gtid_list of the earliest log is benign
but may cause a warning
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
Warnings:
Warning 1076 The current gtid binlog state is incompatible with a former one missing gtids from the '1-1' domain-server pair which is referred to in the gtid list describing an earlier state. Ignore if the domain ('1') was already explicitly deleted.
Warning 1076 The gtid domain being deleted ('1') is not in the current binlog state
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0);
ERROR HY000: Could not delete gtid domain. Reason: binlog files may contain gtids from the domain ('1') being deleted. Make sure to first purge those files.
FLUSH BINARY LOGS;
PURGE BINARY LOGS TO 'master-bin.000005';
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0);
Warnings:
Warning 1076 The gtid domain being deleted ('0') is not in the current binlog state
Gtid_list of the current binlog does not contain 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 0:
show binlog events in 'master-bin.000006' limit 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000006 # Gtid_list 1 # []
SET @@SESSION.gtid_domain_id=1;;
SET @@SESSION.server_id=1;
SET @@SESSION.gtid_seq_no=1;
INSERT INTO t SET a=1;
SET @@SESSION.server_id=2;
SET @@SESSION.gtid_seq_no=2;
INSERT INTO t SET a=2;
SET @@SESSION.gtid_domain_id=11;
SET @@SESSION.server_id=11;
SET @@SESSION.gtid_seq_no=11;
INSERT INTO t SET a=11;
SET @gtid_binlog_state_saved=@@GLOBAL.gtid_binlog_state;
FLUSH BINARY LOGS;
SET @@SESSION.gtid_domain_id=11;
SET @@SESSION.server_id=11;
SET @@SESSION.gtid_seq_no=1;
INSERT INTO t SET a=1;
SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state as "out of order for 11 domain state";
as original state out of order for 11 domain state
1-1-1,1-2-2,11-11-11 1-1-1,1-2-2,11-11-1
PURGE BINARY LOGS TO 'master-bin.000007';
the following command succeeds with warnings
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
Warnings:
Warning 1076 The current gtid binlog state is incompatible with a former one having a gtid '11-11-1' which is less than the '11-11-11' of the gtid list describing an earlier state. The state may have been affected by manually injecting a lower sequence number gtid or via replication.
DROP TABLE t;
RESET MASTER;

View file

@ -0,0 +1,6 @@
SET @@SESSION.debug_dbug='+d,inject_binlog_delete_domain_init_error';
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
ERROR HY000: Could not delete gtid domain. Reason: injected error.
SHOW WARNINGS;
Level Code Message
Error 1076 Could not delete gtid domain. Reason: injected error.

View file

@ -0,0 +1,137 @@
# Prove basic properties of
#
# FLUSH BINARY LOGS DELETE_DOMAIN_ID = (...)
#
# The command removes the supplied list of domains from the current
# @@global.gtid_binlog_state provided the binlog files do not contain
# events from such domains.
# The test is not format specific. One format is chosen to run it.
--source include/have_binlog_format_mixed.inc
# Reset binlog state
RESET MASTER;
# Empty list is accepted
FLUSH BINARY LOGS DELETE_DOMAIN_ID = ();
--echo and the command execution is effective thence rotates binlog as usual
--source include/show_binary_logs.inc
--echo Non-existed domain is warned, the command completes without rotation
--echo but with a warning
--let $binlog_pre_flush=query_get_value(SHOW MASTER STATUS, Position, 1)
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
--let $binlog_start=$binlog_pre_flush
--source include/show_binary_logs.inc
# Log one event in a specified domain and try to delete the domain
SET @@SESSION.gtid_domain_id=1;
SET @@SESSION.server_id=1;
CREATE TABLE t (a int);
--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
# the same error after log rotation
FLUSH BINARY LOGS;
--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
# the latest binlog does not really contain any events incl ones from 1-domain
--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
--eval PURGE BINARY LOGS TO '$purge_to_binlog';
# So now it's safe to delete
--error 0
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
--echo Gtid_list of the current binlog does not contain '1':
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
--source include/show_gtid_list.inc
--echo But the previous log's Gtid_list may have it which explains a warning from the following command
--let $binlog_file=$purge_to_binlog
--source include/show_gtid_list.inc
--echo Already deleted domain in Gtid_list of the earliest log is benign
--echo but may cause a warning
--error 0
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (1);
# Few domains delete. The chosen number verifies among others how
# expected overrun of the static buffers of underlying dynamic arrays is doing.
--let $domain_cnt=17
--let $server_in_domain_cnt=3
--let $domain_list=
--disable_query_log
while ($domain_cnt)
{
--let servers=$server_in_domain_cnt
--eval SET @@SESSION.gtid_domain_id=$domain_cnt
while ($servers)
{
--eval SET @@SESSION.server_id=10*$domain_cnt + $servers
--eval INSERT INTO t SET a=@@SESSION.server_id
--dec $servers
}
--let $domain_list= $domain_cnt, $domain_list
--dec $domain_cnt
}
--enable_query_log
--let $zero=0
--let $domain_list= $domain_list$zero
--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($domain_list)
# Now satisfy the safety condtion to purge log files containing $domain list
FLUSH BINARY LOGS;
--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
--eval PURGE BINARY LOGS TO '$purge_to_binlog'
--error 0
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($domain_list)
--echo Gtid_list of the current binlog does not contain $domain_list:
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
--source include/show_gtid_list.inc
# Show reaction on @@global.gtid_binlog_state not succeeding
# earlier state as described by the 1st binlog' Gtid_list.
# Now let it be out-order gtid logged to a domain unrelated to deletion.
--let $del_d_id=1
--eval SET @@SESSION.gtid_domain_id=$del_d_id;
SET @@SESSION.server_id=1;
SET @@SESSION.gtid_seq_no=1;
INSERT INTO t SET a=1;
SET @@SESSION.server_id=2;
SET @@SESSION.gtid_seq_no=2;
INSERT INTO t SET a=2;
SET @@SESSION.gtid_domain_id=11;
SET @@SESSION.server_id=11;
SET @@SESSION.gtid_seq_no=11;
INSERT INTO t SET a=11;
SET @gtid_binlog_state_saved=@@GLOBAL.gtid_binlog_state;
FLUSH BINARY LOGS;
# Inject out of order for domain '11' before
SET @@SESSION.gtid_domain_id=11;
SET @@SESSION.server_id=11;
SET @@SESSION.gtid_seq_no=1;
INSERT INTO t SET a=1;
SELECT @gtid_binlog_state_saved "as original state", @@GLOBAL.gtid_binlog_state as "out of order for 11 domain state";
# to delete '1', first to purge logs containing its events
--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
--eval PURGE BINARY LOGS TO '$purge_to_binlog'
--echo the following command succeeds with warnings
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID = ($del_d_id)
#
# Cleanup
#
DROP TABLE t;
RESET MASTER;

View file

@ -0,0 +1,11 @@
# Check "internal" error branches of
# FLUSH BINARY LOGS DELETE_DOMAIN_ID = (...)
# handler.
--source include/have_debug.inc
--source include/have_binlog_format_mixed.inc
SET @@SESSION.debug_dbug='+d,inject_binlog_delete_domain_init_error';
--error ER_BINLOG_CANT_DELETE_GTID_DOMAIN
FLUSH BINARY LOGS DELETE_DOMAIN_ID = (99);
SHOW WARNINGS;

View file

@ -0,0 +1,46 @@
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB;
CREATE PROCEDURE insert_proc ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
GET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;
END;
INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
INSERT INTO t1 VALUES (3, 'node 1');
END|
SET GLOBAL wsrep_slave_threads = 2;
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
INSERT INTO t1 VALUES (1, 'node 2');;
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
SET SESSION wsrep_sync_wait = 0;
SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
CALL insert_proc ();;
SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
SELECT @errno = 1213;
@errno = 1213
1
SELECT * FROM t1;
f1 f2
1 node 2
3 node 1
SELECT * FROM t1;
f1 f2
1 node 2
3 node 1
SET GLOBAL wsrep_slave_threads = DEFAULT;
DROP TABLE t1;
DROP PROCEDURE insert_proc;
SET GLOBAL debug = NULL;
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET debug_sync='RESET';
SELECT @@debug_sync;
@@debug_sync
ON - current signal: ''

View file

@ -7,6 +7,7 @@ INSERT INTO t1 VALUES (1);
# Disable binary logging for current session
SET SQL_LOG_BIN=OFF;
INSERT INTO t1 VALUES (2);
FLUSH BINARY LOGS;
CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t2 VALUES (1);
CREATE TABLE test.t3 AS SELECT * from t1;

View file

@ -0,0 +1,76 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(255)) Engine=InnoDB;
DELIMITER |;
CREATE PROCEDURE insert_proc ()
BEGIN
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
GET DIAGNOSTICS CONDITION 1 @errno = MYSQL_ERRNO;
END;
INSERT INTO t1 VALUES (1, 'node 1'),(2, 'node 1');
INSERT INTO t1 VALUES (3, 'node 1');
END|
DELIMITER ;|
# We need two slave threads here to guarantee progress.
# If we use only one thread the following could happen
# in node_1:
# We block the only slave thread in wsrep_apply_cb and we
# issue an INSERT (by calling the stored procedure) that will
# try to acquire galera's local monitor in pre_commit().
# This usually works fine, except for when a commit cut event
# sneaks in the slave queue and gets a local seqno smaller than
# that of the INSERT. Because there is only one slave thread,
# commit cut is not processed and therefore does not advance
# local monitor, and our INSERT remains stuck there.
SET GLOBAL wsrep_slave_threads = 2;
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
--connection node_2
--send INSERT INTO t1 VALUES (1, 'node 2');
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
--connection node_1a
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
--connection node_1
SET SESSION wsrep_sync_wait = 0;
SET SESSION DEBUG_SYNC = 'wsrep_after_replication SIGNAL wsrep_after_replication_reached WAIT_FOR wsrep_after_replication_continue';
--send CALL insert_proc ();
--connection node_1a
SET SESSION DEBUG_SYNC = "now WAIT_FOR wsrep_after_replication_reached";
SET GLOBAL DEBUG = "";
SET DEBUG_SYNC = "now SIGNAL wsrep_after_replication_continue";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
--connection node_2
--reap
--connection node_1
# We expect no errors here, because the handler in insert_proc() caught the deadlock error
--reap
SELECT @errno = 1213;
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1
SET GLOBAL wsrep_slave_threads = DEFAULT;
DROP TABLE t1;
DROP PROCEDURE insert_proc;
SET GLOBAL debug = NULL;
SET debug_sync='RESET';
# Make sure no pending signals are leftover to surprise subsequent tests.
SELECT @@debug_sync;

View file

@ -29,12 +29,11 @@ SELECT * FROM t1;
UNLOCK TABLES;
SHOW TABLES;
SELECT COUNT(*) = 1 FROM t1;
--disable_query_log
--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig";
--enable_query_log
DROP TABLE t1;
SHOW TABLES;
SELECT COUNT(*) = 1 FROM t1;
DROP TABLE t1;

View file

@ -25,7 +25,7 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
my $pid_filename = $ENV{'NODE_2_PIDFILE'};
my $mysqld_pid = `cat $pid_filename`;
chomp($mysqld_pid);
system("kill -19 $mysqld_pid");
system("kill -SIGSTOP $mysqld_pid");
exit(0);
EOF
@ -37,7 +37,7 @@ INSERT INTO t1 VALUES (1);
my $pid_filename = $ENV{'NODE_2_PIDFILE'};
my $mysqld_pid = `cat $pid_filename`;
chomp($mysqld_pid);
system("kill -18 $mysqld_pid");
system("kill -SIGCONT $mysqld_pid");
exit(0);
EOF

View file

@ -1,5 +1,13 @@
# Test to check the behavior of galera cluster with sql_log_bin=ON|OFF & binary
# logging is disabled. sql_bin_log should not affect galera replication.
#
# The following bugfixes are tested:
#
# MDEV-9510: Segmentation fault in binlog thread.
# A scenario otherwise causing a similar segfault is replayed.
# The test must pass having no crashes.
# The sequence of sql statements is provided by original
# sql_log_bin.test augmented with a FLUSH BINLOG LOGS, below.
--source include/galera_cluster.inc
--source include/have_innodb.inc
@ -15,6 +23,10 @@ INSERT INTO t1 VALUES (1);
--echo # Disable binary logging for current session
SET SQL_LOG_BIN=OFF;
INSERT INTO t1 VALUES (2);
# MDEV-9510: the following binlog rotation due to FLUSH segfaults wo/ the fixes
FLUSH BINARY LOGS;
CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t2 VALUES (1);
CREATE TABLE test.t3 AS SELECT * from t1;

View file

@ -0,0 +1,13 @@
#
# Bug#17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX
#
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34);
select * from t1;
f1 f2 f3
14 25 34
drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout';

View file

@ -0,0 +1,54 @@
#
# Test that INFORMATION_SCHEMA.TABLES.UPDATE_TIME is filled
# correctly for InnoDB tables.
#
CREATE TABLE t (a INT) ENGINE=INNODB;
SELECT update_time FROM information_schema.tables WHERE table_name = 't';
update_time
NULL
INSERT INTO t VALUES (1);
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND update_time IS NOT NULL;
COUNT(*)
1
# We cant deterministically check that the saved value is correct, but
# at least we check that it is a timestamp not older than 2 minutes.
# Usually update_time and NOW() are equal below, but on heavily loaded
# machines NOW() could be younger.
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND TIMESTAMPDIFF(SECOND, update_time, NOW()) < 120;
COUNT(*)
1
CREATE TEMPORARY TABLE big (a TEXT) ENGINE=INNODB;
SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
COUNT(*)
1
# INSERT lots of data in table 'big': begin
# INSERT lots of data in table 'big': end
SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
COUNT(*)
0
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND update_time IS NOT NULL;
COUNT(*)
1
DROP TEMPORARY TABLE big;
# Test the behavior after restart with a prepared XA transaction
XA START 'xatrx';
INSERT INTO t VALUES (5);
XA END 'xatrx';
XA PREPARE 'xatrx';
CONNECT con1,localhost,root,,;
call mtr.add_suppression("Found 1 prepared XA transactions");
FLUSH TABLES;
# Kill and restart
SELECT update_time FROM information_schema.tables WHERE table_name = 't';
update_time
NULL
XA COMMIT 'xatrx';
SELECT COUNT(update_time) FROM information_schema.tables WHERE table_name='t';
COUNT(update_time)
1
DROP TABLE t;

View file

@ -0,0 +1,228 @@
CREATE TABLE tab1(c1 int,c2 varchar(30), c3 BLOB) ENGINE=InnoDB;
CREATE TABLE tab1u LIKE tab1;
CREATE TABLE tab1d LIKE tab1;
CREATE TABLE tab1i LIKE tab1;
CREATE TABLE tab3(c1 int,c2 varchar(30)) ENGINE=InnoDB;
CREATE TABLE tab4(c1 int,c2 varchar(30)) ENGINE=InnoDB;
CREATE TABLE tab5(c1 int,c2 varchar(30)) ENGINE=InnoDB;
INSERT INTO tab1u VALUES(1,'Testing the wl6658','Testing the wl6658');
INSERT INTO tab1d VALUES(1,'Updated','Updated');
INSERT INTO tab4 VALUES(1,'Test for Update');
INSERT INTO tab5 VALUES(1,'Test for Delete');
CREATE TRIGGER test_trig BEFORE INSERT ON tab1
FOR EACH ROW BEGIN
INSERT INTO tab3 VALUES(1,'Inserted From Trigger');
UPDATE tab4 SET c2='Updated from Trigger' WHERE c1=1;
DELETE FROM tab5;
END |
CREATE TABLE tab2(
id INT NOT NULL,
store_name VARCHAR(30),
parts VARCHAR(30),
store_id INT
) ENGINE=InnoDB
PARTITION BY LIST(store_id) (
PARTITION pNorth VALUES IN (10,20,30),
PARTITION pEast VALUES IN (40,50,60),
PARTITION pWest VALUES IN (70,80,100)
);
SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
update_time
NULL
CREATE PROCEDURE proc_wl6658()
BEGIN
INSERT INTO tab2 VALUES(1,'ORACLE','NUTT',10);
INSERT INTO tab2 VALUES(2,'HUAWEI','BOLT',40);
COMMIT;
END |
CALL proc_wl6658;
SELECT * FROM tab2 ORDER BY id,store_id;
id store_name parts store_id
1 ORACLE NUTT 10
2 HUAWEI BOLT 40
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab2';
COUNT(update_time)
1
TRUNCATE TABLE tab2;
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab2';
COUNT(update_time)
1
CREATE TABLE tab7(c1 INT NOT NULL, PRIMARY KEY (c1)) ENGINE=INNODB;
CREATE TABLE tab8(c1 INT PRIMARY KEY,c2 INT,
FOREIGN KEY (c2) REFERENCES tab7(c1) ON DELETE CASCADE )
ENGINE=INNODB;
SELECT table_name,update_time
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
table_name update_time
tab7 NULL
tab8 NULL
INSERT INTO tab7 VALUES(1);
INSERT INTO tab8 VALUES(1,1);
SELECT table_name,COUNT(update_time)
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
table_name COUNT(update_time)
tab7 1
tab8 1
#restart the server
SELECT table_name,update_time
FROM information_schema.tables
WHERE table_name IN ('tab1','tab2','tab3','tab4','tab5','tab7','tab8')
ORDER BY table_name;
table_name update_time
tab1 NULL
tab2 NULL
tab3 NULL
tab4 NULL
tab5 NULL
tab7 NULL
tab8 NULL
#case1:
BEGIN WORK;
INSERT INTO tab1
VALUES(1,'Testing the wl6658', 'Testing the wl6658');
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1';
update_time
NULL
COMMIT;
SELECT * FROM tab1;
c1 c2 c3
1 Testing the wl6658 Testing the wl6658
SELECT * FROM tab3;
c1 c2
1 Inserted From Trigger
SELECT * FROM tab4;
c1 c2
1 Updated from Trigger
SELECT * FROM tab5;
c1 c2
SELECT table_name,COUNT(update_time)
FROM information_schema.tables
WHERE table_name IN ('tab1','tab3','tab4','tab5')
GROUP BY table_name ORDER BY table_name;
table_name COUNT(update_time)
tab1 1
tab3 1
tab4 1
tab5 1
Testcase with UPDATE stmt and transaction
SELECT * FROM tab1u;
c1 c2 c3
1 Testing the wl6658 Testing the wl6658
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1u';
update_time
NULL
#case2:
START TRANSACTION;
UPDATE tab1u SET c2='Updated',c3='Updated' WHERE c1=1;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1u';
update_time
NULL
COMMIT;
SELECT * FROM tab1u;
c1 c2 c3
1 Updated Updated
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab1u';
COUNT(update_time)
1
SELECT * FROM tab1d;
c1 c2 c3
1 Updated Updated
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1d';
update_time
NULL
#case3:
START TRANSACTION;
DELETE FROM tab1d;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1d';
update_time
NULL
COMMIT;
SELECT * FROM tab1d;
c1 c2 c3
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab1d';
COUNT(update_time)
1
SELECT * FROM tab1i;
c1 c2 c3
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
update_time
NULL
#case4:
START TRANSACTION;
INSERT INTO tab1i
VALUES(1,'Testing the wl6658', 'Testing the wl6658');
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
update_time
NULL
ROLLBACK;
SELECT * FROM tab1i;
c1 c2 c3
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
update_time
NULL
BEGIN WORK;
INSERT INTO tab2 VALUES(1,'Oracle','NUTT',10);
SAVEPOINT A;
INSERT INTO tab2 VALUES(2,'HUAWEI','BOLT',40);
SAVEPOINT B;
INSERT INTO tab2 VALUES(3,'IBM','NAIL',70);
SAVEPOINT C;
ROLLBACK to A;
SELECT * FROM tab2;
id store_name parts store_id
1 Oracle NUTT 10
SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
update_time
NULL
#execute DDL instead of commit
create table tab6(c1 int);
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab2';
COUNT(update_time)
1
START TRANSACTION;
DELETE FROM tab7;
ROLLBACK;
SELECT * FROM tab7;
c1
1
SELECT * FROM tab8;
c1 c2
1 1
SELECT table_name,update_time
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
table_name update_time
tab7 NULL
tab8 NULL
DELETE FROM tab7;
SELECT * FROM tab7;
c1
SELECT * FROM tab8;
c1 c2
SELECT table_name,COUNT(update_time)
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
table_name COUNT(update_time)
tab7 1
tab8 1
#cleanup
DROP TRIGGER test_trig;
DROP TABLE tab1,tab1u,tab1d,tab1i,tab2,tab3,tab4,tab5,tab6,tab8,tab7;
DROP PROCEDURE proc_wl6658;

View file

@ -0,0 +1,15 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--echo #
--echo # Bug#17604730 ASSERTION: *CURSOR->INDEX->NAME == TEMP_INDEX_PREFIX
--echo #
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34);
select * from t1;
drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout';

View file

@ -0,0 +1 @@
--innodb-buffer-pool-size=10M

View file

@ -0,0 +1,78 @@
###################################################################
-- echo #
-- echo # Test that INFORMATION_SCHEMA.TABLES.UPDATE_TIME is filled
-- echo # correctly for InnoDB tables.
-- echo #
-- source include/have_innodb.inc
-- source include/have_innodb_max_16k.inc
# restart does not work with embedded
-- source include/not_embedded.inc
CREATE TABLE t (a INT) ENGINE=INNODB;
SELECT update_time FROM information_schema.tables WHERE table_name = 't';
INSERT INTO t VALUES (1);
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND update_time IS NOT NULL;
-- echo # We cant deterministically check that the saved value is correct, but
-- echo # at least we check that it is a timestamp not older than 2 minutes.
-- echo # Usually update_time and NOW() are equal below, but on heavily loaded
-- echo # machines NOW() could be younger.
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND TIMESTAMPDIFF(SECOND, update_time, NOW()) < 120;
CREATE TEMPORARY TABLE big (a TEXT) ENGINE=INNODB;
SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
# evict table 't' by inserting as much data as the BP size itself
-- echo # INSERT lots of data in table 'big': begin
-- disable_query_log
BEGIN;
-- let $i = 10240
while ($i)
{
INSERT INTO big VALUES (REPEAT('a', 1024));
dec $i;
}
COMMIT;
-- enable_query_log
-- echo # INSERT lots of data in table 'big': end
# confirm that all pages for table 't' have been evicted
SELECT COUNT(*) FROM information_schema.innodb_buffer_page
WHERE table_name = '`test`.`t`';
# The result from this query will change once update_time becomes persistent
# (WL#6917).
SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't'
AND update_time IS NOT NULL;
DROP TEMPORARY TABLE big;
-- echo # Test the behavior after restart with a prepared XA transaction
XA START 'xatrx';
INSERT INTO t VALUES (5);
XA END 'xatrx';
XA PREPARE 'xatrx';
CONNECT (con1,localhost,root,,);
call mtr.add_suppression("Found 1 prepared XA transactions");
FLUSH TABLES;
--source include/kill_and_restart_mysqld.inc
SELECT update_time FROM information_schema.tables WHERE table_name = 't';
XA COMMIT 'xatrx';
SELECT COUNT(update_time) FROM information_schema.tables WHERE table_name='t';
DROP TABLE t;

View file

@ -0,0 +1,231 @@
###################################################################
#Testing functionality of the WL6658
#case1: begin work with INSERT with Triggers
#case2: (tab1u) begin transaction with UPDATE
#case3: (tab1d) begin transaction with DELETE
#case4: (tab1i) Rollback & INSERT
#case5: (tab2) partitioned table and procedures
#case6: (tab2) SAVEPOINT
#case7: (tab7,tab8) pk-fk with ON DELETE CASCADE
###################################################################
--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
--source include/have_partition.inc
--source include/not_embedded.inc
CREATE TABLE tab1(c1 int,c2 varchar(30), c3 BLOB) ENGINE=InnoDB;
CREATE TABLE tab1u LIKE tab1;
CREATE TABLE tab1d LIKE tab1;
CREATE TABLE tab1i LIKE tab1;
CREATE TABLE tab3(c1 int,c2 varchar(30)) ENGINE=InnoDB;
CREATE TABLE tab4(c1 int,c2 varchar(30)) ENGINE=InnoDB;
CREATE TABLE tab5(c1 int,c2 varchar(30)) ENGINE=InnoDB;
INSERT INTO tab1u VALUES(1,'Testing the wl6658','Testing the wl6658');
INSERT INTO tab1d VALUES(1,'Updated','Updated');
INSERT INTO tab4 VALUES(1,'Test for Update');
INSERT INTO tab5 VALUES(1,'Test for Delete');
delimiter |;
CREATE TRIGGER test_trig BEFORE INSERT ON tab1
FOR EACH ROW BEGIN
INSERT INTO tab3 VALUES(1,'Inserted From Trigger');
UPDATE tab4 SET c2='Updated from Trigger' WHERE c1=1;
DELETE FROM tab5;
END |
delimiter ;|
CREATE TABLE tab2(
id INT NOT NULL,
store_name VARCHAR(30),
parts VARCHAR(30),
store_id INT
) ENGINE=InnoDB
PARTITION BY LIST(store_id) (
PARTITION pNorth VALUES IN (10,20,30),
PARTITION pEast VALUES IN (40,50,60),
PARTITION pWest VALUES IN (70,80,100)
);
SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
delimiter |;
CREATE PROCEDURE proc_wl6658()
BEGIN
INSERT INTO tab2 VALUES(1,'ORACLE','NUTT',10);
INSERT INTO tab2 VALUES(2,'HUAWEI','BOLT',40);
COMMIT;
END |
delimiter ;|
CALL proc_wl6658;
SELECT * FROM tab2 ORDER BY id,store_id;
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab2';
TRUNCATE TABLE tab2;
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab2';
CREATE TABLE tab7(c1 INT NOT NULL, PRIMARY KEY (c1)) ENGINE=INNODB;
CREATE TABLE tab8(c1 INT PRIMARY KEY,c2 INT,
FOREIGN KEY (c2) REFERENCES tab7(c1) ON DELETE CASCADE )
ENGINE=INNODB;
SELECT table_name,update_time
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
INSERT INTO tab7 VALUES(1);
INSERT INTO tab8 VALUES(1,1);
SELECT table_name,COUNT(update_time)
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
--echo #restart the server
--source include/restart_mysqld.inc
SELECT table_name,update_time
FROM information_schema.tables
WHERE table_name IN ('tab1','tab2','tab3','tab4','tab5','tab7','tab8')
ORDER BY table_name;
--echo #case1:
BEGIN WORK;
INSERT INTO tab1
VALUES(1,'Testing the wl6658', 'Testing the wl6658');
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1';
COMMIT;
SELECT * FROM tab1;
SELECT * FROM tab3;
SELECT * FROM tab4;
SELECT * FROM tab5;
SELECT table_name,COUNT(update_time)
FROM information_schema.tables
WHERE table_name IN ('tab1','tab3','tab4','tab5')
GROUP BY table_name ORDER BY table_name;
--echo Testcase with UPDATE stmt and transaction
SELECT * FROM tab1u;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1u';
--echo #case2:
START TRANSACTION;
UPDATE tab1u SET c2='Updated',c3='Updated' WHERE c1=1;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1u';
COMMIT;
SELECT * FROM tab1u;
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab1u';
SELECT * FROM tab1d;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1d';
--echo #case3:
START TRANSACTION;
DELETE FROM tab1d;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1d';
COMMIT;
SELECT * FROM tab1d;
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab1d';
SELECT * FROM tab1i;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
--echo #case4:
START TRANSACTION;
INSERT INTO tab1i
VALUES(1,'Testing the wl6658', 'Testing the wl6658');
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
ROLLBACK;
SELECT * FROM tab1i;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab1i';
BEGIN WORK;
INSERT INTO tab2 VALUES(1,'Oracle','NUTT',10);
SAVEPOINT A;
INSERT INTO tab2 VALUES(2,'HUAWEI','BOLT',40);
SAVEPOINT B;
INSERT INTO tab2 VALUES(3,'IBM','NAIL',70);
SAVEPOINT C;
ROLLBACK to A;
SELECT * FROM tab2;
SELECT update_time
FROM information_schema.tables WHERE table_name='tab2';
--echo #execute DDL instead of commit
create table tab6(c1 int);
SELECT COUNT(update_time)
FROM information_schema.tables WHERE table_name='tab2';
START TRANSACTION;
DELETE FROM tab7;
ROLLBACK;
SELECT * FROM tab7;
SELECT * FROM tab8;
SELECT table_name,update_time
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
DELETE FROM tab7;
SELECT * FROM tab7;
SELECT * FROM tab8;
SELECT table_name,COUNT(update_time)
FROM information_schema.tables WHERE table_name IN ('tab7','tab8')
GROUP BY table_name ORDER BY table_name;
--echo #cleanup
DROP TRIGGER test_trig;
DROP TABLE tab1,tab1u,tab1d,tab1i,tab2,tab3,tab4,tab5,tab6,tab8,tab7;
DROP PROCEDURE proc_wl6658;

View file

@ -0,0 +1 @@
--sequence --innodb-data-file-path=ibdata_first:3M;ibdata_second:1M:autoextend

View file

@ -0,0 +1,19 @@
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
# Create full backup , modify table, then create incremental/differential backup
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
SELECT count(*) FROM t;
count(*)
100000
# Prepare full backup, apply incremental one
# Restore and check results
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
SELECT count(*) FROM t;
count(*)
100000
DROP TABLE t;

View file

@ -0,0 +1,46 @@
call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
echo # Create full backup , modify table, then create incremental/differential backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
SELECT count(*) FROM t;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
--disable_result_log
echo # Prepare full backup, apply incremental one;
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir;
exec $XTRABACKUP --prepare --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
echo # Restore and check results;
let $targetdir=$basedir;
#-- source include/restart_and_restore.inc
let $_datadir= `SELECT @@datadir`;
let $innodb_data_file_path=`SELECT @@innodb_data_file_path`;
echo # shutdown server;
--source include/shutdown_mysqld.inc
echo # remove datadir;
rmdir $_datadir;
echo # xtrabackup move back;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir "--innodb_data_file_path=$innodb_data_file_path" --target-dir=$targetdir;
echo # restart server;
--source include/start_mysqld.inc
--enable_result_log
SELECT count(*) FROM t;
DROP TABLE t;
# Cleanup
rmdir $basedir;
rmdir $incremental_dir;

View file

@ -0,0 +1,82 @@
include/master-slave.inc
[connection master]
connection master;
SET @@SESSION.gtid_domain_id=0;
CREATE TABLE t (a INT);
connection slave;
connection slave;
call mtr.add_suppression("connecting slave requested to start from.*which is not in the master's binlog");
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
connection master;
SET @@SESSION.gtid_domain_id=11;
SET @@SESSION.server_id=111;
SET @@SESSION.gtid_seq_no=1;
INSERT INTO t SET a=1;
connection slave;
SET @save.gtid_slave_pos=@@global.gtid_slave_pos;
SET @@global.gtid_slave_pos=concat(@@global.gtid_slave_pos, ",", 11, "-", 111, "-", 1 + 1);
Warnings:
Warning 1947 Specified GTID 0-1-1 conflicts with the binary log which contains a more recent GTID 0-2-2. If MASTER_GTID_POS=CURRENT_POS is used, the binlog position will override the new value of @@gtid_slave_pos
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1236]
connection master;
FLUSH BINARY LOGS;
PURGE BINARY LOGS TO 'master-bin.000002';;
FLUSH BINARY LOGS DELETE_DOMAIN_ID=(11);
SELECT @@global.gtid_binlog_pos, @@global.gtid_binlog_state;
@@global.gtid_binlog_pos @@global.gtid_binlog_state
0-1-1 0-1-1
connection slave;
SELECT @@global.gtid_slave_pos;
@@global.gtid_slave_pos
0-1-1,11-111-2
include/start_slave.inc
==== BEGIN include/start_slave.inc ====
con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
START SLAVE;
.==== BEGIN include/wait_for_slave_to_start.inc ====
. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
..==== BEGIN include/wait_for_slave_io_to_start.inc ====
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
...==== BEGIN include/wait_for_slave_param.inc [Slave_IO_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Last_IO_Errno']
[connection slave]
...==== END include/wait_for_slave_param.inc [Slave_IO_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
[connection slave]
..==== END include/wait_for_slave_io_to_start.inc ====
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
..==== BEGIN include/wait_for_slave_sql_to_start.inc ====
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
...==== BEGIN include/wait_for_slave_param.inc [Slave_SQL_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
Waiting until 'Slave_SQL_Running' = 'Yes' [timeout='300', $slave_error_param='1']
[connection slave]
...==== END include/wait_for_slave_param.inc [Slave_SQL_Running] ====
... con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
[connection slave]
..==== END include/wait_for_slave_sql_to_start.inc ====
.. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
[connection slave]
.==== END include/wait_for_slave_to_start.inc ====
. con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
[connection slave]
==== END include/start_slave.inc ====
con='slave' warn='1' qlog='1' rlog='1' aborterr='1'
connection master;
INSERT INTO t SET a=1;
connection slave;
include/wait_for_slave_io_error.inc [errno=1236]
connection master;
FLUSH BINARY LOGS;
PURGE BINARY LOGS TO 'master-bin.000004';;
FLUSH BINARY LOGS DELETE_DOMAIN_ID=(11);
connection slave;
include/start_slave.inc
connection master;
SET @@SESSION.gtid_domain_id=0;
DROP TABLE t;
connection slave;
include/rpl_end.inc

View file

@ -0,0 +1,98 @@
# In case master's gtid binlog state is divergent from the slave's gtid_slave_pos
# slave may not be able to connect.
# For instance when slave is more updated in some of domains, see
# MDEV-12012 as example, the master's state may require adjustment.
# In a specific case of an "old" divergent domain, that is there
# won't be no more event groups from it generated, the states can be
# made compatible with wiping the problematic domain away. After that slave
# becomes connectable.
#
# Notice that the slave applied gtid state is not really required to
# be similarly cleaned in order for replication to flow.
# However this could lead to an expected error when the master
# resumes binlogging of such domain which the test demonstrate.
--source include/master-slave.inc
--connection master
# enforce the default domain_id binlogging explicitly
SET @@SESSION.gtid_domain_id=0;
CREATE TABLE t (a INT);
--sync_slave_with_master
--connection slave
call mtr.add_suppression("connecting slave requested to start from.*which is not in the master's binlog");
--source include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
--connection master
# create extra gtid domains for binlog state
--let $extra_domain_id=11
--let $extra_domain_server_id=111
--let $extra_gtid_seq_no=1
--eval SET @@SESSION.gtid_domain_id=$extra_domain_id
--eval SET @@SESSION.server_id=$extra_domain_server_id
--eval SET @@SESSION.gtid_seq_no=$extra_gtid_seq_no
INSERT INTO t SET a=1;
#
# Set up the slave replication state as if slave knows more events from the extra
# domain.
#
--connection slave
SET @save.gtid_slave_pos=@@global.gtid_slave_pos;
--eval SET @@global.gtid_slave_pos=concat(@@global.gtid_slave_pos, ",", $extra_domain_id, "-", $extra_domain_server_id, "-", $extra_gtid_seq_no + 1)
# unsuccessful attempt to start slave
START SLAVE IO_THREAD;
--let $slave_io_errno=1236
--source include/wait_for_slave_io_error.inc
--connection master
# adjust the master binlog state
FLUSH BINARY LOGS;
--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
--eval PURGE BINARY LOGS TO '$purge_to_binlog';
# with final removal of the extra domain
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID=($extra_domain_id)
SELECT @@global.gtid_binlog_pos, @@global.gtid_binlog_state;
--connection slave
SELECT @@global.gtid_slave_pos;
# start the slave sucessfully
--let rpl_debug=1
--source include/start_slave.inc
--let rpl_debug=0
--connection master
# but the following gtid from the *extra* domain will break replication
INSERT INTO t SET a=1;
# take note of the slave io thread error due to being dismissed
# extra domain at connection to master which tried becoming active;
# slave is to stop.
--connection slave
--let $errno=1236
--source include/wait_for_slave_io_error.inc
# let's apply the very same medicine
--connection master
FLUSH BINARY LOGS;
--let $purge_to_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
--eval PURGE BINARY LOGS TO '$purge_to_binlog';
# with final removal of the extra domain
--eval FLUSH BINARY LOGS DELETE_DOMAIN_ID=($extra_domain_id)
--connection slave
--source include/start_slave.inc
#
# cleanup
#
--connection master
SET @@SESSION.gtid_domain_id=0;
DROP TABLE t;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -76,4 +76,55 @@ select * from mysqltest.v3;
connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
drop database mysqltest;
--echo #
--echo # MDEV-13453: privileges checking for CTE
--echo #
create database db;
use db;
create table t1 (i int);
insert into t1
values (3), (7), (1), (4), (2), (3), (1);
create table t2 (a int, b int);
insert into t2
values (3,10), (7,11), (1,17), (4,15), (2,11), (3,10), (1,15);
create user foo@localhost;
grant SELECT on db.t1 to foo@localhost;
grant SELECT(a) on db.t2 to foo@localhost;
--connect (con1,localhost,foo,,)
use db;
with cte as (select * from t1 where i < 4)
select * from cte;
with cte as (select * from t1 where i < 4 group by i)
select * from cte;
with cte as (select * from t1 where i < 4)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
with cte as (select * from t1 where i < 4 group by i)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
--error ER_COLUMNACCESS_DENIED_ERROR
with cte as (select b from t2 where a < 4)
select * from cte cte1 where b < 15 union select * from cte cte2 where b > 15;
with cte as (select a from t2 where a < 4)
select * from cte cte1 where a < 2 union select * from cte cte2 where a > 2;
--connection default
revoke SELECT on db.t1 from foo@localhost;
--connection con1
--error ER_TABLEACCESS_DENIED_ERROR
with cte as (select * from t1 where i < 4)
select * from cte;
# Cleanup
--disconnect con1
--connection default
drop database db;
drop user foo@localhost;

View file

@ -790,54 +790,3 @@ SHOW CREATE VIEW cte_test;
SELECT * FROM cte_test;
DROP VIEW cte_test;
--echo #
--echo # MDEV-13453: privileges checking for CTE
--echo #
create database db;
use db;
create table t1 (i int);
insert into t1
values (3), (7), (1), (4), (2), (3), (1);
create table t2 (a int, b int);
insert into t2
values (3,10), (7,11), (1,17), (4,15), (2,11), (3,10), (1,15);
create user foo@localhost;
grant SELECT on db.t1 to foo@localhost;
grant SELECT(a) on db.t2 to foo@localhost;
--connect (con1,localhost,foo,,)
use db;
with cte as (select * from t1 where i < 4)
select * from cte;
with cte as (select * from t1 where i < 4 group by i)
select * from cte;
with cte as (select * from t1 where i < 4)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
with cte as (select * from t1 where i < 4 group by i)
select * from cte cte1 where i < 2 union select * from cte cte2 where i > 2;
--error ER_COLUMNACCESS_DENIED_ERROR
with cte as (select b from t2 where a < 4)
select * from cte cte1 where b < 15 union select * from cte cte2 where b > 15;
with cte as (select a from t2 where a < 4)
select * from cte cte1 where a < 2 union select * from cte cte2 where a > 2;
--connection default
revoke SELECT on db.t1 from foo@localhost;
--connection con1
--error ER_TABLEACCESS_DENIED_ERROR
with cte as (select * from t1 where i < 4)
select * from cte;
# Cleanup
--disconnect con1
--connection default
drop database db;
drop user foo@localhost;

View file

@ -589,3 +589,9 @@ eval SET GLOBAL SERVER_ID = $old_server_id;
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_group_id.binlog
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_group_id_checksum.binlog
--exec $MYSQL_BINLOG --hexdump std_data/mdev-4645-binlog_none.binlog
#
# MDEV-12372 mysqlbinlog --version output is the same on 10.x as on 5.5.x, and contains not only version
#
replace_regex /.*mysqlbinlog(\.exe)? Ver .* for .* at [-_a-zA-Z0-9]+/mysqlbinlog Ver VER for OS at ARCH/;
exec $MYSQL_BINLOG --version;

View file

@ -9581,6 +9581,23 @@ drop procedure p;
drop view v;
drop table t, tmp_t;
--echo #
--echo # MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
--echo #
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
CREATE FUNCTION f1() RETURNS INT RETURN ( SELECT MAX(i) FROM v1 );
--error ER_NON_INSERTABLE_TABLE
REPLACE INTO v1 VALUES (f1());
SET @aux = f1();
# Cleanup
DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1;
--echo #End of 10.1 tests
--echo #

View file

@ -2643,8 +2643,33 @@ DROP TABLE t1;
SET TIMESTAMP=DEFAULT;
set time_zone= @@global.time_zone;
--echo #
--echo # MDEV-13936: Server crashes in Time_and_counter_tracker::incr_loops
--echo #
CREATE TABLE t1 (i INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE RAND() > 0.5;
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int);
create trigger trg after insert on t2 for each row
INSERT INTO t3 SELECT MAX(i) FROM v1 UNION SELECT MAX(i) FROM v1;
drop table t1;
--error ER_NO_SUCH_TABLE
insert into t2 value (2);
CREATE TABLE t1 (i INT);
insert into t2 value (2);
DROP VIEW v1;
DROP TABLE t1,t2,t3;
--echo End of 10.1 tests.
#
# MDEV-10915 Count number of exceuted triggers
# MDEV-10915 Count number of executed triggers
#
create table t1 (i int);

View file

@ -23,84 +23,74 @@
#
##############################################################################
# Based on 10.2 e2dd4e32063b2526d951e5f4ddfdb8b0d69ef634
main.alter_table : Modified in 10.2.10
main.analyze_format_json : MDEV-11866 - Mismatch
main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result
main.analyze_stmt_orderby : MDEV-11866 - Mismatch
main.case : Modified in 10.2.10
main.check_constraint : Modified in 10.2.9
main.connect2 : MDEV-13885 - Server crash
main.count_distinct : Modified in 10.2.9
main.cte_nonrecursive : Modified in 10.2.10
main.cte_grant : Modified in 10.2.11
main.cte_nonrecursive : Modified in 10.2.11
main.cte_recursive : Modified in 10.2.11
main.ctype_gbk : Modified in 10.2.10
main.ctype_latin1 : Modified in 10.2.10
main.ctype_ucs : Modified in 10.2.10
main.ctype_utf32 : Modified in 10.2.10
main.ctype_utf8 : Modified in 10.2.10
main.date_formats : Modified in 10.2.9
main.default : Modified in 10.2.9
main.delete_returning : Modified in 10.2.10
main.delimiter_command_case_sensitivity : Added in 10.2.11
main.derived_cond_pushdown : Modified in 10.2.11
main.distinct : MDEV-14194 - Crash
main.drop-no_root : MDEV-12633 - Valgrind
main.events_2 : MDEV-13277 - Crash
main.func_in : Modified in 10.2.10
main.func_json : MDEV-11648 - Crash, valgrind; modified in 10.2.10
main.func_math : Modified in 10.2.9
main.func_misc : Modified in 10.2.9
main.func_json : MDEV-11648 - Crash, valgrind; modified in 10.2.11
main.func_misc : Modified in 10.2.11
main.func_regexp_pcre : Modified in 10.2.10
main.func_time : Modified in 10.2.10
main.gis-json : Modified in 10.2.11
main.gis-precise : Modified in 10.2.10
main.gis2 : Modified in 10.2.10
main.having : Modified in 10.2.11
main.index_merge_innodb : MDEV-7142 - Plan mismatch
main.information_schema : Modified in 10.2.10
main.innodb_mysql_lock : MDEV-7861 - Wrong result
main.insert : Modified in 10.2.9
main.kill-2 : MDEV-13257 - Wrong result
main.locale : Modified in 10.2.9
main.log_slow : MDEV-13263 - Wrong result
main.log_tables-big : Modified in 10.2.9
main.mdev13607 : Added in 10.2.10
main.myisam : Modified in 10.2.10
main.mysql_client_test : MDEV-12633 - Valgrind
main.mysql_client_test_comp : MDEV-12633 - Valgrind
main.mysql_client_test_nonblock : MDEV-12633 - Valgrind, CONC-208 - Error on Power
main.mysql_client_test_nonblock : CONC-208 - Error on Power
main.mysql_upgrade_noengine : MDEV-14355 - Wrong result
main.mysql_upgrade_ssl : MDEV-13492 - Unknown SSL error
main.mysqlcheck : MDEV-12633 - Valgrind
main.mysqlbinlog : Modified in 10.2.11
main.mysqld_option_err : MDEV-12747 - Timeout
main.mysqlhotcopy_myisam : MDEV-10995 - Hang on debug
main.mysqltest : MDEV-13887 - Wrong result
main.old-mode : Modified in 10.2.9
main.openssl_1 : MDEV-13492 - Unknown SSL error
main.order_by : Modified in 10.2.11
main.order_by_innodb : Modified in 10.2.11
main.partition_datatype : Modified in 10.2.10
main.partition_symlink : Modified in 10.2.9
main.ps : Modified in 10.2.10
main.range_interrupted-13751 : Added in 10.2.9
main.ps : Modified in 10.2.11
main.range_vs_index_merge : Modified in 10.2.10
main.shm : MDEV-12727 - Mismatch, ERROR 2013
main.show_check : MDEV-12633 - Valgrind
main.show_function_with_pad_char_to_full_length : Added in 10.2.10
main.sp : MDEV-7866 - Mismatch; modified in 10.2.9
main.ssl_7937 : MDEV-11546 - Timeout on Windows
main.sp : MDEV-7866 - Mismatch; modified in 10.2.11
main.ssl_ca : MDEV-10895 - SSL connection error on Power
main.ssl_cert_verify : MDEV-13735 - Server crash
main.ssl_connect : MDEV-13492 - Unknown SSL error
main.ssl_timeout : MDEV-11244 - Crash
main.stat_tables_par : MDEV-13266 - Wrong result
main.status : MDEV-13255 - Wrong result
main.subselect_exists2in : Modified in 10.2.11
main.subselect_mat_cost_bugs : Modified in 10.2.10
main.symlink : Modified in 10.2.9
main.tc_heuristic_recover : MDEV-14189 - Wrong result; modified in 10.2.10
main.trigger : Modified in 10.2.11
main.type_bit : Modified in 10.2.11
main.type_date : Modified in 10.2.11
main.type_float : Modified in 10.2.10
main.type_time : Modified in 10.2.11
main.type_varchar : Modified in 10.2.10
main.user_var : Modified in 10.2.10
main.userstat : MDEV-12904 - SSL errors
main.view : Modified in 10.2.9
main.wait_timeout : Modified in 10.2.9
main.wait_timeout_not_windows : Modified in 10.2.9
main.win : Modified in 10.2.9
main.win_as_arg_to_aggregate_func : Added in 10.2.9
main.win_insert_select : Modified in 10.2.9
main.xml : Modified in 10.2.10
#----------------------------------------------------------------
@ -111,6 +101,8 @@ archive.mysqlhotcopy_archive : MDEV-10995 - Hang on debug
#----------------------------------------------------------------
binlog.binlog_commit_wait : MDEV-10150 - Mismatch
binlog.binlog_flush_binlogs_delete_domain : MDEV-14431 - Wrong exit code; added in 10.2.11
binlog.binlog_gtid_delete_domain_debug : Added in 10.2.11
binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint
#----------------------------------------------------------------
@ -123,6 +115,7 @@ binlog_encryption.rpl_binlog_errors : MDEV-12742 - Crash
binlog_encryption.rpl_parallel : MDEV-10653 - Timeout in include
binlog_encryption.rpl_semi_sync : MDEV-11673 - Valgrind
binlog_encryption.rpl_skip_replication : MDEV-13571 - Unexpected warning
binlog_encryption.rpl_ssl : MDEV-14507 - Timeouts
binlog_encryption.rpl_stm_relay_ign_space : MDEV-13278 - Wrong result (test assertion)
#----------------------------------------------------------------
@ -134,7 +127,7 @@ connect.mongo_c : Include file modified in 10.2.10
connect.mongo_java_2 : Include file modified in 10.2.10
connect.mongo_java_3 : Include file modified in 10.2.10
connect.tbl : MDEV-10179 - Mismatch, MDEV-9844 - Valgrind, crash
connect.tbl_thread : MDEV-10179 - Mismatch, MDEV-9844 - Valgrind, crash
connect.tbl_thread : MDEV-10179 - Mismatch, MDEV-9844 - Valgrind, crash, MDEV-14214 - Syntax error
connect.vcol : MDEV-12374 - Fails on Windows
#----------------------------------------------------------------
@ -142,18 +135,19 @@ connect.vcol : MDEV-12374 - Fails on Windows
encryption.create_or_replace : MDEV-9359, MDEV-13516 - Assertion failure, MDEV-12694 - Timeout
encryption.debug_key_management : MDEV-13841 - Timeout
encryption.encrypt_and_grep : MDEV-13765 - Wrong result
encryption.encryption_force : Modified in 10.2.11
encryption.filekeys_encfile : Modified in 10.2.11
encryption.filekeys_encfile_file : Modified in 10.2.11
encryption.innochecksum : MDEV-13644 - Assertion failure
encryption.innodb-discard-import-change : MDEV-12632 - Valgrind
encryption.innodb_encryption : Modified in 10.2.9
encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout
encryption.innodb-encryption-alter : MDEV-13566 - Lock wait timeout; modified in 10.2.11
encryption.innodb_encryption_discard_import : MDEV-12903 - Wrong result, MDEV-14045 - Error 192
encryption.innodb_encryption_filekeys : MDEV-9962 - Timeout
encryption.innodb_encrypt_log : Modified in 10.2.9
encryption.innodb_encryption_tables : MDEV-9359 - Assertion failure
encryption.innodb-first-page-read : Modified in 10.2.9
encryption.innodb_lotoftables : Modified in 10.2.9
encryption.innodb-redo-badkey : MDEV-13893 - page cannot be decrypted; modified in 10.2.9
encryption.innodb-spatial-index : MDEV-13746 - Wrong result; modified in 10.2.9
encryption.innodb-first-page-read : MDEV-14356 - Timeout in wait condition
encryption.innodb_lotoftables : MDEV-11531 - Operation on a dropped tablespace
encryption.innodb-redo-badkey : MDEV-13893 - Page cannot be decrypted
encryption.innodb-spatial-index : MDEV-13746 - Wrong result; modified in 10.2.11
#----------------------------------------------------------------
@ -164,7 +158,6 @@ engines/rr_trx.* : MDEV-10998 - Not maintained
federated.federated_innodb : MDEV-10617 - Wrong checksum
federated.federated_transactions : MDEV-10617 - Wrong checksum
federated.federatedx : MDEV-10617 - Wrong checksum
federated.net_thd_crash-12951 : Added in 10.2.9
#----------------------------------------------------------------
@ -177,33 +170,34 @@ galera_3nodes.* : Suite is not stable yet
#----------------------------------------------------------------
gcol.gcol_rollback : Modified in 10.2.9
gcol.gcol_update : Modified in 10.2.9
gcol.innodb_virtual_basic : Modified in 10.2.11
gcol.innodb_virtual_debug : Modified in 10.2.11
gcol.innodb_virtual_debug_purge : MDEV-13568 - Wrong result
gcol.innodb_virtual_rebuild : Added in 10.2.11
#----------------------------------------------------------------
innodb.101_compatibility : MDEV-13891 - Wrong result
innodb.alter_crash : Added in 10.2.9
innodb.alter_rename_existing : Added in 10.2.9
innodb.alter_table : Modified in 10.2.10
innodb.create-index-debug : Added in 10.2.9
innodb.deadlock_detect : MDEV-13262 - Wrong error code
innodb.defrag_mdl-9155 : Re-enabled in 10.2.10
innodb_defragment_fill_factor : Re-enabled in 10.2.10
innodb.doublewrite : MDEV-14205 - Crash
innodb.doublewrite : MDEV-12905 - Server crash
innodb.group_commit_crash : MDEV-14191 - InnoDB registration failed
innodb.group_commit_crash_no_optimize_thread : MDEV-13830 - Assertion failure
innodb.index_tree_operation : Added in 10.2.9
innodb.innodb-16k : Modified in 10.2.10
innodb.innodb-32k : Modified in 10.2.10
innodb.innodb-64k : MDEV-14132 - Crash; modified in 10.2.10
innodb.innodb-64k-crash : MDEV-14132 - Crash
innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt
innodb.innodb_bug34300 : MDEV-14132 - Crash
innodb.innodb-64k : Modified in 10.2.10
innodb.innodb-alter : Modified in 10.2.10
innodb.innodb-alter-autoinc : Added in 10.2.9
innodb.innodb-alter-table : Modified in 10.2.10
innodb.innodb-alter-tempfile : MDEV-14485 - Server deadlock on startup
innodb.innodb_bug14147491 : MDEV-11808 - Index is corrupt
innodb.innodb_bug59641 : MDEV-13830 - Assertion failure
innodb.innodb_bulk_create_index : Added in 10.2.11
innodb.innodb_bulk_create_index_debug : Added in 10.2.11
innodb.innodb_bulk_create_index_flush : Added in 10.2.11
innodb.innodb_bulk_create_index_replication : Added in 10.2.11
innodb.innodb_bulk_create_index_small : Added in 10.2.11
innodb.innodb_defrag_binlog : Re-enabled in 10.2.10
innodb.innodb_defrag_concurrent : Re-enabled in 10.2.10
innodb.innodb_defrag_stats : Re-enabled in 10.2.10
@ -211,36 +205,37 @@ innodb.innodb_defrag_stats_many_tables : MDEV-14198 - Table is full; re-enabled
innodb.innodb_defragment : Re-enabled in 10.2.10
innodb.innodb_defragment_fill_factor : Re-enabled in 10.2.10
innodb.innodb_defragment_small : Re-enabled in 10.2.10
innodb.innodb-enlarge-blob : Modified in 10.2.9
innodb.innodb-get-fk : MDEV-13276 - Server crash; modified in 10.2.10
innodb.innodb-index : Modified in 10.2.9
innodb.innodb-index-debug : Added in 10.2.9
innodb.innodb-index-online : Added in 10.2.9
innodb.innodb-index-online-delete : Added in 10.2.9
innodb.innodb-index-online-fk : Added in 10.2.9
innodb.innodb-index-online-purge : Added in 10.2.9
innodb.innodb_information_schema : MDEV-8851 - Wrong result
innodb.innodb-on-duplicate-update : Added in 10.2.11
innodb.innodb-online-alter-gis : Modified in 10.2.10
innodb.innodb-page_compression_default : MDEV-13644 - Assertion failure
innodb.innodb-table-online : MDEV-13894 - Wrong result; modified in 10.2.9
innodb.innodb-page_compression_lzma : MDEV-14353 - Wrong result
innodb.innodb-page_compression_tables : Modified in 10.2.11
innodb.innodb-replace-debug : Added in 10.2.11
innodb.innodb-table-online : MDEV-13894 - Wrong result; modified in 10.2.11
innodb.innodb-truncate : Modified in 10.2.10
innodb.innodb_stats_persistent_debug : Added in 10.2.9
innodb.innodb_sys_semaphore_waits : MDEV-10331 - Semaphore wait
innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno; modified in 10.2.9
innodb.innodb-wl5522-debug : MDEV-14200 - Wrong errno
innodb.innodb-wl5980-alter : Modified in 10.2.10
innodb.innodb_zip_innochecksum2 : MDEV-13882 - Extra warnings
innodb.innodb_zip_innochecksum3 : MDEV-14486 - Resource temporarily unavailable
innodb.log_corruption : MDEV-13251 - Wrong result
innodb.log_data_file_size : MDEV-14204 - Server failed to start; modified in 10.2.9
innodb.log_data_file_size : MDEV-14204 - Server failed to start
innodb.log_file_name : MDEV-14193 - Exception
innodb.log_file_size : Modified in 10.2.10
innodb.purge_thread_shutdown : MDEV-13792 - Wrong result
innodb.read_only_recovery : MDEV-13886 - Server crash
innodb.row_format_redundant : MDEV-14485 - Server deadlock on startup
innodb.table_definition_cache_debug : MDEV-14206 - Extra warning; added in 10.2.10
innodb.table_flags : MDEV-13572 - Wrong result; modified in 10.2.9
innodb.table_flags : MDEV-13572 - Wrong result
innodb.temporary_table : MDEV-13265 - Wrong result
innodb.truncate_debug : Modified in 10.2.10
innodb.truncate_restart : Added in 10.2.11
innodb.undo_log : Added in 10.2.10
innodb.update_time : Added in 10.2.11
innodb.update_time_wl6658 : Added in 10.2.11
innodb-wl5980-alter : Re-enabled in 10.2.10
innodb.xa_recovery : Modified in 10.2.9
innodb_fts.concurrent_insert : Added in 10.2.10
innodb_fts.fulltext : Modified in 10.2.10
@ -258,7 +253,7 @@ innodb_gis.bug17057168 : Added in 10.2.10
innodb_gis.geometry : Added in 10.2.10
innodb_gis.gis_split_inf : Added in 10.2.10
innodb_gis.gis_split_nan : Added in 10.2.10
innodb_gis.kill_server : Added in 10.2.10
innodb_gis.kill_server : MDEV-14218 - Assertion failure; added in 10.2.10
innodb_gis.multi_pk : Added in 10.2.10
innodb_gis.point_basic : Added in 10.2.10
innodb_gis.point_big : Added in 10.2.10
@ -287,36 +282,41 @@ innodb_gis.update_root : Added in 10.2.10
innodb_zip.16k : Modified in 10.2.10
innodb_zip.4k : Modified in 10.2.10
innodb_zip.8k : Modified in 10.2.10
innodb_zip.create_options : Modified in 10.2.9
innodb_zip.cmp_per_index : MDEV-14490 - Table is marked as crashed
innodb_zip.innochecksum_3 : MDEV-13279 - Extra warnings
innodb_zip.index_large_prefix_4k : Modified in 10.2.10
innodb_zip.index_large_prefix_8k : Modified in 10.2.10
innodb_zip.prefix_index_liftedlimit : MDEV-14238 - Assertion failure
innodb_zip.wl6470_1 : MDEV-14240 - Assertion failure
innodb_zip.wl6501_1 : MDEV-10891 - Can't create UNIX socket
innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2; modified in 10.2.9
innodb_zip.wl5522_debug_zip : MDEV-11600 - Operating system error number 2
innodb_zip.wl6501_scale_1 : MDEV-13254 - Timeout, MDEV-14104 - Error 192
#----------------------------------------------------------------
maria.insert_select : MDEV-12757 - Timeout
maria.maria : Modified in 10.2.10
maria.maria : MDEV-14430 - Extra warning; modified in 10.2.10
#----------------------------------------------------------------
mariabackup.apply-log-only : Added in 10.2.9
mariabackup.apply-log-only-incr : Added in 10.2.9
mariabackup.auth_plugin_win : Added in 10.2.9
mariabackup.apply-log-only : MDEV-14192 - Assertion failure
mariabackup.apply-log-only-incr : MDEV-14192 - Assertion failure
mariabackup.compress_qpress : Added in 10.2.10
mariabackup.data_directory : Added in 10.2.11
mariabackup.full_backup : MDEV-13889 - Timeout
mariabackup.incremental_backup : MDEV-14192 - Assertion failure
mariabackup.incremental_backup : MDEV-14192 - Assertion failure; modified in 10.2.11
mariabackup.incremental_encrypted : MDEV-14188 - Wrong result
mariabackup.lock_ddl_per_table : Added in 10.2.9
mariabackup.partial : Modified in 10.2.9
mariabackup.xb_aws_key_management : Modified in 10.2.9
mariabackup.mdev-14447 : Added in 10.2.11
mariabackup.partition_datadir : Added in 10.2.11
mariabackup.xb_file_key_management : Modified in 10.2.10
mariabackup.xb_page_compress : Modified in 10.2.9
mariabackup.xbstream : MDEV-14192 - Crash
#----------------------------------------------------------------
mroonga.* : Version-related changes in include files in 10.2.11
mroonga/storage.* : Massive changes in 10.2.11
mroonga/wrapper.* : Massive changes in 10.2.11
mroonga/storage.index_multiple_column_unique_datetime_index_read : MDEV-8643 - Valgrind
#----------------------------------------------------------------
@ -329,16 +329,8 @@ multi_source.simple : MDEV-4633 - Wrong result
#----------------------------------------------------------------
parts.partition_alter_maria : Added in 10.2.10
parts.partition_auto_increment_maria : MDEV-14430 - Extra warning
parts.partition_debug_innodb : MDEV-10891 - Can't create UNIX socket
parts.partition_exch_myisam_innodb : Modified in 10.2.9
parts.partition_exch_qa_10 : Include files modified in 10.2.9
parts.partition_exch_qa_11 : Include files modified in 10.2.9
parts.partition_exch_qa_12 : Include files modified in 10.2.9
parts.partition_exch_qa_14 : Modified in 10.2.9
parts.partition_exch_qa_15 : Modified in 10.2.9
parts.partition_exch_qa_2 : Modified in 10.2.9
parts.partition_exch_qa_3 : Modified in 10.2.9
parts.partition_exch_qa_6 : Modified in 10.2.9
#----------------------------------------------------------------
@ -363,6 +355,9 @@ perfschema_stress.* : MDEV-10996 - Not maintained
#----------------------------------------------------------------
plugins.feedback_plugin_send : MDEV-7932, MDEV-11118 - Connection problems and such
plugins.server_audit : Modified in 10.2.11
plugins.thread_pool_server : Modified in 10.2.11
plugins.thread_pool_server_audit : MDEV-14295 - Wrong result
#----------------------------------------------------------------
@ -380,15 +375,22 @@ rpl.rpl_domain_id_filter_io_crash : MDEV-12729 - Timeout in include file, MDE
rpl.rpl_domain_id_filter_restart : MDEV-10684 - Wrong result
rpl.rpl_extra_col_master_myisam : MDEV-14203 - Extra warning
rpl.rpl_gtid_crash : MDEV-9501 - Failed registering on master, MDEV-13643 - Lost connection
rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash; modified in 10.2.9
rpl.rpl_gtid_delete_domain : MDEV-14463 - Timeout; added in 10.2.11
rpl.rpl_gtid_errorhandling : MDEV-13261 - Crash
rpl.rpl_gtid_reconnect : MDEV-14497 - Crash
rpl.rpl_gtid_stop_start : MDEV-11621 - Table marked as crashed
rpl.rpl_manual_change_index_file : MDEV-14309 - Requires Env package
rpl.rpl_mariadb_slave_capability : MDEV-11018 - Extra lines in binlog
rpl.rpl_non_direct_stm_mixing_engines : MDEV-14489 - Failed sync_slave_with_master
rpl.rpl_parallel : MDEV-12730 - Assertion failure
rpl.rpl_parallel_mdev6589 : MDEV-12979 - Assertion failure
rpl.rpl_parallel_optimistic_nobinlog : MDEV-12746 - Timeouts, mismatch
rpl.rpl_parallel_retry : MDEV-11119 - Crash
rpl.rpl_parallel_temptable : MDEV-10356 - Crash
rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master
rpl.rpl_row_drop_create_temp_table : MDEV-14487 - Wrong result
rpl.rpl_row_mixing_engines : MDEV-14491 - Long semaphore wait
rpl.rpl_semi_sync : MDEV-11220 - Wrong result
rpl.rpl_semi_sync_after_sync : MDEV-14366 - Wrong result
rpl.rpl_set_statement_default_master : MDEV-13258 - Extra warning
rpl.rpl_show_slave_hosts : MDEV-10681 - Crash
rpl.rpl_skip_replication : MDEV-13258 - Extra warning
@ -396,11 +398,10 @@ rpl.rpl_slave_grp_exec : MDEV-10514 - Deadlock
rpl.rpl_slave_load_tmpdir_not_exist : MDEV-14203 - Extra warning
rpl.rpl_slow_query_log : MDEV-13250 - Test abort
rpl.rpl_sp_effects : MDEV-13249 - Crash
rpl.rpl_sp_variables : Added in 10.2.9
rpl.rpl_start_stop_slave : MDEV-13567 - Sync slave timeout
rpl.rpl_stm_multi_query : MDEV-9501 - Failed registering on master
rpl.rpl_stm_stop_middle_group : MDEV-13791 - Server crash
rpl.rpl_temporal_format_mariadb53_to_mysql56_dst : Added in 10.2.9
rpl.rpl_temporal_mysql56_to_mariadb53 : MDEV-9501 - Failed registering on master
rpl.rpl_upgrade_master_info : MDEV-11620 - Table marked as crashed
rpl/extra/rpl_tests.* : MDEV-10994 - Not maintained
@ -429,16 +430,19 @@ storage_engine.* : Not always timely maintained
sys_vars.explicit_defaults_for_timestamp_on : Include file modified in 10.2.10
sys_vars.explicit_defaults_for_timestamp_off : Include file modified in 10.2.10
sys_vars.host_cache_size_auto : Modified in 10.2.10
sys_vars.innodb_buffer_pool_load_now_basic : MDEV-14196 - Timeout
sys_vars.log_slow_admin_statements_func : MDEV-14132 - Crash
sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion
sys_vars.innodb_buffer_pool_dump_at_shutdown_basic : MDEV-14280 - Unexpected error
sys_vars.innodb_buffer_pool_dump_now_basic : Modified in 10.2.11
sys_vars.innodb_buffer_pool_dump_pct_basic : Modified in 10.2.11
sys_vars.innodb_buffer_pool_load_now_basic : Modified in 10.2.11
sys_vars.rpl_init_slave_func : MDEV-10149 - Test assertion
sys_vars.slow_query_log_func : MDEV-14273 - Wrong result
#----------------------------------------------------------------
tokudb.change_column_all_1000_10 : MDEV-12640 - Lost connection
tokudb.change_column_bin : MDEV-12640 - Lost connection
tokudb.change_column_char : MDEV-12822 - Lost connection
tokudb.dir_per_db : MDEV-11537 - Wrong result; modified in 10.2.9
tokudb.dir_per_db : MDEV-11537 - Wrong result
tokudb.hotindex-insert-bigchar : MDEV-12640 - Crash
tokudb.hotindex-update-1 : MDEV-12640 - Crash
tokudb.rows-32m-rand-insert : MDEV-12640 - Crash
@ -455,21 +459,18 @@ tokudb_parts.partition_alter4_tokudb : MDEV-12640 - Lost connection
#----------------------------------------------------------------
unit.conc_ps_bugs : MDEV-13252 - not ok 44 test_bug4236
unit.lf : MDEV-12897 - Signal 11 thrown
#----------------------------------------------------------------
vcol.innodb_virtual_fk : Added in 10.2.9
vcol.update : Modified in 10.2.9
vcol.vcol_misc : Modified in 10.2.10
vcol.vcol_supported_sql_funcs : Include file modified in 10.2.9
#----------------------------------------------------------------
wsrep.binlog_format : MDEV-11532 - Could not execute check-testcase
wsrep.foreign_key : Re-enabled in 10.2.9
wsrep.mdev_6832 : MDEV-14195 - Check testcase failed; option file changed in 10.2.9
wsrep.mdev_7798 : Option file changed in 10.2.9
wsrep.mdev_6832 : MDEV-14195 - Check testcase failed
wsrep.pool_of_threads : MDEV-12234 - GLIBCXX_3.4.20 not found
wsrep.variables : MDEV-14311 - Wrong result
wsrep_info.plugin : MDEV-13569 - No nodes coming from prim view

View file

@ -124,9 +124,9 @@ readonly WSREP_SST_OPT_BYPASS
readonly WSREP_SST_OPT_BINLOG
readonly WSREP_SST_OPT_CONF_SUFFIX
if [ -n "${WSREP_SST_OPT_ADDR_PORT:-}" ]; then
if [ -n "${WSREP_SST_OPT_ADDR:-}" ]; then
if [ -n "${WSREP_SST_OPT_PORT:-}" ]; then
if [ "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
if [ -n "$WSREP_SST_OPT_ADDR_PORT" -a "$WSREP_SST_OPT_PORT" != "$WSREP_SST_OPT_ADDR_PORT" ]; then
wsrep_log_error "port in --port=$WSREP_SST_OPT_PORT differs from port in --address=$WSREP_SST_OPT_ADDR"
exit 2
fi
@ -266,18 +266,18 @@ parse_cnf()
# finally get the variable value (if variables has been specified multiple time use the last value only)
# look in group+suffix
if [[ -n $WSREP_SST_OPT_CONF_SUFFIX ]]; then
if [ -n $WSREP_SST_OPT_CONF_SUFFIX ]; then
reval=$($MY_PRINT_DEFAULTS "${group}${WSREP_SST_OPT_CONF_SUFFIX}" | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
fi
# look in group
if [[ -z $reval ]]; then
if [ -z $reval ]; then
reval=$($MY_PRINT_DEFAULTS $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2- | tail -1)
fi
# use default if we haven't found a value
if [[ -z $reval ]]; then
[[ -n $3 ]] && reval=$3
if [ -z $reval ]; then
[ -n $3 ] && reval=$3
fi
echo $reval
}

View file

@ -5465,7 +5465,7 @@ void Regexp_processor_pcre::pcre_exec_warn(int rc) const
switch (rc)
{
case PCRE_ERROR_NULL:
errmsg= "pcre_exec: null arguement passed";
errmsg= "pcre_exec: null argument passed";
break;
case PCRE_ERROR_BADOPTION:
errmsg= "pcre_exec: bad option";

View file

@ -181,6 +181,7 @@ static SYMBOL symbols[] = {
{ "DELAYED", SYM(DELAYED_SYM)},
{ "DELAY_KEY_WRITE", SYM(DELAY_KEY_WRITE_SYM)},
{ "DELETE", SYM(DELETE_SYM)},
{ "DELETE_DOMAIN_ID", SYM(DELETE_DOMAIN_ID_SYM)},
{ "DESC", SYM(DESC)},
{ "DESCRIBE", SYM(DESCRIBE)},
{ "DES_KEY_FILE", SYM(DES_KEY_FILE)},

View file

@ -6656,6 +6656,120 @@ void MYSQL_BIN_LOG::checkpoint_and_purge(ulong binlog_id)
purge();
}
/**
Searches for the first (oldest) binlog file name in in the binlog index.
@param[in,out] buf_arg pointer to a buffer to hold found
the first binary log file name
@return NULL on success, otherwise error message
*/
static const char* get_first_binlog(char* buf_arg)
{
IO_CACHE *index_file;
size_t length;
char fname[FN_REFLEN];
const char* errmsg= NULL;
DBUG_ENTER("get_first_binlog");
DBUG_ASSERT(mysql_bin_log.is_open());
mysql_bin_log.lock_index();
index_file=mysql_bin_log.get_index_file();
if (reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0))
{
errmsg= "failed to create a cache on binlog index";
goto end;
}
/* The file ends with EOF or empty line */
if ((length=my_b_gets(index_file, fname, sizeof(fname))) <= 1)
{
errmsg= "empty binlog index";
goto end;
}
else
{
fname[length-1]= 0; // Remove end \n
}
if (normalize_binlog_name(buf_arg, fname, false))
{
errmsg= "cound not normalize the first file name in the binlog index";
goto end;
}
end:
mysql_bin_log.unlock_index();
DBUG_RETURN(errmsg);
}
/**
Check weather the gtid binlog state can safely remove gtid
domains passed as the argument. A safety condition is satisfied when
there are no events from the being deleted domains in the currently existing
binlog files. Upon successful check the supplied domains are removed
from @@gtid_binlog_state. The caller is supposed to rotate binlog so that
the active latest file won't have the deleted domains in its Gtid_list header.
@param domain_drop_lex gtid domain id sequence from lex.
Passed as a pointer to dynamic array must be not empty
unless pointer value NULL.
@retval zero on success
@retval > 0 ineffective call none from the *non* empty
gtid domain sequence is deleted
@retval < 0 on error
*/
static int do_delete_gtid_domain(DYNAMIC_ARRAY *domain_drop_lex)
{
int rc= 0;
Gtid_list_log_event *glev= NULL;
char buf[FN_REFLEN];
File file;
IO_CACHE cache;
const char* errmsg= NULL;
char errbuf[MYSQL_ERRMSG_SIZE]= {0};
if (!domain_drop_lex)
return 0; // still "effective" having empty domain sequence to delete
DBUG_ASSERT(domain_drop_lex->elements > 0);
mysql_mutex_assert_owner(mysql_bin_log.get_log_lock());
if ((errmsg= get_first_binlog(buf)) != NULL)
goto end;
bzero((char*) &cache, sizeof(cache));
if ((file= open_binlog(&cache, buf, &errmsg)) == (File) -1)
goto end;
errmsg= get_gtid_list_event(&cache, &glev);
end_io_cache(&cache);
mysql_file_close(file, MYF(MY_WME));
DBUG_EXECUTE_IF("inject_binlog_delete_domain_init_error",
errmsg= "injected error";);
if (errmsg)
goto end;
errmsg= rpl_global_gtid_binlog_state.drop_domain(domain_drop_lex,
glev, errbuf);
end:
if (errmsg)
{
if (strlen(errmsg) > 0)
{
my_error(ER_BINLOG_CANT_DELETE_GTID_DOMAIN, MYF(0), errmsg);
rc= -1;
}
else
{
rc= 1;
}
}
delete glev;
return rc;
}
/**
The method is a shortcut of @c rotate() and @c purge().
LOCK_log is acquired prior to rotate and is released after it.
@ -6665,16 +6779,24 @@ void MYSQL_BIN_LOG::checkpoint_and_purge(ulong binlog_id)
@retval
nonzero - error in rotating routine.
*/
int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate)
int MYSQL_BIN_LOG::rotate_and_purge(bool force_rotate,
DYNAMIC_ARRAY *domain_drop_lex)
{
int error= 0;
int err_gtid=0, error= 0;
ulong prev_binlog_id;
DBUG_ENTER("MYSQL_BIN_LOG::rotate_and_purge");
bool check_purge= false;
mysql_mutex_lock(&LOCK_log);
prev_binlog_id= current_binlog_id;
if ((error= rotate(force_rotate, &check_purge)))
if ((err_gtid= do_delete_gtid_domain(domain_drop_lex)))
{
// inffective attempt to delete merely skips rotate and purge
if (err_gtid < 0)
error= 1; // otherwise error is propagated the user
}
else if ((error= rotate(force_rotate, &check_purge)))
check_purge= false;
/*
NOTE: Run purge_logs wo/ holding LOCK_log because it does not need
@ -7078,8 +7200,15 @@ MYSQL_BIN_LOG::write_transaction_to_binlog(THD *thd,
mode. Also, do not write the cached updates to binlog if binary logging is
disabled (log-bin/sql_log_bin).
*/
if (wsrep_emulate_bin_log || !(thd->variables.option_bits & OPTION_BIN_LOG))
if (wsrep_emulate_bin_log)
{
DBUG_RETURN(0);
}
else if (!(thd->variables.option_bits & OPTION_BIN_LOG))
{
cache_mngr->need_unlog= false;
DBUG_RETURN(0);
}
entry.thd= thd;
entry.cache_mngr= cache_mngr;
@ -9402,11 +9531,19 @@ TC_LOG_BINLOG::log_and_order(THD *thd, my_xid xid, bool all,
if (err)
DBUG_RETURN(0);
bool need_unlog= cache_mngr->need_unlog;
/*
The transaction won't need the flag anymore.
Todo/fixme: consider to move the statement into cache_mngr->reset()
relocated to the current or later point.
*/
cache_mngr->need_unlog= false;
/*
If using explicit user XA, we will not have XID. We must still return a
non-zero cookie (as zero cookie signals error).
*/
if (!xid || !cache_mngr->need_unlog)
if (!xid || !need_unlog)
DBUG_RETURN(BINLOG_COOKIE_DUMMY(cache_mngr->delayed_error));
else
DBUG_RETURN(BINLOG_COOKIE_MAKE(cache_mngr->binlog_id,
@ -9479,6 +9616,9 @@ TC_LOG_BINLOG::mark_xid_done(ulong binlog_id, bool write_checkpoint)
if (b->binlog_id == binlog_id)
{
--b->xid_count;
DBUG_ASSERT(b->xid_count >= 0); // catch unmatched (++) decrement
break;
}
first= false;
@ -10252,6 +10392,73 @@ TC_LOG_BINLOG::set_status_variables(THD *thd)
}
}
/*
Find the Gtid_list_log_event at the start of a binlog.
NULL for ok, non-NULL error message for error.
If ok, then the event is returned in *out_gtid_list. This can be NULL if we
get back to binlogs written by old server version without GTID support. If
so, it means we have reached the point to start from, as no GTID events can
exist in earlier binlogs.
*/
const char *
get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list)
{
Format_description_log_event init_fdle(BINLOG_VERSION);
Format_description_log_event *fdle;
Log_event *ev;
const char *errormsg = NULL;
*out_gtid_list= NULL;
if (!(ev= Log_event::read_log_event(cache, 0, &init_fdle,
opt_master_verify_checksum)) ||
ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
{
if (ev)
delete ev;
return "Could not read format description log event while looking for "
"GTID position in binlog";
}
fdle= static_cast<Format_description_log_event *>(ev);
for (;;)
{
Log_event_type typ;
ev= Log_event::read_log_event(cache, 0, fdle, opt_master_verify_checksum);
if (!ev)
{
errormsg= "Could not read GTID list event while looking for GTID "
"position in binlog";
break;
}
typ= ev->get_type_code();
if (typ == GTID_LIST_EVENT)
break; /* Done, found it */
if (typ == START_ENCRYPTION_EVENT)
{
if (fdle->start_decryption((Start_encryption_log_event*) ev))
errormsg= "Could not set up decryption for binlog.";
}
delete ev;
if (typ == ROTATE_EVENT || typ == STOP_EVENT ||
typ == FORMAT_DESCRIPTION_EVENT || typ == START_ENCRYPTION_EVENT)
continue; /* Continue looking */
/* We did not find any Gtid_list_log_event, must be old binlog. */
ev= NULL;
break;
}
delete fdle;
*out_gtid_list= static_cast<Gtid_list_log_event *>(ev);
return errormsg;
}
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };

View file

@ -760,7 +760,7 @@ public:
int update_log_index(LOG_INFO* linfo, bool need_update_threads);
int rotate(bool force_rotate, bool* check_purge);
void checkpoint_and_purge(ulong binlog_id);
int rotate_and_purge(bool force_rotate);
int rotate_and_purge(bool force_rotate, DYNAMIC_ARRAY* drop_gtid_domain= NULL);
/**
Flush binlog cache and synchronize to disk.
@ -1169,4 +1169,9 @@ static inline TC_LOG *get_tc_log_implementation()
return &tc_log_mmap;
}
class Gtid_list_log_event;
const char *
get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list);
#endif /* LOG_H */

View file

@ -5885,9 +5885,6 @@ int mysqld_main(int argc, char **argv)
#ifdef __WIN__
if (!opt_console)
{
if (reopen_fstreams(log_error_file, stdout, stderr))
unireg_abort(1);
setbuf(stderr, NULL);
FreeConsole(); // Remove window
}

View file

@ -42,13 +42,12 @@ partition_info *partition_info::get_clone(THD *thd)
List_iterator<partition_element> part_it(partitions);
partition_element *part;
partition_info *clone= new (mem_root) partition_info();
partition_info *clone= new (mem_root) partition_info(*this);
if (!clone)
{
mem_alloc_error(sizeof(partition_info));
DBUG_RETURN(NULL);
}
memcpy(clone, this, sizeof(partition_info));
memset(&(clone->read_partitions), 0, sizeof(clone->read_partitions));
memset(&(clone->lock_partitions), 0, sizeof(clone->lock_partitions));
clone->bitmaps_are_initialized= FALSE;

View file

@ -26,7 +26,7 @@
#include "key.h"
#include "rpl_gtid.h"
#include "rpl_rli.h"
#include "log_event.h"
const LEX_STRING rpl_gtid_slave_state_table_name=
{ C_STRING_WITH_LEN("gtid_slave_pos") };
@ -1727,6 +1727,155 @@ end:
return res;
}
/**
Remove domains supplied by the first argument from binlog state.
Removal is done for any domain whose last gtids (from all its servers) match
ones in Gtid list event of the 2nd argument.
@param ids gtid domain id sequence, may contain dups
@param glev pointer to Gtid list event describing
the match condition
@param errbuf [out] pointer to possible error message array
@retval NULL as success when at least one domain is removed
@retval "" empty string to indicate ineffective call
when no domains removed
@retval NOT EMPTY string otherwise an error message
*/
const char*
rpl_binlog_state::drop_domain(DYNAMIC_ARRAY *ids,
Gtid_list_log_event *glev,
char* errbuf)
{
DYNAMIC_ARRAY domain_unique; // sequece (unsorted) of unique element*:s
rpl_binlog_state::element* domain_unique_buffer[16];
ulong k, l;
const char* errmsg= NULL;
DBUG_ENTER("rpl_binlog_state::drop_domain");
my_init_dynamic_array2(&domain_unique,
sizeof(element*), domain_unique_buffer,
sizeof(domain_unique_buffer) / sizeof(element*), 4, 0);
mysql_mutex_lock(&LOCK_binlog_state);
/*
Gtid list is supposed to come from a binlog's Gtid_list event and
therefore should be a subset of the current binlog state. That is
for every domain in the list the binlog state contains a gtid with
sequence number not less than that of the list.
Exceptions of this inclusion rule are:
A. the list may still refer to gtids from already deleted domains.
Files containing them must have been purged whereas the file
with the list is not yet.
B. out of order groups were injected
C. manually build list of binlog files violating the inclusion
constraint.
While A is a normal case (not necessarily distinguishable from C though),
B and C may require the user's attention so any (incl the A's suspected)
inconsistency is diagnosed and *warned*.
*/
for (l= 0, errbuf[0]= 0; l < glev->count; l++, errbuf[0]= 0)
{
rpl_gtid* rb_state_gtid= find_nolock(glev->list[l].domain_id,
glev->list[l].server_id);
if (!rb_state_gtid)
sprintf(errbuf,
"missing gtids from the '%u-%u' domain-server pair which is "
"referred to in the gtid list describing an earlier state. Ignore "
"if the domain ('%u') was already explicitly deleted",
glev->list[l].domain_id, glev->list[l].server_id,
glev->list[l].domain_id);
else if (rb_state_gtid->seq_no < glev->list[l].seq_no)
sprintf(errbuf,
"having a gtid '%u-%u-%llu' which is less than "
"the '%u-%u-%llu' of the gtid list describing an earlier state. "
"The state may have been affected by manually injecting "
"a lower sequence number gtid or via replication",
rb_state_gtid->domain_id, rb_state_gtid->server_id,
rb_state_gtid->seq_no, glev->list[l].domain_id,
glev->list[l].server_id, glev->list[l].seq_no);
if (strlen(errbuf)) // use strlen() as cheap flag
push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
ER_BINLOG_CANT_DELETE_GTID_DOMAIN,
"The current gtid binlog state is incompatible with "
"a former one %s.", errbuf);
}
/*
For each domain_id from ids
when no such domain in binlog state
warn && continue
For each domain.server's last gtid
when not locate the last gtid in glev.list
error out binlog state can't change
otherwise continue
*/
for (ulong i= 0; i < ids->elements; i++)
{
rpl_binlog_state::element *elem= NULL;
ulong *ptr_domain_id;
bool not_match;
ptr_domain_id= (ulong*) dynamic_array_ptr(ids, i);
elem= (rpl_binlog_state::element *)
my_hash_search(&hash, (const uchar *) ptr_domain_id, 0);
if (!elem)
{
push_warning_printf(current_thd, Sql_condition::WARN_LEVEL_WARN,
ER_BINLOG_CANT_DELETE_GTID_DOMAIN,
"The gtid domain being deleted ('%lu') is not in "
"the current binlog state", *ptr_domain_id);
continue;
}
for (not_match= true, k= 0; k < elem->hash.records; k++)
{
rpl_gtid *d_gtid= (rpl_gtid *)my_hash_element(&elem->hash, k);
for (ulong l= 0; l < glev->count && not_match; l++)
not_match= !(*d_gtid == glev->list[l]);
}
if (not_match)
{
sprintf(errbuf, "binlog files may contain gtids from the domain ('%lu') "
"being deleted. Make sure to first purge those files",
*ptr_domain_id);
errmsg= errbuf;
goto end;
}
// compose a sequence of unique pointers to domain object
for (k= 0; k < domain_unique.elements; k++)
{
if ((rpl_binlog_state::element*) dynamic_array_ptr(&domain_unique, k)
== elem)
break; // domain_id's elem has been already in
}
if (k == domain_unique.elements) // proven not to have duplicates
insert_dynamic(&domain_unique, (uchar*) &elem);
}
// Domain removal from binlog state
for (k= 0; k < domain_unique.elements; k++)
{
rpl_binlog_state::element *elem= *(rpl_binlog_state::element**)
dynamic_array_ptr(&domain_unique, k);
my_hash_free(&elem->hash);
my_hash_delete(&hash, (uchar*) elem);
}
DBUG_ASSERT(strlen(errbuf) == 0);
if (domain_unique.elements == 0)
errmsg= "";
end:
mysql_mutex_unlock(&LOCK_binlog_state);
delete_dynamic(&domain_unique);
DBUG_RETURN(errmsg);
}
slave_connection_state::slave_connection_state()
{

View file

@ -34,6 +34,13 @@ struct rpl_gtid
uint64 seq_no;
};
inline bool operator==(const rpl_gtid& lhs, const rpl_gtid& rhs)
{
return
lhs.domain_id == rhs.domain_id &&
lhs.server_id == rhs.server_id &&
lhs.seq_no == rhs.seq_no;
};
enum enum_gtid_skip_type {
GTID_SKIP_NOT, GTID_SKIP_STANDALONE, GTID_SKIP_TRANSACTION
@ -93,6 +100,7 @@ struct gtid_waiting {
class Relay_log_info;
struct rpl_group_info;
class Gtid_list_log_event;
/*
Replication slave state.
@ -257,6 +265,7 @@ struct rpl_binlog_state
rpl_gtid *find_nolock(uint32 domain_id, uint32 server_id);
rpl_gtid *find(uint32 domain_id, uint32 server_id);
rpl_gtid *find_most_recent(uint32 domain_id);
const char* drop_domain(DYNAMIC_ARRAY *ids, Gtid_list_log_event *glev, char*);
};

View file

@ -1801,8 +1801,8 @@ ER_WRONG_AUTO_KEY 42000 S1009
spa "Puede ser solamente un campo automatico y este debe ser definido como una clave"
swe "Det får finnas endast ett AUTO_INCREMENT-fält och detta måste vara en nyckel"
ukr "Невірне визначення таблиці; Може бути лише один автоматичний стовбець, що повинен бути визначений як ключ"
ER_UNUSED_9
eng "You should never see it"
ER_BINLOG_CANT_DELETE_GTID_DOMAIN
eng "Could not delete gtid domain. Reason: %s."
ER_NORMAL_SHUTDOWN
cze "%s (%s): normální ukončení\n"
dan "%s (%s): Normal nedlukning\n"
@ -7330,7 +7330,7 @@ ER_SUBQUERIES_NOT_SUPPORTED 42000
eng "%s does not support subqueries or stored functions"
ER_SET_STATEMENT_NOT_SUPPORTED 42000
eng "The system variable %.200s cannot be set in SET STATEMENT."
ER_UNUSED_17
ER_UNUSED_9
eng "You should never see it"
ER_USER_CREATE_EXISTS
eng "Can't create user '%-.64s'@'%-.64s'; it already exists"

View file

@ -1022,6 +1022,19 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
if (check_stack_overrun(thd, 7 * STACK_MIN_SIZE, (uchar*)&old_packet))
DBUG_RETURN(TRUE);
/*
Normally the counter is not reset between parsing and first execution,
but it is possible in case of error to have parsing on one CALL and
first execution (where VIEW will be parsed and added). So we store the
counter after parsing and restore it before execution just to avoid
repeating SELECT numbers.
Other problem is that it can be more SELECTs parsed in case of fixing
error causes previous interruption of the SP. So it is save not just
assign old value but add it.
*/
thd->select_number+= m_select_number;
/* init per-instruction memroot */
init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
@ -1361,6 +1374,16 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
m_recursion_level + 1));
m_first_instance->m_first_free_instance= this;
/*
This execution of the SP was aborted with an error (e.g. "Table not
found"). However it might still have consumed some numbers from the
thd->select_number counter. The next sp->exec() call must not use the
consumed numbers, so we remember the first free number (We know that
nobody will use it as this execution has stopped with an error).
*/
if (err_status)
set_select_number(thd->select_number);
DBUG_RETURN(err_status);
}
@ -2046,26 +2069,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
if (!err_status)
{
/*
Normally the counter is not reset between parsing and first execution,
but it is possible in case of error to have parsing on one CALL and
first execution (where VIEW will be parsed and added). So we store the
counter after parsing and restore it before execution just to avoid
repeating SELECT numbers.
*/
thd->select_number= m_select_number;
err_status= execute(thd, TRUE);
DBUG_PRINT("info", ("execute returned %d", (int) err_status));
/*
This execution of the SP was aborted with an error (e.g. "Table not
found"). However it might still have consumed some numbers from the
thd->select_number counter. The next sp->exec() call must not use the
consumed numbers, so we remember the first free number (We know that
nobody will use it as this execution has stopped with an error).
*/
if (err_status)
set_select_number(thd->select_number);
}
if (save_log_general)

View file

@ -5004,17 +5004,14 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
extern "C" int thd_binlog_format(const MYSQL_THD thd)
{
#ifdef WITH_WSREP
if (WSREP(thd))
{
/* for wsrep binlog format is meaningful also when binlogging is off */
return (int) WSREP_BINLOG_FORMAT(thd->variables.binlog_format);
return (int) thd->wsrep_binlog_format();
}
#endif /* WITH_WSREP */
if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
return (int) thd->variables.binlog_format;
else
return BINLOG_FORMAT_UNSPEC;
return BINLOG_FORMAT_UNSPEC;
}
extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all)

View file

@ -828,6 +828,7 @@ void lex_end_stage2(LEX *lex)
/* Reset LEX_MASTER_INFO */
lex->mi.reset(lex->sql_command == SQLCOM_CHANGE_MASTER);
delete_dynamic(&lex->delete_gtid_domain);
DBUG_VOID_RETURN;
}
@ -3034,6 +3035,10 @@ LEX::LEX()
INITIAL_LEX_PLUGIN_LIST_SIZE, 0);
reset_query_tables_list(TRUE);
mi.init();
init_dynamic_array2(&delete_gtid_domain, sizeof(ulong*),
gtid_domain_static_buffer,
initial_gtid_domain_buffer_size,
initial_gtid_domain_buffer_size, 0);
}

View file

@ -2948,6 +2948,13 @@ public:
*/
Item *limit_rows_examined;
ulonglong limit_rows_examined_cnt;
/**
Holds a set of domain_ids for deletion at FLUSH..DELETE_DOMAIN_ID
*/
DYNAMIC_ARRAY delete_gtid_domain;
static const ulong initial_gtid_domain_buffer_size= 16;
ulong gtid_domain_static_buffer[initial_gtid_domain_buffer_size];
inline void set_limit_rows_examined()
{
if (limit_rows_examined)

View file

@ -6257,6 +6257,24 @@ finish:
THD_STAGE_INFO(thd, stage_rollback);
trans_rollback_stmt(thd);
}
#ifdef WITH_WSREP
else if (thd->spcont &&
(thd->wsrep_conflict_state == MUST_ABORT ||
thd->wsrep_conflict_state == CERT_FAILURE))
{
/*
The error was cleared, but THD was aborted by wsrep and
wsrep_conflict_state is still set accordingly. This
situation is expected if we are running a stored procedure
that declares a handler that catches ER_LOCK_DEADLOCK error.
In which case the error may have been cleared in method
sp_rcontext::handle_sql_condition().
*/
trans_rollback_stmt(thd);
thd->wsrep_conflict_state= NO_CONFLICT;
thd->killed= NOT_KILLED;
}
#endif /* WITH_WSREP */
else
{
/* If commit fails, we should be able to reset the OK status. */

View file

@ -153,7 +153,10 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
tmp_write_to_binlog= 0;
if (mysql_bin_log.is_open())
{
if (mysql_bin_log.rotate_and_purge(true))
DYNAMIC_ARRAY *drop_gtid_domain=
(thd && (thd->lex->delete_gtid_domain.elements > 0)) ?
&thd->lex->delete_gtid_domain : NULL;
if (mysql_bin_log.rotate_and_purge(true, drop_gtid_domain))
*write_to_binlog= -1;
if (WSREP_ON)

View file

@ -30,7 +30,7 @@
#include <my_dir.h>
#include "rpl_handler.h"
#include "debug_sync.h"
#include "log.h" // get_gtid_list_event
enum enum_gtid_until_state {
GTID_UNTIL_NOT_DONE,
@ -875,72 +875,6 @@ get_binlog_list(MEM_ROOT *memroot)
DBUG_RETURN(current_list);
}
/*
Find the Gtid_list_log_event at the start of a binlog.
NULL for ok, non-NULL error message for error.
If ok, then the event is returned in *out_gtid_list. This can be NULL if we
get back to binlogs written by old server version without GTID support. If
so, it means we have reached the point to start from, as no GTID events can
exist in earlier binlogs.
*/
static const char *
get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list)
{
Format_description_log_event init_fdle(BINLOG_VERSION);
Format_description_log_event *fdle;
Log_event *ev;
const char *errormsg = NULL;
*out_gtid_list= NULL;
if (!(ev= Log_event::read_log_event(cache, 0, &init_fdle,
opt_master_verify_checksum)) ||
ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
{
if (ev)
delete ev;
return "Could not read format description log event while looking for "
"GTID position in binlog";
}
fdle= static_cast<Format_description_log_event *>(ev);
for (;;)
{
Log_event_type typ;
ev= Log_event::read_log_event(cache, 0, fdle, opt_master_verify_checksum);
if (!ev)
{
errormsg= "Could not read GTID list event while looking for GTID "
"position in binlog";
break;
}
typ= ev->get_type_code();
if (typ == GTID_LIST_EVENT)
break; /* Done, found it */
if (typ == START_ENCRYPTION_EVENT)
{
if (fdle->start_decryption((Start_encryption_log_event*) ev))
errormsg= "Could not set up decryption for binlog.";
}
delete ev;
if (typ == ROTATE_EVENT || typ == STOP_EVENT ||
typ == FORMAT_DESCRIPTION_EVENT || typ == START_ENCRYPTION_EVENT)
continue; /* Continue looking */
/* We did not find any Gtid_list_log_event, must be old binlog. */
ev= NULL;
break;
}
delete fdle;
*out_gtid_list= static_cast<Gtid_list_log_event *>(ev);
return errormsg;
}
/*
Check if every GTID requested by the slave is contained in this (or a later)

View file

@ -81,7 +81,6 @@ int rpl_append_gtid_state(String *dest, bool use_binlog);
int rpl_load_gtid_state(slave_connection_state *state, bool use_binlog);
bool rpl_gtid_pos_check(THD *thd, char *str, size_t len);
bool rpl_gtid_pos_update(THD *thd, char *str, size_t len);
#else
struct LOAD_FILE_IO_CACHE : public IO_CACHE { };

View file

@ -5190,12 +5190,13 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
if (share->tmp_table == SYSTEM_TMP_TABLE)
table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"), cs);
else if (share->tmp_table)
table->field[3]->store(STRING_WITH_LEN("LOCAL TEMPORARY"), cs);
else if (share->table_type == TABLE_TYPE_SEQUENCE)
table->field[3]->store(STRING_WITH_LEN("SEQUENCE"), cs);
else
{
DBUG_ASSERT(share->tmp_table == NO_TMP_TABLE);
table->field[3]->store(STRING_WITH_LEN("BASE TABLE"), cs);
}
for (int i= 4; i < 20; i++)
{

View file

@ -1027,6 +1027,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token DEFINER_SYM
%token DELAYED_SYM
%token DELAY_KEY_WRITE_SYM
%token DELETE_DOMAIN_ID_SYM
%token DELETE_SYM /* SQL-2003-R */
%token DENSE_RANK_SYM
%token DESC /* SQL-2003-N */
@ -1908,6 +1909,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
vcol_opt_attribute_list vcol_attribute
opt_serial_attribute opt_serial_attribute_list serial_attribute
explainable_command
opt_delete_gtid_domain
END_OF_INPUT
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@ -13567,7 +13569,7 @@ flush_option:
{ Lex->type|= REFRESH_GENERAL_LOG; }
| SLOW LOGS_SYM
{ Lex->type|= REFRESH_SLOW_LOG; }
| BINARY LOGS_SYM
| BINARY LOGS_SYM opt_delete_gtid_domain
{ Lex->type|= REFRESH_BINARY_LOG; }
| RELAY LOGS_SYM optional_connection_name
{
@ -13624,6 +13626,24 @@ opt_table_list:
| table_list {}
;
opt_delete_gtid_domain:
/* empty */ {}
| DELETE_DOMAIN_ID_SYM '=' '(' delete_domain_id_list ')'
{}
;
delete_domain_id_list:
/* Empty */
| delete_domain_id
| delete_domain_id_list ',' delete_domain_id
;
delete_domain_id:
ulong_num
{
insert_dynamic(&Lex->delete_gtid_domain, (uchar*) &($1));
}
;
optional_flush_tables_arguments:
/* empty */ {$$= 0;}
| AND_SYM DISABLE_SYM CHECKPOINT_SYM {$$= REFRESH_CHECKPOINT; }

View file

@ -436,6 +436,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token DEFINER_SYM
%token DELAYED_SYM
%token DELAY_KEY_WRITE_SYM
%token DELETE_DOMAIN_ID_SYM
%token DELETE_SYM /* SQL-2003-R */
%token DENSE_RANK_SYM
%token DESC /* SQL-2003-N */

View file

@ -28,11 +28,19 @@
#endif
#ifdef HAVE_IOCP
#define OPTIONAL_IO_POLL_READ_PARAM &overlapped
#define OPTIONAL_IO_POLL_READ_PARAM this
#else
#define OPTIONAL_IO_POLL_READ_PARAM 0
#endif
#ifdef _WIN32
typedef HANDLE TP_file_handle;
#else
typedef int TP_file_handle;
#define INVALID_HANDLE_VALUE -1
#endif
#include <sql_connect.h>
#include <mysqld.h>
#include <debug_sync.h>
@ -59,10 +67,10 @@ typedef OVERLAPPED_ENTRY native_event;
#pragma warning (disable : 4312)
#endif
static void io_poll_close(int fd)
static void io_poll_close(TP_file_handle fd)
{
#ifdef _WIN32
CloseHandle((HANDLE)fd);
CloseHandle(fd);
#else
close(fd);
#endif
@ -151,14 +159,17 @@ struct TP_connection_generic:public TP_connection
TP_connection_generic **prev_in_queue;
ulonglong abs_wait_timeout;
ulonglong dequeue_time;
TP_file_handle fd;
bool bound_to_poll_descriptor;
int waiting;
#ifdef HAVE_IOCP
OVERLAPPED overlapped;
#endif
#ifdef _WIN32
enum_vio_type vio_type;
#endif
};
typedef TP_connection_generic TP_connection_generic;
typedef I_P_List<TP_connection_generic,
I_P_List_adapter<TP_connection_generic,
@ -177,7 +188,7 @@ struct thread_group_t
worker_list_t waiting_threads;
worker_thread_t *listener;
pthread_attr_t *pthread_attr;
int pollfd;
TP_file_handle pollfd;
int thread_count;
int active_thread_count;
int connection_count;
@ -245,11 +256,11 @@ static void print_pool_blocked_message(bool);
Creates an io_poll descriptor
On Linux: epoll_create()
- io_poll_associate_fd(int poll_fd, int fd, void *data, void *opt)
- io_poll_associate_fd(int poll_fd, TP_file_handle fd, void *data, void *opt)
Associate file descriptor with io poll descriptor
On Linux : epoll_ctl(..EPOLL_CTL_ADD))
- io_poll_disassociate_fd(int pollfd, int fd)
- io_poll_disassociate_fd(TP_file_handle pollfd, TP_file_handle fd)
Associate file descriptor with io poll descriptor
On Linux: epoll_ctl(..EPOLL_CTL_DEL)
@ -259,7 +270,7 @@ static void print_pool_blocked_message(bool);
io_poll_associate_fd() was called.
On Linux : epoll_ctl(..EPOLL_CTL_MOD)
- io_poll_wait (int pollfd, native_event *native_events, int maxevents,
- io_poll_wait (TP_file_handle pollfd, native_event *native_events, int maxevents,
int timeout_ms)
wait until one or more descriptors added with io_poll_associate_fd()
@ -276,13 +287,13 @@ static void print_pool_blocked_message(bool);
/* Early 2.6 kernel did not have EPOLLRDHUP */
#define EPOLLRDHUP 0
#endif
static int io_poll_create()
static TP_file_handle io_poll_create()
{
return epoll_create(1);
}
int io_poll_associate_fd(int pollfd, int fd, void *data, void*)
int io_poll_associate_fd(TP_file_handle pollfd, TP_file_handle fd, void *data, void*)
{
struct epoll_event ev;
ev.data.u64= 0; /* Keep valgrind happy */
@ -293,7 +304,7 @@ int io_poll_associate_fd(int pollfd, int fd, void *data, void*)
int io_poll_start_read(int pollfd, int fd, void *data, void *)
int io_poll_start_read(TP_file_handle pollfd, TP_file_handle fd, void *data, void *)
{
struct epoll_event ev;
ev.data.u64= 0; /* Keep valgrind happy */
@ -302,7 +313,7 @@ int io_poll_start_read(int pollfd, int fd, void *data, void *)
return epoll_ctl(pollfd, EPOLL_CTL_MOD, fd, &ev);
}
int io_poll_disassociate_fd(int pollfd, int fd)
int io_poll_disassociate_fd(TP_file_handle pollfd, TP_file_handle fd)
{
struct epoll_event ev;
return epoll_ctl(pollfd, EPOLL_CTL_DEL, fd, &ev);
@ -314,7 +325,7 @@ int io_poll_disassociate_fd(int pollfd, int fd)
NOTE - in case of EINTR, it restarts with original timeout. Since we use
either infinite or 0 timeouts, this is not critical
*/
int io_poll_wait(int pollfd, native_event *native_events, int maxevents,
int io_poll_wait(TP_file_handle pollfd, native_event *native_events, int maxevents,
int timeout_ms)
{
int ret;
@ -347,12 +358,12 @@ static void *native_event_get_userdata(native_event *event)
#endif
int io_poll_create()
TP_file_handle io_poll_create()
{
return kqueue();
}
int io_poll_start_read(int pollfd, int fd, void *data,void *)
int io_poll_start_read(TP_file_handle pollfd, TP_file_handle fd, void *data,void *)
{
struct kevent ke;
MY_EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT,
@ -361,7 +372,7 @@ int io_poll_start_read(int pollfd, int fd, void *data,void *)
}
int io_poll_associate_fd(int pollfd, int fd, void *data,void *)
int io_poll_associate_fd(TP_file_handle pollfd, TP_file_handle fd, void *data,void *)
{
struct kevent ke;
MY_EV_SET(&ke, fd, EVFILT_READ, EV_ADD|EV_ONESHOT,
@ -370,7 +381,7 @@ int io_poll_associate_fd(int pollfd, int fd, void *data,void *)
}
int io_poll_disassociate_fd(int pollfd, int fd)
int io_poll_disassociate_fd(TP_file_handle pollfd, TP_file_handle fd)
{
struct kevent ke;
MY_EV_SET(&ke,fd, EVFILT_READ, EV_DELETE, 0, 0, 0);
@ -378,7 +389,7 @@ int io_poll_disassociate_fd(int pollfd, int fd)
}
int io_poll_wait(int pollfd, struct kevent *events, int maxevents, int timeout_ms)
int io_poll_wait(TP_file_handle pollfd, struct kevent *events, int maxevents, int timeout_ms)
{
struct timespec ts;
int ret;
@ -403,27 +414,27 @@ static void* native_event_get_userdata(native_event *event)
#elif defined (__sun)
static int io_poll_create()
static TP_file_handle io_poll_create()
{
return port_create();
}
int io_poll_start_read(int pollfd, int fd, void *data, void *)
int io_poll_start_read(TP_file_handle pollfd, TP_file_handle fd, void *data, void *)
{
return port_associate(pollfd, PORT_SOURCE_FD, fd, POLLIN, data);
}
static int io_poll_associate_fd(int pollfd, int fd, void *data, void *)
static int io_poll_associate_fd(TP_file_handle pollfd, TP_file_handle fd, void *data, void *)
{
return io_poll_start_read(pollfd, fd, data, 0);
}
int io_poll_disassociate_fd(int pollfd, int fd)
int io_poll_disassociate_fd(TP_file_handle pollfd, TP_file_handle fd)
{
return port_dissociate(pollfd, PORT_SOURCE_FD, fd);
}
int io_poll_wait(int pollfd, native_event *events, int maxevents, int timeout_ms)
int io_poll_wait(TP_file_handle pollfd, native_event *events, int maxevents, int timeout_ms)
{
struct timespec ts;
int ret;
@ -451,25 +462,32 @@ static void* native_event_get_userdata(native_event *event)
#elif defined(HAVE_IOCP)
static int io_poll_create()
static TP_file_handle io_poll_create()
{
HANDLE h= CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0);
return PtrToInt(h);
return CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0);
}
int io_poll_start_read(int pollfd, int fd, void *, void *opt)
int io_poll_start_read(TP_file_handle pollfd, TP_file_handle fd, void *, void *opt)
{
DWORD num_bytes = 0;
static char c;
TP_connection_generic *con= (TP_connection_generic *)opt;
OVERLAPPED *overlapped= &con->overlapped;
if (con->vio_type == VIO_TYPE_NAMEDPIPE)
{
if (ReadFile(fd, &c, 0, NULL, overlapped))
return 0;
}
else
{
WSABUF buf;
buf.buf= &c;
buf.len= 0;
DWORD flags=0;
WSABUF buf;
buf.buf= &c;
buf.len= 0;
DWORD flags=0;
if (WSARecv((SOCKET)fd, &buf, 1, &num_bytes, &flags, (OVERLAPPED *)opt, NULL) == 0)
return 0;
if (WSARecv((SOCKET)fd, &buf, 1,NULL, &flags,overlapped, NULL) == 0)
return 0;
}
if (GetLastError() == ERROR_IO_PENDING)
return 0;
@ -478,26 +496,26 @@ int io_poll_start_read(int pollfd, int fd, void *, void *opt)
}
static int io_poll_associate_fd(int pollfd, int fd, void *data, void *opt)
static int io_poll_associate_fd(TP_file_handle pollfd, TP_file_handle fd, void *data, void *opt)
{
HANDLE h= CreateIoCompletionPort(IntToPtr(fd), IntToPtr(pollfd), (ULONG_PTR)data, 0);
HANDLE h= CreateIoCompletionPort(fd, pollfd, (ULONG_PTR)data, 0);
if (!h)
return -1;
return io_poll_start_read(pollfd,fd, 0, opt);
}
int io_poll_disassociate_fd(int pollfd, int fd)
int io_poll_disassociate_fd(TP_file_handle pollfd, TP_file_handle fd)
{
/* Not possible to unbind/rebind file descriptor in IOCP. */
return 0;
}
int io_poll_wait(int pollfd, native_event *events, int maxevents, int timeout_ms)
int io_poll_wait(TP_file_handle pollfd, native_event *events, int maxevents, int timeout_ms)
{
ULONG n;
BOOL ok = GetQueuedCompletionStatusEx((HANDLE)pollfd, events,
BOOL ok = GetQueuedCompletionStatusEx(pollfd, events,
maxevents, &n, timeout_ms, FALSE);
return ok ? (int)n : -1;
@ -1038,7 +1056,7 @@ int thread_group_init(thread_group_t *thread_group, pthread_attr_t* thread_attr)
DBUG_ENTER("thread_group_init");
thread_group->pthread_attr = thread_attr;
mysql_mutex_init(key_group_mutex, &thread_group->mutex, NULL);
thread_group->pollfd= -1;
thread_group->pollfd= INVALID_HANDLE_VALUE;
thread_group->shutdown_pipe[0]= -1;
thread_group->shutdown_pipe[1]= -1;
queue_init(thread_group);
@ -1049,10 +1067,10 @@ int thread_group_init(thread_group_t *thread_group, pthread_attr_t* thread_attr)
void thread_group_destroy(thread_group_t *thread_group)
{
mysql_mutex_destroy(&thread_group->mutex);
if (thread_group->pollfd != -1)
if (thread_group->pollfd != INVALID_HANDLE_VALUE)
{
io_poll_close(thread_group->pollfd);
thread_group->pollfd= -1;
thread_group->pollfd= INVALID_HANDLE_VALUE;
}
#ifndef HAVE_IOCP
for(int i=0; i < 2; i++)
@ -1109,7 +1127,7 @@ static int wake_listener(thread_group_t *thread_group)
if (write(thread_group->shutdown_pipe[1], &c, 1) < 0)
return -1;
#else
PostQueuedCompletionStatus((HANDLE)thread_group->pollfd, 0, 0, 0);
PostQueuedCompletionStatus(thread_group->pollfd, 0, 0, 0);
#endif
return 0;
}
@ -1432,6 +1450,16 @@ TP_connection_generic::TP_connection_generic(CONNECT *c):
, overlapped()
#endif
{
DBUG_ASSERT(c->vio);
#ifdef _WIN32
vio_type= c->vio->type;
fd= (vio_type == VIO_TYPE_NAMEDPIPE) ?
c->vio->hPipe: (TP_file_handle)mysql_socket_getfd(c->vio->mysql_socket);
#else
fd= mysql_socket_getfd(c->vio->mysql_socket);
#endif
/* Assign connection to a group. */
thread_group_t *group=
&all_groups[c->thread_id%group_count];
@ -1486,7 +1514,6 @@ static int change_group(TP_connection_generic *c,
thread_group_t *new_group)
{
int ret= 0;
int fd= (int)mysql_socket_getfd(c->thd->net.vio->mysql_socket);
DBUG_ASSERT(c->thread_group == old_group);
@ -1494,7 +1521,7 @@ static int change_group(TP_connection_generic *c,
mysql_mutex_lock(&old_group->mutex);
if (c->bound_to_poll_descriptor)
{
io_poll_disassociate_fd(old_group->pollfd,fd);
io_poll_disassociate_fd(old_group->pollfd,c->fd);
c->bound_to_poll_descriptor= false;
}
c->thread_group->connection_count--;
@ -1513,9 +1540,7 @@ static int change_group(TP_connection_generic *c,
int TP_connection_generic::start_io()
{
int fd= (int)mysql_socket_getfd(thd->net.vio->mysql_socket);
{
#ifndef HAVE_IOCP
/*
Usually, connection will stay in the same group for the entire
@ -1666,10 +1691,10 @@ int TP_pool_generic::set_pool_size(uint size)
{
thread_group_t *group= &all_groups[i];
mysql_mutex_lock(&group->mutex);
if (group->pollfd == -1)
if (group->pollfd == INVALID_HANDLE_VALUE)
{
group->pollfd= io_poll_create();
success= (group->pollfd >= 0);
success= (group->pollfd != INVALID_HANDLE_VALUE);
if(!success)
{
sql_print_error("io_poll_create() failed, errno=%d\n", errno);
@ -1707,7 +1732,7 @@ int TP_pool_generic::set_stall_limit(uint limit)
int TP_pool_generic::get_idle_thread_count()
{
int sum=0;
for (uint i= 0; i < threadpool_max_size && all_groups[i].pollfd >= 0; i++)
for (uint i= 0; i < threadpool_max_size && all_groups[i].pollfd != INVALID_HANDLE_VALUE; i++)
{
sum+= (all_groups[i].thread_count - all_groups[i].active_thread_count);
}

View file

@ -508,6 +508,9 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
}
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
DEBUG_SYNC(thd, "wsrep_after_replication");
switch(rcode) {
case 0:
/*

View file

@ -2022,7 +2022,7 @@ static bool abort_replicated(THD *thd)
bool ret_code= false;
if (thd->wsrep_query_state== QUERY_COMMITTING)
{
WSREP_DEBUG("aborting replicated trx: %lu", thd->real_id);
WSREP_DEBUG("aborting replicated trx: %llu", (ulonglong)(thd->real_id));
(void)wsrep_abort_thd(thd, thd, TRUE);
ret_code= true;

View file

@ -327,8 +327,9 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type)
if (wsrep_inited == 1)
wsrep_deinit(false);
char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
//when fails
if (wsrep_init())
{
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp, my_error, "wsrep_init failed");

View file

@ -61,7 +61,7 @@ IF(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -fexceptions -fPIC ")
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} inihandl.c)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} inihandl.cpp)
SET(IPHLPAPI_LIBRARY "")
ELSE(NOT UNIX)
SET(CONNECT_SOURCES ${CONNECT_SOURCES}

0
storage/connect/filamvct.cpp Executable file → Normal file
View file

View file

@ -217,7 +217,8 @@ DllExport int PlugExit(PGLOBAL); // Plug global termination
DllExport LPSTR PlugRemoveType(LPSTR, LPCSTR);
DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR prefix, LPCSTR name, LPCSTR dir);
DllExport BOOL PlugIsAbsolutePath(LPCSTR path);
DllExport void *PlugAllocMem(PGLOBAL, uint);
DllExport bool AllocSarea(PGLOBAL, uint);
DllExport void FreeSarea(PGLOBAL);
DllExport BOOL PlugSubSet(PGLOBAL, void *, uint);
DllExport void *PlugSubAlloc(PGLOBAL, void *, size_t);
DllExport char *PlugDup(PGLOBAL g, const char *str);

View file

@ -3009,7 +3009,9 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
return NULL;
if (!x) {
const char *p;
char *s = (ishav) ? havg : body;
uint j, k, n;
// Append the value to the filter
switch (args[i]->field_type()) {
@ -3065,16 +3067,38 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond)
strcat(s, "'}");
break;
default:
strcat(s, "'");
strncat(s, res->ptr(), res->length());
strcat(s, "'");
} // endswitch field type
j = strlen(s);
s[j++] = '\'';
p = res->ptr();
n = res->length();
for (k = 0; k < n; k++) {
if (p[k] == '\'')
s[j++] = '\'';
s[j++] = p[k];
} // endfor k
s[j++] = '\'';
s[j] = 0;
} // endswitch field type
} else {
strcat(s, "'");
strncat(s, res->ptr(), res->length());
strcat(s, "'");
} // endif tty
j = strlen(s);
s[j++] = '\'';
p = res->ptr();
n = res->length();
for (k = 0; k < n; k++) {
if (p[k] == '\'')
s[j++] = '\'';
s[j++] = p[k];
} // endfor k
s[j++] = '\'';
s[j] = 0;
} // endif tty
break;
default:

View file

@ -37,7 +37,7 @@
// The types and variables used locally
//typedef int bool;
typedef unsigned int uint;
#define SVP(S) ((S) ? S : "<null>")
//#define SVP(S) ((S) ? S : "<null>")
#define _strlwr(P) strlwr(P) //OB: changed this line
#define MAX_PATHNAME_LEN 256
#define N_CACHED_PROFILES 10
@ -61,8 +61,8 @@ void htrc(char const *fmt, ...)
} /* end of htrc */
#else // !TEST_MODULE
// Normal included functions
extern int trace;
void htrc(char const *fmt, ...);
//extern int trace;
//void htrc(char const *fmt, ...);
#endif // !TEST MODULE
@ -112,10 +112,11 @@ static PROFILE *MRUProfile[N_CACHED_PROFILES] = {NULL};
//static CRITICAL_SECTION PROFILE_CritSect = CRITICAL_SECTION_INIT("PROFILE_CritSect");
static const char hex[16] = "0123456789ABCDEF";
static const char hex[17] = "0123456789ABCDEF";
BOOL WritePrivateProfileString(LPCSTR section, LPCSTR entry,
LPCSTR string, LPCSTR filename );
LPCSTR string, LPCSTR filename);
/***********************************************************************
* PROFILE_CopyEntry
*
@ -254,7 +255,7 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
PROFILESECTION* *next_section;
PROFILEKEY *key, *prev_key, **next_key;
first_section = malloc(sizeof(*section));
first_section = (PROFILESECTION*)malloc(sizeof(*section));
if (first_section == NULL)
return NULL;
@ -281,7 +282,7 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
*p2 = '\0';
p++;
if (!(section = malloc(sizeof(*section) + strlen(p))))
if (!(section = (PROFILESECTION*)malloc(sizeof(*section) + strlen(p))))
break;
strcpy(section->name, p);
@ -319,13 +320,13 @@ static PROFILESECTION *PROFILE_Load( FILE *file )
} // endif p2
if (*p || !prev_key || *prev_key->name) {
if (!(key = malloc(sizeof(*key) + strlen(p))))
if (!(key = (PROFILEKEY*)malloc(sizeof(*key) + strlen(p))))
break;
strcpy(key->name, p);
if (p2) {
key->value = malloc(strlen(p2)+1);
key->value = (char*)malloc(strlen(p2)+1);
strcpy(key->value, p2);
} else
key->value = NULL;
@ -452,7 +453,7 @@ static BOOL PROFILE_Open(LPCSTR filename)
/* First time around */
if (!CurProfile)
for (i = 0; i < N_CACHED_PROFILES; i++) {
MRUProfile[i] = malloc(sizeof(PROFILE));
MRUProfile[i] = (PROFILE*)malloc(sizeof(PROFILE));
if (MRUProfile[i] == NULL)
break;
@ -520,7 +521,7 @@ static BOOL PROFILE_Open(LPCSTR filename)
// strcpy(newdos_name, filename);
// CurProfile->dos_name = newdos_name;
CurProfile->filename = malloc(strlen(filename) + 1);
CurProfile->filename = (char*)malloc(strlen(filename) + 1);
strcpy(CurProfile->filename, filename);
/* Try to open the profile file, first in $HOME/.wine */
@ -783,7 +784,7 @@ static PROFILEKEY *PROFILE_Find(PROFILESECTION* *section,
if (!create)
return NULL;
if (!(*key = malloc(sizeof(PROFILEKEY) + strlen(key_name))))
if (!(*key = (PROFILEKEY*)malloc(sizeof(PROFILEKEY) + strlen(key_name))))
return NULL;
strcpy((*key)->name, key_name);
@ -798,7 +799,7 @@ static PROFILEKEY *PROFILE_Find(PROFILESECTION* *section,
if (!create)
return NULL;
*section = malloc(sizeof(PROFILESECTION) + strlen(section_name));
*section = (PROFILESECTION*)malloc(sizeof(PROFILESECTION) + strlen(section_name));
if (*section == NULL)
return NULL;
@ -806,7 +807,7 @@ static PROFILEKEY *PROFILE_Find(PROFILESECTION* *section,
strcpy((*section)->name, section_name);
(*section)->next = NULL;
if (!((*section)->key = malloc(sizeof(PROFILEKEY) + strlen(key_name)))) {
if (!((*section)->key = (tagPROFILEKEY*)malloc(sizeof(PROFILEKEY) + strlen(key_name)))) {
free(*section);
return NULL;
} // endif malloc
@ -1052,7 +1053,7 @@ static BOOL PROFILE_SetString(LPCSTR section_name, LPCSTR key_name,
} else if (trace > 1)
htrc(" creating key\n" );
key->value = malloc(strlen(value) + 1);
key->value = (char*)malloc(strlen(value) + 1);
strcpy(key->value, value);
CurProfile->changed = TRUE;
} // endelse
@ -1125,7 +1126,7 @@ static int PROFILE_GetPrivateProfileString(LPCSTR section, LPCSTR entry,
if (*p == ' ') { /* ouch, contained trailing ' ' */
int len = p - (LPSTR)def_val;
pDefVal = malloc(len + 1);
pDefVal = (LPSTR)malloc(len + 1);
strncpy(pDefVal, def_val, len);
pDefVal[len] = '\0';
} // endif *p
@ -1277,7 +1278,7 @@ BOOL WritePrivateProfileSection(LPCSTR section,
ret = TRUE;
while (*string) {
LPSTR buf = malloc(strlen(string) + 1);
LPSTR buf = (LPSTR)malloc(strlen(string) + 1);
strcpy(buf, string);
if ((p = strchr(buf, '='))) {

View file

@ -1507,23 +1507,16 @@ static my_bool CheckMemory(PGLOBAL g, UDF_INIT *initid, UDF_ARGS *args, uint n,
ml += g->More;
if (ml > g->Sarea_Size) {
#if !defined(DEVELOPMENT)
if (trace)
#endif
htrc("Freeing Sarea at %p size=%d\n", g->Sarea, g->Sarea_Size);
FreeSarea(g);
free(g->Sarea);
if (!(g->Sarea = PlugAllocMem(g, ml))) {
if (AllocSarea(g, ml)) {
char errmsg[MAX_STR];
snprintf(errmsg, sizeof(errmsg)-1, MSG(WORK_AREA), g->Message);
strcpy(g->Message, errmsg);
g->Sarea_Size = 0;
return true;
} // endif Alloc
} // endif SareaAlloc
g->Sarea_Size = ml;
g->Createas = 0;
g->Xchk = NULL;
initid->max_length = rl;

View file

@ -334,7 +334,7 @@ PDBUSER PlgMakeUser(PGLOBAL g)
{
PDBUSER dbuserp;
if (!(dbuserp = (PDBUSER)PlugAllocMem(g, (uint)sizeof(DBUSERBLK)))) {
if (!(dbuserp = (PDBUSER)malloc(sizeof(DBUSERBLK)))) {
sprintf(g->Message, MSG(MALLOC_ERROR), "PlgMakeUser");
return NULL;
} // endif dbuserp

View file

@ -138,7 +138,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
if (trace > 1)
htrc("PlugInit: Language='%s'\n",
((!Language) ? "Null" : (char*)Language));
((!Language) ? "Null" : (char*)Language));
try {
g = new GLOBAL;
@ -160,13 +160,11 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
/*******************************************************************/
/* Allocate the main work segment. */
/*******************************************************************/
if (worksize && !(g->Sarea = PlugAllocMem(g, worksize))) {
if (worksize && AllocSarea(g, worksize)) {
char errmsg[MAX_STR];
snprintf(errmsg, sizeof(errmsg) - 1, MSG(WORK_AREA), g->Message);
strcpy(g->Message, errmsg);
g->Sarea_Size = 0;
} else
g->Sarea_Size = worksize;
} // endif Sarea
g->jump_level = -1; /* New setting to allow recursive call of Plug */
return(g);
@ -183,15 +181,7 @@ int PlugExit(PGLOBAL g)
if (dup)
free(dup);
if (g->Sarea) {
#if !defined(DEVELOPMENT)
if (trace)
#endif
htrc("Freeing Sarea at %p size=%d\n", g->Sarea, g->Sarea_Size);
free(g->Sarea);
} // endif Sarea
FreeSarea(g);
delete g;
} // endif g
@ -459,30 +449,65 @@ short GetLineLength(PGLOBAL g)
/***********************************************************************/
/* Program for memory allocation of work and language areas. */
/***********************************************************************/
void *PlugAllocMem(PGLOBAL g, uint size)
bool AllocSarea(PGLOBAL g, uint size)
{
void *areap; /* Pointer to allocated area */
/*********************************************************************/
/* This is the allocation routine for the WIN32/UNIX/AIX version. */
/*********************************************************************/
if (!(areap = malloc(size)))
sprintf(g->Message, MSG(MALLOC_ERROR), "malloc");
#if defined(__WIN__)
if (size >= 1048576) // 1M
g->Sarea = VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
else
#endif
g->Sarea = malloc(size);
if (!g->Sarea) {
sprintf(g->Message, MSG(MALLOC_ERROR), "malloc");
g->Sarea_Size = 0;
} else
g->Sarea_Size = size;
#if defined(DEVELOPMENT)
if (true) {
#else
if (trace) {
#endif
if (areap)
htrc("Memory of %u allocated at %p\n", size, areap);
if (g->Sarea)
htrc("Work area of %u allocated at %p\n", size, g->Sarea);
else
htrc("PlugAllocMem: %s\n", g->Message);
htrc("SareaAlloc: %s\n", g->Message);
} // endif trace
return (areap);
} // end of PlugAllocMem
return (!g->Sarea);
} // end of AllocSarea
/***********************************************************************/
/* Program for memory freeing the work area. */
/***********************************************************************/
void FreeSarea(PGLOBAL g)
{
if (g->Sarea) {
#if defined(__WIN__)
if (g->Sarea_Size >= 1048576) // 1M
VirtualFree(g->Sarea, 0, MEM_RELEASE);
else
#endif
free(g->Sarea);
#if defined(DEVELOPMENT)
if (true)
#else
if (trace)
#endif
htrc("Freeing Sarea at %p size = %d\n", g->Sarea, g->Sarea_Size);
g->Sarea = NULL;
g->Sarea_Size = 0;
} // endif Sarea
return;
} // end of FreeSarea
/***********************************************************************/
/* Program for SubSet initialization of memory pools. */

View file

@ -547,14 +547,12 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
} // endif dladdr
#endif // 0
// Is the library already loaded?
if (!Hdll && !(Hdll = dlopen(soname, RTLD_NOLOAD)))
// Load the desired shared library
if (!(Hdll = dlopen(soname, RTLD_LAZY))) {
error = dlerror();
sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
return NULL;
} // endif Hdll
// Load the desired shared library
if (!Hdll && !(Hdll = dlopen(soname, RTLD_LAZY))) {
error = dlerror();
sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error));
return NULL;
} // endif Hdll
// The exported name is always in uppercase
for (int i = 0; ; i++) {

View file

@ -156,29 +156,20 @@ void user_connect::SetHandler(ha_connect *hc)
bool user_connect::CheckCleanup(bool force)
{
if (thdp->query_id > last_query_id || force) {
uint worksize= GetWorkSize();
uint worksize= GetWorkSize(), size = g->Sarea_Size;
PlugCleanup(g, true);
if (g->Sarea_Size != worksize) {
if (g->Sarea) {
#if !defined(DEVELOPMENT)
if (trace)
#endif
htrc("CheckCleanup: Free Sarea at %p size=%d\n",
g->Sarea, g->Sarea_Size);
free(g->Sarea);
} // endif Size
if (size != worksize) {
FreeSarea(g);
// Check whether the work area could be allocated
if (!(g->Sarea = PlugAllocMem(g, worksize))) {
g->Sarea = PlugAllocMem(g, g->Sarea_Size);
if (AllocSarea(g, worksize)) {
AllocSarea(g, size);
SetWorkSize(g->Sarea_Size); // Was too big
} else
g->Sarea_Size = worksize; // Ok
} // endif sarea
} // endif worksize
} // endif worksize
PlugSubSet(g, g->Sarea, g->Sarea_Size);
g->Xchk = NULL;

0
storage/connect/xindex.cpp Executable file → Normal file
View file

View file

@ -138,10 +138,13 @@ inline void* aligned_malloc(size_t size, size_t align) {
void *result;
#ifdef _MSC_VER
result = _aligned_malloc(size, align);
#else
#elif defined (HAVE_POSIX_MEMALIGN)
if(posix_memalign(&result, align, size)) {
result = 0;
}
#else
/* Use unaligned malloc as fallback */
result = malloc(size);
#endif
return result;
}

View file

@ -1197,11 +1197,12 @@ to original un-instrumented file I/O APIs */
# define os_file_read_no_error_handling(type, file, buf, offset, n, o) \
os_file_read_no_error_handling_func(type, file, buf, offset, n, o)
# define os_file_read_no_error_handling_int_fd(type, file, buf, offset, n) \
os_file_read_no_error_handling_func(type, file, buf, offset, n, NULL)
os_file_read_no_error_handling_func(type, OS_FILE_FROM_FD(file), buf, offset, n, NULL)
# define os_file_write(type, name, file, buf, offset, n) \
os_file_write_func(type, name, file, buf, offset, n)
# define os_file_write_int_fd os_file_write_func
# define os_file_write_int_fd(type, name, file, buf, offset, n) \
os_file_write_func(type, name, OS_FILE_FROM_FD(file), buf, offset, n)
# define os_file_flush(file) os_file_flush_func(file)

View file

@ -163,6 +163,11 @@ IF(NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i686")
ENDIF()
CHECK_FUNCTION_EXISTS(posix_memalign HAVE_POSIX_MEMALIGN)
IF(HAVE_POSIX_MEMALIGN)
ADD_DEFINITIONS(-DHAVE_POSIX_MEMALIGN)
ENDIF()
# Only use futexes on Linux if GCC atomics are available
IF(NOT MSVC AND NOT CMAKE_CROSSCOMPILING)
CHECK_C_SOURCE_RUNS(

View file

@ -1438,11 +1438,11 @@ row_ins_foreign_check_on_constraint(
#ifdef WITH_WSREP
err = wsrep_append_foreign_key(
thr_get_trx(thr),
foreign,
clust_rec,
clust_index,
FALSE, FALSE);
thr_get_trx(thr),
foreign,
clust_rec,
clust_index,
FALSE, FALSE);
if (err != DB_SUCCESS) {
fprintf(stderr,
"WSREP: foreign key append failed: %d\n", err);

View file

@ -15,7 +15,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
cmake_minimum_required(VERSION 2.6)
project(mroonga)
@ -51,6 +51,14 @@ if(MSVC)
endif()
endif()
if(MRN_BUNDLED)
if(WITHOUT_MROONGA OR
WITHOUT_MROONGA_STORAGE_ENGINE OR
"${PLUGIN_MROONGA}" STREQUAL "NO")
return()
endif()
endif()
set(MRN_BUNDLED_GROONGA_RELATIVE_DIR "vendor/groonga")
set(MRN_BUNDLED_GROONGA_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
@ -79,6 +87,58 @@ file(READ ${MRN_SOURCE_DIR}/version_micro MRN_VERSION_MICRO)
file(READ ${MRN_SOURCE_DIR}/version_in_hex MRN_VERSION_IN_HEX)
file(READ ${MRN_SOURCE_DIR}/plugin_version MRN_PLUGIN_VERSION)
if(MRN_GROONGA_BUNDLED)
option(MRN_GROONGA_EMBED
"Embed libgroonga"
ON)
if(MRN_GROONGA_EMBED)
set(GRN_EMBED ON)
endif()
set(MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR
"${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
option(MRN_GROONGA_NORMALIZER_MYSQL_EMBED
"Embed groonga-normalizer-mysql Groonga plugin"
ON)
if(EXISTS ${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR})
set(GROONGA_NORMALIZER_MYSQL_FOUND ON)
else()
set(GROONGA_NORMALIZER_MYSQL_FOUND OFF)
set(MRN_GROONGA_NORMALIZER_MYSQL_EMBED OFF)
endif()
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
endif()
file(READ "${MRN_BUNDLED_GROONGA_DIR}/bundled_lz4_version"
MRN_BUNDLED_LZ4_VERSION)
string(STRIP
"${MRN_BUNDLED_LZ4_VERSION}"
MRN_BUNDLED_LZ4_VERSION)
set(MRN_BUNDLED_LZ4_DIR
"${MRN_BUNDLED_GROONGA_DIR}/vendor/lz4-${MRN_BUNDLED_LZ4_VERSION}")
if(EXISTS ${MRN_BUNDLED_LZ4_DIR})
set(GRN_WITH_BUNDLED_LZ4 ON)
set(GRN_WITH_LZ4 "yes")
else()
set(GRN_WITH_LZ4 "no")
endif()
add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
else()
set(MRN_GROONGA_EMBED OFF)
file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION)
file(READ
${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version
REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
string(STRIP
"${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}"
REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
endif()
set(MRN_PACKAGE_STRING "${PROJECT_NAME} ${MRN_VERSION}")
include(CheckCCompilerFlag)
@ -107,18 +167,7 @@ read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/udf/sources.am MRN_UDF_SOURCES)
string(REGEX REPLACE "([^;]+)" "${MRN_RELATIVE_DIR_PREFIX}udf/\\1"
MRN_UDF_SOURCES "${MRN_UDF_SOURCES}")
set(MRN_ALL_SOURCES
${MRN_SOURCES}
${MRN_UDF_SOURCES}
${LIBMRN_NO_MYSQL_SOURCES}
${LIBMRN_NEED_MYSQL_SOURCES})
if(MRN_BUNDLED)
mysql_add_plugin(mroonga ${MRN_ALL_SOURCES} STORAGE_ENGINE MODULE_ONLY)
if(NOT TARGET mroonga)
return()
endif()
set(MYSQL_SOURCE_DIR ${CMAKE_SOURCE_DIR})
set(MYSQL_BUILD_DIR ${MYSQL_SOURCE_DIR})
set(MYSQL_CONFIG ${CMAKE_SOURCE_DIR}/scripts/mysql_config)
@ -134,44 +183,6 @@ else()
endif()
find_path(MYSQL_CONFIG "${MYSQL_CONFIG}")
if(MRN_GROONGA_BUNDLED)
option(MRN_GROONGA_EMBED
"Embed libgroonga"
ON)
if(MRN_GROONGA_EMBED)
set(GRN_EMBED ON)
endif()
set(MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR
"${MRN_BUNDLED_GROONGA_DIR}/vendor/plugins/groonga-normalizer-mysql")
option(MRN_GROONGA_NORMALIZER_MYSQL_EMBED
"Embed groonga-normalizer-mysql Groonga plugin"
ON)
if(EXISTS ${MRN_BUNDLED_GROONGA_NORMALIZER_MYSQL_DIR})
set(GROONGA_NORMALIZER_MYSQL_FOUND ON)
else()
set(GROONGA_NORMALIZER_MYSQL_FOUND OFF)
set(MRN_GROONGA_NORMALIZER_MYSQL_EMBED OFF)
endif()
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
set(GROONGA_NORMALIZER_MYSQL_EMBED ON)
endif()
add_subdirectory("${MRN_BUNDLED_GROONGA_RELATIVE_DIR}")
else()
set(MRN_GROONGA_EMBED OFF)
file(READ ${MRN_SOURCE_DIR}/required_groonga_version REQUIRED_GROONGA_VERSION)
string(STRIP "${REQUIRED_GROONGA_VERSION}" REQUIRED_GROONGA_VERSION)
file(READ
${MRN_SOURCE_DIR}/required_groonga_normalizer_mysql_version
REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
string(STRIP
"${REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION}"
REQUIRED_GROONGA_NORMALIZER_MYSQL_VERSION)
endif()
if(EXISTS "${MYSQL_SOURCE_DIR}/storage/maria")
set(MYSQL_VARIANT "MariaDB")
else()
@ -194,6 +205,7 @@ if(EXISTS "${MYSQL_SOURCE_DIR}/libbinlogevents")
set(MYSQL_LIBBINLOGEVENTS_EXPORT_DIR
"${MYSQL_SOURCE_DIR}/libbinlogevents/export")
set(MYSQL_LIBBINLOGEVENTS_INCLUDE_DIR
"${MYSQL_BUILD_DIR}/libbinlogevents/include"
"${MYSQL_SOURCE_DIR}/libbinlogevents/include")
else()
set(MYSQL_LIBBINLOGEVENTS_EXPORT_DIR)
@ -270,6 +282,7 @@ else()
set(MRN_LIBRARY_DIRS
${MRN_LIBRARY_DIRS}
${GROONGA_LIBRARY_DIRS})
set(MRN_LIBRARIES ${GROONGA_LIBRARIES})
endif()
include_directories(
@ -291,11 +304,17 @@ link_directories(
${MRN_LIBRARY_DIRS}
${MYSQL_LIBRARY_DIRS})
set(MRN_ALL_SOURCES
${MRN_SOURCES}
${MRN_UDF_SOURCES}
${LIBMRN_NO_MYSQL_SOURCES}
${LIBMRN_NEED_MYSQL_SOURCES})
if(MRN_BUNDLED)
target_link_libraries(mroonga ${MRN_LIBRARIES})
if(NOT TARGET mroonga)
return()
endif()
mysql_add_plugin(mroonga
${MRN_ALL_SOURCES}
STORAGE_ENGINE MODULE_ONLY
LINK_LIBRARIES ${MRN_LIBRARIES})
else()
add_library(mroonga MODULE ${MRN_ALL_SOURCES})
@ -340,8 +359,12 @@ else()
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-strict-aliasing")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated")
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-implicit-templates")
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-exceptions")
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-rtti")
if(("${MYSQL_VARIANT}" STREQUAL "MariaDB") OR
("${MYSQL_VARIANT}" STREQUAL "MySQL" AND
${MYSQL_VERSION} VERSION_LESS "5.7.0"))
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-exceptions")
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-rtti")
endif()
MY_CHECK_AND_SET_COMPILER_FLAG("-felide-constructors")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
endif()
@ -362,10 +385,20 @@ else()
install(TARGETS mroonga DESTINATION "${MYSQL_PLUGIN_DIR}")
endif()
option(MRN_BUILD_FOR_EMBEDDED_SERVER
"Whether to build Mroonga for embedded server or not. You can't use Mroonga built for embedded server with non embedded server."
OFF)
if(MRN_BUILD_FOR_EMBEDDED_SERVER)
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
endif()
if(GROONGA_NORMALIZER_MYSQL_FOUND)
add_definitions("-DWITH_GROONGA_NORMALIZER_MYSQL=1")
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "WITH_GROONGA_NORMALIZER_MYSQL=1")
if(MRN_GROONGA_NORMALIZER_MYSQL_EMBED)
add_definitions("-DMRN_GROONGA_NORMALIZER_MYSQL_EMBEDDED")
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "MRN_GROONGA_NORMALIZER_MYSQL_EMBEDDED")
else()
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME=\"normalizers/mysql\"")
@ -373,7 +406,8 @@ if(GROONGA_NORMALIZER_MYSQL_FOUND)
endif()
if(MRN_GROONGA_EMBED)
add_definitions("-DMRN_GROONGA_EMBEDDED")
set_property(TARGET mroonga APPEND PROPERTY
COMPILE_DEFINITIONS "MRN_GROONGA_EMBEDDED")
endif()
set(MRN_DEFAULT_PARSER "" CACHE STRING
@ -419,6 +453,8 @@ else()
set(MRN_DATA_DIR "share/${PROJECT_NAME}")
endif()
install(FILES
"${PROJECT_SOURCE_DIR}/AUTHORS"
"${PROJECT_SOURCE_DIR}/COPYING"
"${PROJECT_BINARY_DIR}/data/install.sql"
"${PROJECT_SOURCE_DIR}/data/uninstall.sql"
DESTINATION "${MRN_DATA_DIR}/")

View file

@ -1,9 +1,9 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_ARGS}
AUTOMAKE_OPTIONS = 1.9.7
LOCALES = ja
AM_CPPFLAGS = $(MYSQL_INCLUDES) $(GROONGA_CFLAGS) -I$(top_srcdir)/lib
ACLOCAL_AMFLAGS = $$ACLOCAL_ARGS
include sources.am
@ -49,7 +49,13 @@ tag:
cd $(top_srcdir) && \
git tag v$(VERSION) -a -m 'Mroonga $(VERSION)!!!'
update-latest-release: misc
ensure-cutter-source-path:
@if test -z "$(CUTTER_SOURCE_PATH)"; then \
echo "\$$(CUTTER_SOURCE_PATH) is missing"; \
exit 1; \
fi
update-latest-release: ensure-cutter-source-path
@if test -z "$(OLD_RELEASE)"; then \
echo "\$$(OLD_RELEASE) is missing"; \
exit 1; \
@ -63,17 +69,40 @@ update-latest-release: misc
exit 1; \
fi
cd $(top_srcdir) && \
misc/update-latest-release.rb \
"$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \
$(PACKAGE) $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
$(VERSION) $(NEW_RELEASE_DATE) \
packages/rpm/centos/mariadb-mroonga.spec.in \
packages/rpm/centos/mariadb-10.1-mroonga.spec.in \
packages/rpm/centos/mariadb-10.2-mroonga.spec.in \
packages/rpm/centos/mysql55-mroonga.spec.in \
packages/rpm/centos/mysql56-community-mroonga.spec.in \
packages/debian/changelog \
packages/rpm/centos/mysql57-community-mroonga.spec.in \
packages/rpm/centos/percona-server-56-mroonga.spec.in \
packages/rpm/centos/percona-server-57-mroonga.spec.in \
doc/source/install/*.rst \
doc/locale/*/LC_MESSAGES/install.po \
$(MROONGA_GITHUB_COM_PATH)/index.html \
$(MROONGA_GITHUB_COM_PATH)/ja/index.html
$(MROONGA_GITHUB_COM_PATH)/_config.yml
cd $(top_srcdir) && \
"$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \
$(PACKAGE)-5.5 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
$(VERSION) $(NEW_RELEASE_DATE) \
packages/debian-5.5/changelog
cd $(top_srcdir) && \
"$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \
$(PACKAGE)-5.6 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
$(VERSION) $(NEW_RELEASE_DATE) \
packages/debian-5.6/changelog
cd $(top_srcdir) && \
"$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \
$(PACKAGE)-5.7 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
$(VERSION) $(NEW_RELEASE_DATE) \
packages/debian-5.7/changelog
cd $(top_srcdir) && \
"$(CUTTER_SOURCE_PATH)/misc/update-latest-release.rb" \
$(PACKAGE)-mariadb-10.0 $(OLD_RELEASE) $(OLD_RELEASE_DATE) \
$(VERSION) $(NEW_RELEASE_DATE) \
packages/debian-mariadb-10.0/changelog
update-po:
@for lang in $(LOCALES); do \
@ -144,10 +173,3 @@ upload-to-github:
echo-cutter:
echo $(CUTTER)
misc:
@if test -z "$(CUTTER_SOURCE_PATH)"; then \
echo "\$$(CUTTER_SOURCE_PATH) is missing"; \
exit 1; \
fi
ln -s "$(CUTTER_SOURCE_PATH)/misc" misc

View file

@ -1,54 +1,63 @@
version: "{build}"
clone_depth: 10
environment:
global:
MARIADB_VERSION: 10.1.26
matrix:
- CMAKE_GENERATOR_NAME: "Visual Studio 14 2015"
- CMAKE_GENERATOR_NAME: "Visual Studio 14 2015 Win64"
install:
- cd ..
- choco install -y curl 7zip.commandline
- curl -O http://mirror.jmu.edu/pub/mariadb/mariadb-10.0.20/source/mariadb-10.0.20.tar.gz
- 7z x mariadb-10.0.20.tar.gz
- 7z x mariadb-10.0.20.tar > nul
- cd mariadb-10.0.20
- curl -O http://mirror.jmu.edu/pub/mariadb/mariadb-%MARIADB_VERSION%/source/mariadb-%MARIADB_VERSION%.tar.gz
- 7z x mariadb-%MARIADB_VERSION%.tar.gz
- 7z x mariadb-%MARIADB_VERSION%.tar > nul
- cd mariadb-%MARIADB_VERSION%
- rmdir /S /Q storage\mroonga\
- move ..\mroonga storage\mroonga
- git clone --quiet --depth 1 https://github.com/groonga/groonga.git ..\groonga
- cd ..\groonga
- git submodule update --init
- cd ..\mariadb-10.0.20
- git clone --quiet --depth 1 --recursive https://github.com/groonga/groonga.git ..\groonga
- rmdir /S /Q ..\groonga\test\
- cd ..\groonga\vendor
- c:\Ruby22-x64\bin\ruby -v download_lz4.rb
- c:\Ruby22-x64\bin\ruby -v download_mecab.rb
- cd ..\..\mariadb-%MARIADB_VERSION%
- mkdir storage\mroonga\vendor
- move ..\groonga storage\mroonga\vendor\groonga
- git clone --quiet --depth 1 https://github.com/groonga/groonga-normalizer-mysql.git storage\mroonga\vendor\groonga\vendor\plugins\groonga-normalizer-mysql
build_script:
- "echo # > win\\packaging\\CMakeLists.txt"
- cmake . -G "Visual Studio 12 Win64"
- cmake . -G "%CMAKE_GENERATOR_NAME%"
-DCMAKE_BUILD_TYPE=Debug
-DWITHOUT_ARCHIVE=ON
-DWITHOUT_BLACKHOLE=ON
-DWITHOUT_CASSANDRA=ON
-DWITHOUT_CONNECT=ON
-DWITHOUT_CSV=ON
-DWITHOUT_EXAMPLE=ON
-DWITHOUT_FEDERATED=ON
-DWITHOUT_FEDERATEDX=ON
-DWITHOUT_HEAP=ON
-DWITHOUT_INNOBASE=ON
-DWITHOUT_MYISAM=ON
-DWITHOUT_MYISAMMRG=ON
-DWITHOUT_OQGRAPH=ON
-DWITHOUT_PERFSCHEMA=OFF
-DWITHOUT_SEQUENCE=ON
-DWITHOUT_SPHINX=ON
-DWITHOUT_SPIDER=ON
-DWITHOUT_TEST_SQL_DISCOVERY=ON
-DWITHOUT_TOKUDB=ON
-DWITHOUT_XTRADB=ON
-DPLUGIN_ARCHIVE=NO
-DPLUGIN_BLACKHOLE=NO
-DPLUGIN_CASSANDRA=NO
-DPLUGIN_CONNECT=NO
-DPLUGIN_CSV=NO
-DPLUGIN_EXAMPLE=NO
-DPLUGIN_FEDERATED=NO
-DPLUGIN_FEDERATEDX=NO
-DPLUGIN_HEAP=NO
-DPLUGIN_INNOBASE=NO
-DPLUGIN_MYISAM=NO
-DPLUGIN_MYISAMMRG=NO
-DPLUGIN_OQGRAPH=NO
-DPLUGIN_PERFSCHEMA=NO
-DPLUGIN_SEQUENCE=NO
-DPLUGIN_SPHINX=NO
-DPLUGIN_SPIDER=NO
-DPLUGIN_TEST_SQL_DISCOVERY=NO
-DPLUGIN_TOKUDB=NO
-DPLUGIN_XTRADB=NO
-DWITH_UNIT_TESTS=OFF
-DWITH_MARIABACKUP=OFF
-DGRN_WITH_BUNDLED_MECAB=ON
- cmake --build . --config Debug
notifications:
- provider: Email
to:
- groonga-mysql-commit@lists.sourceforge.jp
- kou@clear-code.com
on_build_status_changed: true
test: off

View file

@ -1,116 +1,11 @@
#!/bin/sh
warn() {
echo " WARNING: $@" 1>&2
}
# init
LIBTOOLIZE=libtoolize
ACLOCAL=aclocal
AUTOCONF=autoconf
AUTOHEADER=autoheader
AUTOMAKE=automake
case `uname -s` in
Darwin)
LIBTOOLIZE=glibtoolize
;;
case $(uname -s) in
FreeBSD)
ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/"
;;
ACLOCAL_ARGS="$ACLOCAL_ARGS -I /usr/local/share/aclocal/"
;;
esac
mkdir -p m4
# libtoolize
echo "Searching libtoolize..."
if [ `which $LIBTOOLIZE` ] ; then
echo " FOUND: libtoolize -> $LIBTOOLIZE"
else
warn "Cannot Found libtoolize... input libtool command"
read LIBTOOLIZE
LIBTOOLIZE=`which $LIBTOOLIZE`
if [ `which $LIBTOOLIZE` ] ; then
echo " SET: libtoolize -> $LIBTOOLIZE"
else
warn "$LIBTOOLIZE: Command not found."
exit 1;
fi
fi
# aclocal
echo "Searching aclocal..."
if [ `which $ACLOCAL` ] ; then
echo " FOUND: aclocal -> $ACLOCAL"
else
warn "Cannot Found aclocal... input aclocal command"
read ACLOCAL
ACLOCAL=`which $ACLOCAL`
if [ `which $ACLOCAL` ] ; then
echo " SET: aclocal -> $ACLOCAL"
else
warn "$ACLOCAL: Command not found."
exit 1;
fi
fi
# automake
echo "Searching automake..."
if [ `which $AUTOMAKE` ] ; then
echo " FOUND: automake -> $AUTOMAKE"
else
warn "Cannot Found automake... input automake command"
read AUTOMAKE
ACLOCAL=`which $AUTOMAKE`
if [ `which $AUTOMAKE` ] ; then
echo " SET: automake -> $AUTOMAKE"
else
warn "$AUTOMAKE: Command not found."
exit 1;
fi
fi
# autoheader
echo "Searching autoheader..."
if [ `which $AUTOHEADER` ] ; then
echo " FOUND: autoheader -> $AUTOHEADER"
else
warn "Cannot Found autoheader... input autoheader command"
read AUTOHEADER
ACLOCAL=`which $AUTOHEADER`
if [ `which $AUTOHEADER` ] ; then
echo " SET: autoheader -> $AUTOHEADER"
else
warn "$AUTOHEADER: Command not found."
exit 1;
fi
fi
# autoconf
echo "Searching autoconf..."
if [ `which $AUTOCONF` ] ; then
echo " FOUND: autoconf -> $AUTOCONF"
else
warn "Cannot Found autoconf... input autoconf command"
read AUTOCONF
ACLOCAL=`which $AUTOCONF`
if [ `which $AUTOCONF` ] ; then
echo " SET: autoconf -> $AUTOCONF"
else
warn "$AUTOCONF: Command not found."
exit 1;
fi
fi
set -e
echo "Running libtoolize ..."
$LIBTOOLIZE --force --copy
echo "Running aclocal ..."
$ACLOCAL ${ACLOCAL_ARGS}
echo "Running autoheader..."
$AUTOHEADER
echo "Running automake ..."
$AUTOMAKE --add-missing --copy
echo "Running autoconf ..."
$AUTOCONF
${AUTORECONF:-autoreconf} --force --install "$@"

View file

@ -10,10 +10,8 @@ PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = $(PAPEROPT_$(PAPER)) -E $(SPHINXOPTS) $(SOURCE_DIR)
SPHINX_DIR = $(abs_top_builddir)/doc/sphinx
SPHINX_BUILD_COMMAND = \
DOCUMENT_VERSION="$(DOCUMENT_VERSION)" \
DOCUMENT_VERSION_FULL="$(DOCUMENT_VERSION_FULL)" \
LOCALE="$(LOCALE)" \
PYTHONPATH="$(SPHINX_DIR):$$PYTHONPATH" \
$(SPHINX_BUILD)

View file

@ -12,7 +12,7 @@
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_SOURCE_DIR="@MYSQL_SOURCE_DIR@"
MYSQL_BUILD_DIR="@MYSQL_BUILD_DIR@"

Some files were not shown because too many files have changed in this diff Show more