Commit 8dc77a72 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14057 InnoDB GIS tests fail

Fix and enable some of the tests; some remain disabled.

The tests innodb_gis.rtree_old and innodb_gis.row_format
duplicated some versions of the test main.gis-rtree.
Instead of duplicating, source that test, in a new test
innodb_gis.innodb_gis_rtree.

Introduce innodb_row_format.combinations. Due to this,
ROW_FORMAT=COMPRESSED will not be covered in some tests
where it is covered in MySQL 5.7.
parent 218dbf68
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,
g GEOMETRY NOT NULL,
SPATIAL KEY(g)
) ENGINE=MyISAM;
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -185,7 +184,7 @@ DROP TABLE t1;
CREATE TABLE t2 (
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)));
......@@ -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)"));
......@@ -754,7 +750,7 @@ CREATE TABLE t1 (
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,7 +758,7 @@ 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
("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
......@@ -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)')),
......@@ -1548,7 +1544,7 @@ End of 5.0 tests.
# 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);
id select_type table type possible_keys key key_len ref rows Extra
......
......@@ -11,15 +11,9 @@
##############################################################################
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
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;
......@@ -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;
......@@ -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;
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;
......@@ -3,15 +3,12 @@
#
# test of rtree (using with spatial data)
#
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
CREATE TABLE t1 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL,
SPATIAL KEY(g)
) ENGINE=MyISAM;
);
SHOW CREATE TABLE t1;
......@@ -33,7 +30,7 @@ DROP TABLE t1;
CREATE TABLE t2 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL
) ENGINE=MyISAM;
);
let $1=10;
while ($1)
......@@ -70,7 +67,6 @@ while ($1)
DROP TABLE t2;
drop table if exists 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)"));
......@@ -113,7 +109,7 @@ CREATE TABLE t1 (
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)'));
#select * from t1 where g<GeomFromText('LineString(1 2, 2 3)');
......@@ -125,9 +121,7 @@ CREATE TABLE t1 (
name VARCHAR(32),
SPATIAL KEY (line)
) engine=myisam;
);
ALTER TABLE t1 DISABLE KEYS;
INSERT INTO t1 (name, kind, line) VALUES
......@@ -172,7 +166,7 @@ CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT IGNORE INTO t2 SELECT GeomFromText(st) FROM t1;
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
......@@ -193,7 +187,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,
......@@ -207,7 +201,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,
......@@ -252,7 +246,7 @@ CREATE TABLE t1 (id bigint(12) unsigned NOT NULL auto_increment,
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)')),
......@@ -936,7 +930,7 @@ DROP TABLE t1;
--echo #
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)"));
--error ER_CANT_CREATE_GEOMETRY_OBJECT
INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
......@@ -946,7 +940,7 @@ SELECT ASTEXT(a), ASTEXT(b) FROM t1;
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)"));
--error ER_CANT_CREATE_GEOMETRY_OBJECT
INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
......@@ -963,7 +957,7 @@ DROP TABLE t1;
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)'));
......@@ -985,7 +979,7 @@ DROP TABLE t1;
--echo #
--echo # MDEV-8239 Reverse spatial operations OP(const, field) do not get optimized
--echo #
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));
EXPLAIN SELECT * FROM t1 WHERE ST_INTERSECTS(a,Point(1,2));
......@@ -996,7 +990,7 @@ DROP TABLE t1;
--echo #
--echo # MDEV-8610 "WHERE CONTAINS(indexed_geometry_column,1)" causes full table scan
--echo #
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);
EXPLAIN SELECT * FROM t1 WHERE CONTAINS(a,1.0);
......
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