Skip to content

Commit

Permalink
Merge branch '10.2' of https://github.com/mariadb/server into 10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vaintroub committed Jan 5, 2018
2 parents b9e0945 + 0de565a commit e6e24fe
Show file tree
Hide file tree
Showing 88 changed files with 2,167 additions and 5,651 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=12
MYSQL_VERSION_PATCH=13
2 changes: 2 additions & 0 deletions extra/comp_err.c
Expand Up @@ -267,6 +267,7 @@ static int create_header_files(struct errors *error_head)
fprintf(sql_statef, "/* Autogenerated file, please don't edit */\n\n");
fprintf(er_namef, "/* Autogenerated file, please don't edit */\n\n");

fprintf(er_definef, "#ifndef ER_ERROR_FIRST\n");
fprintf(er_definef, "#define ER_ERROR_FIRST %d\n", error_head->d_code);

current_d_code= error_head->d_code -1;
Expand Down Expand Up @@ -314,6 +315,7 @@ static int create_header_files(struct errors *error_head)
}
/* finishing off with mysqld_error.h */
fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last);
fprintf(er_definef, "#endif /* ER_ERROR_FIRST */\n");
my_fclose(er_definef, MYF(0));
my_fclose(sql_statef, MYF(0));
my_fclose(er_namef, MYF(0));
Expand Down
2 changes: 2 additions & 0 deletions include/my_time.h
Expand Up @@ -173,8 +173,10 @@ static inline my_bool validate_timestamp_range(const MYSQL_TIME *t)
}

/* Can't include mysqld_error.h, it needs mysys to build, thus hardcode 2 error values here. */
#ifndef ER_WARN_DATA_OUT_OF_RANGE
#define ER_WARN_DATA_OUT_OF_RANGE 1264
#define ER_WARN_INVALID_TIMESTAMP 1299
#endif

my_time_t
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, uint *error_code);
Expand Down
420 changes: 0 additions & 420 deletions mysql-test/include/innodb_gis_row_format_basic.inc

This file was deleted.

83 changes: 0 additions & 83 deletions mysql-test/include/innodb_gis_undo.inc

This file was deleted.

8 changes: 8 additions & 0 deletions mysql-test/include/innodb_row_format.combinations
@@ -0,0 +1,8 @@
[redundant]
innodb_default_row_format=redundant

[compact]
innodb_default_row_format=compact

[dynamic]
innodb_default_row_format=dynamic
4 changes: 4 additions & 0 deletions mysql-test/include/innodb_row_format.inc
@@ -0,0 +1,4 @@
# The goal of including this file is to enable innodb_default_row_format
# combinations (see include/innodb_row_format.combinations)

--source include/have_innodb.inc
60 changes: 0 additions & 60 deletions mysql-test/include/wait_innodb_all_purged.inc

This file was deleted.

