Skip to content

Commit

Permalink
Merge branch '10.2' into bb-10.2-mariarocks
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrunia committed Dec 21, 2017
2 parents 15219eb + 207976d commit 9c28fd7
Show file tree
Hide file tree
Showing 101 changed files with 1,452 additions and 757 deletions.
4 changes: 2 additions & 2 deletions client/mysql_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ static struct my_option my_long_options[]=
"server with which it was built/distributed.",
&opt_version_check, &opt_version_check, 0,
GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"write-binlog", OPT_WRITE_BINLOG, "All commands including those, "
"issued by mysqlcheck, are written to the binary log.",
{"write-binlog", OPT_WRITE_BINLOG, "All commands including those "
"issued by mysqlcheck are written to the binary log.",
&opt_write_binlog, &opt_write_binlog, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
Expand Down
7 changes: 4 additions & 3 deletions extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1060,11 +1060,13 @@ struct my_option xb_server_options[] =
(G_PTR*) &defaults_group, (G_PTR*) &defaults_group,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

{"plugin-dir", OPT_PLUGIN_DIR, "Server plugin directory",
{"plugin-dir", OPT_PLUGIN_DIR,
"Server plugin directory. Used to load encryption plugin during 'prepare' phase."
"Has no effect in the 'backup' phase (plugin directory during backup is the same as server's)",
&xb_plugin_dir, &xb_plugin_dir,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },

{ "plugin-load", OPT_PLUGIN_LOAD, "encrypton plugin to load",
{ "plugin-load", OPT_PLUGIN_LOAD, "encrypton plugin to load during 'prepare' phase.",
&xb_plugin_load, &xb_plugin_load,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },

Expand Down Expand Up @@ -3626,7 +3628,6 @@ xtrabackup_backup_func()
/* Reset the system variables in the recovery module. */
recv_sys_var_init();
trx_pool_init();
row_mysql_init();

ut_crc32_init();
crc_init();
Expand Down
6 changes: 6 additions & 0 deletions include/ma_dyncol.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ typedef struct st_mysql_lex_string LEX_STRING;
/* NO and OK is the same used just to show semantics */
#define ER_DYNCOL_NO ER_DYNCOL_OK

#ifdef HAVE_CHARSET_utf8mb4
#define DYNCOL_UTF (&my_charset_utf8mb4_general_ci)
#else
#define DYNCOL_UTF (&my_charset_utf8_general_ci)
#endif

enum enum_dyncol_func_result
{
ER_DYNCOL_OK= 0,
Expand Down
3 changes: 1 addition & 2 deletions man/mysql_upgrade.1
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,7 @@ it was built/distributed. Defaults to on; use \fB\-\-skip\-version\-check\fR to
.sp
Cause binary logging to be enabled while
\fBmysql_upgrade\fR
runs\&. This is the default behavior; to disable binary logging during the upgrade, use the inverse of this option (that is, start the program with
\fB\-\-skip\-write\-binlog\fR)\&.
runs\&.
.RE
.SH "COPYRIGHT"
.br
Expand Down
15 changes: 0 additions & 15 deletions mysql-test/include/kill_and_restart_mysqld.inc

This file was deleted.

47 changes: 47 additions & 0 deletions mysql-test/r/cte_recursive.result
Original file line number Diff line number Diff line change
Expand Up @@ -2897,3 +2897,50 @@ n
1
2
3
#
# mdev-14629: a user-defined variable is defined by the recursive CTE
#
set @var=
(
with recursive cte_tab(a) as (
select 1
union
select a+1 from cte_tab
where a<3)
select count(*) from cte_tab
);
select @var;
@var
3
create table t1(a int, b int);
insert into t1 values (3,8),(1,5),(5,7),(7,4),(4,3);
set @var=
(
with recursive summ(a,s) as (
select 1, 0 union
select t1.b, t1.b+summ.s from summ, t1
where summ.a=t1.a)
select s from summ
order by a desc
limit 1
);
select @var;
@var
27
set @var=
(
with recursive
cte_1 as (
select 1
union
select * from cte_2),
cte_2 as (
select * from cte_1
union
select a from t1, cte_2
where t1.a=cte_2.a)
select * from cte_2
limit 1
);
ERROR HY000: Unacceptable mutual recursion with anchored table 'cte_1'
drop table t1;
15 changes: 15 additions & 0 deletions mysql-test/r/ctype_utf8.result
Original file line number Diff line number Diff line change
Expand Up @@ -10272,6 +10272,21 @@ DROP TABLE allbytes;
SET sql_mode = DEFAULT;
# End of ctype_backslash.inc
#
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
#
SET NAMES utf8;
SELECT CHAR(0xDF USING latin1);
CHAR(0xDF USING latin1)
ß
CREATE OR REPLACE VIEW v1 AS SELECT CHAR(0xDF USING latin1) AS c;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select char(0xdf using latin1) AS `c` utf8 utf8_general_ci
SELECT * FROM v1;
c
ß
DROP VIEW v1;
#
# End of 10.0 tests
#
#
Expand Down
26 changes: 26 additions & 0 deletions mysql-test/r/ctype_utf8mb4.result
Original file line number Diff line number Diff line change
Expand Up @@ -3430,6 +3430,32 @@ a b
a 😁 b a ? b
DROP TABLE t1;
#
# MDEV-8949: COLUMN_CREATE unicode name breakage
#
SET NAMES utf8mb4;
SELECT COLUMN_JSON(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1));
COLUMN_JSON(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1))
{"😎":1}
SELECT COLUMN_LIST(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1));
COLUMN_LIST(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1))
`😎`
SELECT COLUMN_GET(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1), _utf8mb4 0xF09F988E
as int);
COLUMN_GET(COLUMN_CREATE(_utf8mb4 0xF09F988E, 1), _utf8mb4 0xF09F988E
as int)
1
CREATE TABLE t1 AS SELECT
COLUMN_LIST(COLUMN_CREATE('a',1)),
COLUMN_JSON(COLUMN_CREATE('b',1));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`COLUMN_LIST(COLUMN_CREATE('a',1))` longtext CHARACTER SET utf8mb4 DEFAULT NULL,
`COLUMN_JSON(COLUMN_CREATE('b',1))` longtext CHARACTER SET utf8mb4 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
SET NAMES default;
#
# End of 10.0 tests
#
#
Expand Down
15 changes: 15 additions & 0 deletions mysql-test/r/func_misc.result
Original file line number Diff line number Diff line change
Expand Up @@ -1523,5 +1523,20 @@ str str1 b c
::10.0.5.9 ::10.0.5.9 1 0
DROP TABLE t1;
#
# MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields
#
CREATE TABLE `t1` (
`numgtfmt` char(10) COLLATE utf8_bin NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
create view v1(numgtfmt)
as
select 'x' from t1
union
select 'x' from t1 ;
SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLATE 'utf8_bin');
numgtfmt
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.2 tests
#
21 changes: 21 additions & 0 deletions mysql-test/r/func_str.result
Original file line number Diff line number Diff line change
Expand Up @@ -4556,6 +4556,27 @@ set global max_allowed_packet=default;
# End of 5.6 tests
#
#
# Start of 10.0 tests
#
#
# MDEV-12681 Wrong VIEW results for CHAR(0xDF USING latin1)
#
EXPLAIN EXTENDED SELECT CHAR(0xDF USING latin1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf using latin1) AS `CHAR(0xDF USING latin1)`
EXPLAIN EXTENDED SELECT CHAR(0xDF USING `binary`);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF USING ``binary``)`
EXPLAIN EXTENDED SELECT CHAR(0xDF);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select char(0xdf) AS `CHAR(0xDF)`
#
# Start of 10.1 tests
#
#
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/suite/innodb/r/innodb-autoinc.result
Original file line number Diff line number Diff line change
Expand Up @@ -1351,3 +1351,15 @@ t CREATE TABLE `t` (
KEY `i` (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=latin1
DROP TABLE t;
#
# MDEV-14008 Assertion failing: `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())
#
SET sql_mode=STRICT_ALL_TABLES;
CREATE TABLE t1 (
c1 DOUBLE NOT NULL PRIMARY KEY AUTO_INCREMENT
) ENGINE=InnoDB AUTO_INCREMENT=10000000000000000000;
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
c1
1e19
DROP TABLE t1;
57 changes: 57 additions & 0 deletions mysql-test/suite/innodb/r/lock_deleted.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
connect stop_purge, localhost, root,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connect delete, localhost, root,,;
connection default;
CREATE TABLE t1(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1,1);
DELETE FROM t1;
SET DEBUG_SYNC='row_ins_sec_index_unique SIGNAL inserted WAIT_FOR locked';
BEGIN;
INSERT INTO t1 VALUES(1,1);
connection delete;
SET DEBUG_SYNC='now WAIT_FOR inserted';
SET DEBUG_SYNC='innodb_row_search_for_mysql_exit SIGNAL locked';
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
DELETE FROM t1 WHERE b=1;
connection default;
connection delete;
COMMIT;
connection default;
SET DEBUG_SYNC='RESET';
ROLLBACK;
SET DEBUG_SYNC='row_ins_sec_index_unique SIGNAL inserted WAIT_FOR locked';
BEGIN;
INSERT INTO t1 VALUES(1,1);
connection delete;
SET DEBUG_SYNC='now WAIT_FOR inserted';
SET DEBUG_SYNC='innodb_row_search_for_mysql_exit SIGNAL locked';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
BEGIN;
DELETE FROM t1 WHERE b=1;
connection default;
connection delete;
COMMIT;
connection default;
SET DEBUG_SYNC='RESET';
ROLLBACK;
SET DEBUG_SYNC='row_ins_sec_index_unique SIGNAL inserted WAIT_FOR locked';
BEGIN;
SET innodb_lock_wait_timeout=1;
INSERT INTO t1 VALUES(1,1);
connection delete;
SET DEBUG_SYNC='now WAIT_FOR inserted';
SET DEBUG_SYNC='innodb_row_search_for_mysql_exit SIGNAL locked';
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
DELETE FROM t1 WHERE b=1;
connection default;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
COMMIT;
SET DEBUG_SYNC='RESET';
connection delete;
COMMIT;
disconnect delete;
disconnect stop_purge;
connection default;
DROP TABLE t1;
64 changes: 64 additions & 0 deletions mysql-test/suite/innodb/r/recovery_shutdown.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup
# while rolling back recovered incomplete transactions
#
CREATE TABLE t (a INT) ENGINE=InnoDB;
BEGIN;
COMMIT;
connect con$c,localhost,root,,;
CREATE TABLE t8 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t8 (a) SELECT NULL FROM t;
UPDATE t8 SET a=a+100, b=a;
DELETE FROM t8;
connect con$c,localhost,root,,;
CREATE TABLE t7 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t7 (a) SELECT NULL FROM t;
UPDATE t7 SET a=a+100, b=a;
DELETE FROM t7;
connect con$c,localhost,root,,;
CREATE TABLE t6 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t6 (a) SELECT NULL FROM t;
UPDATE t6 SET a=a+100, b=a;
DELETE FROM t6;
connect con$c,localhost,root,,;
CREATE TABLE t5 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t5 (a) SELECT NULL FROM t;
UPDATE t5 SET a=a+100, b=a;
DELETE FROM t5;
connect con$c,localhost,root,,;
CREATE TABLE t4 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t4 (a) SELECT NULL FROM t;
UPDATE t4 SET a=a+100, b=a;
DELETE FROM t4;
connect con$c,localhost,root,,;
CREATE TABLE t3 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t3 (a) SELECT NULL FROM t;
UPDATE t3 SET a=a+100, b=a;
DELETE FROM t3;
connect con$c,localhost,root,,;
CREATE TABLE t2 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t2 (a) SELECT NULL FROM t;
UPDATE t2 SET a=a+100, b=a;
DELETE FROM t2;
connect con$c,localhost,root,,;
CREATE TABLE t1 (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 (a) SELECT NULL FROM t;
UPDATE t1 SET a=a+100, b=a;
DELETE FROM t1;
INSERT INTO t1(a) SELECT NULL FROM t;
INSERT INTO t1(a) SELECT NULL FROM t1;
INSERT INTO t1(a) SELECT NULL FROM t1;
INSERT INTO t1(a) SELECT NULL FROM t1;
INSERT INTO t1(a) SELECT NULL FROM t1;
connection default;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
CREATE TABLE u(a SERIAL) ENGINE=INNODB;
DROP TABLE t,u;
1 change: 0 additions & 1 deletion mysql-test/suite/innodb/r/update_time.result
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ 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
Expand Down
12 changes: 12 additions & 0 deletions mysql-test/suite/innodb/t/innodb-autoinc.test
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,15 @@ INSERT INTO t VALUES (NULL);
SELECT * FROM t;
SHOW CREATE TABLE t;
DROP TABLE t;

--echo #
--echo # MDEV-14008 Assertion failing: `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())
--echo #

SET sql_mode=STRICT_ALL_TABLES;
CREATE TABLE t1 (
c1 DOUBLE NOT NULL PRIMARY KEY AUTO_INCREMENT
) ENGINE=InnoDB AUTO_INCREMENT=10000000000000000000;
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
DROP TABLE t1;
Loading

0 comments on commit 9c28fd7

Please sign in to comment.