Commit cc577f81 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-11041 Innodb_gis/ tests taken from MySQL fail.

        Some fixes made in innodb and item_create.cc.
        Adapted Innodb-GIS tests moved to MariaDB.
parent 098dff10
...@@ -179,6 +179,7 @@ my @DEFAULT_SUITES= qw( ...@@ -179,6 +179,7 @@ my @DEFAULT_SUITES= qw(
heap- heap-
innodb- innodb-
innodb_fts- innodb_fts-
innodb_gis-
innodb_zip- innodb_zip-
maria- maria-
multi_source- multi_source-
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
create table t1 (i int, g geometry not null, spatial index (g))engine=innodb;
SET SESSION debug="+d,rtree_test_check_count";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
insert into t1 values (1, POINT(1,1));
insert into t1 values (1, POINT(1.5,1.5));
insert into t1 values (1, POINT(3,3));
insert into t1 values (1, POINT(3.1,3.1));
insert into t1 values (1, POINT(5,5));
CALL mtr.add_suppression("InnoDB: Flagged corruption of `g` in table `test`.`t1` in CHECK TABLE; Wrong count");
check table t1;
Table Op Msg_type Msg_text
test.t1 check Warning InnoDB: Index 'g' contains 0 entries, should be 5.
test.t1 check error Corrupt
drop table t1;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SET default_storage_engine=InnoDB;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL,
KEY gis_key(g(5))
) ENGINE=InnoDB;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`g` geometry NOT NULL,
PRIMARY KEY (`fid`),
KEY `gis_key` (`g`(5))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT count(*) FROM t1;
count(*)
150
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
EXPLAIN SELECT fid, ST_AsText(g) FROM t1 WHERE ST_Within(g, ST_GeomFromText('Polygon((140 140,160 140,160 160,140 140))'));
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL gis_key NULL NULL NULL 150 #
SELECT fid, ST_AsText(g) FROM t1 WHERE ST_Within(g, ST_GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')) ORDER BY fid;
fid ST_AsText(g)
1 LINESTRING(150 150,150 150)
2 LINESTRING(149 149,151 151)
3 LINESTRING(148 148,152 152)
4 LINESTRING(147 147,153 153)
5 LINESTRING(146 146,154 154)
6 LINESTRING(145 145,155 155)
7 LINESTRING(144 144,156 156)
8 LINESTRING(143 143,157 157)
9 LINESTRING(142 142,158 158)
10 LINESTRING(141 141,159 159)
11 LINESTRING(140 140,160 160)
DROP TABLE t1;
CREATE TABLE t1 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL
) ENGINE=InnoDB;
ALTER TABLE t1 ADD SPATIAL KEY(g);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`fid` int(11) NOT NULL AUTO_INCREMENT,
`g` geometry NOT NULL,
PRIMARY KEY (`fid`),
SPATIAL KEY `g` (`g`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
SELECT count(*) FROM t1;
count(*)
100
SELECT fid, ST_AsText(g) FROM t1 WHERE ST_Within(g,
ST_GeomFromText('Polygon((40 40,60 40,60 60,40 40))')) ORDER BY fid;
fid ST_AsText(g)
DROP TABLE t1;
End of 5.5 tests.
This diff is collapsed.
--source include/have_innodb.inc
SET default_storage_engine=innodb;
--source include/gis_generic.inc
--source include/gis_keys.inc
#
# Bug #15680 (SPATIAL key in innodb)
#
#--error ER_TABLE_CANT_HANDLE_SPKEYS
create table t1 (g geometry not null, spatial gk(g)) engine=innodb;
DROP TABLE t1;
# Test read uncommitted
create table t1 (c1 int, c2 geometry not null, spatial index (c2))engine=innodb;
connect (a,localhost,root,,);
connection a;
start transaction;
insert into t1 values(1, Point(1,1));
connect (con1,localhost,root,,);
connection con1;
set @g1 = ST_GeomFromText('Polygon((0 0,0 100,100 100,100 0,0 0))');
set transaction isolation level read uncommitted;
select count(*) from t1 where ST_Within(t1.c2, @g1);
disconnect con1;
--source include/wait_until_disconnected.inc
connection a;
commit;
disconnect a;
--source include/wait_until_disconnected.inc
connection default;
drop table t1;
This diff is collapsed.
This diff is collapsed.
# This test case will test checking R-tree features.
# Not supported in embedded
--source include/not_embedded.inc
--source include/have_debug.inc
--source include/have_innodb.inc
# Create table with R-tree index.
create table t1 (i int, g geometry not null, spatial index (g))engine=innodb;
# Turn on the geometry data print.
SET SESSION debug="+d,rtree_test_check_count";
# Insert values.
insert into t1 values (1, POINT(1,1));
insert into t1 values (1, POINT(1.5,1.5));
insert into t1 values (1, POINT(3,3));
insert into t1 values (1, POINT(3.1,3.1));
insert into t1 values (1, POINT(5,5));
CALL mtr.add_suppression("InnoDB: Flagged corruption of `g` in table `test`.`t1` in CHECK TABLE; Wrong count");
# Select by R-tree index.
check table t1;
# Cleanup.
drop table t1;
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