32 changes: 31 additions & 1 deletion mysql-test/r/cte_nonrecursive.result
Expand Up @@ -705,7 +705,7 @@ ERROR 42S21: Duplicate column name 'f1'
with t as (select * from t2 where c>3),
t as (select a from t1 where a>2)
select * from t,t1 where t1.a=t.c;
ERROR HY000: Duplicate query name in WITH clause
ERROR HY000: Duplicate query name in WITH clause 't'
with t as (select a from s where a<5),
s as (select a from t1 where b>='d')
select * from t,s where t.a=s.a;
Expand Down Expand Up @@ -1265,3 +1265,33 @@ a
4
deallocate prepare stmt;
drop table t1;
#
# MDEV-14852: CTE using temporary table in query
# with two references to the CTE
#
create temporary table t1 (i int);
insert into t1 values (5),(4),(1),(2),(3);
with
c1 as (select i from t1),
c2 as (select i from c1 where c1.i=2)
select i from c1 where i > 3 union select i from c2;
i
5
4
2
drop table t1;
create table t1 (term char(10));
create temporary table t2 (term char(10));
insert into t1 values ('TERM01'),('TERM02'),('TERM03');
insert into t2 values ('TERM02'),('TERM03'),('TERM04');
with c1 as (select * from t1), c2 as (select * from t2)
(select * from c1 left outer join c2 on c1.term = c2.term)
union all
(select * from c1 right outer join c2 on c1.term = c2.term
where c1.term is null);
term term
TERM02 TERM02
TERM03 TERM03
TERM01 NULL
NULL TERM04
drop table t1,t2;
44 changes: 20 additions & 24 deletions mysql-test/r/gis-rtree.result
@@ -1,9 +1,8 @@
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL,
SPATIAL KEY(g)
) ENGINE=MyISAM;
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
Expand Down Expand Up @@ -183,9 +182,9 @@ fid AsText(g)
2 LINESTRING(149 149,151 151)
DROP TABLE t1;
CREATE TABLE t2 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL
) ENGINE=MyISAM;
);
INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)));
Expand Down Expand Up @@ -298,11 +297,11 @@ t2 CREATE TABLE `t2` (
SELECT count(*) FROM t2;
count(*)
100
EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g,
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range g g 34 NULL 4 Using where
SELECT fid, AsText(g) FROM t2 WHERE Within(g,
SELECT fid, AsText(g) FROM t2 WHERE Within(g,
GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
fid AsText(g)
46 LINESTRING(51 41,60 50)
Expand Down Expand Up @@ -710,9 +709,6 @@ SELECT count(*) FROM t2;
count(*)
100
DROP TABLE t2;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a));
INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
Expand Down Expand Up @@ -751,20 +747,20 @@ Table Op Msg_type Msg_text
test.t1 analyze status OK
drop table t1;
CREATE TABLE t1 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL,
SPATIAL KEY(g)
) ENGINE=MyISAM;
);
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
drop table t1;
CREATE TABLE t1 (
line GEOMETRY NOT NULL,
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
name VARCHAR(32),
SPATIAL KEY (line)
) engine=myisam;
);
ALTER TABLE t1 DISABLE KEYS;
INSERT INTO t1 (name, kind, line) VALUES
INSERT INTO t1 (name, kind, line) VALUES
("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
Expand Down Expand Up @@ -803,7 +799,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT IGNORE INTO t2 SELECT GeomFromText(st) FROM t1;
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1, t2;
CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`)) DEFAULT CHARSET=latin1;
INSERT INTO t1 (geometry) VALUES
(PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000
-66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999,
Expand All @@ -819,7 +815,7 @@ drop table t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
Expand All @@ -833,7 +829,7 @@ DROP TABLE t1;
CREATE TABLE t1 (
c1 geometry NOT NULL default '',
SPATIAL KEY i1 (c1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) DEFAULT CHARSET=latin1;
INSERT INTO t1 (c1) VALUES (
PolygonFromText('POLYGON((-18.6086111000 -66.9327777000,
-18.6055555000 -66.8158332999,
Expand Down Expand Up @@ -874,7 +870,7 @@ c3 varchar(10) collate utf8_bin default NULL,
spatial_point point NOT NULL,
PRIMARY KEY(id),
SPATIAL KEY (spatial_point)
)ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
INSERT INTO t1 (c2, c1, c3, spatial_point) VALUES
('y', 's', 'j', GeomFromText('POINT(167 74)')),
('r', 'n', 'd', GeomFromText('POINT(215 118)')),
Expand Down Expand Up @@ -1544,11 +1540,11 @@ HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.0 tests.
#
# Bug #57323/11764487: myisam corruption with insert ignore
# Bug #57323/11764487: myisam corruption with insert ignore
# and invalid spatial data
#
CREATE TABLE t1(a POINT NOT NULL, b GEOMETRY NOT NULL,
SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
SPATIAL KEY(a), SPATIAL KEY(b));
INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
Expand All @@ -1559,7 +1555,7 @@ ASTEXT(a) ASTEXT(b)
POINT(0 0) POINT(1 1)
DROP TABLE t1;
CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
KEY(a), SPATIAL KEY(b));
INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
Expand All @@ -1573,7 +1569,7 @@ End of 5.1 tests
CREATE TABLE t1 (
l LINESTRING NOT NULL,
SPATIAL KEY(l)
) ENGINE = myisam;
);
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(0 0, 1 1)'));
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(1 1, 2 2)'));
INSERT INTO t1 VALUES(GeomFromText('LINESTRING(2 2, 3 3)'));
Expand All @@ -1596,7 +1592,7 @@ DROP TABLE t1;
#
# MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
#
CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM;
CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a));
INSERT INTO t1 VALUES (Point(1,2)),(Point(1,3));
EXPLAIN SELECT * FROM t1 WHERE MBRINTERSECTS(a,Point(1,2));
id select_type table type possible_keys key key_len ref rows Extra
Expand All @@ -1614,7 +1610,7 @@ DROP TABLE t1;
#
# MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scan
#
CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a)) ENGINE=MyISAM;
CREATE TABLE t1 (a GEOMETRY NOT NULL, SPATIAL KEY(a));
INSERT INTO t1 VALUES (Point(1,1)),(Point(2,2)),(Point(3,3));
EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1);
id select_type table type possible_keys key key_len ref rows Extra
Expand Down
5 changes: 3 additions & 2 deletions mysql-test/suite/encryption/t/debug_key_management.test
Expand Up @@ -8,13 +8,14 @@ if (`select count(*) = 0 from information_schema.plugins
set global innodb_encrypt_tables=ON;
show variables like 'innodb_encrypt%';

let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=1;
--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'`
let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=1;
--source include/wait_condition.inc

select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 1;
set global debug_key_management_version=10;

let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=10;
let $wait_condition= select count(*) = $tables_count from information_schema.innodb_tablespaces_encryption where current_key_version=10;
--source include/wait_condition.inc

select count(*) from information_schema.innodb_tablespaces_encryption where current_key_version <> 10;
Expand Down
3 changes: 2 additions & 1 deletion mysql-test/suite/encryption/t/encrypt_and_grep.test
Expand Up @@ -63,7 +63,8 @@ SET GLOBAL innodb_encrypt_tables = off;

--echo # Wait max 10 min for key encryption threads to decrypt all spaces
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0;
--let $tables_count= `select count(*) from information_schema.tables where engine = 'InnoDB'`
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0;
--source include/wait_condition.inc

SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
Expand Down
6 changes: 4 additions & 2 deletions mysql-test/suite/encryption/t/innodb_encryption.test
Expand Up @@ -14,9 +14,11 @@ SHOW VARIABLES LIKE 'innodb_encrypt%';

SET GLOBAL innodb_encrypt_tables = ON;

--let $tables_count= `select count(*) + 1 from information_schema.tables where engine = 'InnoDB'`

--echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) >= 3 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--source include/wait_condition.inc

SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
Expand Down Expand Up @@ -59,7 +61,7 @@ SET GLOBAL innodb_encryption_threads=@start_global_value;

--echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) >=3 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--let $wait_condition=SELECT COUNT(*) >= $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
--source include/wait_condition.inc

SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/galera_bf_abort.result
Expand Up @@ -9,7 +9,7 @@ INSERT INTO t1 VALUES (1,'node_1');
connection node_2a;
connection node_2;
INSERT INTO t1 VALUES (2, 'node_2');
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/galera_bf_abort_get_lock.result
Expand Up @@ -10,7 +10,7 @@ SELECT GET_LOCK("foo", 1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/galera_bf_abort_sleep.result
Expand Up @@ -6,7 +6,7 @@ SELECT SLEEP(1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/galera_enum.result
Expand Up @@ -38,7 +38,7 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three';
COUNT(*) = 1
Expand Down

0 comments on commit e6e24fe

Please sign in to comment.