Commit 33723996 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

merge

parents 57b4295d f51e62cf
...@@ -186,106 +186,106 @@ CREATE TABLE t2 ( ...@@ -186,106 +186,106 @@ CREATE TABLE t2 (
fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
g GEOMETRY NOT NULL g GEOMETRY NOT NULL
) ENGINE=MyISAM; ) ENGINE=MyISAM;
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)));
INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))); INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)));
ALTER TABLE t2 ADD SPATIAL KEY(g); ALTER TABLE t2 ADD SPATIAL KEY(g);
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
...@@ -309,406 +309,406 @@ fid AsText(g) ...@@ -309,406 +309,406 @@ fid AsText(g)
56 LINESTRING(41 41,50 50) 56 LINESTRING(41 41,50 50)
45 LINESTRING(51 51,60 60) 45 LINESTRING(51 51,60 60)
55 LINESTRING(41 51,50 60) 55 LINESTRING(41 51,50 60)
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
99 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
98 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
97 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
96 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
95 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
94 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
93 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
92 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
91 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
90 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
89 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
88 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
87 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
86 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
85 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
84 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
83 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
82 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
81 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
80 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
79 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
78 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
77 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
76 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
75 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
74 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
73 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
72 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
71 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
70 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
69 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
68 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
67 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
66 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
65 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
64 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
63 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
62 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
61 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
60 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
59 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
58 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
57 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
56 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
55 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
54 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
53 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
52 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
51 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
50 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
49 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
48 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
47 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
46 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
45 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
44 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
43 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
42 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
41 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
40 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
39 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
38 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
37 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
36 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
35 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
34 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
33 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
32 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
31 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
30 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
29 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
28 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
27 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
26 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
25 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
24 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
23 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
22 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
21 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
20 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
19 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
18 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
17 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
16 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
15 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
14 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
13 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
12 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
11 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
10 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
9 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
8 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
7 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
6 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
5 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
4 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
3 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
2 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
1 100
DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))))); DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
count(*) count(*)
0 100
DROP TABLE t2; DROP TABLE t2;
drop table if exists t1; drop table if exists t1;
Warnings: Warnings:
...@@ -863,11 +863,11 @@ Table Op Msg_type Msg_text ...@@ -863,11 +863,11 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1))); INSERT INTO t1 (foo) VALUES (POINT(1,1));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0))); INSERT INTO t1 (foo) VALUES (POINT(1,0));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1))); INSERT INTO t1 (foo) VALUES (POINT(0,1));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0))); INSERT INTO t1 (foo) VALUES (POINT(0,0));
SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0)); SELECT 1 FROM t1 WHERE foo != POINT(0,0);
1 1
1 1
1 1
...@@ -1426,35 +1426,35 @@ Table Op Msg_type Msg_text ...@@ -1426,35 +1426,35 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
DROP TABLE t1; DROP TABLE t1;
create table t1 (a geometry not null, spatial index(a)); create table t1 (a geometry not null, spatial index(a));
insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072))); insert into t1 values (POINT(1.1517219314031e+164, 131072));
insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284))); insert into t1 values (POINT(9.1248812352444e+192, 2.9740338169556e+284));
insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0))); insert into t1 values (POINT(4.7783097267365e-299, -0));
insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53))); insert into t1 values (POINT(1.49166814624e-154, 2.0880974297595e-53));
insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111))); insert into t1 values (POINT(4.0917382598702e+149, 1.2024538023802e+111));
insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241))); insert into t1 values (POINT(2.0349165139404e+236, 2.9993936277913e-241));
insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111))); insert into t1 values (POINT(2.5243548967072e-29, 1.2024538023802e+111));
insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251))); insert into t1 values (POINT(0, 6.9835074892995e-251));
insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231))); insert into t1 values (POINT(2.0880974297595e-53, 3.1050361846014e+231));
insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260))); insert into t1 values (POINT(2.8728483499323e-188, 2.4600631144627e+260));
insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236))); insert into t1 values (POINT(3.0517578125e-05, 2.0349165139404e+236));
insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125))); insert into t1 values (POINT(1.1517219314031e+164, 1.1818212630766e-125));
insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275))); insert into t1 values (POINT(2.481040258324e-265, 5.7766220027675e-275));
insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29))); insert into t1 values (POINT(2.0880974297595e-53, 2.5243548967072e-29));
insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86))); insert into t1 values (POINT(5.7766220027675e-275, 9.9464647281957e+86));
insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270))); insert into t1 values (POINT(2.2181357552967e+130, 3.7857669957337e-270));
insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19))); insert into t1 values (POINT(4.5767114681874e-246, 3.6893488147419e+19));
insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255))); insert into t1 values (POINT(4.5767114681874e-246, 3.7537584144024e+255));
insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130))); insert into t1 values (POINT(3.7857669957337e-270, 1.8033161362863e-130));
insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39))); insert into t1 values (POINT(0, 5.8774717541114e-39));
insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159))); insert into t1 values (POINT(1.1517219314031e+164, 2.2761049594727e-159));
insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270))); insert into t1 values (POINT(6.243497100632e+144, 3.7857669957337e-270));
insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82))); insert into t1 values (POINT(3.7857669957337e-270, 2.6355494858076e-82));
insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34))); insert into t1 values (POINT(2.0349165139404e+236, 3.8518598887745e-34));
insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53))); insert into t1 values (POINT(4.6566128730774e-10, 2.0880974297595e-53));
insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183))); insert into t1 values (POINT(2.0880974297595e-53, 1.8827498946116e-183));
insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192))); insert into t1 values (POINT(1.8033161362863e-130, 9.1248812352444e+192));
insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159))); insert into t1 values (POINT(4.7783097267365e-299, 2.2761049594727e-159));
insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178))); insert into t1 values (POINT(1.94906280228e+289, 1.2338789709327e-178));
drop table t1; drop table t1;
CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); CREATE TABLE t1(foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1(foo) VALUES (NULL); INSERT INTO t1(foo) VALUES (NULL);
......
...@@ -47,26 +47,26 @@ INSERT INTO gis_point VALUES ...@@ -47,26 +47,26 @@ INSERT INTO gis_point VALUES
INSERT INTO gis_line VALUES INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10)))); (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));
INSERT INTO gis_polygon VALUES INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))));
INSERT INTO gis_multi_point VALUES INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));
INSERT INTO gis_multi_line VALUES INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));
INSERT INTO gis_multi_polygon VALUES INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));
INSERT INTO gis_geometrycollection VALUES INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))));
INSERT into gis_geometry SELECT * FROM gis_point; INSERT into gis_geometry SELECT * FROM gis_point;
INSERT into gis_geometry SELECT * FROM gis_line; INSERT into gis_geometry SELECT * FROM gis_line;
INSERT into gis_geometry SELECT * FROM gis_polygon; INSERT into gis_geometry SELECT * FROM gis_polygon;
......
...@@ -83,4 +83,4 @@ sync_slave_with_master; ...@@ -83,4 +83,4 @@ sync_slave_with_master;
# will be created. You will need to go to the mysql-test dir and diff # will be created. You will need to go to the mysql-test dir and diff
# the files your self to see what is not matching # the files your self to see what is not matching
--exec diff $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql --diff_files $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_master.sql $MYSQLTEST_VARDIR/tmp/rpl_switch_stm_row_mixed_slave.sql
rm -f $MYSQLTEST_VARDIR/slave-data/master.info
...@@ -244,7 +244,7 @@ connection master; ...@@ -244,7 +244,7 @@ connection master;
# We should be gold by the time, so I will get rid of our file. # We should be gold by the time, so I will get rid of our file.
--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql --remove_file $MYSQLTEST_VARDIR/tmp/remote.sql
################### End Bug 17654 ###################### ################### End Bug 17654 ######################
# What is the point of this test? It seems entirely pointless. It # What is the point of this test? It seems entirely pointless. It
...@@ -349,9 +349,9 @@ FLUSH LOGS; ...@@ -349,9 +349,9 @@ FLUSH LOGS;
--diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql --diff_files $MYSQLTEST_VARDIR/tmp/local.sql $MYSQLTEST_VARDIR/tmp/remote.sql
--exec rm $MYSQLTEST_VARDIR/tmp/remote.sql --remove_file $MYSQLTEST_VARDIR/tmp/remote.sql
--exec rm $MYSQLTEST_VARDIR/tmp/local.sql --remove_file $MYSQLTEST_VARDIR/tmp/local.sql
DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5; DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
sync_slave_with_master; sync_slave_with_master;
......
...@@ -41,7 +41,7 @@ while ($1) ...@@ -41,7 +41,7 @@ while ($1)
let $2=10; let $2=10;
while ($2) while ($2)
{ {
eval INSERT INTO t2 (g) VALUES (GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)))); eval INSERT INTO t2 (g) VALUES (LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10)));
dec $2; dec $2;
} }
dec $1; dec $1;
...@@ -61,7 +61,7 @@ while ($1) ...@@ -61,7 +61,7 @@ while ($1)
let $2=10; let $2=10;
while ($2) while ($2)
{ {
eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))))); eval DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))));
SELECT count(*) FROM t2; SELECT count(*) FROM t2;
dec $2; dec $2;
} }
...@@ -235,11 +235,11 @@ DROP TABLE t1; ...@@ -235,11 +235,11 @@ DROP TABLE t1;
# Bug #21888: Query on GEOMETRY field using PointFromWKB() results in lost connection # Bug #21888: Query on GEOMETRY field using PointFromWKB() results in lost connection
# #
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) ); CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1))); INSERT INTO t1 (foo) VALUES (POINT(1,1));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0))); INSERT INTO t1 (foo) VALUES (POINT(1,0));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1))); INSERT INTO t1 (foo) VALUES (POINT(0,1));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0))); INSERT INTO t1 (foo) VALUES (POINT(0,0));
SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0)); SELECT 1 FROM t1 WHERE foo != POINT(0,0);
DROP TABLE t1; DROP TABLE t1;
# #
...@@ -802,35 +802,35 @@ DROP TABLE t1; ...@@ -802,35 +802,35 @@ DROP TABLE t1;
# #
create table t1 (a geometry not null, spatial index(a)); create table t1 (a geometry not null, spatial index(a));
insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 131072))); insert into t1 values (POINT(1.1517219314031e+164, 131072));
insert into t1 values (PointFromWKB(POINT(9.1248812352444e+192, 2.9740338169556e+284))); insert into t1 values (POINT(9.1248812352444e+192, 2.9740338169556e+284));
insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, -0))); insert into t1 values (POINT(4.7783097267365e-299, -0));
insert into t1 values (PointFromWKB(POINT(1.49166814624e-154, 2.0880974297595e-53))); insert into t1 values (POINT(1.49166814624e-154, 2.0880974297595e-53));
insert into t1 values (PointFromWKB(POINT(4.0917382598702e+149, 1.2024538023802e+111))); insert into t1 values (POINT(4.0917382598702e+149, 1.2024538023802e+111));
insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 2.9993936277913e-241))); insert into t1 values (POINT(2.0349165139404e+236, 2.9993936277913e-241));
insert into t1 values (PointFromWKB(POINT(2.5243548967072e-29, 1.2024538023802e+111))); insert into t1 values (POINT(2.5243548967072e-29, 1.2024538023802e+111));
insert into t1 values (PointFromWKB(POINT(0, 6.9835074892995e-251))); insert into t1 values (POINT(0, 6.9835074892995e-251));
insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 3.1050361846014e+231))); insert into t1 values (POINT(2.0880974297595e-53, 3.1050361846014e+231));
insert into t1 values (PointFromWKB(POINT(2.8728483499323e-188, 2.4600631144627e+260))); insert into t1 values (POINT(2.8728483499323e-188, 2.4600631144627e+260));
insert into t1 values (PointFromWKB(POINT(3.0517578125e-05, 2.0349165139404e+236))); insert into t1 values (POINT(3.0517578125e-05, 2.0349165139404e+236));
insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 1.1818212630766e-125))); insert into t1 values (POINT(1.1517219314031e+164, 1.1818212630766e-125));
insert into t1 values (PointFromWKB(POINT(2.481040258324e-265, 5.7766220027675e-275))); insert into t1 values (POINT(2.481040258324e-265, 5.7766220027675e-275));
insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 2.5243548967072e-29))); insert into t1 values (POINT(2.0880974297595e-53, 2.5243548967072e-29));
insert into t1 values (PointFromWKB(POINT(5.7766220027675e-275, 9.9464647281957e+86))); insert into t1 values (POINT(5.7766220027675e-275, 9.9464647281957e+86));
insert into t1 values (PointFromWKB(POINT(2.2181357552967e+130, 3.7857669957337e-270))); insert into t1 values (POINT(2.2181357552967e+130, 3.7857669957337e-270));
insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.6893488147419e+19))); insert into t1 values (POINT(4.5767114681874e-246, 3.6893488147419e+19));
insert into t1 values (PointFromWKB(POINT(4.5767114681874e-246, 3.7537584144024e+255))); insert into t1 values (POINT(4.5767114681874e-246, 3.7537584144024e+255));
insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 1.8033161362863e-130))); insert into t1 values (POINT(3.7857669957337e-270, 1.8033161362863e-130));
insert into t1 values (PointFromWKB(POINT(0, 5.8774717541114e-39))); insert into t1 values (POINT(0, 5.8774717541114e-39));
insert into t1 values (PointFromWKB(POINT(1.1517219314031e+164, 2.2761049594727e-159))); insert into t1 values (POINT(1.1517219314031e+164, 2.2761049594727e-159));
insert into t1 values (PointFromWKB(POINT(6.243497100632e+144, 3.7857669957337e-270))); insert into t1 values (POINT(6.243497100632e+144, 3.7857669957337e-270));
insert into t1 values (PointFromWKB(POINT(3.7857669957337e-270, 2.6355494858076e-82))); insert into t1 values (POINT(3.7857669957337e-270, 2.6355494858076e-82));
insert into t1 values (PointFromWKB(POINT(2.0349165139404e+236, 3.8518598887745e-34))); insert into t1 values (POINT(2.0349165139404e+236, 3.8518598887745e-34));
insert into t1 values (PointFromWKB(POINT(4.6566128730774e-10, 2.0880974297595e-53))); insert into t1 values (POINT(4.6566128730774e-10, 2.0880974297595e-53));
insert into t1 values (PointFromWKB(POINT(2.0880974297595e-53, 1.8827498946116e-183))); insert into t1 values (POINT(2.0880974297595e-53, 1.8827498946116e-183));
insert into t1 values (PointFromWKB(POINT(1.8033161362863e-130, 9.1248812352444e+192))); insert into t1 values (POINT(1.8033161362863e-130, 9.1248812352444e+192));
insert into t1 values (PointFromWKB(POINT(4.7783097267365e-299, 2.2761049594727e-159))); insert into t1 values (POINT(4.7783097267365e-299, 2.2761049594727e-159));
insert into t1 values (PointFromWKB(POINT(1.94906280228e+289, 1.2338789709327e-178))); insert into t1 values (POINT(1.94906280228e+289, 1.2338789709327e-178));
drop table t1; drop table t1;
# End of 4.1 tests # End of 4.1 tests
......
...@@ -37,32 +37,32 @@ INSERT INTO gis_point VALUES ...@@ -37,32 +37,32 @@ INSERT INTO gis_point VALUES
INSERT INTO gis_line VALUES INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')), (105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')), (106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10)))); (107, LineStringFromWKB(AsWKB(LineString(Point(10, 10), Point(40, 10)))));
INSERT INTO gis_polygon VALUES INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')), (108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')), (109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))); (110, PolyFromWKB(AsWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0))))));
INSERT INTO gis_multi_point VALUES INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')), (111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')), (112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10)))); (113, MPointFromWKB(AsWKB(MultiPoint(Point(3, 6), Point(4, 10)))));
INSERT INTO gis_multi_line VALUES INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')), (114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')), (115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))); (116, MLineFromWKB(AsWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7))))));
INSERT INTO gis_multi_polygon VALUES INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')), (118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))); (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3)))))));
INSERT INTO gis_geometrycollection VALUES INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))); (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9))))));
INSERT into gis_geometry SELECT * FROM gis_point; INSERT into gis_geometry SELECT * FROM gis_point;
INSERT into gis_geometry SELECT * FROM gis_line; INSERT into gis_geometry SELECT * FROM gis_line;
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
delimiter |; delimiter |;
# #
# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog # Bug#13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
# Bug #23333 stored function + non-transac table + transac table = # Bug#23333 stored function + non-transac table + transac table =
# breaks stmt-based binlog # breaks stmt-based binlog
# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() # Bug#27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
# #
--disable_warnings --disable_warnings
drop function if exists bug23333| drop function if exists bug23333|
drop table if exists t1,t2| drop table if exists t1,t2|
--enable_warnings --enable_warnings
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
insert into t2 values (1,1)| insert into t2 values (1,1)|
......
...@@ -78,10 +78,17 @@ String *Item_func_geometry_from_wkb::val_str(String *str) ...@@ -78,10 +78,17 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
String arg_val; String arg_val;
String *wkb= args[0]->val_str(&arg_val); String *wkb;
Geometry_buffer buffer; Geometry_buffer buffer;
uint32 srid= 0; uint32 srid= 0;
if (args[0]->field_type() == MYSQL_TYPE_GEOMETRY)
{
return args[0]->val_str(str);
}
wkb= args[0]->val_str(&arg_val);
if ((arg_count == 2) && !args[1]->null_value) if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int(); srid= (uint32)args[1]->val_int();
...@@ -345,14 +352,16 @@ String *Item_func_point::val_str(String *str) ...@@ -345,14 +352,16 @@ String *Item_func_point::val_str(String *str)
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
double x= args[0]->val_real(); double x= args[0]->val_real();
double y= args[1]->val_real(); double y= args[1]->val_real();
uint32 srid= 0;
if ((null_value= (args[0]->null_value || if ((null_value= (args[0]->null_value ||
args[1]->null_value || args[1]->null_value ||
str->realloc(1 + 4 + SIZEOF_STORED_DOUBLE*2)))) str->realloc(4/*SRID*/ + 1 + 4 + SIZEOF_STORED_DOUBLE*2))))
return 0; return 0;
str->set_charset(&my_charset_bin); str->set_charset(&my_charset_bin);
str->length(0); str->length(0);
str->q_append(srid);
str->q_append((char)Geometry::wkb_ndr); str->q_append((char)Geometry::wkb_ndr);
str->q_append((uint32)Geometry::wkb_point); str->q_append((uint32)Geometry::wkb_point);
str->q_append(x); str->q_append(x);
...@@ -376,12 +385,14 @@ String *Item_func_spatial_collection::val_str(String *str) ...@@ -376,12 +385,14 @@ String *Item_func_spatial_collection::val_str(String *str)
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
String arg_value; String arg_value;
uint i; uint i;
uint32 srid= 0;
str->set_charset(&my_charset_bin); str->set_charset(&my_charset_bin);
str->length(0); str->length(0);
if (str->reserve(1 + 4 + 4, 512)) if (str->reserve(4/*SRID*/ + 1 + 4 + 4, 512))
goto err; goto err;
str->q_append(srid);
str->q_append((char) Geometry::wkb_ndr); str->q_append((char) Geometry::wkb_ndr);
str->q_append((uint32) coll_type); str->q_append((uint32) coll_type);
str->q_append((uint32) arg_count); str->q_append((uint32) arg_count);
...@@ -399,13 +410,13 @@ String *Item_func_spatial_collection::val_str(String *str) ...@@ -399,13 +410,13 @@ String *Item_func_spatial_collection::val_str(String *str)
In the case of GeometryCollection we don't need any checkings In the case of GeometryCollection we don't need any checkings
for item types, so just copy them into target collection for item types, so just copy them into target collection
*/ */
if (str->append(res->ptr(), len, (uint32) 512)) if (str->append(res->ptr() + 4/*SRID*/, len - 4/*SRID*/, (uint32) 512))
goto err; goto err;
} }
else else
{ {
enum Geometry::wkbType wkb_type; enum Geometry::wkbType wkb_type;
const char *data= res->ptr() + 1; const char *data= res->ptr() + 4/*SRID*/ + 1;
/* /*
In the case of named collection we must check that items In the case of named collection we must check that items
...@@ -414,7 +425,7 @@ String *Item_func_spatial_collection::val_str(String *str) ...@@ -414,7 +425,7 @@ String *Item_func_spatial_collection::val_str(String *str)
wkb_type= (Geometry::wkbType) uint4korr(data); wkb_type= (Geometry::wkbType) uint4korr(data);
data+= 4; data+= 4;
len-= 5; len-= 5 + 4/*SRID*/;
if (wkb_type != item_type) if (wkb_type != item_type)
goto err; goto err;
......
...@@ -340,8 +340,7 @@ Rpl_filter::add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec) ...@@ -340,8 +340,7 @@ Rpl_filter::add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec)
e->tbl_name= e->db + (dot - table_spec) + 1; e->tbl_name= e->db + (dot - table_spec) + 1;
e->key_len= len; e->key_len= len;
memcpy(e->db, table_spec, len); memcpy(e->db, table_spec, len);
insert_dynamic(a, (uchar*)&e); return insert_dynamic(a, (uchar*)&e);
return 0;
} }
......
...@@ -2132,17 +2132,16 @@ sp_head::restore_lex(THD *thd) ...@@ -2132,17 +2132,16 @@ sp_head::restore_lex(THD *thd)
/** /**
Put the instruction on the backpatch list, associated with the label. Put the instruction on the backpatch list, associated with the label.
*/ */
void int
sp_head::push_backpatch(sp_instr *i, sp_label_t *lab) sp_head::push_backpatch(sp_instr *i, sp_label_t *lab)
{ {
bp_t *bp= (bp_t *)sql_alloc(sizeof(bp_t)); bp_t *bp= (bp_t *)sql_alloc(sizeof(bp_t));
if (bp) if (!bp)
{ return 1;
bp->lab= lab; bp->lab= lab;
bp->instr= i; bp->instr= i;
(void)m_backpatch.push_front(bp); return m_backpatch.push_front(bp);
}
} }
/** /**
...@@ -2217,7 +2216,7 @@ sp_head::fill_field_definition(THD *thd, LEX *lex, ...@@ -2217,7 +2216,7 @@ sp_head::fill_field_definition(THD *thd, LEX *lex,
} }
void int
sp_head::new_cont_backpatch(sp_instr_opt_meta *i) sp_head::new_cont_backpatch(sp_instr_opt_meta *i)
{ {
m_cont_level+= 1; m_cont_level+= 1;
...@@ -2225,15 +2224,17 @@ sp_head::new_cont_backpatch(sp_instr_opt_meta *i) ...@@ -2225,15 +2224,17 @@ sp_head::new_cont_backpatch(sp_instr_opt_meta *i)
{ {
/* Use the cont. destination slot to store the level */ /* Use the cont. destination slot to store the level */
i->m_cont_dest= m_cont_level; i->m_cont_dest= m_cont_level;
(void)m_cont_backpatch.push_front(i); if (m_cont_backpatch.push_front(i))
return 1;
} }
return 0;
} }
void int
sp_head::add_cont_backpatch(sp_instr_opt_meta *i) sp_head::add_cont_backpatch(sp_instr_opt_meta *i)
{ {
i->m_cont_dest= m_cont_level; i->m_cont_dest= m_cont_level;
(void)m_cont_backpatch.push_front(i); return m_cont_backpatch.push_front(i);
} }
void void
...@@ -2469,7 +2470,7 @@ sp_head::show_create_routine(THD *thd, int type) ...@@ -2469,7 +2470,7 @@ sp_head::show_create_routine(THD *thd, int type)
@param instr Instruction @param instr Instruction
*/ */
void sp_head::add_instr(sp_instr *instr) int sp_head::add_instr(sp_instr *instr)
{ {
instr->free_list= m_thd->free_list; instr->free_list= m_thd->free_list;
m_thd->free_list= 0; m_thd->free_list= 0;
...@@ -2480,7 +2481,7 @@ void sp_head::add_instr(sp_instr *instr) ...@@ -2480,7 +2481,7 @@ void sp_head::add_instr(sp_instr *instr)
entire stored procedure, as their life span is equal. entire stored procedure, as their life span is equal.
*/ */
instr->mem_root= &main_mem_root; instr->mem_root= &main_mem_root;
insert_dynamic(&m_instr, (uchar*)&instr); return insert_dynamic(&m_instr, (uchar*)&instr);
} }
......
...@@ -308,7 +308,7 @@ class sp_head :private Query_arena ...@@ -308,7 +308,7 @@ class sp_head :private Query_arena
bool bool
show_create_routine(THD *thd, int type); show_create_routine(THD *thd, int type);
void int
add_instr(sp_instr *instr); add_instr(sp_instr *instr);
inline uint inline uint
...@@ -344,7 +344,7 @@ class sp_head :private Query_arena ...@@ -344,7 +344,7 @@ class sp_head :private Query_arena
restore_lex(THD *thd); restore_lex(THD *thd);
/// Put the instruction on the backpatch list, associated with the label. /// Put the instruction on the backpatch list, associated with the label.
void int
push_backpatch(sp_instr *, struct sp_label *); push_backpatch(sp_instr *, struct sp_label *);
/// Update all instruction with this label in the backpatch list to /// Update all instruction with this label in the backpatch list to
...@@ -353,11 +353,11 @@ class sp_head :private Query_arena ...@@ -353,11 +353,11 @@ class sp_head :private Query_arena
backpatch(struct sp_label *); backpatch(struct sp_label *);
/// Start a new cont. backpatch level. If 'i' is NULL, the level is just incr. /// Start a new cont. backpatch level. If 'i' is NULL, the level is just incr.
void int
new_cont_backpatch(sp_instr_opt_meta *i); new_cont_backpatch(sp_instr_opt_meta *i);
/// Add an instruction to the current level /// Add an instruction to the current level
void int
add_cont_backpatch(sp_instr_opt_meta *i); add_cont_backpatch(sp_instr_opt_meta *i);
/// Backpatch (and pop) the current level to the current position. /// Backpatch (and pop) the current level to the current position.
......
...@@ -265,8 +265,8 @@ sp_pcontext::push_variable(LEX_STRING *name, enum enum_field_types type, ...@@ -265,8 +265,8 @@ sp_pcontext::push_variable(LEX_STRING *name, enum enum_field_types type,
p->mode= mode; p->mode= mode;
p->offset= current_var_count(); p->offset= current_var_count();
p->dflt= NULL; p->dflt= NULL;
insert_dynamic(&m_vars, (uchar*)&p); if (insert_dynamic(&m_vars, (uchar*)&p))
return NULL;
return p; return p;
} }
...@@ -310,18 +310,17 @@ sp_pcontext::find_label(char *name) ...@@ -310,18 +310,17 @@ sp_pcontext::find_label(char *name)
return NULL; return NULL;
} }
void int
sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val) sp_pcontext::push_cond(LEX_STRING *name, sp_cond_type_t *val)
{ {
sp_cond_t *p= (sp_cond_t *)sql_alloc(sizeof(sp_cond_t)); sp_cond_t *p= (sp_cond_t *)sql_alloc(sizeof(sp_cond_t));
if (p) if (p == NULL)
{ return 1;
p->name.str= name->str; p->name.str= name->str;
p->name.length= name->length; p->name.length= name->length;
p->val= val; p->val= val;
insert_dynamic(&m_conds, (uchar*)&p); return insert_dynamic(&m_conds, (uchar *)&p);
}
} }
/* /*
...@@ -384,7 +383,7 @@ sp_pcontext::find_handler(sp_cond_type_t *cond) ...@@ -384,7 +383,7 @@ sp_pcontext::find_handler(sp_cond_type_t *cond)
return FALSE; return FALSE;
} }
void int
sp_pcontext::push_cursor(LEX_STRING *name) sp_pcontext::push_cursor(LEX_STRING *name)
{ {
LEX_STRING n; LEX_STRING n;
...@@ -393,7 +392,7 @@ sp_pcontext::push_cursor(LEX_STRING *name) ...@@ -393,7 +392,7 @@ sp_pcontext::push_cursor(LEX_STRING *name)
m_max_cursor_index+= 1; m_max_cursor_index+= 1;
n.str= name->str; n.str= name->str;
n.length= name->length; n.length= name->length;
insert_dynamic(&m_cursors, (uchar*)&n); return insert_dynamic(&m_cursors, (uchar *)&n);
} }
/* /*
......
...@@ -323,7 +323,7 @@ class sp_pcontext : public Sql_alloc ...@@ -323,7 +323,7 @@ class sp_pcontext : public Sql_alloc
// Conditions // Conditions
// //
void int
push_cond(LEX_STRING *name, sp_cond_type_t *val); push_cond(LEX_STRING *name, sp_cond_type_t *val);
inline void inline void
...@@ -365,7 +365,7 @@ class sp_pcontext : public Sql_alloc ...@@ -365,7 +365,7 @@ class sp_pcontext : public Sql_alloc
// Cursors // Cursors
// //
void int
push_cursor(LEX_STRING *name); push_cursor(LEX_STRING *name);
my_bool my_bool
......
...@@ -3476,14 +3476,6 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level, ...@@ -3476,14 +3476,6 @@ add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
} }
} }
/**
Add all keys with uses 'field' for some keypart.
If field->and_level != and_level then only mark key_part as const_part.
@todo
ft-keys in non-ft queries. SerG
*/
static uint static uint
max_part_bit(key_part_map bits) max_part_bit(key_part_map bits)
...@@ -3493,7 +3485,16 @@ max_part_bit(key_part_map bits) ...@@ -3493,7 +3485,16 @@ max_part_bit(key_part_map bits)
return found; return found;
} }
static void /*
Add all keys with uses 'field' for some keypart
If field->and_level != and_level then only mark key_part as const_part
RETURN
0 - OK
1 - Out of memory.
*/
static bool
add_key_part(DYNAMIC_ARRAY *keyuse_array,KEY_FIELD *key_field) add_key_part(DYNAMIC_ARRAY *keyuse_array,KEY_FIELD *key_field)
{ {
Field *field=key_field->field; Field *field=key_field->field;
...@@ -3523,24 +3524,26 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array,KEY_FIELD *key_field) ...@@ -3523,24 +3524,26 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array,KEY_FIELD *key_field)
keyuse.optimize= key_field->optimize & KEY_OPTIMIZE_REF_OR_NULL; keyuse.optimize= key_field->optimize & KEY_OPTIMIZE_REF_OR_NULL;
keyuse.null_rejecting= key_field->null_rejecting; keyuse.null_rejecting= key_field->null_rejecting;
keyuse.cond_guard= key_field->cond_guard; keyuse.cond_guard= key_field->cond_guard;
VOID(insert_dynamic(keyuse_array,(uchar*) &keyuse)); if (insert_dynamic(keyuse_array,(uchar*) &keyuse))
return TRUE;
} }
} }
} }
} }
return FALSE;
} }
#define FT_KEYPART (MAX_REF_PARTS+10) #define FT_KEYPART (MAX_REF_PARTS+10)
static void static bool
add_ft_keys(DYNAMIC_ARRAY *keyuse_array, add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
JOIN_TAB *stat,COND *cond,table_map usable_tables) JOIN_TAB *stat,COND *cond,table_map usable_tables)
{ {
Item_func_match *cond_func=NULL; Item_func_match *cond_func=NULL;
if (!cond) if (!cond)
return; return FALSE;
if (cond->type() == Item::FUNC_ITEM) if (cond->type() == Item::FUNC_ITEM)
{ {
...@@ -3574,13 +3577,16 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array, ...@@ -3574,13 +3577,16 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
{ {
Item *item; Item *item;
while ((item=li++)) while ((item=li++))
add_ft_keys(keyuse_array,stat,item,usable_tables); {
if (add_ft_keys(keyuse_array,stat,item,usable_tables))
return TRUE;
}
} }
} }
if (!cond_func || cond_func->key == NO_SUCH_KEY || if (!cond_func || cond_func->key == NO_SUCH_KEY ||
!(usable_tables & cond_func->table->map)) !(usable_tables & cond_func->table->map))
return; return FALSE;
KEYUSE keyuse; KEYUSE keyuse;
keyuse.table= cond_func->table; keyuse.table= cond_func->table;
...@@ -3590,7 +3596,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array, ...@@ -3590,7 +3596,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
keyuse.used_tables=cond_func->key_item()->used_tables(); keyuse.used_tables=cond_func->key_item()->used_tables();
keyuse.optimize= 0; keyuse.optimize= 0;
keyuse.keypart_map= 0; keyuse.keypart_map= 0;
VOID(insert_dynamic(keyuse_array,(uchar*) &keyuse)); return insert_dynamic(keyuse_array,(uchar*) &keyuse);
} }
...@@ -3744,7 +3750,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, ...@@ -3744,7 +3750,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
sargables); sargables);
for (; field != end ; field++) for (; field != end ; field++)
{ {
add_key_part(keyuse,field); if (add_key_part(keyuse,field))
return TRUE;
/* Mark that we can optimize LEFT JOIN */ /* Mark that we can optimize LEFT JOIN */
if (field->val->type() == Item::NULL_ITEM && if (field->val->type() == Item::NULL_ITEM &&
!field->field->real_maybe_null()) !field->field->real_maybe_null())
...@@ -3782,11 +3789,15 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, ...@@ -3782,11 +3789,15 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
/* fill keyuse with found key parts */ /* fill keyuse with found key parts */
for ( ; field != end ; field++) for ( ; field != end ; field++)
add_key_part(keyuse,field); {
if (add_key_part(keyuse,field))
return TRUE;
}
if (select_lex->ftfunc_list->elements) if (select_lex->ftfunc_list->elements)
{ {
add_ft_keys(keyuse,join_tab,cond,normal_tables); if (add_ft_keys(keyuse,join_tab,cond,normal_tables))
return TRUE;
} }
/* /*
...@@ -3807,7 +3818,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, ...@@ -3807,7 +3818,8 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
(qsort_cmp) sort_keyuse); (qsort_cmp) sort_keyuse);
bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */ bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */
VOID(insert_dynamic(keyuse,(uchar*) &key_end)); if (insert_dynamic(keyuse,(uchar*) &key_end))
return TRUE;
use=save_pos=dynamic_element(keyuse,0,KEYUSE*); use=save_pos=dynamic_element(keyuse,0,KEYUSE*);
prev= &key_end; prev= &key_end;
......
...@@ -280,9 +280,7 @@ int case_stmt_action_expr(LEX *lex, Item* expr) ...@@ -280,9 +280,7 @@ int case_stmt_action_expr(LEX *lex, Item* expr)
parsing_ctx, case_expr_id, expr, lex); parsing_ctx, case_expr_id, expr, lex);
sp->add_cont_backpatch(i); sp->add_cont_backpatch(i);
sp->add_instr(i); return sp->add_instr(i);
return 0;
} }
/** /**
...@@ -293,7 +291,7 @@ int case_stmt_action_expr(LEX *lex, Item* expr) ...@@ -293,7 +291,7 @@ int case_stmt_action_expr(LEX *lex, Item* expr)
@param simple true for simple cases, false for searched cases @param simple true for simple cases, false for searched cases
*/ */
void case_stmt_action_when(LEX *lex, Item *when, bool simple) int case_stmt_action_when(LEX *lex, Item *when, bool simple)
{ {
sp_head *sp= lex->sphead; sp_head *sp= lex->sphead;
sp_pcontext *ctx= lex->spcont; sp_pcontext *ctx= lex->spcont;
...@@ -325,8 +323,9 @@ void case_stmt_action_when(LEX *lex, Item *when, bool simple) ...@@ -325,8 +323,9 @@ void case_stmt_action_when(LEX *lex, Item *when, bool simple)
(jump_if_not from instruction 2 to 5, 5 to 8 ... in the example) (jump_if_not from instruction 2 to 5, 5 to 8 ... in the example)
*/ */
sp->push_backpatch(i, ctx->push_label((char *)"", 0)); return !test(i) ||
sp->add_cont_backpatch(i); sp->push_backpatch(i, ctx->push_label((char *)"", 0)) ||
sp->add_cont_backpatch(i) ||
sp->add_instr(i); sp->add_instr(i);
} }
...@@ -336,13 +335,14 @@ void case_stmt_action_when(LEX *lex, Item *when, bool simple) ...@@ -336,13 +335,14 @@ void case_stmt_action_when(LEX *lex, Item *when, bool simple)
@param lex the parser lex context @param lex the parser lex context
*/ */
void case_stmt_action_then(LEX *lex) int case_stmt_action_then(LEX *lex)
{ {
sp_head *sp= lex->sphead; sp_head *sp= lex->sphead;
sp_pcontext *ctx= lex->spcont; sp_pcontext *ctx= lex->spcont;
uint ip= sp->instructions(); uint ip= sp->instructions();
sp_instr_jump *i = new sp_instr_jump(ip, ctx); sp_instr_jump *i = new sp_instr_jump(ip, ctx);
sp->add_instr(i); if (!test(i) || sp->add_instr(i))
return 1;
/* /*
BACKPATCH: Resolving forward jump from BACKPATCH: Resolving forward jump from
...@@ -358,7 +358,7 @@ void case_stmt_action_then(LEX *lex) ...@@ -358,7 +358,7 @@ void case_stmt_action_then(LEX *lex)
(jump from instruction 4 to 12, 7 to 12 ... in the example) (jump from instruction 4 to 12, 7 to 12 ... in the example)
*/ */
sp->push_backpatch(i, ctx->last_label()); return sp->push_backpatch(i, ctx->last_label());
} }
/** /**
...@@ -2322,10 +2322,9 @@ sp_decl: ...@@ -2322,10 +2322,9 @@ sp_decl:
var_type, var_type,
lex, lex,
(i == num_vars - 1)); (i == num_vars - 1));
if (is == NULL) if (is == NULL ||
lex->sphead->add_instr(is))
MYSQL_YYABORT; MYSQL_YYABORT;
lex->sphead->add_instr(is);
} }
pctx->declare_var_boundary(0); pctx->declare_var_boundary(0);
...@@ -2344,7 +2343,8 @@ sp_decl: ...@@ -2344,7 +2343,8 @@ sp_decl:
my_error(ER_SP_DUP_COND, MYF(0), $2.str); my_error(ER_SP_DUP_COND, MYF(0), $2.str);
MYSQL_YYABORT; MYSQL_YYABORT;
} }
YYTHD->lex->spcont->push_cond(&$2, $5); if(YYTHD->lex->spcont->push_cond(&$2, $5))
MYSQL_YYABORT;
$$.vars= $$.hndlrs= $$.curs= 0; $$.vars= $$.hndlrs= $$.curs= 0;
$$.conds= 1; $$.conds= 1;
} }
...@@ -2359,10 +2359,10 @@ sp_decl: ...@@ -2359,10 +2359,10 @@ sp_decl:
sp_instr_hpush_jump *i= sp_instr_hpush_jump *i=
new sp_instr_hpush_jump(sp->instructions(), ctx, $2, new sp_instr_hpush_jump(sp->instructions(), ctx, $2,
ctx->current_var_count()); ctx->current_var_count());
if (i == NULL) if (i == NULL ||
sp->add_instr(i) ||
sp->push_backpatch(i, ctx->push_label((char *)"", 0)))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
} }
sp_hcond_list sp_proc_stmt sp_hcond_list sp_proc_stmt
{ {
...@@ -2376,17 +2376,17 @@ sp_decl: ...@@ -2376,17 +2376,17 @@ sp_decl:
{ {
i= new sp_instr_hreturn(sp->instructions(), ctx, i= new sp_instr_hreturn(sp->instructions(), ctx,
ctx->current_var_count()); ctx->current_var_count());
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
else else
{ /* EXIT or UNDO handler, just jump to the end of the block */ { /* EXIT or UNDO handler, just jump to the end of the block */
i= new sp_instr_hreturn(sp->instructions(), ctx, 0); i= new sp_instr_hreturn(sp->instructions(), ctx, 0);
if (i == NULL) if (i == NULL ||
sp->add_instr(i) ||
sp->push_backpatch(i, lex->spcont->last_label())) /* Block end */
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
sp->push_backpatch(i, lex->spcont->last_label()); /* Block end */
} }
lex->sphead->backpatch(hlab); lex->sphead->backpatch(hlab);
...@@ -2412,10 +2412,10 @@ sp_decl: ...@@ -2412,10 +2412,10 @@ sp_decl:
} }
i= new sp_instr_cpush(sp->instructions(), ctx, $5, i= new sp_instr_cpush(sp->instructions(), ctx, $5,
ctx->current_cursor_count()); ctx->current_cursor_count());
if (i == NULL) if (i == NULL ||
sp->add_instr(i) ||
ctx->push_cursor(&$2))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
ctx->push_cursor(&$2);
$$.vars= $$.conds= $$.hndlrs= 0; $$.vars= $$.conds= $$.hndlrs= 0;
$$.curs= 1; $$.curs= 1;
} }
...@@ -2652,10 +2652,11 @@ sp_proc_stmt_statement: ...@@ -2652,10 +2652,11 @@ sp_proc_stmt_statement:
i->m_query.length= lip->get_ptr() - sp->m_tmp_query; i->m_query.length= lip->get_ptr() - sp->m_tmp_query;
else else
i->m_query.length= lip->get_tok_end() - sp->m_tmp_query; i->m_query.length= lip->get_tok_end() - sp->m_tmp_query;
i->m_query.str= strmake_root(thd->mem_root, if (!(i->m_query.str= strmake_root(thd->mem_root,
sp->m_tmp_query, sp->m_tmp_query,
i->m_query.length); i->m_query.length)) ||
sp->add_instr(i); sp->add_instr(i))
MYSQL_YYABORT;
} }
sp->restore_lex(thd); sp->restore_lex(thd);
} }
...@@ -2680,9 +2681,9 @@ sp_proc_stmt_return: ...@@ -2680,9 +2681,9 @@ sp_proc_stmt_return:
i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3, i= new sp_instr_freturn(sp->instructions(), lex->spcont, $3,
sp->m_return_field_def.sql_type, lex); sp->m_return_field_def.sql_type, lex);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
sp->m_flags|= sp_head::HAS_RETURN; sp->m_flags|= sp_head::HAS_RETURN;
} }
sp->restore_lex(YYTHD); sp->restore_lex(YYTHD);
...@@ -2779,22 +2780,22 @@ sp_proc_stmt_iterate: ...@@ -2779,22 +2780,22 @@ sp_proc_stmt_iterate:
if (n) if (n)
{ {
sp_instr_hpop *hpop= new sp_instr_hpop(ip++, ctx, n); sp_instr_hpop *hpop= new sp_instr_hpop(ip++, ctx, n);
if (hpop == NULL) if (hpop == NULL ||
sp->add_instr(hpop))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(hpop);
} }
n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */ n= ctx->diff_cursors(lab->ctx, FALSE); /* Inclusive the dest. */
if (n) if (n)
{ {
sp_instr_cpop *cpop= new sp_instr_cpop(ip++, ctx, n); sp_instr_cpop *cpop= new sp_instr_cpop(ip++, ctx, n);
if (cpop == NULL) if (cpop == NULL ||
sp->add_instr(cpop))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(cpop);
} }
i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */ i= new sp_instr_jump(ip, ctx, lab->ip); /* Jump back */
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
} }
; ;
...@@ -2813,9 +2814,9 @@ sp_proc_stmt_open: ...@@ -2813,9 +2814,9 @@ sp_proc_stmt_open:
MYSQL_YYABORT; MYSQL_YYABORT;
} }
i= new sp_instr_copen(sp->instructions(), lex->spcont, offset); i= new sp_instr_copen(sp->instructions(), lex->spcont, offset);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
; ;
...@@ -2833,9 +2834,9 @@ sp_proc_stmt_fetch: ...@@ -2833,9 +2834,9 @@ sp_proc_stmt_fetch:
MYSQL_YYABORT; MYSQL_YYABORT;
} }
i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset); i= new sp_instr_cfetch(sp->instructions(), lex->spcont, offset);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
sp_fetch_list sp_fetch_list
{} {}
...@@ -2855,9 +2856,9 @@ sp_proc_stmt_close: ...@@ -2855,9 +2856,9 @@ sp_proc_stmt_close:
MYSQL_YYABORT; MYSQL_YYABORT;
} }
i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset); i= new sp_instr_cclose(sp->instructions(), lex->spcont, offset);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
; ;
...@@ -2920,12 +2921,11 @@ sp_if: ...@@ -2920,12 +2921,11 @@ sp_if:
uint ip= sp->instructions(); uint ip= sp->instructions();
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx, sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, ctx,
$2, lex); $2, lex);
if (i == NULL) if (i == NULL ||
sp->push_backpatch(i, ctx->push_label((char *)"", 0)) ||
sp->add_cont_backpatch(i) ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
sp->add_cont_backpatch(i);
sp->add_instr(i);
sp->restore_lex(YYTHD); sp->restore_lex(YYTHD);
} }
sp_proc_stmts1 sp_proc_stmts1
...@@ -2934,10 +2934,9 @@ sp_if: ...@@ -2934,10 +2934,9 @@ sp_if:
sp_pcontext *ctx= Lex->spcont; sp_pcontext *ctx= Lex->spcont;
uint ip= sp->instructions(); uint ip= sp->instructions();
sp_instr_jump *i = new sp_instr_jump(ip, ctx); sp_instr_jump *i = new sp_instr_jump(ip, ctx);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
sp->backpatch(ctx->pop_label()); sp->backpatch(ctx->pop_label());
sp->push_backpatch(i, ctx->push_label((char *)"", 0)); sp->push_backpatch(i, ctx->push_label((char *)"", 0));
} }
...@@ -3021,14 +3020,16 @@ simple_when_clause: ...@@ -3021,14 +3020,16 @@ simple_when_clause:
/* Simple case: <caseval> = <whenval> */ /* Simple case: <caseval> = <whenval> */
LEX *lex= Lex; LEX *lex= Lex;
case_stmt_action_when(lex, $3, true); if (case_stmt_action_when(lex, $3, true))
MYSQL_YYABORT;
lex->sphead->restore_lex(YYTHD); /* For expr $3 */ lex->sphead->restore_lex(YYTHD); /* For expr $3 */
} }
THEN_SYM THEN_SYM
sp_proc_stmts1 sp_proc_stmts1
{ {
LEX *lex= Lex; LEX *lex= Lex;
case_stmt_action_then(lex); if (case_stmt_action_then(lex))
MYSQL_YYABORT;
} }
; ;
...@@ -3040,14 +3041,16 @@ searched_when_clause: ...@@ -3040,14 +3041,16 @@ searched_when_clause:
expr expr
{ {
LEX *lex= Lex; LEX *lex= Lex;
case_stmt_action_when(lex, $3, false); if (case_stmt_action_when(lex, $3, false))
MYSQL_YYABORT;
lex->sphead->restore_lex(YYTHD); /* For expr $3 */ lex->sphead->restore_lex(YYTHD); /* For expr $3 */
} }
THEN_SYM THEN_SYM
sp_proc_stmts1 sp_proc_stmts1
{ {
LEX *lex= Lex; LEX *lex= Lex;
case_stmt_action_then(lex); if (case_stmt_action_then(lex))
MYSQL_YYABORT;
} }
; ;
...@@ -3059,9 +3062,9 @@ else_clause_opt: ...@@ -3059,9 +3062,9 @@ else_clause_opt:
uint ip= sp->instructions(); uint ip= sp->instructions();
sp_instr_error *i= new sp_instr_error(ip, lex->spcont, sp_instr_error *i= new sp_instr_error(ip, lex->spcont,
ER_SP_CASE_NOT_FOUND); ER_SP_CASE_NOT_FOUND);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
| ELSE sp_proc_stmts1 | ELSE sp_proc_stmts1
; ;
...@@ -3175,16 +3178,16 @@ sp_block_content: ...@@ -3175,16 +3178,16 @@ sp_block_content:
if ($3.hndlrs) if ($3.hndlrs)
{ {
i= new sp_instr_hpop(sp->instructions(), ctx, $3.hndlrs); i= new sp_instr_hpop(sp->instructions(), ctx, $3.hndlrs);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
if ($3.curs) if ($3.curs)
{ {
i= new sp_instr_cpop(sp->instructions(), ctx, $3.curs); i= new sp_instr_cpop(sp->instructions(), ctx, $3.curs);
if (i == NULL) if (i == NULL ||
sp->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
sp->add_instr(i);
} }
lex->spcont= ctx->pop_context(); lex->spcont= ctx->pop_context();
} }
...@@ -3198,9 +3201,9 @@ sp_unlabeled_control: ...@@ -3198,9 +3201,9 @@ sp_unlabeled_control:
uint ip= lex->sphead->instructions(); uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */ sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip); sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
if (i == NULL) if (i == NULL ||
lex->sphead->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
lex->sphead->add_instr(i);
} }
| WHILE_SYM | WHILE_SYM
{ Lex->sphead->reset_lex(YYTHD); } { Lex->sphead->reset_lex(YYTHD); }
...@@ -3211,12 +3214,12 @@ sp_unlabeled_control: ...@@ -3211,12 +3214,12 @@ sp_unlabeled_control:
uint ip= sp->instructions(); uint ip= sp->instructions();
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$3, lex); $3, lex);
if (i == NULL) if (i == NULL ||
MYSQL_YYABORT;
/* Jumping forward */ /* Jumping forward */
sp->push_backpatch(i, lex->spcont->last_label()); sp->push_backpatch(i, lex->spcont->last_label()) ||
sp->new_cont_backpatch(i); sp->new_cont_backpatch(i) ||
sp->add_instr(i); sp->add_instr(i))
MYSQL_YYABORT;
sp->restore_lex(YYTHD); sp->restore_lex(YYTHD);
} }
sp_proc_stmts1 END WHILE_SYM sp_proc_stmts1 END WHILE_SYM
...@@ -3225,9 +3228,9 @@ sp_unlabeled_control: ...@@ -3225,9 +3228,9 @@ sp_unlabeled_control:
uint ip= lex->sphead->instructions(); uint ip= lex->sphead->instructions();
sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */ sp_label_t *lab= lex->spcont->last_label(); /* Jumping back */
sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip); sp_instr_jump *i = new sp_instr_jump(ip, lex->spcont, lab->ip);
if (i == NULL) if (i == NULL ||
lex->sphead->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
lex->sphead->add_instr(i);
lex->sphead->do_cont_backpatch(); lex->sphead->do_cont_backpatch();
} }
| REPEAT_SYM sp_proc_stmts1 UNTIL_SYM | REPEAT_SYM sp_proc_stmts1 UNTIL_SYM
...@@ -3240,9 +3243,9 @@ sp_unlabeled_control: ...@@ -3240,9 +3243,9 @@ sp_unlabeled_control:
sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont, sp_instr_jump_if_not *i = new sp_instr_jump_if_not(ip, lex->spcont,
$5, lab->ip, $5, lab->ip,
lex); lex);
if (i == NULL) if (i == NULL ||
lex->sphead->add_instr(i))
MYSQL_YYABORT; MYSQL_YYABORT;
lex->sphead->add_instr(i);
lex->sphead->restore_lex(YYTHD); lex->sphead->restore_lex(YYTHD);
/* We can shortcut the cont_backpatch here */ /* We can shortcut the cont_backpatch here */
i->m_cont_dest= ip+1; i->m_cont_dest= ip+1;
...@@ -11751,7 +11754,8 @@ option_type_value: ...@@ -11751,7 +11754,8 @@ option_type_value:
qbuff.length); qbuff.length);
qbuff.length+= 4; qbuff.length+= 4;
i->m_query= qbuff; i->m_query= qbuff;
sp->add_instr(i); if (sp->add_instr(i))
MYSQL_YYABORT;
} }
lex->sphead->restore_lex(thd); lex->sphead->restore_lex(thd);
} }
...@@ -11843,7 +11847,8 @@ sys_option_value: ...@@ -11843,7 +11847,8 @@ sys_option_value:
(uchar **) &trg_fld-> (uchar **) &trg_fld->
next_trg_field); next_trg_field);
lex->sphead->add_instr(sp_fld); if (lex->sphead->add_instr(sp_fld))
MYSQL_YYABORT;
} }
else if ($2.var) else if ($2.var)
{ /* System variable */ { /* System variable */
...@@ -11882,9 +11887,9 @@ sys_option_value: ...@@ -11882,9 +11887,9 @@ sys_option_value:
} }
sp_set= new sp_instr_set(lex->sphead->instructions(), ctx, sp_set= new sp_instr_set(lex->sphead->instructions(), ctx,
spv->offset, it, spv->type, lex, TRUE); spv->offset, it, spv->type, lex, TRUE);
if (sp_set == NULL) if (sp_set == NULL ||
lex->sphead->add_instr(sp_set))
MYSQL_YYABORT; MYSQL_YYABORT;
lex->sphead->add_instr(sp_set);
} }
} }
| option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types | option_type TRANSACTION_SYM ISOLATION LEVEL_SYM isolation_types
......
...@@ -898,6 +898,8 @@ int ha_ibmdb2i::index_init(uint idx, bool sorted) ...@@ -898,6 +898,8 @@ int ha_ibmdb2i::index_init(uint idx, bool sorted)
releaseIndexFile(idx); releaseIndexFile(idx);
} }
rrnAssocHandle= 0;
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -1154,6 +1156,8 @@ int ha_ibmdb2i::rnd_init(bool scan) ...@@ -1154,6 +1156,8 @@ int ha_ibmdb2i::rnd_init(bool scan)
releaseDataFile(); releaseDataFile();
} }
rrnAssocHandle= 0;
DBUG_RETURN(0); // MySQL sometimes does not check the return code, causing DBUG_RETURN(0); // MySQL sometimes does not check the return code, causing
// an assert in ha_rnd_end later on if we return a non-zero // an assert in ha_rnd_end later on if we return a non-zero
// value here. // value here.
...@@ -1251,7 +1255,8 @@ int ha_ibmdb2i::rnd_pos(uchar * buf, uchar *pos) ...@@ -1251,7 +1255,8 @@ int ha_ibmdb2i::rnd_pos(uchar * buf, uchar *pos)
int rc = 0; int rc = 0;
if (activeHandle != rrnAssocHandle) if (rrnAssocHandle &&
(activeHandle != rrnAssocHandle))
{ {
if (activeHandle) releaseActiveHandle(); if (activeHandle) releaseActiveHandle();
rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle); rc = useFileByHandle(QMY_UPDATABLE, rrnAssocHandle);
......
...@@ -250,7 +250,11 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, ...@@ -250,7 +250,11 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
if (info->ft1_to_ft2) if (info->ft1_to_ft2)
{ {
/* we're in ft1->ft2 conversion mode. Saving key data */ /* we're in ft1->ft2 conversion mode. Saving key data */
insert_dynamic(info->ft1_to_ft2, (lastkey+off)); if (insert_dynamic(info->ft1_to_ft2, (lastkey+off)))
{
DBUG_PRINT("error",("Out of memory"));
DBUG_RETURN(-1);
}
} }
else else
{ {
......
...@@ -562,7 +562,14 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo, ...@@ -562,7 +562,14 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
we cannot easily dispatch an empty page here */ we cannot easily dispatch an empty page here */
b+=blen+ft2len+2; b+=blen+ft2len+2;
for (a=anc_buff+a_length ; b < a ; b+=ft2len+2) for (a=anc_buff+a_length ; b < a ; b+=ft2len+2)
insert_dynamic(info->ft1_to_ft2, b); {
if (insert_dynamic(info->ft1_to_ft2, b))
{
mi_print_error(info->s, HA_ERR_OUT_OF_MEM);
my_errno= HA_ERR_OUT_OF_MEM;
DBUG_RETURN(-1);
}
}
/* fixing the page's length - it contains only one key now */ /* fixing the page's length - it contains only one key now */
mi_putint(anc_buff,2+blen+ft2len+2,0); mi_putint(anc_buff,2+blen+ft2len+2,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