Skip to content

Commit

Permalink
Merge bb-10.2-ext into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Dec 14, 2017
2 parents 159a6c2 + 1b5f0cb commit 866ccc8
Show file tree
Hide file tree
Showing 58 changed files with 663 additions and 378 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
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.

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
33 changes: 27 additions & 6 deletions mysql-test/r/func_str.result
Original file line number Diff line number Diff line change
Expand Up @@ -4734,6 +4734,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 Expand Up @@ -4843,6 +4864,12 @@ YQ== 61
Yq== 62
DROP TABLE t1;
#
# End of 10.1 tests
#
#
# Start of 10.3 tests
#
#
# MDEV-12685 Oracle-compatible function CHR()
#
select chr(65);
Expand All @@ -4859,12 +4886,6 @@ utf8 3 1
drop database mysqltest1;
use test;
#
# End of 10.1 tests
#
#
# Start of 10.3 tests
#
#
# MDEV-12592 Illegal mix of collations with the HEX function
#
SET NAMES utf8;
Expand Down
20 changes: 20 additions & 0 deletions mysql-test/r/loadxml.result
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,23 @@ LOAD XML INFILE '../../std_data/loaddata/mdev12696.xml' INTO TABLE v1 (c2);
ERROR HY000: Column 'c2' is not updatable
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-14628 Wrong autoinc value assigned by LOAD XML in the NO_AUTO_VALUE_ON_ZERO mode
#
SET sql_mode=NO_AUTO_VALUE_ON_ZERO;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT);
LOAD XML INFILE '../../std_data/loaddata/mdev14628a.xml' INTO TABLE t1 ROWS IDENTIFIED BY '<row>';
SELECT * FROM t1 ORDER BY b;
a b
1 bbb1
2 bbb2
DROP TABLE t1;
SET sql_mode=DEFAULT;
SET sql_mode='';
CREATE TABLE t1 (id INT, g GEOMETRY NOT NULL);
LOAD XML INFILE '../../std_data/loaddata/mdev14628b.xml' INTO TABLE t1 ROWS IDENTIFIED BY '<row>';
ERROR 22004: Column set to default value; NULL supplied to NOT NULL column 'g' at row 1
SELECT * FROM t1;
id g
DROP TABLE t1;
SET sql_mode=DEFAULT;
4 changes: 4 additions & 0 deletions mysql-test/std_data/loaddata/mdev14628a.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<list>
<row a="1" b="bbb1"/>
<row b="bbb2"/>
</list>
3 changes: 3 additions & 0 deletions mysql-test/std_data/loaddata/mdev14628b.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<list>
<row id="1"/>
</list>
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
59 changes: 59 additions & 0 deletions mysql-test/suite/innodb/t/recovery_shutdown.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
--source include/have_innodb.inc
--source include/not_embedded.inc

--echo #
--echo # MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup
--echo # while rolling back recovered incomplete transactions
--echo #

CREATE TABLE t (a INT) ENGINE=InnoDB;
let $size = 100;
let $trx = 8;
let $c = $size;
BEGIN;
--disable_query_log
while ($c) {
INSERT INTO t VALUES();
dec $c;
}
--enable_query_log
COMMIT;

let $c = $trx;
while ($c)
{
connect (con$c,localhost,root,,);
eval CREATE TABLE t$c (a SERIAL, b INT UNIQUE, c INT UNIQUE) ENGINE=InnoDB;
BEGIN;
eval INSERT INTO t$c (a) SELECT NULL FROM t;
eval UPDATE t$c SET a=a+$size, b=a;
eval DELETE FROM t$c;
dec $c;
}

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;

--let $shutdown_timeout=0
--source include/restart_mysqld.inc
--let $shutdown_timeout=60
--source include/restart_mysqld.inc

--disable_query_log
let $c = $trx;
while ($c)
{
disconnect con$c;
eval DROP TABLE t$c;
dec $c;
}
--enable_query_log

DROP TABLE t,u;
2 changes: 1 addition & 1 deletion mysql-test/suite/innodb/t/table_definition_cache_debug.opt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--innodb-open-files=13
--innodb-open-files=20
3 changes: 2 additions & 1 deletion mysql-test/suite/innodb/t/update_time.test
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ CONNECT (con1,localhost,root,,);
call mtr.add_suppression("Found 1 prepared XA transactions");
FLUSH TABLES;

--source include/kill_and_restart_mysqld.inc
--let $shutdown_timeout=0
--source include/restart_mysqld.inc

SELECT update_time FROM information_schema.tables WHERE table_name = 't';

Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/innodb_gis/r/kill_server.result
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ call mtr.add_suppression("InnoDB: A copy of page \[page id: space=[0-9]+, page n
START TRANSACTION;
CALL insert_t1(5000);
COMMIT;
# Kill and restart
drop procedure insert_t1;
drop table t1;
1 change: 0 additions & 1 deletion mysql-test/suite/innodb_gis/r/rtree_compress2.result
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ call mtr.add_suppression("InnoDB: A copy of page \[page id: space=[0-9]+, page n
START TRANSACTION;
CALL insert_t1(5000);
COMMIT;
# Kill and restart
drop procedure insert_t1;
drop table t1;
41 changes: 0 additions & 41 deletions mysql-test/suite/innodb_gis/r/rtree_crash.result

This file was deleted.

Loading

0 comments on commit 866ccc8

Please sign in to comment.