Skip to content
Permalink
Browse files
Merge 10.0 into 10.1
  • Loading branch information
dr-m committed Apr 24, 2018
2 parents 5b79303 + c7bb337 commit 9c34a41
Show file tree
Hide file tree
Showing 63 changed files with 644 additions and 250 deletions.
@@ -1418,7 +1418,7 @@ void close_statements()
for (con= connections; con < next_con; con++)
{
if (con->stmt)
mysql_stmt_close(con->stmt);
do_stmt_close(con);
con->stmt= 0;
}
DBUG_VOID_RETURN;
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2010, 2013, Monty Program Ab
Copyright (c) 2010, 2018, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1,7 +1,7 @@
#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
/* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
Copyright (c) 2010, 2012, Monty Program Ab
Copyright (c) 2010, 2018, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2,7 +2,7 @@
# -*- cperl -*-

# Copyright (c) 2004, 2014, Oracle and/or its affiliates.
# Copyright (c) 2009, 2017, MariaDB Corporation
# Copyright (c) 2009, 2018, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -4616,6 +4616,37 @@ Field Type Null Key Default Extra
c1 mediumtext YES NULL
DROP TABLE t1;
#
# MDEV-15624 Changing the default character set to utf8mb4 changes query evaluation in a very surprising way
#
SET NAMES utf8;
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT COUNT(DISTINCT c) FROM (SELECT id, REPLACE(uuid_short(), '0', CAST('o' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
COUNT(DISTINCT c)
3
SELECT DISTINCT REPLACE(uuid_short(), '0', CAST('o' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
c
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
SELECT COUNT(DISTINCT c) FROM (SELECT id, INSERT(uuid_short(), 1, 1, CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
COUNT(DISTINCT c)
3
SELECT DISTINCT INSERT(uuid_short(), 1, 1, CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
c
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
SELECT COUNT(DISTINCT c) FROM (SELECT id, CONCAT(uuid_short(), CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1) AS d1;
COUNT(DISTINCT c)
3
SELECT DISTINCT CONCAT(uuid_short(), CAST('0' AS CHAR CHARACTER SET ucs2)) AS c FROM t1;
c
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
DROP TABLE t1;
#
# End of 5.5 tests
#
#
@@ -2859,6 +2859,29 @@ SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
len
196608
#
# MDEV-15624 Changing the default character set to utf8mb4 changes query evaluation in a very surprising way
#
SET NAMES utf8mb4;
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT COUNT(DISTINCT c) FROM (SELECT id, REPLACE(UUID(), "-", "") AS c FROM t1) AS d1;
COUNT(DISTINCT c)
3
SELECT DISTINCT INSERT(uuid(), 9, 1, "X") AS c FROM t1;
c
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
SELECT COUNT(DISTINCT c) FROM (SELECT id, INSERT(UUID(), 9, 1, "X") AS c FROM t1) AS d1;
COUNT(DISTINCT c)
3
SELECT DISTINCT INSERT(UUID(), 9, 1, "X") AS c FROM t1;
c
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
xxxxxxxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
DROP TABLE t1;
#
# End of 5.5 tests
#
#
@@ -2,8 +2,10 @@ Windows bug: happens when a new line is exactly at the right offset.
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
The following specify which files/extra groups are read (specified before remaining options):
--defaults-file=# Only read default options from the given file #.
--defaults-extra-file=# Read this file after the global files are read.
--defaults-group-suffix=# Additionally read default groups with # appended as a suffix.

--allow-suspicious-udfs
Allows use of UDFs consisting of only one symbol xxx()
@@ -223,6 +223,14 @@ a a
5 10
DROP TABLE temp1, temp2;

# MDEV-14185 CREATE TEMPORARY TABLE AS SELECT causes error 1290 with read_only and InnoDB.

CREATE TEMPORARY TABLE temp1 ENGINE=INNODB AS SELECT a FROM t1;
SELECT * FROM temp1;
a
1
DROP TABLE temp1;

# Disconnect and cleanup

SET GLOBAL READ_ONLY = OFF;
@@ -171,3 +171,9 @@ create database mysqltest1;
create procedure mysqltest1.foo() select "foo";
update mysql.proc set name='' where db='mysqltest1';
drop database mysqltest1;
create procedure p1() set @foo = 10;
alter table mysql.proc drop primary key;
drop procedure p1;
ERROR HY000: Cannot load from mysql.proc. The table is probably corrupted
alter table mysql.proc add primary key (db,name,type);
drop procedure p1;
@@ -2503,6 +2503,26 @@ SELECT 2 IN (SELECT 2 from DUAL WHERE 1 != 1);
SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size;
#
# MDEV-14515: Wrong results for tableless query with subquery in WHERE
# and implicit aggregation
#
create table t1 (i1 int, i2 int);
insert into t1 values (1314, 1084),(1330, 1084),(1401, 1084),(580, 1084);
create table t2 (cd int);
insert into t2 values
(1330), (1330), (1330), (1330), (1330), (1330), (1330), (1330),
(1330), (1330), (1330), (1330), (1330), (1330), (1330), (1330);
select max(10) from dual
where exists (select 1 from t2 join t1 on t1.i1 = t2.cd and t1.i2 = 345);
max(10)
NULL
insert into t2 select * from t2;
select max(10) from dual
where exists (select 1 from t2 join t1 on t1.i1 = t2.cd and t1.i2 = 345);
max(10)
NULL
DROP TABLE t1,t2;
#
# MDEV-10232 Scalar result of subquery changes after adding an outer select stmt
#
create table t1(c1 int, c2 int, primary key(c2));
@@ -51,3 +51,7 @@ WHERE NAME='test/t';
TABLE_ID NAME FLAG N_COLS SPACE FILE_FORMAT ROW_FORMAT ZIP_PAGE_SIZE
# test/t 1 6 # Antelope Compact 0
DROP TABLE t;
CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1);
ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1);
DROP TABLE t1;
@@ -0,0 +1,24 @@
create table t1 (a int not null, b int not null) engine=innodb;
insert t1 values (1,2),(3,4);
lock table t1 write, t1 tr read;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 0
unlock tables;
alter table t1 drop primary key;
lock table t1 write;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 0
unlock tables;
alter table t1 drop primary key;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 0
drop table t1;
@@ -71,6 +71,11 @@ WHERE NAME='test/t';

DROP TABLE t;

CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1);
ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1);
DROP TABLE t1;

# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
@@ -0,0 +1,28 @@
#
# BUG#27216817: INNODB: FAILING ASSERTION:
# PREBUILT->TABLE->N_MYSQL_HANDLES_OPENED == 1
#

source include/have_innodb.inc;
create table t1 (a int not null, b int not null) engine=innodb;
insert t1 values (1,2),(3,4);

lock table t1 write, t1 tr read;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
unlock tables;
alter table t1 drop primary key;

lock table t1 write;
flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';
unlock tables;
alter table t1 drop primary key;

flush status;
alter table t1 add primary key (b);
show status like 'Handler_read_rnd_next';

drop table t1;
@@ -35,3 +35,13 @@ ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
PARTITION p3 VALUES IN (4,5,6)
);
DROP TABLE t1;

#
# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
#
create table t1 (i int) partition by range(i) (partition p0 values less than (10));
lock table t1 write;
--error ER_SAME_NAME_PARTITION
alter table t1 add partition (partition p0 values less than (20));
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
@@ -47,3 +47,9 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
create table t1 (i int) partition by range(i) (partition p0 values less than (10));
lock table t1 write;
alter table t1 add partition (partition p0 values less than (20));
ERROR HY000: Duplicate partition name p0
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
@@ -69,3 +69,9 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
create table t1 (i int) partition by range(i) (partition p0 values less than (10));
lock table t1 write;
alter table t1 add partition (partition p0 values less than (20));
ERROR HY000: Duplicate partition name p0
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
@@ -42,6 +42,12 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
create table t1 (i int) partition by range(i) (partition p0 values less than (10));
lock table t1 write;
alter table t1 add partition (partition p0 values less than (20));
ERROR HY000: Duplicate partition name p0
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
partition by key(c1) (
partition p01 data directory = 'MYSQL_TMP_DIR'

0 comments on commit 9c34a41

Please sign in to comment.