Commit fa7d85bb authored by Marko Mäkelä's avatar Marko Mäkelä

Merge bb-10.2-ext into 10.3

parents 6feb74c4 6d49ef49
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
[redundant]
innodb_default_row_format=redundant
[compact]
innodb_default_row_format=compact
[dynamic]
innodb_default_row_format=dynamic
# 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
# include/wait_innodb_all_purged.inc
#
# SUMMARY
#
# Waits until purged all undo records of innodb, or operation times out.
#
# USAGE
#
# --source include/wait_innodb_all_purged.inc
#
--source include/have_innodb.inc
--source include/have_debug.inc
--disable_query_log
let $wait_counter_init= 300;
if ($wait_timeout)
{
let $wait_counter_init= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
let $wait_counter= $wait_counter_init;
# Keep track of how many times the wait condition is tested
let $wait_condition_reps= 0;
let $prev_trx_age= 0;
while ($wait_counter)
{
--disable_warnings
let $trx_age = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME = 'INNODB_PURGE_TRX_ID_AGE';`;
--enable_warnings
if ($trx_age != $prev_trx_age)
{
let $wait_counter= $wait_counter_init;
let $prev_trx_age= $trx_age;
}
let $success= `SELECT $trx_age < 1`;
inc $wait_condition_reps;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
echo Timeout in wait_innodb_all_purged.inc for INNODB_PURGE_TRX_ID_AGE = $trx_age;
}
--enable_query_log
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` (
......@@ -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)));
......@@ -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)
......@@ -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)"));
......@@ -751,10 +747,10 @@ 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 (
......@@ -762,9 +758,9 @@ 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)")),
......@@ -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,
......@@ -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,
......@@ -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,
......@@ -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)')),
......@@ -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
......@@ -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
......@@ -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)'));
......@@ -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
......@@ -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);
ERROR HY000: Illegal parameter data type int for operation 'st_contains'
......
......@@ -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: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
......@@ -10,7 +10,7 @@ SELECT GET_LOCK("foo", 1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
......@@ -6,7 +6,7 @@ SELECT SLEEP(1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
wsrep_local_aborts_increment
1
DROP TABLE t1;
......@@ -38,7 +38,7 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three';
COUNT(*) = 1
......
......@@ -22,6 +22,6 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE child;
DROP TABLE parent;
......@@ -51,7 +51,7 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
ROLLBACK;
INSERT INTO t1 VALUES (1), (2);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
......
......@@ -129,5 +129,5 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE t1;
......@@ -28,7 +28,7 @@ SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
UNLOCK TABLES;
connection node_1;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
COUNT(*) = 1
1
......
......@@ -28,6 +28,6 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE t1;
DROP TABLE t2;
......@@ -28,6 +28,6 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE t1;
DROP TABLE t2;
......@@ -31,6 +31,6 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE t1;
DROP TABLE t2;
......@@ -19,7 +19,7 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
SELECT f1 = 'текст2' FROM t1;
f1 = 'текст2'
1
......
......@@ -27,6 +27,6 @@ COMMIT;
SET AUTOCOMMIT=ON;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
SET AUTOCOMMIT=ON;
DROP TABLE t1;
......@@ -24,6 +24,6 @@ COMMIT;
SET AUTOCOMMIT=ON;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
SET AUTOCOMMIT=ON;
DROP TABLE t1;
......@@ -9,7 +9,7 @@ connection node_2;
INSERT INTO t1 VALUES (1,1);
connection node_1;
SELECT * FROM t1;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
ROLLBACK;
DELETE FROM t1;
connection node_1;
......@@ -22,7 +22,7 @@ connection node_2;
UPDATE t1 SET f2 = 2;
connection node_1;
UPDATE t1 SET f2 = 3;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
ROLLBACK;
DELETE FROM t1;
connection node_1;
......@@ -33,5 +33,5 @@ connection node_2;
INSERT INTO t1 VALUES (1,2);
connection node_1;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
DROP TABLE t1;
......@@ -14,9 +14,9 @@ INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, te
connection node_2;
DROP DATABASE database1;;
connection node_1;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_1a;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
connection node_1;
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
......
......@@ -8,7 +8,7 @@ connection node_2a;
ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_1;
INSERT INTO t1 VALUES (2, 2);
SELECT COUNT(*) = 2 FROM t1;
......
......@@ -9,7 +9,7 @@ connection node_1;
TRUNCATE TABLE t1;;
connection node_1;
connection node_2;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
......
......@@ -18,7 +18,7 @@ connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
SELECT f1 = 'текст2' FROM t1;
f1 = 'текст2'
1
......@@ -35,6 +35,6 @@ connection node_2;
COMMIT;
connection node_1;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
COMMIT;
DROP TABLE t1;
......@@ -59,7 +59,7 @@ connection node_1a;
COMMIT;
connection node_2a;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
connection node_1a;
SELECT * FROM t1;
f1 node
......
......@@ -20,6 +20,6 @@ connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
connection node_2;
COMMIT;
ERROR 40001: wsrep aborted transaction
ERROR 40001: Deadlock: wsrep aborted transaction
include/assert_grep.inc [cluster conflict due to high priority abort for threads]
DROP TABLE t1;
......@@ -11,16 +11,8 @@
##############################################################################
gis_split_inf : MDEV-14057 InnoDB GIS tests fail
row_format : MDEV-14057 InnoDB GIS tests fail
rtree_estimate : MDEV-14057 InnoDB GIS tests fail
rtree_multi_pk : MDEV-14057 InnoDB GIS tests fail
rtree_recovery : MDEV-14058 InnoDB Assertion failure !leaf on rem0rec.cc line 566 on test innodb_gis.rtree_recovery
tree_search : MDEV-14057 InnoDB GIS tests fail
rtree_concurrent_srch: MDEV-14059 InnoDB assertion failure offset >= ((38U + 36 + 2 * 10) + 5) at page0page.h line 318
point_big : MDEV-14057 InnoDB GIS tests fail
geometry : MDEV-14057 InnoDB GIS tests fail
bug17057168 : MDEV-14057 InnoDB GIS tests fail
bug16236208 : MDEV-14057 InnoDB GIS tests fail
bug16266012 : MDEV-14057 InnoDB GIS tests fail
rtree_search : MDEV-14057 InnoDB GIS tests fail
rtree_old : MDEV-14057 InnoDB GIS tests fail
......@@ -12,10 +12,8 @@ INSERT INTO t1 (location) SELECT POINT(tmp1.id, tmp2.id) FROM tmp tmp1,
tmp tmp2 ORDER BY tmp1.id, tmp2.id;
EXPLAIN SELECT id, ST_AsText(location) FROM t1 WHERE location = POINT(1,
2);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ref location location 28 const 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `geotest`.`t1`.`id` AS `id`,st_astext(`geotest`.`t1`.`location`) AS `ST_AsText(location)` from `geotest`.`t1` where (`geotest`.`t1`.`location` = <cache>(point(1,2)))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref location location 28 const 1 Using where
SELECT id, ST_AsText(location) FROM t1 WHERE location = POINT(1, 2);
id ST_AsText(location)
163 POINT(1 2)
......
This diff is collapsed.
This diff is collapsed.
SET GLOBAL innodb_file_per_table=1;
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb ROW_FORMAT=COMPRESSED;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
......@@ -39,14 +40,15 @@ set @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
0
SET @saved_dbug = @@SESSION.debug_dbug;
SET DEBUG='+d,page_copy_rec_list_start_compress_fail';
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
delete from t1;
SET DEBUG='-d,page_copy_rec_list_start_compress_fail';
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
0
SET debug_dbug = @saved_dbug;
InnoDB 0 transactions not purged
drop table t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
......@@ -9,16 +9,12 @@ set i = i + 1;
end while;
end|
CALL insert_t1(70000);
select count(*) from t1;
count(*)
70000
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
truncate table t1;
call mtr.add_suppression("InnoDB: A copy of page \[page id: space=[0-9]+, page number=[0-9]+\] in the doublewrite buffer slot [0-9]+ is not within space bounds");
START TRANSACTION;
CALL insert_t1(5000);
COMMIT;
select count(*) from t1;
count(*)
70000
delete from t1;
drop procedure insert_t1;
drop table t1;
......@@ -14,22 +14,25 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
connect a,localhost,root,,;
SET debug_dbug='+d,rtr_pcur_move_to_next_return';
set session transaction isolation level serializable;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'row_search_for_mysql_before_return SIGNAL started WAIT_FOR go_ahead';
select count(*) from t1 where MBRWithin(t1.c2, @g1);;
# Establish session con1 (user=root)
connect con1,localhost,root,,;
set session transaction isolation level serializable;
SET DEBUG_SYNC = 'now WAIT_FOR started';
insert into t1 select * from t1;
SET DEBUG_SYNC = 'now SIGNAL go_ahead';
connection a;
count(*)
576
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
1152
connection default;
insert into t1 select * from t1;
insert into t1 select * from t1;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
......@@ -53,6 +56,7 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
set session transaction isolation level serializable;
select @@tx_isolation;
@@tx_isolation
......@@ -62,6 +66,7 @@ set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100)
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
0
connect b,localhost,root,,;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
select @@tx_isolation;
......@@ -70,16 +75,20 @@ SERIALIZABLE
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
commit;
connection default;
select count(*) from t1;
count(*)
896
insert into t1 values (105, Point(105, 105));
connection a;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
1
connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
......@@ -91,10 +100,12 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select count(*) from t1;
count(*)
897
connection a;
select sleep(2);
sleep(2)
0
commit;
connection default;
truncate t1;
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
......@@ -107,6 +118,7 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
set session transaction isolation level serializable;
select @@tx_isolation;
@@tx_isolation
......@@ -116,6 +128,7 @@ set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100)
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
0
connection b;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
select @@tx_isolation;
......@@ -125,11 +138,14 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
commit;
connection default;
select count(*) from t1;
count(*)
1792
insert into t1 values (105, Point(105, 105));
connection a;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
......@@ -138,6 +154,7 @@ count(*)
select count(*) from t1 where MBRIntersects(t1.c2, @g1);
count(*)
1793
connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
......@@ -149,10 +166,12 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select count(*) from t1;
count(*)
1793
connection a;
select sleep(2);
sleep(2)
0
commit;
connection default;
truncate t1;
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
......@@ -163,13 +182,16 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
set @g1 = ST_GeomFromText('Polygon((3 3, 3 5, 5 5, 5 3, 3 3))');
start transaction;
delete from t1 where MBRWithin(t1.c2, @g1);
connection a;
set session innodb_lock_wait_timeout = 1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
insert into t1 values(4, Point(4,4));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
rollback;
connection default;
truncate t1;
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(2 2, 150 150)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(3 3, 160 160)'));
......@@ -182,13 +204,16 @@ start transaction;
select count(*) from t1 where MBRWithin(t1.c2, @g1) for update;
count(*)
0
connection a;
set session innodb_lock_wait_timeout = 1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
insert into t1 values(4, Point(4,4));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
rollback;
connection default;
truncate t1;
create procedure insert_t1(IN start int, IN total int)
begin
......@@ -200,6 +225,7 @@ set i = i + 1;
end while;
end|
CALL insert_t1(0, 1000);
connection a;
set session transaction isolation level serializable;
select @@tx_isolation;
@@tx_isolation
......@@ -208,17 +234,21 @@ start transaction;
set @g1 = ST_GeomFromText('Polygon((800 800, 800 1000, 1000 1000, 1000 800, 800 800))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
199
201
connection b;
CALL insert_t1(1001, 2000);
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
insert into t1 values (1200, Point(950, 950));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection a;
select sleep(2);
sleep(2)
0
commit;
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
disconnect a;
disconnect b;
connection default;
drop table t1;
drop procedure insert_t1;
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
......@@ -229,14 +259,19 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(5 5, 180 180)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(6 6, 190 190)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
connect a,localhost,root,,;
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
set transaction isolation level serializable;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
0
connect b,localhost,root,,;
delete from t1 where c1 = 1;
connection a;
commit;
set transaction isolation level serializable;
start transaction;
......@@ -244,10 +279,13 @@ set @g1 = ST_GeomFromText('Polygon((0 0, 0 300, 300 300, 300 0, 0 0))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
count(*)
2
connection b;
set session innodb_lock_wait_timeout = 1;
delete from t1 where c1 = 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection a;
commit;
connection default;
drop table t1;
SET DEBUG_SYNC= 'RESET';
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
......@@ -273,18 +311,22 @@ insert into t1 select * from t1;
select count(*) from t1;
count(*)
4608
connection b;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
set transaction isolation level read uncommitted;
SET DEBUG_SYNC= 'row_search_for_mysql_before_return SIGNAL siga WAIT_FOR sigb';
select count(*) from t1 where MBRWithin(t1.c2, @g1);
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR siga';
rollback;
SET DEBUG_SYNC= 'now SIGNAL sigb';
connection b;
count(*)
1
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
0
connection default;
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
......@@ -298,15 +340,21 @@ end while;
end|
start transaction;
CALL insert_t1(100);
connection a;
set @g1 = ST_GeomFromText('Polygon((0 0,0 1000,1000 1000,1000 0,0 0))');
SET DEBUG_SYNC= 'rtr_pcur_move_to_next_return SIGNAL siga WAIT_FOR sigb';
select count(*) from t1 where MBRWithin(t1.c2, @g1);;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR siga';
rollback;
SET DEBUG_SYNC= 'now SIGNAL sigb';
connection a;
count(*)
0
connection default;
drop procedure insert_t1;
DROP TABLE t1;
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
disconnect a;
disconnect b;
connection default;
SET DEBUG_SYNC = 'RESET';
......@@ -6,10 +6,8 @@ SET @g1 = ST_GeomFromText('POINT(10 10)');
SET @g2 = ST_GeomFromText('POLYGON((5 5, 20 5, 20 21, 5 21, 5 5))');
SET @g3 = ST_GeomFromText('POLYGON((1.79769e+308 1.79769e+308, 20 5, -1.79769e+308 -1.79769e+308, 1.79769e+308 1.79769e+308))');
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g1);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL g NULL NULL NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrcontains(`test`.`t1`.`g`,(@`g1`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL g NULL NULL NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
INSERT INTO t1 VALUES(@g1);
......@@ -24,135 +22,105 @@ ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g1);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrcontains(`test`.`t1`.`g`,(@`g1`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(10 10)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRDisjoint(g, @g1);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 2 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrdisjoint(`test`.`t1`.`g`,(@`g1`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 2 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(10 10)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBREquals(g, @g1);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrequals(`test`.`t1`.`g`,(@`g1`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(10 10)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRIntersects(g, @g1);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrintersects(`test`.`t1`.`g`,(@`g1`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(10 10)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrwithin(`test`.`t1`.`g`,(@`g1`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g1);
ST_AsText(g)
POINT(10 10)
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g2);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrcontains(`test`.`t1`.`g`,(@`g2`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRDisjoint(g, @g2);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrdisjoint(`test`.`t1`.`g`,(@`g2`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBREquals(g, @g2);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrequals(`test`.`t1`.`g`,(@`g2`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 1 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRIntersects(g, @g2);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 2 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrintersects(`test`.`t1`.`g`,(@`g2`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 2 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL range g g 34 NULL 2 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrwithin(`test`.`t1`.`g`,(@`g2`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range g g 34 NULL 2 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g2);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRContains(g, @g3);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL g NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrcontains(`test`.`t1`.`g`,(@`g3`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
POLYGON((1.79769e308 1.79769e308,20 5,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRDisjoint(g, @g3);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL g NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrdisjoint(`test`.`t1`.`g`,(@`g3`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
POLYGON((1.79769e308 1.79769e308,20 5,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBREquals(g, @g3);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL g NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrequals(`test`.`t1`.`g`,(@`g3`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
POLYGON((1.79769e308 1.79769e308,20 5,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRIntersects(g, @g3);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL g NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrintersects(`test`.`t1`.`g`,(@`g3`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(10 10)
POLYGON((5 5,20 5,20 21,5 21,5 5))
POLYGON((1.79769e308 1.79769e308,20 5,-1.79769e308 -1.79769e308,1.79769e308 1.79769e308))
EXPLAIN SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 NULL ALL g NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select st_astext(`test`.`t1`.`g`) AS `ST_AsText(g)` from `test`.`t1` where mbrwithin(`test`.`t1`.`g`,(@`g3`))
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL g NULL NULL NULL 3 Using where
SELECT ST_AsText(g) FROM t1 WHERE MBRWithin(g, @g3);
ST_AsText(g)
POINT(10 10)
......
This diff is collapsed.
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
create table t (
a point not null,b point not null,c point,
d point not null,e point,f point,
spatial key (d),spatial key (b)
b point not null,d point not null, spatial key (d),spatial key (b)
) engine=innodb;
create procedure p(i int)
begin
declare n int default 0;
declare continue handler for sqlexception begin end;
delete from t;
repeat
set @p=point(1,1);
insert into t values(@p,@p,@p,@p,@p,@p);
insert into t values(@p,@p,@p,@p,@p,@p);
insert into t select @p,@p,@p,@p,@p,@p
from t a,t b,t c,t d,t e,t f,t g,t h,t i,t j;
delete from t;
set n:=n+1;
until n >= i end repeat;
end|
call p(200);
InnoDB 0 transactions not purged
drop procedure p;
drop table t;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
# restart
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
create procedure insert_t1(IN total int)
begin
......@@ -33,10 +32,9 @@ Table Op Msg_type Msg_text
test.t1 check status OK
select count(*) from t1;
count(*)
18
17
select c1, ST_astext(c2) from t1;
c1 ST_astext(c2)
350 POINT(10350 10350)
351 POINT(10351 10351)
352 POINT(10352 10352)
353 POINT(10353 10353)
......
......@@ -14,19 +14,19 @@ count(*)
set @g1 = ST_GeomFromText('Polygon((0 0,0 1000,1000 1000,1000 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
999
1000
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
99
100
set @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
789
791
set @g1 = ST_GeomFromText('Polygon((100 100,100 800,800 800,800 100,100 100))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
699
701
set @g1 = ST_GeomFromText('Point(1 1)');
select count(*) from t1 where MBRequals(t1.c2, @g1);
count(*)
......
......@@ -14,9 +14,10 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
SET SESSION debug="+d, rtr_page_need_second_split";
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d, rtr_page_need_second_split';
insert into t1 select * from t1;
SET SESSION debug="-d, rtr_page_need_second_split";
SET debug_dbug = @saved_dbug;
delete from t1;
insert into t1 values(1, Point(1,1));
insert into t1 values(2, Point(2,2));
......@@ -62,6 +63,8 @@ count(*)
0
drop index c2 on t1;
create spatial index idx2 on t1(c2);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -73,7 +76,10 @@ set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
73728
# restart: --innodb-read-only
set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
65536
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
......@@ -81,6 +87,5 @@ count(*)
set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
57344
# restart
65536
drop table t1;
--source include/have_innodb.inc
--source include/have_debug.inc
create table t1(a geometrycollection not null,spatial key(a))engine=innodb;
......@@ -21,9 +19,6 @@ insert into t1(a) values( geometrycollection(linestring(point(85,-29), point(
insert into t1(a) values( geometrycollection(polygon(linestring(point(-9,0), point(-17,-15), point(-9,0)), linestring(point(-11,1), point(18,12), point(15,3), point(7,0), point(-11,1)), linestring(point(19,5), point(19,5)), linestring(point(17,-11), point(8,4), point(17,-11)), linestring(point(14914539334033432000000000000000000000.000000,127247994336690690000000000000000000000.000000), point(-14,-7), point(13,-2))), point(-4,-7), polygon(linestring(point(-18,9), point(11,-1), point(-18,9)), linestring(point(9,-3), point(9,-3)), linestring(point(-7,-9), point(9,-11), point(11,14), point(1.663324e+308,1.572127e+308)), linestring(point(-15,4), point(18,12), point(7,2), point(-15,4)), linestring(point(-15,-18), point(-20,-15), point(1152921504606846972,34359738370))), polygon(linestring(point(-5,-19), point(-11,11), point(10,5), point(-7,13), point(-5,-19)), linestring(point(-8,-6), point(-4,16), point(-8,-6)), linestring(point(-6,-10), point(3,-12), point(-6,-10)), linestring(point(-16,1), point(20,-12), point(-16,1)), linestring(point(-8,5), point(-20,-4), point(4,1), point(-6,-6), point(-8,5)), linestring(point(-8,-11), point(-5,-14), point(-8,-11)), linestring(point(3,-16), point(-15,-13), point(1.166708e+308,1.901147e+307), point(-8,6), point(3,-16))), point(0,-5)) ) ;
insert into t1(a) values( geometrycollection(linestring(point(-33,99), point(99,-87), point(38,-79), point(33,-39), point(-91,-8), point(46,-87))) ) ;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
......
-- source include/innodb_page_size.inc
-- source include/innodb_row_format.inc
-- source ../../../t/gis-rtree.test
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/innodb_page_size_small.inc
# Test the redundant format
LET $file_per_table='off';
LET $file_format='Antelope';
LET $row_format=REDUNDANT;
--source include/innodb_gis_row_format_basic.inc
# Test the compressed format
LET $file_per_table='on';
LET $file_format='Barracuda';
LET $row_format=COMPRESSED;
--source include/innodb_gis_row_format_basic.inc
# Test the dynamic format
LET $file_per_table='on';
LET $file_format='Barracuda';
LET $row_format=DYNAMIC;
--source include/innodb_gis_row_format_basic.inc
# Test the compact format
LET $file_per_table='off';
LET $file_format='Antelope';
LET $row_format=COMPACT;
--source include/innodb_gis_row_format_basic.inc
......@@ -4,17 +4,15 @@
# Not supported in embedded
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
--source include/have_debug.inc
--source include/big_test.inc
# Valgrind takes too much time on PB2 even in the --big-test runs.
--source include/not_valgrind.inc
# Create table with R-tree index.
SET GLOBAL innodb_file_per_table=1;
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
#Create table with R-tree index.
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb ROW_FORMAT=COMPRESSED;
# Insert enough values to let R-tree split.
......@@ -53,12 +51,14 @@ select count(*) from t1 where MBRWithin(t1.c2, @g1);
set @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
SET @saved_dbug = @@SESSION.debug_dbug;
SET DEBUG='+d,page_copy_rec_list_start_compress_fail';
delete from t1;
SET DEBUG='-d,page_copy_rec_list_start_compress_fail';
select count(*) from t1 where MBRWithin(t1.c2, @g1);
SET debug_dbug = @saved_dbug;
--source ../../innodb/include/wait_all_purged.inc
# Clean up.
drop table t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
......@@ -4,8 +4,7 @@
# Restarting is not supported in embedded
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
--source include/big_test.inc
# Valgrind takes too much time on PB2 even in the --big-test runs.
--source include/not_valgrind.inc
......@@ -29,31 +28,14 @@ delimiter ;|
# Test level 3 rtree.
CALL insert_t1(70000);
select count(*) from t1;
# Check table.
check table t1;
truncate table t1;
# Test crash recovery.
#
#
call mtr.add_suppression("InnoDB: A copy of page \[page id: space=[0-9]+, page number=[0-9]+\] in the doublewrite buffer slot [0-9]+ is not within space bounds");
# Test rtree enlarge recovery.
START TRANSACTION;
CALL insert_t1(5000);
#select count(*) from t1;
# Check table.
#check table t1;
COMMIT;
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
check table t1;
select count(*) from t1;
delete from t1;
# Clean up.
drop procedure insert_t1;
drop table t1;
# WL#6745 InnoDB R-tree support
# This test case will test R-tree split.
# Not supported in embedded
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
......@@ -32,8 +29,7 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
connect (a,localhost,root,,);
connection a;
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
SET debug_dbug='+d,rtr_pcur_move_to_next_return';
set session transaction isolation level serializable;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
......@@ -41,9 +37,7 @@ SET DEBUG_SYNC = 'RESET';
SET DEBUG_SYNC = 'row_search_for_mysql_before_return SIGNAL started WAIT_FOR go_ahead';
--send select count(*) from t1 where MBRWithin(t1.c2, @g1);
--echo # Establish session con1 (user=root)
connect (con1,localhost,root,,);
connection con1;
set session transaction isolation level serializable;
SET DEBUG_SYNC = 'now WAIT_FOR started';
......@@ -92,7 +86,6 @@ select count(*) from t1 where MBRwithin(t1.c2, @g1);
# The split will replicate locks across pages
connect (b,localhost,root,,);
connection b;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
......@@ -292,15 +285,8 @@ insert into t1 values (1200, Point(950, 950));
connection a;
select sleep(2);
commit;
connection a;
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
disconnect a;
--source include/wait_until_disconnected.inc
connection b;
disconnect b;
--source include/wait_until_disconnected.inc
# Clean up.
connection default;
......@@ -321,7 +307,6 @@ INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(7 7, 200 200)'));
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 8, 210 210)'));
connect (a,localhost,root,,);
connection a;
SET SESSION debug="+d,rtr_pcur_move_to_next_return";
set transaction isolation level serializable;
......@@ -330,7 +315,6 @@ set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100)
select count(*) from t1 where MBRwithin(t1.c2, @g1);
connect (b,localhost,root,,);
connection b;
# This should be successful
delete from t1 where c1 = 1;
......@@ -432,20 +416,14 @@ rollback;
SET DEBUG_SYNC= 'now SIGNAL sigb';
connection a;
--reap;
reap;
connection default;
drop procedure insert_t1;
DROP TABLE t1;
connection a;
SET SESSION debug="-d,rtr_pcur_move_to_next_return";
disconnect a;
--source include/wait_until_disconnected.inc
connection b;
disconnect b;
--source include/wait_until_disconnected.inc
connection default;
SET DEBUG_SYNC = 'RESET';
This diff is collapsed.
# This test case will test R-tree purge.
# Not supported in embedded
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/have_debug.inc
--source include/big_test.inc
--source include/innodb_page_size.inc
# Valgrind takes too much time on PB2 even in the --big-test runs.
--source include/not_valgrind.inc
# Temporarily disable it for 4k page size. Since it'll take too long
# time.
--disable_warnings
if (`SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value = 4096`)
{
--skip Test requires InnoDB with not 4k Page size.
}
--enable_warnings
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
create table t (
a point not null,b point not null,c point,
d point not null,e point,f point,
spatial key (d),spatial key (b)
b point not null,d point not null, spatial key (d),spatial key (b)
) engine=innodb;
delimiter |;
create procedure p(i int)
begin
declare n int default 0;
declare continue handler for sqlexception begin end;
delete from t;
repeat
set @p=point(1,1);
insert into t values(@p,@p,@p,@p,@p,@p);
insert into t values(@p,@p,@p,@p,@p,@p);
insert into t select @p,@p,@p,@p,@p,@p
from t a,t b,t c,t d,t e,t f,t g,t h,t i,t j;
delete from t;
set n:=n+1;
until n >= i end repeat;
end|
delimiter ;|
call p(200);
--disable_query_log
set @p=point(1,1);
let $n=200;
while ($n) {
begin;
insert into t values(@p,@p),(@p,@p);
insert into t select @p,@p
from t a,t b,t c,t d,t e,t f,t g;
delete from t;
commit;
dec $n;
}
--enable_query_log
--source include/wait_all_purged.inc
--source ../../innodb/include/wait_all_purged.inc
# Clean up.
drop procedure p;
drop table t;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
......@@ -31,9 +31,10 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
#Check second round spliting.
SET SESSION debug="+d, rtr_page_need_second_split";
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d, rtr_page_need_second_split';
insert into t1 select * from t1;
SET SESSION debug="-d, rtr_page_need_second_split";
SET debug_dbug = @saved_dbug;
delete from t1;
......@@ -79,24 +80,27 @@ select count(*) from t1 where MBRWithin(t1.c2, @g1);
drop index c2 on t1;
# Test create index with algorithm=inplace
--enable_info
create spatial index idx2 on t1(c2);
--disable_info
show create table t1;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
# test read only case
let $restart_parameters = restart: --innodb-read-only;
let $restart_parameters = --innodb-read-only;
--source include/restart_mysqld.inc
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
let $restart_parameters = restart;
let $restart_parameters =;
--source include/restart_mysqld.inc
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
set @g1 = ST_GeomFromText('Polygon((2 2,2 800,800 800,800 2,2 2))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
# Clean up.
drop table t1;
This diff is collapsed.
This diff is collapsed.
......@@ -20,7 +20,7 @@
#include "sql_array.h"
#include "rpl_rli.h"
#include <lf.h>
#include <mysqld_error.h>
#include "unireg.h"
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
#include <mysql/psi/mysql_stage.h>
......
This diff is collapsed.
This diff is collapsed.
......@@ -41,7 +41,7 @@
#include <sql_common.h>
#include <errmsg.h>
#include <ssl_compat.h>
#include <mysqld_error.h>
#include "unireg.h"
#include <mysys_err.h>
#include <signal.h>
#include <mysql.h>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment