From 788043cd0b20e01fc07f8a4673de678404938240 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 4 May 2011 23:20:17 +0500 Subject: Precise GIS functions added. --- mysql-test/r/gis-rtree.result | 468 +++++++++++++++++++++++++++++++-- mysql-test/r/gis.result | 436 +++++++++++++++++++++++++++++-- mysql-test/t/gis-rtree.test | 12 - mysql-test/t/gis.test | 589 ++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 1430 insertions(+), 75 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index a28f537b2de..21193cd8ec2 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -12,6 +12,156 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`fid`), SPATIAL KEY `g` (`g`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(150 150, 150 150)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(149 149, 151 151)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(148 148, 152 152)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(147 147, 153 153)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(146 146, 154 154)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(145 145, 155 155)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(144 144, 156 156)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(143 143, 157 157)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(142 142, 158 158)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(141 141, 159 159)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(140 140, 160 160)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(139 139, 161 161)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(138 138, 162 162)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(137 137, 163 163)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(136 136, 164 164)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(135 135, 165 165)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(134 134, 166 166)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(133 133, 167 167)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(132 132, 168 168)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(131 131, 169 169)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(130 130, 170 170)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(129 129, 171 171)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(128 128, 172 172)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(127 127, 173 173)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(126 126, 174 174)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(125 125, 175 175)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(124 124, 176 176)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(123 123, 177 177)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(122 122, 178 178)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(121 121, 179 179)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(120 120, 180 180)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(119 119, 181 181)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(118 118, 182 182)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(117 117, 183 183)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(116 116, 184 184)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(115 115, 185 185)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(114 114, 186 186)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(113 113, 187 187)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(112 112, 188 188)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(111 111, 189 189)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(110 110, 190 190)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(109 109, 191 191)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(108 108, 192 192)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(107 107, 193 193)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(106 106, 194 194)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(105 105, 195 195)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(104 104, 196 196)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(103 103, 197 197)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(102 102, 198 198)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(101 101, 199 199)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(100 100, 200 200)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(99 99, 201 201)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(98 98, 202 202)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(97 97, 203 203)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(96 96, 204 204)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(95 95, 205 205)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(94 94, 206 206)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(93 93, 207 207)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(92 92, 208 208)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(91 91, 209 209)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(90 90, 210 210)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(89 89, 211 211)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(88 88, 212 212)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(87 87, 213 213)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(86 86, 214 214)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(85 85, 215 215)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(84 84, 216 216)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(83 83, 217 217)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(82 82, 218 218)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(81 81, 219 219)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(80 80, 220 220)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(79 79, 221 221)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(78 78, 222 222)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(77 77, 223 223)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(76 76, 224 224)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(75 75, 225 225)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(74 74, 226 226)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(73 73, 227 227)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(72 72, 228 228)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(71 71, 229 229)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(70 70, 230 230)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(69 69, 231 231)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(68 68, 232 232)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(67 67, 233 233)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(66 66, 234 234)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(65 65, 235 235)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(64 64, 236 236)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(63 63, 237 237)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(62 62, 238 238)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(61 61, 239 239)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(60 60, 240 240)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(59 59, 241 241)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(58 58, 242 242)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(57 57, 243 243)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(56 56, 244 244)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(55 55, 245 245)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(54 54, 246 246)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(53 53, 247 247)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(52 52, 248 248)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(51 51, 249 249)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(50 50, 250 250)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(49 49, 251 251)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(48 48, 252 252)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(47 47, 253 253)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(46 46, 254 254)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(45 45, 255 255)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(44 44, 256 256)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(43 43, 257 257)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(42 42, 258 258)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(41 41, 259 259)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(40 40, 260 260)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(39 39, 261 261)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(38 38, 262 262)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(37 37, 263 263)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(36 36, 264 264)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(35 35, 265 265)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(34 34, 266 266)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(33 33, 267 267)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(32 32, 268 268)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(31 31, 269 269)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(30 30, 270 270)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(29 29, 271 271)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(28 28, 272 272)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(27 27, 273 273)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(26 26, 274 274)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(25 25, 275 275)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(24 24, 276 276)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(23 23, 277 277)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(22 22, 278 278)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(21 21, 279 279)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(20 20, 280 280)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(19 19, 281 281)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(18 18, 282 282)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(17 17, 283 283)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(16 16, 284 284)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(15 15, 285 285)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(14 14, 286 286)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(13 13, 287 287)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(12 12, 288 288)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(11 11, 289 289)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(10 10, 290 290)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(9 9, 291 291)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(8 8, 292 292)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(7 7, 293 293)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(6 6, 294 294)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(5 5, 295 295)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(4 4, 296 296)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(3 3, 297 297)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(2 2, 298 298)')); +INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 1, 299 299)')); SELECT count(*) FROM t1; count(*) 150 @@ -20,22 +170,112 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 8 Using where SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); fid AsText(g) -1 LINESTRING(150 150,150 150) -3 LINESTRING(148 148,152 152) -4 LINESTRING(147 147,153 153) -5 LINESTRING(146 146,154 154) -6 LINESTRING(145 145,155 155) -7 LINESTRING(144 144,156 156) -8 LINESTRING(143 143,157 157) -9 LINESTRING(142 142,158 158) -10 LINESTRING(141 141,159 159) 11 LINESTRING(140 140,160 160) -2 LINESTRING(149 149,151 151) DROP TABLE t1; CREATE TABLE t2 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, g GEOMETRY NOT NULL ) ENGINE=MyISAM; +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))); +INSERT INTO t2 (g) VALUES (LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 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); SHOW CREATE TABLE t2; Table Create Table @@ -51,218 +291,414 @@ count(*) EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range g g 34 NULL 4 Using where +1 SIMPLE t2 range g g 34 NULL 1 Using where SELECT fid, AsText(g) FROM t2 WHERE Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); fid AsText(g) -46 LINESTRING(51 41,60 50) -56 LINESTRING(41 41,50 50) -45 LINESTRING(51 51,60 60) -55 LINESTRING(41 51,50 60) +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10)))); +SELECT count(*) FROM t2; count(*) 100 +DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10)))); +SELECT count(*) FROM t2; count(*) 100 DROP TABLE t2; drop table if exists t1; Warnings: -Note 1051 Unknown table 't1' +Note 1051 Unknown table 'test.t1' CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a)); INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)")); diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index beb1331563e..daf66b16d62 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -228,7 +228,7 @@ explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelo id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00 Warnings: -Note 1003 select dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,astext(envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry` +Note 1003 select st_dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,st_geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,st_isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,st_astext(st_envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry` SELECT fid, X(g) FROM gis_point; fid X(g) 101 10 @@ -245,7 +245,7 @@ explain extended select X(g),Y(g) FROM gis_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_point ALL NULL NULL NULL NULL 4 100.00 Warnings: -Note 1003 select x(`test`.`gis_point`.`g`) AS `X(g)`,y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point` +Note 1003 select st_x(`test`.`gis_point`.`g`) AS `X(g)`,st_y(`test`.`gis_point`.`g`) AS `Y(g)` from `test`.`gis_point` SELECT fid, AsText(StartPoint(g)) FROM gis_line; fid AsText(StartPoint(g)) 105 POINT(0 0) @@ -258,7 +258,7 @@ fid AsText(EndPoint(g)) 107 POINT(40 10) SELECT fid, GLength(g) FROM gis_line; fid GLength(g) -105 24.142135623731 +105 24.14213562373095 106 40 107 30 SELECT fid, NumPoints(g) FROM gis_line; @@ -280,11 +280,11 @@ explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),Num id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_line ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,astext(endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,glength(`test`.`gis_line`.`g`) AS `GLength(g)`,numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,astext(pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line` +Note 1003 select st_astext(st_startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint(g))`,st_astext(st_endpoint(`test`.`gis_line`.`g`)) AS `AsText(EndPoint(g))`,st_length(`test`.`gis_line`.`g`) AS `GLength(g)`,st_numpoints(`test`.`gis_line`.`g`) AS `NumPoints(g)`,st_astext(st_pointn(`test`.`gis_line`.`g`,2)) AS `AsText(PointN(g, 2))`,st_isclosed(`test`.`gis_line`.`g`) AS `IsClosed(g)` from `test`.`gis_line` SELECT fid, AsText(Centroid(g)) FROM gis_polygon; fid AsText(Centroid(g)) 108 POINT(15 15) -109 POINT(25.4166666666667 25.4166666666667) +109 POINT(25.416666666666668 25.416666666666668) 110 POINT(20 10) SELECT fid, Area(g) FROM gis_polygon; fid Area(g) @@ -310,7 +310,7 @@ explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumI id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select astext(centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,area(`test`.`gis_polygon`.`g`) AS `Area(g)`,astext(exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,astext(interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon` +Note 1003 select st_astext(st_centroid(`test`.`gis_polygon`.`g`)) AS `AsText(Centroid(g))`,st_area(`test`.`gis_polygon`.`g`) AS `Area(g)`,st_astext(st_exteriorring(`test`.`gis_polygon`.`g`)) AS `AsText(ExteriorRing(g))`,st_numinteriorrings(`test`.`gis_polygon`.`g`) AS `NumInteriorRings(g)`,st_astext(st_interiorringn(`test`.`gis_polygon`.`g`,1)) AS `AsText(InteriorRingN(g, 1))` from `test`.`gis_polygon` SELECT fid, IsClosed(g) FROM gis_multi_line; fid IsClosed(g) 114 0 @@ -318,8 +318,8 @@ fid IsClosed(g) 116 0 SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; fid AsText(Centroid(g)) -117 POINT(55.5885277530424 17.426536064114) -118 POINT(55.5885277530424 17.426536064114) +117 POINT(55.58852775304245 17.426536064113982) +118 POINT(55.58852775304245 17.426536064113982) 119 POINT(2 2) SELECT fid, Area(g) FROM gis_multi_polygon; fid Area(g) @@ -349,7 +349,7 @@ explain extended SELECT fid, NumGeometries(g) from gis_multi_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point` +Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,st_numgeometries(`test`.`gis_multi_point`.`g`) AS `NumGeometries(g)` from `test`.`gis_multi_point` SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; fid AsText(GeometryN(g, 2)) 111 POINT(10 10) @@ -377,17 +377,17 @@ explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,astext(geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point` +Note 1003 select `test`.`gis_multi_point`.`fid` AS `fid`,st_astext(st_geometryn(`test`.`gis_multi_point`.`g`,2)) AS `AsText(GeometryN(g, 2))` from `test`.`gis_multi_point` SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r -120 120 1 1 0 1 0 0 1 0 +120 120 1 1 0 1 0 1 1 0 120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 -121 121 1 1 0 1 0 0 1 0 +121 121 1 1 0 1 0 1 1 0 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -395,9 +395,9 @@ Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) +1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (BNL, regular buffers) Warnings: -Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,overlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,disjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,intersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` +Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,mbrwithin(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,mbrcontains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,mbrequals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( gp point, @@ -439,12 +439,12 @@ explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4 id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` +Note 1003 select st_astext(st_geometryfromwkb(st_aswkb(st_geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))` explain extended SELECT AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)')))); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select astext(geometryfromwkb(aswkb(geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` +Note 1003 select st_astext(st_geometryfromwkb(st_aswkb(st_geometryfromtext('POINT(1 4)')))) AS `AsText(GeometryFromWKB(AsWKB(PointFromText('POINT(1 4)'))))` SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); SRID(GeomFromText('LineString(1 1,2 2)',101)) 101 @@ -452,12 +452,12 @@ explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select srid(geometryfromtext('LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` +Note 1003 select srid(st_geometryfromtext('LineString(1 1,2 2)',101)) AS `SRID(GeomFromText('LineString(1 1,2 2)',101))` explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))` +Note 1003 select st_issimple(st_multipoint(st_point(3,6),st_point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,st_issimple(st_point(3,6)) AS `issimple(Point(3, 6))` create table t1 (a geometry not null); insert into t1 values (GeomFromText('Point(1 2)')); insert into t1 values ('Garbage'); @@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85998; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) -85998 MULTIPOLYGON 0 POINT(115.318773152032 -36.2374728210215) +85998 MULTIPOLYGON 1 POINT(115.31877315203187 -36.23747282102153) select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) -85984 MULTIPOLYGON 0 POINT(-114.877871869233 36.3310176346905) +85984 MULTIPOLYGON 1 POINT(-114.87787186923313 36.33101763469059) drop table t1; create table t1 (fl geometry not null); insert into t1 values (1); @@ -1014,12 +1014,392 @@ SET @a=0x00000000030000000100000000000000000000000000144000000000000014400000000 SET @a=POLYFROMWKB(@a); SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000000001840000000000000184000000000000014400000000000001440; SET @a=POLYFROMWKB(@a); -create table t1(a polygon NOT NULL)engine=myisam; -insert into t1 values (geomfromtext("point(0 1)")); -insert into t1 values (geomfromtext("point(1 0)")); -select * from (select polygon(t1.a) as p from t1 order by t1.a) d; -p -NULL -NULL -drop table t1; End of 5.1 tests +CREATE TABLE t1( +col0 BINARY NOT NULL, +col2 TIMESTAMP, +SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; +ERROR 42000: A SPATIAL index may only contain a geometrical type column +CREATE TABLE t1 ( +col0 BINARY NOT NULL, +col2 TIMESTAMP +) ENGINE=MyISAM; +CREATE SPATIAL INDEX idx0 ON t1(col0); +ERROR 42000: A SPATIAL index may only contain a geometrical type column +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); +ERROR 42000: A SPATIAL index may only contain a geometrical type column +CREATE TABLE t2 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 POINT +); +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +CREATE TABLE t3 ( +col0 INTEGER NOT NULL, +col1 POINT, +col2 LINESTRING, +SPATIAL INDEX i1 (col1, col2) +); +ERROR HY000: Incorrect arguments to SPATIAL INDEX +DROP TABLE t1; +DROP TABLE t2; +DROP DATABASE IF EXISTS gis_ogs; +CREATE DATABASE gis_ogs; +USE gis_ogs; +# +# C.3.3.1 Geometry types and functions schema construction +# +CREATE TABLE lakes ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +shore POLYGON); +CREATE TABLE road_segments ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +aliases CHARACTER VARYING(64), +num_lanes INTEGER, +centerline LINESTRING); +CREATE TABLE divided_routes ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +num_lanes INTEGER, +centerlines MULTILINESTRING); +CREATE TABLE forests ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +boundary MULTIPOLYGON); +CREATE TABLE bridges ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +position POINT); +CREATE TABLE streams ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +centerline LINESTRING); +CREATE TABLE buildings ( +fid INTEGER NOT NULL PRIMARY KEY, +address CHARACTER VARYING(64), +position POINT, +footprint POLYGON); +CREATE TABLE ponds ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +type CHARACTER VARYING(64), +shores MULTIPOLYGON); +CREATE TABLE named_places ( +fid INTEGER NOT NULL PRIMARY KEY, +name CHARACTER VARYING(64), +boundary POLYGON); +CREATE TABLE map_neatlines ( +fid INTEGER NOT NULL PRIMARY KEY, +neatline POLYGON); +# +# C.3.3.2 Geometry types and functions schema data loading +# +# Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( +(52 18,66 23,73 9,48 6,52 18), +(59 18,67 18,67 13,59 13,59 18) +)', +101)); +# Road Segments +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); +# DividedRoutes +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), +(16 0,16 23,16 48))', 101)); +# Forests +INSERT INTO forests VALUES(109, 'Green Forest', +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)))', +101)); +# Bridges +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); +# Streams +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); +# Buildings +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); +# Ponds +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), +( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); +# Named Places +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); +# Map Neatlines +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); +# +# C.3.3.3 Geometry types and functions schema test queries + +# Conformance Item T6 +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; +Dimension(shore) +2 +# Conformance Item T7 +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GeometryType(centerlines) +MULTILINESTRING +# Conformance Item T8 +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; +AsText(boundary) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +# Conformance Item T9 +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(PolyFromWKB(AsBinary(boundary),101)) +POLYGON((67 13,67 18,59 18,59 13,67 13)) +# Conformance Item T10 +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; +SRID(boundary) +101 +# Conformance Item T11 +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; +IsEmpty(centerline) +0 +# Conformance Item T14 +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Envelope(boundary)) +POLYGON((59 13,67 13,67 18,59 18,59 13)) +# Conformance Item T15 +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; +X(position) +44 +# Conformance Item T16 +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; +Y(position) +31 +# Conformance Item T17 +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(StartPoint(centerline)) +POINT(0 18) +# Conformance Item T18 +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; +AsText(EndPoint(centerline)) +POINT(44 31) +# Conformance Item T21 +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; +GLength(centerline) +26 +# Conformance Item T22 +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; +NumPoints(centerline) +5 +# Conformance Item T23 +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; +AsText(PointN(centerline, 1)) +POINT(0 18) +# Conformance Item T24 +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; +AsText(Centroid(boundary)) +POINT(63 15.5) +# Conformance Item T26 +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; +Area(boundary) +40 +# Conformance Item T27 +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(ExteriorRing(shore)) +LINESTRING(52 18,66 23,73 9,48 6,52 18) +# Conformance Item T28 +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; +NumInteriorRings(shore) +1 +# Conformance Item T29 +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; +AsText(InteriorRingN(shore, 1)) +LINESTRING(59 18,67 18,67 13,59 13,59 18) +# Conformance Item T30 +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +NumGeometries(centerlines) +2 +# Conformance Item T31 +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; +AsText(GeometryN(centerlines, 2)) +LINESTRING(16 0,16 23,16 48) +# Conformance Item T32 +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +IsClosed(centerlines) +0 +# Conformance Item T33 +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; +GLength(centerlines) +96 +# Conformance Item T34 +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; +AsText(Centroid(shores)) +POINT(25 42) +# Conformance Item T36 +SELECT Area(shores) +FROM ponds +WHERE fid = 120; +Area(shores) +8 +# Conformance Item T37 +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; +ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +1 +# Conformance Item T38 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; +ST_Disjoint(centerlines, boundary) +1 +# Conformance Item T39 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; +ST_Touches(centerline, shore) +1 +# Conformance Item T42 +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +Crosses(road_segments.centerline, divided_routes.centerlines) +1 +# Conformance Item T43 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; +ST_Intersects(road_segments.centerline, divided_routes.centerlines) +1 +# Conformance Item T44 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; +ST_Contains(forests.boundary, named_places.boundary) +0 +# Conformance Item T46 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; +ST_Distance(position, boundary) +12 +# Conformance Item T48 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; +AsText(ST_Difference(named_places.boundary, forests.boundary)) +POLYGON((56 34,62 48,84 48,84 42,56 34)) +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; +AsText(ST_Union(shore, boundary)) +POLYGON((48 6,52 18,66 23,73 9,48 6)) +# Conformance Item T50 +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; +AsText(ST_SymDifference(shore, boundary)) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(67 13,59 13,59 18,67 18,67 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +# Conformance Item T51 +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; +count(*) +1 +DROP DATABASE gis_ogs; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 9e6002a1faf..b006096528e 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -17,16 +17,12 @@ SHOW CREATE TABLE t1; let $1=150; let $2=150; ---disable_query_log -begin; while ($1) { eval INSERT INTO t1 (g) VALUES (GeomFromText('LineString($1 $1, $2 $2)')); dec $1; inc $2; } -commit; ---enable_query_log SELECT count(*) FROM t1; EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); @@ -39,8 +35,6 @@ CREATE TABLE t2 ( g GEOMETRY NOT NULL ) ENGINE=MyISAM; ---disable_query_log -begin; let $1=10; while ($1) { @@ -52,8 +46,6 @@ while ($1) } dec $1; } -commit; ---enable_query_log ALTER TABLE t2 ADD SPATIAL KEY(g); SHOW CREATE TABLE t2; @@ -63,8 +55,6 @@ EXPLAIN SELECT fid, AsText(g) FROM t2 WHERE Within(g, SELECT fid, AsText(g) FROM t2 WHERE Within(g, GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))')); ---disable_query_log -begin; let $1=10; while ($1) { @@ -77,8 +67,6 @@ while ($1) } dec $1; } -commit; ---enable_query_log DROP TABLE t2; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 97fc6f94b6a..416a40630bc 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -353,6 +353,9 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439 36.252666,-115.261439 36.247366,-115.247239 36.247066)))')); +# Expected result is 115.31877315203187, but IA64 returns 115.31877315203188 +# due to fused multiply-add instructions. +--replace_result 115.31877315203188 115.31877315203187 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85998; @@ -535,18 +538,6 @@ create table t1 (g geometry not null); insert into t1 values(default); drop table t1; -# -# Bug #27300: create view with geometry functions lost columns types -# -CREATE TABLE t1 (a GEOMETRY); -CREATE VIEW v1 AS SELECT GeomFromwkb(ASBINARY(a)) FROM t1; -CREATE VIEW v2 AS SELECT a FROM t1; -DESCRIBE v1; -DESCRIBE v2; - -DROP VIEW v1,v2; -DROP TABLE t1; - # # Bug#24563: MBROverlaps does not seem to function propertly # Bug#54888: MBROverlaps missing in 5.1? @@ -744,14 +735,574 @@ SET @a=0x00000000030000000000000000000000000000000000144000000000000014400000000 SET @a=POLYFROMWKB(@a); +--echo End of 5.1 tests + # -# Bug #57321 crashes and valgrind errors from spatial types +# Bug #50574 5.5.x allows spatial indexes on non-spatial +# columns, causing crashes! # +--error ER_SPATIAL_MUST_HAVE_GEOM_COL +CREATE TABLE t1( + col0 BINARY NOT NULL, + col2 TIMESTAMP, + SPATIAL INDEX i1 (col0) +) ENGINE=MyISAM; + +# Test other ways to add indices +CREATE TABLE t1 ( + col0 BINARY NOT NULL, + col2 TIMESTAMP +) ENGINE=MyISAM; -create table t1(a polygon NOT NULL)engine=myisam; -insert into t1 values (geomfromtext("point(0 1)")); -insert into t1 values (geomfromtext("point(1 0)")); -select * from (select polygon(t1.a) as p from t1 order by t1.a) d; -drop table t1; +--error ER_SPATIAL_MUST_HAVE_GEOM_COL +CREATE SPATIAL INDEX idx0 ON t1(col0); ---echo End of 5.1 tests +--error ER_SPATIAL_MUST_HAVE_GEOM_COL +ALTER TABLE t1 ADD SPATIAL INDEX i1 (col0); + +CREATE TABLE t2 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 POINT +); + +--error ER_WRONG_ARGUMENTS +CREATE SPATIAL INDEX idx0 ON t2 (col1, col2); + +--error ER_WRONG_ARGUMENTS +CREATE TABLE t3 ( + col0 INTEGER NOT NULL, + col1 POINT, + col2 LINESTRING, + SPATIAL INDEX i1 (col1, col2) +); + +# cleanup +DROP TABLE t1; +DROP TABLE t2; + +# Conformance tests +# +# C.3.3 Geometry types and functions +# + +--disable_warnings +DROP DATABASE IF EXISTS gis_ogs; +--enable_warnings + +CREATE DATABASE gis_ogs; +USE gis_ogs; + +--echo # +--echo # C.3.3.1 Geometry types and functions schema construction +--echo # + +# TODO: WL#2377 +#CREATE TABLE spatial_ref_sys ( +#srid INTEGER NOT NULL PRIMARY KEY, +#auth_name CHARACTER VARYING, +#auth_srid INTEGER, +#srtext CHARACTER VARYING(2048)); + +CREATE TABLE lakes ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + shore POLYGON); + +CREATE TABLE road_segments ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + aliases CHARACTER VARYING(64), + num_lanes INTEGER, + centerline LINESTRING); + +CREATE TABLE divided_routes ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + num_lanes INTEGER, + centerlines MULTILINESTRING); + +CREATE TABLE forests ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + boundary MULTIPOLYGON); + +CREATE TABLE bridges ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + position POINT); + +CREATE TABLE streams ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + centerline LINESTRING); + +CREATE TABLE buildings ( + fid INTEGER NOT NULL PRIMARY KEY, + address CHARACTER VARYING(64), + position POINT, + footprint POLYGON); + +CREATE TABLE ponds ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + type CHARACTER VARYING(64), + shores MULTIPOLYGON); + +CREATE TABLE named_places ( + fid INTEGER NOT NULL PRIMARY KEY, + name CHARACTER VARYING(64), + boundary POLYGON); + +CREATE TABLE map_neatlines ( + fid INTEGER NOT NULL PRIMARY KEY, + neatline POLYGON); + +--echo # +--echo # C.3.3.2 Geometry types and functions schema data loading +--echo # + +# TODO: WL#2377 +#-- Spatial Reference System +#INSERT INTO spatial_ref_sys VALUES +#(101, 'POSC', 32214, 'PROJCS["UTM_ZONE_14N", +#GEOGCS["World Geodetic System 72", +#DATUM["WGS_72", +#ELLIPSOID["NWL_10D", 6378135, 298.26]], +#PRIMEM["Greenwich", 0], +#UNIT["Meter", 1.0]], +#PROJECTION["Transverse_Mercator"], +#PARAMETER["False_Easting", 500000.0], +#PARAMETER["False_Northing", 0.0], +#PARAMETER["Central_Meridian", -99.0], +#PARAMETER["Scale_Factor", 0.9996], +#PARAMETER["Latitude_of_origin", 0.0], +#UNIT["Meter", 1.0]]'); + +--echo # Lakes +INSERT INTO lakes VALUES ( +101, 'BLUE LAKE', +PolyFromText( +'POLYGON( +(52 18,66 23,73 9,48 6,52 18), +(59 18,67 18,67 13,59 13,59 18) +)', +101)); + + +--echo # Road Segments + +INSERT INTO road_segments VALUES(102, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 0 18, 10 21, 16 23, 28 26, 44 31 )' ,101)); + +INSERT INTO road_segments VALUES(103, 'Route 5', 'Main Street', 4, +LineFromText( +'LINESTRING( 44 31, 56 34, 70 38 )' ,101)); + +INSERT INTO road_segments VALUES(104, 'Route 5', NULL, 2, +LineFromText( +'LINESTRING( 70 38, 72 48 )' ,101)); + +INSERT INTO road_segments VALUES(105, 'Main Street', NULL, 4, +LineFromText( +'LINESTRING( 70 38, 84 42 )' ,101)); + +INSERT INTO road_segments VALUES(106, 'Dirt Road by Green Forest', NULL, +1, +LineFromText( +'LINESTRING( 28 26, 28 0 )',101)); + +--echo # DividedRoutes + +INSERT INTO divided_routes VALUES(119, 'Route 75', 4, +MLineFromText( +'MULTILINESTRING((10 48,10 21,10 0), +(16 0,16 23,16 48))', 101)); + +--echo # Forests + +INSERT INTO forests VALUES(109, 'Green Forest', +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)))', +101)); + +--echo # Bridges + +INSERT INTO bridges VALUES(110, 'Cam Bridge', PointFromText( +'POINT( 44 31 )', 101)); + +--echo # Streams + +INSERT INTO streams VALUES(111, 'Cam Stream', +LineFromText( +'LINESTRING( 38 48, 44 41, 41 36, 44 31, 52 18 )', 101)); + +INSERT INTO streams VALUES(112, NULL, +LineFromText( +'LINESTRING( 76 0, 78 4, 73 9 )', 101)); + +--echo # Buildings + +INSERT INTO buildings VALUES(113, '123 Main Street', +PointFromText( +'POINT( 52 30 )', 101), +PolyFromText( +'POLYGON( ( 50 31, 54 31, 54 29, 50 29, 50 31) )', 101)); + +INSERT INTO buildings VALUES(114, '215 Main Street', +PointFromText( +'POINT( 64 33 )', 101), +PolyFromText( +'POLYGON( ( 66 34, 62 34, 62 32, 66 32, 66 34) )', 101)); + + +--echo # Ponds + +INSERT INTO ponds VALUES(120, NULL, 'Stock Pond', +MPolyFromText( +'MULTIPOLYGON( ( ( 24 44, 22 42, 24 40, 24 44) ), +( ( 26 44, 26 40, 28 42, 26 44) ) )', 101)); + +--echo # Named Places + +INSERT INTO named_places VALUES(117, 'Ashton', +PolyFromText( +'POLYGON( ( 62 48, 84 48, 84 30, 56 30, 56 34, 62 48) )', 101)); + +INSERT INTO named_places VALUES(118, 'Goose Island', +PolyFromText( +'POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )', 101)); + +--echo # Map Neatlines + +INSERT INTO map_neatlines VALUES(115, +PolyFromText( +'POLYGON( ( 0 0, 0 48, 84 48, 84 0, 0 0 ) )', 101)); + +--echo # +--echo # C.3.3.3 Geometry types and functions schema test queries +--echo + +# TODO: WL#2377 +#--echo # Conformance Item T1 +#SELECT f_table_name +#FROM geometry_columns; +# +#--echo # Conformance Item T2 +#SELECT f_geometry_column +#FROM geometry_columns +#WHERE f_table_name = 'streams'; +# +#--echo # Conformance Item T3 +#SELECT coord_dimension +#FROM geometry_columns +#WHERE f_table_name = 'streams'; +# +#--echo # Conformance Item T4 +# +#SELECT srid +#FROM geometry_columns +#WHERE f_table_name = 'streams'; +# +#--echo # Conformance Item T5 +# +#SELECT srtext +#FROM SPATIAL_REF_SYS +#WHERE SRID = 101; +# + + +--echo # Conformance Item T6 +# TODO: ST_Dimension() alias +SELECT Dimension(shore) +FROM lakes +WHERE name = 'Blue Lake'; + +--echo # Conformance Item T7 +# TODO: ST_GeometryType() alias +SELECT GeometryType(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; + +--echo # Conformance Item T8 +# TODO: ST_AsText() alias +SELECT AsText(boundary) +FROM named_places +WHERE name = 'Goose Island'; + +--echo # Conformance Item T9 +# TODO: ST_AsBinary(), ST_PolyFromWKB() aliases +SELECT AsText(PolyFromWKB(AsBinary(boundary),101)) +FROM named_places +WHERE name = 'Goose Island'; + +--echo # Conformance Item T10 +# TODO: ST_SRID() alias +SELECT SRID(boundary) +FROM named_places +WHERE name = 'Goose Island'; + +--echo # Conformance Item T11 +# TODO: ST_IsEmpty() alias +SELECT IsEmpty(centerline) +FROM road_segments +WHERE name = 'Route 5' +AND aliases = 'Main Street'; + +# FIXME: get wrong result:0, expected 1. +#--echo # Conformance Item T12 +# TODO: ST_IsSimple() alias +#SELECT IsSimple(shore) +#FROM lakes +#WHERE name = 'Blue Lake'; + +# TODO: WL#2377 +#--echo # Conformance Item T13 +#SELECT AsText(Boundary((boundary),101) +#FROM named_places +#WHERE name = 'Goose Island'; + +--echo # Conformance Item T14 +# TODO: ST_Envelope( ) alias +# FIXME: we get anticlockwise, GIS suggests clockwise +SELECT AsText(Envelope(boundary)) +FROM named_places +WHERE name = 'Goose Island'; + +--echo # Conformance Item T15 +# TODO: ST_X() alias +SELECT X(position) +FROM bridges +WHERE name = 'Cam Bridge'; + +--echo # Conformance Item T16 +# TODO: ST_Y() alias +SELECT Y(position) +FROM bridges +WHERE name = 'Cam Bridge'; + +--echo # Conformance Item T17 +# TODO: ST_StartPoint() alias +SELECT AsText(StartPoint(centerline)) +FROM road_segments +WHERE fid = 102; + +--echo # Conformance Item T18 +# TODO: ST_EndPoint +SELECT AsText(EndPoint(centerline)) +FROM road_segments +WHERE fid = 102; + +# TODO: WL#2377 +#--echo # Conformance Item T19 +# TODO: ST_LineFromWKB() alias +#SELECT IsClosed(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary))) +#FROM named_places +#WHERE name = 'Goose Island'; + +# TODO: WL#2377 +#--echo # Conformance Item T20 +#SELECT IsRing(LineFromWKB(AsBinary(Boundary(boundary)),SRID(boundary))) +#FROM named_places +#WHERE name = 'Goose Island'; + +--echo # Conformance Item T21 +# TODO: ST_Length() alias +SELECT GLength(centerline) +FROM road_segments +WHERE fid = 106; + +--echo # Conformance Item T22 +# TODO: ST_NumPoints() alias +SELECT NumPoints(centerline) +FROM road_segments +WHERE fid = 102; + +--echo # Conformance Item T23 +# TODO: ST_PointN() alias +SELECT AsText(PointN(centerline, 1)) +FROM road_segments +WHERE fid = 102; + +--echo # Conformance Item T24 +# TODO: ST_Centroid() alias +SELECT AsText(Centroid(boundary)) +FROM named_places +WHERE name = 'Goose Island'; + +# TODO: WL#2377 +#--echo # Conformance Item T25 +#SELECT Contains(boundary, PointOnSurface(boundary)) +#FROM named_places +#WHERE name = 'Goose Island'; + +--echo # Conformance Item T26 +# TODO: ST_Area() alias +SELECT Area(boundary) +FROM named_places +WHERE name = 'Goose Island'; + +--echo # Conformance Item T27 +# TODO: ST_ExteriorRing() alias +SELECT AsText(ExteriorRing(shore)) +FROM lakes +WHERE name = 'Blue Lake'; + +--echo # Conformance Item T28 +# TODO: ST_NumInteriorRings() alias +SELECT NumInteriorRings(shore) +FROM lakes +WHERE name = 'Blue Lake'; + +--echo # Conformance Item T29 +# TODO: ST_InteriorRingN() alias +SELECT AsText(InteriorRingN(shore, 1)) +FROM lakes +WHERE name = 'Blue Lake'; + +--echo # Conformance Item T30 +# TODO: ST_NumGeometries() alias +SELECT NumGeometries(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; + +--echo # Conformance Item T31 +# TODO: ST_GeometryN() alias +SELECT AsText(GeometryN(centerlines, 2)) +FROM divided_routes +WHERE name = 'Route 75'; + +--echo # Conformance Item T32 +# TODO: ST_IsClosed() alias +SELECT IsClosed(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; + +--echo # Conformance Item T33 +# TODO: ST_Length() alias +SELECT GLength(centerlines) +FROM divided_routes +WHERE name = 'Route 75'; + +--echo # Conformance Item T34 +# TODO: ST_Centroid() alias +SELECT AsText(Centroid(shores)) +FROM ponds +WHERE fid = 120; + +# TODO: WL#2377 +#--echo # Conformance Item T35 +#SELECT Contains(shores, PointOnSurface(shores)) +#FROM ponds +#WHERE fid = 120; + +--echo # Conformance Item T36 +# TODO: ST_Area() alias +SELECT Area(shores) +FROM ponds +WHERE fid = 120; + +--echo # Conformance Item T37 +# TODO: ST_PolyFromText() alias +SELECT ST_Equals(boundary, +PolyFromText('POLYGON( ( 67 13, 67 18, 59 18, 59 13, 67 13) )',1)) +FROM named_places +WHERE name = 'Goose Island'; + +--echo # Conformance Item T38 +SELECT ST_Disjoint(centerlines, boundary) +FROM divided_routes, named_places +WHERE divided_routes.name = 'Route 75' +AND named_places.name = 'Ashton'; + +--echo # Conformance Item T39 +SELECT ST_Touches(centerline, shore) +FROM streams, lakes +WHERE streams.name = 'Cam Stream' +AND lakes.name = 'Blue Lake'; + +# FIXME: wrong result: get 0, expected 1 +#--echo # Conformance Item T40 +#SELECT ST_Within(boundary, footprint) +#FROM named_places, buildings +#WHERE named_places.name = 'Ashton' +#AND buildings.address = '215 Main Street'; + +# FIXME: wrong result: get 0, expected 1 +#--echo # Conformance Item T41 +#SELECT ST_Overlaps(forests.boundary, named_places.boundary) +#FROM forests, named_places +#WHERE forests.name = 'Green Forest' +#AND named_places.name = 'Ashton'; + +--echo # Conformance Item T42 +# FIXME: TODO: ST_Crosses() alias +SELECT Crosses(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; + +--echo # Conformance Item T43 +SELECT ST_Intersects(road_segments.centerline, divided_routes.centerlines) +FROM road_segments, divided_routes +WHERE road_segments.fid = 102 +AND divided_routes.name = 'Route 75'; + +--echo # Conformance Item T44 +SELECT ST_Contains(forests.boundary, named_places.boundary) +FROM forests, named_places +WHERE forests.name = 'Green Forest' +AND named_places.name = 'Ashton'; + +# TODO: WL#2377 +#--echo # Conformance Item T45 +#SELECT Relate(forests.boundary, named_places.boundary, 'TTTTTTTTT') +#FROM forests, named_places +#WHERE forests.name = 'Green Forest' +#AND named_places.name = 'Ashton'; + +--echo # Conformance Item T46 +SELECT ST_Distance(position, boundary) +FROM bridges, named_places +WHERE bridges.name = 'Cam Bridge' +AND named_places.name = 'Ashton'; + +# FIXME: wrong result: NULL, expected 12 +#--echo # Conformance Item T47 +#SELECT AsText(ST_Intersection(centerline, shore)) +#FROM streams, lakes +#WHERE streams.name = 'Cam Stream' +#AND lakes.name = 'Blue Lake'; + +--echo # Conformance Item T48 +SELECT AsText(ST_Difference(named_places.boundary, forests.boundary)) +FROM named_places, forests +WHERE named_places.name = 'Ashton' +AND forests.name = 'Green Forest'; + +#--echo # Conformance Item T49 +SELECT AsText(ST_Union(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Goose Island'; + +--echo # Conformance Item T50 +SELECT AsText(ST_SymDifference(shore, boundary)) +FROM lakes, named_places +WHERE lakes.name = 'Blue Lake' +AND named_places.name = 'Ashton'; + +--echo # Conformance Item T51 +SELECT count(*) +FROM buildings, bridges +WHERE ST_Contains(ST_Buffer(bridges.position, 15.0), buildings.footprint) = 1; + +# TODO: WL#2377 +#--echo # Conformance Item T52 +#SELECT AsText(ConvexHull(shore)) +#FROM lakes +#WHERE lakes.name = 'Blue Lake'; + +DROP DATABASE gis_ogs; -- cgit v1.2.1 From 9d51588e9560e963fa6087513098c940b70b2e3d Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 14 Jun 2011 11:20:48 +0500 Subject: Precision spatial function tests added. --- mysql-test/r/gis-precise.result | 204 +++++++++++++++++++++++++++++++++++++ mysql-test/r/gis-rt-precise.result | 49 +++++++++ mysql-test/t/gis-precise.test | 107 +++++++++++++++++++ mysql-test/t/gis-rt-precise.test | 64 ++++++++++++ 4 files changed, 424 insertions(+) create mode 100644 mysql-test/r/gis-precise.result create mode 100644 mysql-test/r/gis-rt-precise.result create mode 100644 mysql-test/t/gis-precise.test create mode 100644 mysql-test/t/gis-rt-precise.test (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result new file mode 100644 index 00000000000..3bdc535e6f0 --- /dev/null +++ b/mysql-test/r/gis-precise.result @@ -0,0 +1,204 @@ +DROP TABLE IF EXISTS t1; +select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))')); +1 ST_Intersects(GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))')) +1 1 +select 0, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))')); +0 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))')) +0 0 +select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')); +1 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')) +1 1 +select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +1 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) +1 1 +select 0, ST_Within(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +0 ST_Within(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) +0 0 +select 1, ST_Within(GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))')); +1 ST_Within(GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))')) +1 1 +create table t1 (g point); +insert into t1 values +(GeomFromText('POINT(2 2)')), (GeomFromText('POINT(2 4)')), (GeomFromText('POINT(2 6)')), (GeomFromText('POINT(2 8)')), +(GeomFromText('POINT(4 2)')), (GeomFromText('POINT(4 4)')), (GeomFromText('POINT(4 6)')), (GeomFromText('POINT(4 8)')), +(GeomFromText('POINT(6 2)')), (GeomFromText('POINT(6 4)')), (GeomFromText('POINT(6 6)')), (GeomFromText('POINT(6 8)')), +(GeomFromText('POINT(8 2)')), (GeomFromText('POINT(8 4)')), (GeomFromText('POINT(8 6)')), (GeomFromText('POINT(8 8)')); +select astext(g) from t1 where ST_Within(g, GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))')); +astext(g) +POINT(4 2) +POINT(4 4) +POINT(4 6) +POINT(6 2) +POINT(6 4) +POINT(6 6) +select 'Contains'; +Contains +Contains +select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +astext(g) +POINT(4 4) +POINT(6 2) +POINT(6 4) +POINT(6 6) +select 'Intersects'; +Intersects +Intersects +select astext(g) from t1 where ST_Intersects(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +astext(g) +POINT(4 4) +POINT(6 2) +POINT(6 4) +POINT(6 6) +select 'Contains'; +Contains +Contains +select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +astext(g) +POINT(4 4) +POINT(6 2) +POINT(6 4) +POINT(6 6) +select 'Contains2'; +Contains2 +Contains2 +select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g); +astext(g) +POINT(4 4) +POINT(6 2) +POINT(6 6) +POINT(8 4) +DROP TABLE t1; +select 0, ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +0 ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) +0 0 +select 1, ST_Within(GeomFromText('LINESTRING(15 15, 16 16)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +1 ST_Within(GeomFromText('LINESTRING(15 15, 16 16)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) +1 1 +select 1, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(50 15, 15 50)')); +1 ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(50 15, 15 50)')) +1 1 +select 0, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)')); +0 ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)')) +0 0 +select 1, ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); +1 ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')) +1 1 +select astext(ST_Union(geometryfromtext('point(1 1)'), geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); +astext(ST_Union(geometryfromtext('point(1 1)'), geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))) +POLYGON((0 0,1 2,2 0,0 0)) +select astext(ST_Intersection(geometryfromtext('point(1 1)'), geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); +astext(ST_Intersection(geometryfromtext('point(1 1)'), geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))) +POINT(1 1) +select ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); +ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')) +1 +select ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')); +ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')) +0 +select ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')); +ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')) +1 +select ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')); +ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')) +0 +select ST_Overlaps(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')); +ST_Overlaps(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')) +1 +select ST_Overlaps(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))')); +ST_Overlaps(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))')) +0 +select ST_DISTANCE(geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')); +ST_DISTANCE(geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')) +0.707106781186547 +select ST_DISTANCE(geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), geomfromtext('linestring(0 1, 1 0)')); +ST_DISTANCE(geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), geomfromtext('linestring(0 1, 1 0)')) +0 +select ST_DISTANCE(geomfromtext('polygon((0 0, 3 6, 6 3, 0 0))'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')); +ST_DISTANCE(geomfromtext('polygon((0 0, 3 6, 6 3, 0 0))'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')) +0 +select ST_DISTANCE(geomfromtext('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), geomfromtext('point(3 3)')); +ST_DISTANCE(geomfromtext('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), geomfromtext('point(3 3)')) +0.447213595499958 +select ST_DISTANCE(geomfromtext('linestring(0 0, 3 6, 6 3, 0 0)'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')); +ST_DISTANCE(geomfromtext('linestring(0 0, 3 6, 6 3, 0 0)'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')) +0.894427190999916 +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))); +astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))) +POLYGON((26.4705882352941 23.8235294117647,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337,29.2899408284024 26.3609467455621,26.4705882352941 23.8235294117647)) +select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))); +astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))) +MULTIPOINT(26.4705882352941 23.8235294117647,29.2899408284024 26.3609467455621,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337) +select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))); +astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))) +POINT(29.2899408284024 26.3609467455621) +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))); +astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))) +POINT(20 20) +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200)'))); +astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200)'))) +LINESTRING(0 0,46.6666666666667 46.6666666666667) +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) +MULTILINESTRING((0 0,46.6666666666667 46.6666666666667),(8 10,45.3333333333333 47.3333333333333)) +select astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) +GEOMETRYCOLLECTION(LINESTRING(-10 -10,0 0),LINESTRING(-11 -9,8 10),POLYGON((0 0,40 50,50 45,0 0)),LINESTRING(46.6666666666667 46.6666666666667,200 200,199 201,45.3333333333333 47.3333333333333)) +select astext(ST_intersection(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))); +astext(ST_intersection(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))) +POLYGON((0 0,0 1,0.5 0.5,0 0)) +select astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))); +astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))) +MULTIPOLYGON(((0 0,0 1,0 0,0.5 0.5,1 0,0 0)),((0.5 0.5,0 1,0 2,1 1,0.5 0.5))) +select astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) +GEOMETRYCOLLECTION(LINESTRING(-10 -10,0 0),LINESTRING(-11 -9,8 10),POLYGON((0 0,40 50,50 45,0 0)),LINESTRING(46.6666666666667 46.6666666666667,200 200,199 201,45.3333333333333 47.3333333333333)) +select astext(ST_buffer(geometryfromtext('point(1 1)'), 1)); +astext(ST_buffer(geometryfromtext('point(1 1)'), 1)) +POLYGON((1 0,0.950932325672582 0.00120454379482759,0.901982859670439 0.00481527332780318,0.853269525544638 0.010823490035219,0.804909677983872 0.0192147195967696,0.757019820096736 0.029968746805456,0.709715322745538 0.0430596642677911,0.66311014660778 0.0584559348169792,0.61731656763491 0.0761204674887133,0.572444906569718 0.0960107068765567,0.528603263174002 0.118078735651645,0.485897255806778 0.142271389999728,0.444429766980398 0.168530387697455,0.404300695507567 0.196792468519355,0.365606715836355 0.226989546637263,0.328441045152982 0.259048874645041,0.292893218813453 0.292893218813453,0.259048874645041 0.328441045152982,0.226989546637263 0.365606715836355,0.196792468519355 0.404300695507567,0.168530387697455 0.444429766980398,0.142271389999728 0.485897255806778,0.118078735651645 0.528603263174002,0.0960107068765567 0.572444906569718,0.0761204674887133 0.61731656763491,0.0584559348169792 0.66311014660778,0.0430596642677911 0.709715322745538,0.029968746805456 0.757019820096736,0.0192147195967696 0.804909677983872,0.010823490035219 0.853269525544638,0.00481527332780318 0.901982859670439,0.00120454379482759 0.950932325672582,0 1,0.00481527332780318 1.09801714032956,0.010823490035219 1.14673047445536,0.0192147195967696 1.19509032201613,0.029968746805456 1.24298017990326,0.0430596642677911 1.29028467725446,0.0584559348169792 1.33688985339222,0.0761204674887133 1.38268343236509,0.0960107068765567 1.42755509343028,0.118078735651645 1.471396736826,0.142271389999728 1.51410274419322,0.168530387697455 1.5555702330196,0.196792468519355 1.59569930449243,0.226989546637263 1.63439328416365,0.259048874645041 1.67155895484702,0.292893218813453 1.70710678118655,0.328441045152982 1.74095112535496,0.365606715836355 1.77301045336274,0.404300695507567 1.80320753148064,0.444429766980398 1.83146961230255,0.485897255806778 1.85772861000027,0.528603263174002 1.88192126434835,0.572444906569718 1.90398929312344,0.61731656763491 1.92387953251129,0.66311014660778 1.94154406518302,0.709715322745538 1.95694033573221,0.757019820096736 1.97003125319454,0.804909677983872 1.98078528040323,0.853269525544638 1.98917650996478,0.901982859670439 1.9951847266722,0.950932325672582 1.99879545620517,1 2,1.04906767432742 1.99879545620517,1.09801714032956 1.9951847266722,1.14673047445536 1.98917650996478,1.19509032201613 1.98078528040323,1.24298017990326 1.97003125319454,1.29028467725446 1.95694033573221,1.33688985339222 1.94154406518302,1.38268343236509 1.92387953251129,1.42755509343028 1.90398929312344,1.471396736826 1.88192126434835,1.51410274419322 1.85772861000027,1.5555702330196 1.83146961230255,1.59569930449243 1.80320753148064,1.63439328416365 1.77301045336274,1.67155895484702 1.74095112535496,1.70710678118655 1.70710678118655,1.74095112535496 1.67155895484702,1.77301045336274 1.63439328416365,1.80320753148064 1.59569930449243,1.83146961230255 1.5555702330196,1.85772861000027 1.51410274419322,1.88192126434835 1.471396736826,1.90398929312344 1.42755509343028,1.92387953251129 1.38268343236509,1.94154406518302 1.33688985339222,1.95694033573221 1.29028467725446,1.97003125319454 1.24298017990326,1.98078528040323 1.19509032201613,1.98917650996478 1.14673047445536,1.9951847266722 1.09801714032956,1.99879545620517 1.04906767432742,2 1,1.9951847266722 0.901982859670439,1.98917650996478 0.853269525544638,1.98078528040323 0.804909677983872,1.97003125319454 0.757019820096736,1.95694033573221 0.709715322745538,1.94154406518302 0.66311014660778,1.92387953251129 0.61731656763491,1.90398929312344 0.572444906569718,1.88192126434835 0.528603263174002,1.85772861000027 0.485897255806778,1.83146961230255 0.444429766980398,1.80320753148064 0.404300695507567,1.77301045336274 0.365606715836355,1.74095112535496 0.328441045152982,1.70710678118655 0.292893218813453,1.67155895484702 0.259048874645041,1.63439328416365 0.226989546637263,1.59569930449243 0.196792468519355,1.5555702330196 0.168530387697455,1.51410274419322 0.142271389999728,1.471396736826 0.118078735651645,1.42755509343028 0.0960107068765567,1.38268343236509 0.0761204674887133,1.33688985339222 0.0584559348169792,1.29028467725446 0.0430596642677911,1.24298017990326 0.029968746805456,1.19509032201613 0.0192147195967696,1.14673047445536 0.010823490035219,1.09801714032956 0.00481527332780318,1.04906767432742 0.00120454379482759,1 0)) +create table t1(geom geometrycollection); +insert into t1 values (geomfromtext('POLYGON((0 0, 10 10, 0 8, 0 0))')); +insert into t1 values (geomfromtext('POLYGON((1 1, 10 10, 0 8, 1 1))')); +select astext(geom), area(geom),area(ST_buffer(geom,2)) from t1; +astext(geom) area(geom) area(ST_buffer(geom,2)) +POLYGON((0 0,10 10,0 8,0 0)) 40 101.671508403749 +POLYGON((1 1,10 10,0 8,1 1)) 36 108.555395892665 +select astext(ST_buffer(geom,2)) from t1; +astext(ST_buffer(geom,2)) +POLYGON((1.41421356237309 -1.41421356237309,-1.41421356237309 1.41421356237309,0 2.82842712474619,0 6.00005026122218,-0.0960457772985613 6.00230752900675,-0.193952209526528 6.00942657999767,-0.29139139389354 6.02134109671101,-0.388128590869789 6.03802237603243,-0.483930752074584 6.05943023129893,-0.578567081710303 6.08551308911207,-0.671809592569691 6.11620811358278,-0.763433655277008 6.15144135770856,-0.853218539439872 6.19112794151823,-0.940947945408108 6.23517225655526,-1.02641052535855 6.2834681962069,-1.10940039245046 6.33589941132431,-1.18971761682496 6.39233959051784,-1.26716870725357 6.45265276445223,-1.34156707727553 6.51669363340867,-1.41273349470095 6.58430791732451,-1.48049651339678 6.65533272746751,-1.54469288631567 6.72959695884898,-1.6051679587723 6.80692170243074,-1.66177604102015 6.88712067613267,-1.71438075923078 6.97000067360251,-1.76285538403041 7.05536202966692,-1.80708313580201 7.14299910134239,-1.84695746601768 7.23270076324713,-1.88238231392335 7.32425091622068,-1.91327233795755 7.41742900792569,-1.93955312134675 7.5120105641778,-1.96116135138184 7.60776772972363,-1.978044971944 7.70446981716405,-1.99016330891247 7.8018838627003,-1.99748716815206 7.89977518736424,-1.99999890584435 7.99790796238047,-1.99769247099325 8.09604577729856,-1.99057342000233 8.19395220952653,-1.97865890328899 8.29139139389354,-1.96197762396757 8.38812859086979,-1.94056976870107 8.48393075207458,-1.91448691088793 8.5785670817103,-1.88379188641722 8.67180959256969,-1.84855864229144 8.76343365527701,-1.80887205848177 8.85321853943987,-1.76482774344474 8.94094794540811,-1.7165318037931 9.02641052535855,-1.66410058867569 9.10940039245046,-1.60766040948216 9.18971761682496,-1.54734723554777 9.26716870725357,-1.48330636659133 9.34156707727553,-1.41569208267549 9.41273349470094,-1.34466727253249 9.48049651339678,-1.27040304115102 9.54469288631567,-1.19307829756926 9.6051679587723,-1.11287932386733 9.66177604102015,-1.02999932639749 9.71438075923078,-0.944637970333077 9.76285538403041,-0.857000898657614 9.80708313580201,-0.767299236752872 9.84695746601768,-0.675749083779317 9.88238231392335,-0.582570992074307 9.91327233795755,-0.487989435822199 9.93955312134675,-0.392232270276368 9.96116135138184,-0.295530182835952 9.978044971944,-0.392232270276368 9.96116135138184,9.60776772972363 11.9611613513818,9.60981935596774 11.9615705608065,9.70653905108928 11.9783530199296,9.80396571934088 11.9903694533444,9.90186465134516 11.9975909124103,10 12,10.0981353486548 11.9975909124103,10.1960342806591 11.9903694533444,10.2934609489107 11.9783530199296,10.3901806440323 11.9615705608065,10.4859603598065 11.9400625063891,10.5805693545089 11.9138806714644,10.6737797067844 11.883088130366,10.7653668647302 11.8477590650226,10.8551101868606 11.8079785862469,10.942793473652 11.7638425286967,11.0282054883864 11.7154572200005,11.1111404660392 11.6629392246051,11.1913986089849 11.6064150629613,11.2687865683273 11.5460209067255,11.343117909694 11.4819022507099,11.4142135623731 11.4142135623731,11.4819022507099 11.343117909694,11.5460209067255 11.2687865683273,11.6064150629613 11.1913986089849,11.6629392246051 11.1111404660392,11.7154572200005 11.0282054883864,11.7638425286967 10.942793473652,11.8079785862469 10.8551101868606,11.8477590650226 10.7653668647302,11.883088130366 10.6737797067844,11.9138806714644 10.5805693545089,11.9400625063891 10.4859603598065,11.9615705608065 10.3901806440323,11.9783530199296 10.2934609489107,11.9903694533444 10.1960342806591,11.9975909124103 10.0981353486548,12 10,11.9975909124103 9.90186465134516,11.9903694533444 9.80396571934088,11.9783530199296 9.70653905108928,11.9615705608065 9.60981935596774,11.9400625063891 9.51403964019347,11.9138806714644 9.41943064549108,11.883088130366 9.32622029321556,11.8477590650226 9.23463313526982,11.8079785862469 9.14488981313944,11.7638425286967 9.057206526348,11.7154572200005 8.97179451161356,11.6629392246051 8.8888595339608,11.6064150629613 8.80860139101513,11.5460209067255 8.73121343167271,11.4819022507099 8.65688209030596,11.4142135623731 8.5857864376269,1.41421356237309 -1.41421356237309)) +POLYGON((0.989269849411119 -0.999971215759952,0.891148838068309 -0.997035659307595,0.793290058708828 -0.989289069032301,0.69592926170357 -0.976750107148565,0.599300997740319 -0.959448981113848,0.503638052770599 -0.937427370856167,0.409170887207927 -0.910738328363497,0.316127080728489 -0.879446149876889,0.22473078401177 -0.843626220995187,0.135202178741929 -0.803364835064523,0.0477569471708416 -0.758758985290084,-0.0373942474793394 -0.709916131070988,-0.120046268522338 -0.656953939121177,-0.2 -0.6,-0.277062826370076 -0.539191520735374,-0.351049096533933 -0.474674994280042,-0.421780571086316 -0.406605846597216,-0.489086851709682 -0.335148062225815,-0.552805791678675 -0.260473789227354,-0.61278388648579 -0.182762924466179,-0.668876643647177 -0.102202680222169,-0.720948930797688 -0.0189871331799512,-0.768875301236584 0.0666832431188291,-0.812540296139623 0.154602061233829,-0.851838722709481 0.244557517031431,-0.886675907594418 0.33633289993945,-0.916967924964667 0.429707115021888,-0.942641798697117 0.524455215615996,-0.963635678181181 0.620348945248487,-0.979898987322333 0.717157287525381,-1.97989898732233 7.71715728752538,-1.99016330891247 7.8018838627003,-1.99748716815206 7.89977518736424,-1.99999890584435 7.99790796238047,-1.99769247099325 8.09604577729856,-1.99057342000233 8.19395220952653,-1.97865890328899 8.29139139389354,-1.96197762396757 8.38812859086979,-1.94056976870107 8.48393075207458,-1.91448691088793 8.5785670817103,-1.88379188641722 8.67180959256969,-1.84855864229144 8.76343365527701,-1.80887205848177 8.85321853943987,-1.76482774344474 8.94094794540811,-1.7165318037931 9.02641052535855,-1.66410058867569 9.10940039245046,-1.60766040948216 9.18971761682496,-1.54734723554777 9.26716870725357,-1.48330636659133 9.34156707727553,-1.41569208267549 9.41273349470094,-1.34466727253249 9.48049651339678,-1.27040304115102 9.54469288631567,-1.19307829756926 9.6051679587723,-1.11287932386733 9.66177604102015,-1.02999932639749 9.71438075923078,-0.944637970333077 9.76285538403041,-0.857000898657614 9.80708313580201,-0.767299236752872 9.84695746601768,-0.675749083779317 9.88238231392335,-0.582570992074307 9.91327233795755,-0.487989435822199 9.93955312134675,-0.392232270276368 9.96116135138184,9.60776772972363 11.9611613513818,9.60981935596774 11.9615705608065,9.70653905108928 11.9783530199296,9.80396571934088 11.9903694533444,9.90186465134516 11.9975909124103,10 12,10.0981353486548 11.9975909124103,10.1960342806591 11.9903694533444,10.2934609489107 11.9783530199296,10.3901806440323 11.9615705608065,10.4859603598065 11.9400625063891,10.5805693545089 11.9138806714644,10.6737797067844 11.883088130366,10.7653668647302 11.8477590650226,10.8551101868606 11.8079785862469,10.942793473652 11.7638425286967,11.0282054883864 11.7154572200005,11.1111404660392 11.6629392246051,11.1913986089849 11.6064150629613,11.2687865683273 11.5460209067255,11.343117909694 11.4819022507099,11.4142135623731 11.4142135623731,11.4819022507099 11.343117909694,11.5460209067255 11.2687865683273,11.6064150629613 11.1913986089849,11.6629392246051 11.1111404660392,11.7154572200005 11.0282054883864,11.7638425286967 10.942793473652,11.8079785862469 10.8551101868606,11.8477590650226 10.7653668647302,11.883088130366 10.6737797067844,11.9138806714644 10.5805693545089,11.9400625063891 10.4859603598065,11.9615705608065 10.3901806440323,11.9783530199296 10.2934609489107,11.9903694533444 10.1960342806591,11.9975909124103 10.0981353486548,12 10,11.9975909124103 9.90186465134516,11.9903694533444 9.80396571934088,11.9783530199296 9.70653905108928,11.9615705608065 9.60981935596774,11.9400625063891 9.51403964019347,11.9138806714644 9.41943064549108,11.883088130366 9.32622029321556,11.8477590650226 9.23463313526982,11.8079785862469 9.14488981313944,11.7638425286967 9.057206526348,11.7154572200005 8.97179451161356,11.6629392246051 8.8888595339608,11.6064150629613 8.80860139101513,11.5460209067255 8.73121343167271,11.4819022507099 8.65688209030596,11.4142135623731 8.5857864376269,2.41421356237309 -0.414213562373095,2.40660584659722 -0.421780571086316,2.33514806222581 -0.489086851709682,2.26047378922735 -0.552805791678675,2.18276292446618 -0.61278388648579,2.10220268022217 -0.668876643647177,2.01898713317995 -0.720948930797688,1.93331675688117 -0.768875301236584,1.84539793876617 -0.812540296139623,1.75544248296857 -0.851838722709481,1.66366710006055 -0.886675907594418,1.57029288497811 -0.916967924964667,1.475544784384 -0.942641798697117,1.37965105475151 -0.963635678181181,1.28284271247462 -0.979898987322333,1.18535297732928 -0.991392546384357,1.08741671062655 -0.998088666376754,0.989269849411119 -0.999971215759952)) +set @geom=geomfromtext('LINESTRING(2 1, 4 2, 2 3, 2 5)'); +set @buff=ST_buffer(@geom,1); +select astext(@buff); +astext(@buff) +POLYGON((2.02185940085665 0.000238945250322198,1.97277712041129 0.000370611262904941,1.92376042226731 0.00291047203014849,1.87492739194389 0.0078524088049996,1.82639567248833 0.015184516028905,1.7782821810637 0.0248891300133454,1.73070282728507 0.0369428714932084,1.68377223398316 0.0513167019494863,1.63760346106787 0.0679759935656108,1.59230773315705 0.086880612648897,1.54799417162668 0.107985016316124,1.50476953172789 0.131238362210331,1.46273794540424 0.156584630984506,1.42200067042871 0.1839627612571,1.38265584646488 0.213306796714246,1.34479825863987 0.244546045004294,1.3085191091987 0.277605248041878,1.27390579779004 0.312404763311236,1.24104171091284 0.348860755732007,1.21000602103095 0.386885399625282,1.1808734958397 0.426387090293356,1.15371431814397 0.467270664703471,1.12859391678171 0.509437630743893,1.10557280900008 0.552786404500042,1.08470645466414 0.597212554979035,1.06604512264916 0.642609055693097,1.0496337697385 0.688866542495745,1.0355119323188 0.735873577049592,1.02371363113331 0.783516915291068,1.01426728932301 0.831681780245288,1.00719566395272 0.880252138533831,1.00251579118736 0.929110979909321,1.00023894525032 0.978140599143353,1.0003706112629 1.02722287958871,1.00291047203015 1.07623957773269,1.007852408805 1.12507260805611,1.01518451602891 1.17360432751167,1.02488913001335 1.2217178189363,1.03694287149321 1.26929717271493,1.05131670194949 1.31622776601684,1.06797599356561 1.36239653893213,1.0868806126489 1.40769226684295,1.10798501631612 1.45200582837332,1.13123836221033 1.49523046827211,1.15658463098451 1.53726205459576,1.1839627612571 1.57799932957129,1.21330679671425 1.61734415353512,1.24454604500429 1.65520174136013,1.27760524804188 1.6914808908013,1.31240476331124 1.72609420220996,1.34886075573201 1.75895828908716,1.38688539962528 1.78999397896905,1.42638709029336 1.8191265041603,1.46727066470347 1.84628568185603,1.50943763074389 1.87140608321829,1.55278640450004 1.89442719099992,1.76393202250021 2,1.55278640450004 2.10557280900008,1.528603263174 2.11807873565165,1.48589725580678 2.14227138999973,1.4444297669804 2.16853038769745,1.40430069550757 2.19679246851936,1.36560671583635 2.22698954663726,1.32844104515298 2.25904887464504,1.29289321881345 2.29289321881345,1.25904887464504 2.32844104515298,1.22698954663726 2.36560671583635,1.19679246851936 2.40430069550757,1.16853038769745 2.4444297669804,1.14227138999973 2.48589725580678,1.11807873565165 2.528603263174,1.09601070687656 2.57244490656972,1.07612046748871 2.61731656763491,1.05845593481698 2.66311014660778,1.04305966426779 2.70971532274554,1.02996874680546 2.75701982009674,1.01921471959677 2.80490967798387,1.01082349003522 2.85326952554464,1.0048152733278 2.90198285967044,1.00120454379483 2.95093232567258,1 3,1 5,1.0048152733278 5.09801714032956,1.01082349003522 5.14673047445536,1.01921471959677 5.19509032201613,1.02996874680546 5.24298017990326,1.04305966426779 5.29028467725446,1.05845593481698 5.33688985339222,1.07612046748871 5.38268343236509,1.09601070687656 5.42755509343028,1.11807873565165 5.471396736826,1.14227138999973 5.51410274419322,1.16853038769745 5.5555702330196,1.19679246851936 5.59569930449243,1.22698954663726 5.63439328416365,1.25904887464504 5.67155895484702,1.29289321881345 5.70710678118655,1.32844104515298 5.74095112535496,1.36560671583635 5.77301045336274,1.40430069550757 5.80320753148064,1.4444297669804 5.83146961230254,1.48589725580678 5.85772861000027,1.528603263174 5.88192126434835,1.57244490656972 5.90398929312344,1.61731656763491 5.92387953251129,1.66311014660778 5.94154406518302,1.70971532274554 5.95694033573221,1.75701982009674 5.97003125319454,1.80490967798387 5.98078528040323,1.85326952554464 5.98917650996478,1.90198285967044 5.9951847266722,1.95093232567258 5.99879545620517,2 6,2.04906767432742 5.99879545620517,2.09801714032956 5.9951847266722,2.14673047445536 5.98917650996478,2.19509032201613 5.98078528040323,2.24298017990326 5.97003125319454,2.29028467725446 5.95694033573221,2.33688985339222 5.94154406518302,2.38268343236509 5.92387953251129,2.42755509343028 5.90398929312344,2.471396736826 5.88192126434835,2.51410274419322 5.85772861000027,2.5555702330196 5.83146961230254,2.59569930449243 5.80320753148064,2.63439328416365 5.77301045336274,2.67155895484702 5.74095112535496,2.70710678118655 5.70710678118655,2.74095112535496 5.67155895484702,2.77301045336274 5.63439328416365,2.80320753148064 5.59569930449243,2.83146961230255 5.5555702330196,2.85772861000027 5.51410274419322,2.88192126434835 5.471396736826,2.90398929312344 5.42755509343028,2.92387953251129 5.38268343236509,2.94154406518302 5.33688985339222,2.95694033573221 5.29028467725446,2.97003125319454 5.24298017990326,2.98078528040323 5.19509032201613,2.98917650996478 5.14673047445536,2.9951847266722 5.09801714032956,2.99879545620517 5.04906767432742,3 5,3 3.61803398874989,4.44721359549996 2.89442719099992,4.45200582837332 2.89201498368388,4.49523046827211 2.86876163778967,4.53726205459576 2.84341536901549,4.57799932957129 2.8160372387429,4.61734415353512 2.78669320328575,4.65520174136013 2.75545395499571,4.6914808908013 2.72239475195812,4.72609420220996 2.68759523668876,4.75895828908716 2.65113924426799,4.78999397896905 2.61311460037472,4.8191265041603 2.57361290970664,4.84628568185602 2.53272933529653,4.87140608321829 2.49056236925611,4.89442719099992 2.44721359549996,4.91529354533586 2.40278744502096,4.93395487735084 2.3573909443069,4.9503662302615 2.31113345750426,4.9644880676812 2.26412642295041,4.97628636886669 2.21648308470893,4.98573271067699 2.16831821975471,4.99280433604728 2.11974786146617,4.99748420881264 2.07088902009068,4.99976105474968 2.02185940085665,4.99962938873709 1.97277712041129,4.99708952796985 1.92376042226731,4.992147591195 1.87492739194389,4.9848154839711 1.82639567248833,4.97511086998665 1.7782821810637,4.96305712850679 1.73070282728507,4.94868329805051 1.68377223398316,4.93202400643439 1.63760346106787,4.9131193873511 1.59230773315705,4.89201498368388 1.54799417162668,4.86876163778967 1.50476953172789,4.84341536901549 1.46273794540424,4.8160372387429 1.42200067042871,4.78669320328575 1.38265584646488,4.75545395499571 1.34479825863987,4.72239475195812 1.3085191091987,4.68759523668876 1.27390579779004,4.65113924426799 1.24104171091284,4.61311460037472 1.21000602103095,4.57361290970664 1.1808734958397,4.53272933529653 1.15371431814397,4.49056236925611 1.12859391678171,4.44721359549996 1.10557280900008,2.44721359549996 0.105572809000084,2.3573909443069 0.0660451226491613,2.31113345750426 0.0496337697385035,2.26412642295041 0.0355119323187965,2.21648308470893 0.0237136311333106,2.16831821975471 0.014267289323011,2.11974786146617 0.00719566395272053,2.07088902009068 0.00251579118735756,2.02185940085665 0.000238945250322198)) +DROP TABLE t1; +select st_touches(geomfromtext('point(0 0)'), geomfromtext('point(1 1)')); +st_touches(geomfromtext('point(0 0)'), geomfromtext('point(1 1)')) +0 +select st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')); +st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')) +1 +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')); +st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')) +1 +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')); +st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')) +0 +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 2)')); +st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 2)')) +0 +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')); +st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')) +0 +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')); +st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')) +1 +SELECT ST_Equals(PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),PolyFromText('POLYGON((67 13, 67 18, 59 19, 59 13, 59 13, 67 13) )')) as result; +result +0 +SELECT ST_Equals(PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),PolyFromText('POLYGON((67 13, 67 18, 59 18, 59 13, 59 13, 67 13) )')) as result; +result +1 +SELECT ST_Equals(PointFromText('POINT (12 13)'),PointFromText('POINT (12 13)')) as result; +result +1 diff --git a/mysql-test/r/gis-rt-precise.result b/mysql-test/r/gis-rt-precise.result new file mode 100644 index 00000000000..4519dcb6d19 --- /dev/null +++ b/mysql-test/r/gis-rt-precise.result @@ -0,0 +1,49 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL, +SPATIAL KEY(g) +) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fid` int(11) NOT NULL AUTO_INCREMENT, + `g` geometry NOT NULL, + PRIMARY KEY (`fid`), + SPATIAL KEY `g` (`g`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT count(*) FROM t1; +count(*) +150 +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 140))')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range g g 34 NULL 8 Using where +SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); +fid AsText(g) +11 LINESTRING(140 140,160 160) +DROP TABLE t1; +CREATE TABLE t1 ( +fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +g GEOMETRY NOT NULL +) ENGINE=MyISAM; +ALTER TABLE t1 ADD SPATIAL KEY(g); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fid` int(11) NOT NULL AUTO_INCREMENT, + `g` geometry NOT NULL, + PRIMARY KEY (`fid`), + SPATIAL KEY `g` (`g`) +) ENGINE=MyISAM AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 +SELECT count(*) FROM t1; +count(*) +100 +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, +GeomFromText('Polygon((40 40,60 40,60 60,40 40))')); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range g g 34 NULL 1 Using where +SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, +GeomFromText('Polygon((40 40,60 40,60 60,40 40))')); +fid AsText(g) +DROP TABLE t1; +End of 5.5 tests. diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test new file mode 100644 index 00000000000..f37249aedee --- /dev/null +++ b/mysql-test/t/gis-precise.test @@ -0,0 +1,107 @@ +-- source include/have_geometry.inc + + +# +# Spatial objects +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'), GeomFromText('POLYGON((10 10,30 10,30 30,10 30,10 10))')); +select 0, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 40, 40 50, 20 70, 10 40))')); +select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')); +select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +select 0, ST_Within(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +select 1, ST_Within(GeomFromText('POLYGON((1 1,20 10,10 30, 1 1))'), GeomFromText('POLYGON((0 0,30 5,10 40, 0 0))')); + + +create table t1 (g point); +insert into t1 values +(GeomFromText('POINT(2 2)')), (GeomFromText('POINT(2 4)')), (GeomFromText('POINT(2 6)')), (GeomFromText('POINT(2 8)')), +(GeomFromText('POINT(4 2)')), (GeomFromText('POINT(4 4)')), (GeomFromText('POINT(4 6)')), (GeomFromText('POINT(4 8)')), +(GeomFromText('POINT(6 2)')), (GeomFromText('POINT(6 4)')), (GeomFromText('POINT(6 6)')), (GeomFromText('POINT(6 8)')), +(GeomFromText('POINT(8 2)')), (GeomFromText('POINT(8 4)')), (GeomFromText('POINT(8 6)')), (GeomFromText('POINT(8 8)')); + +select astext(g) from t1 where ST_Within(g, GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))')); +select 'Contains'; +select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +select 'Intersects'; +select astext(g) from t1 where ST_Intersects(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +select 'Contains'; +select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); +select 'Contains2'; +select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g); + +DROP TABLE t1; + +select 0, ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); +select 1, ST_Within(GeomFromText('LINESTRING(15 15, 16 16)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); + + +select 1, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(50 15, 15 50)')); +select 0, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)')); + +select 1, ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); + +select astext(ST_Union(geometryfromtext('point(1 1)'), geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); +select astext(ST_Intersection(geometryfromtext('point(1 1)'), geometryfromtext('polygon((0 0, 2 0, 1 2, 0 0))'))); + +select ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); +select ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')); +select ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')); +select ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')); +select ST_Overlaps(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 4, 4 4, 4 10, 10 10))')); +select ST_Overlaps(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((1 1, 1 4, 4 4, 4 1, 1 1))')); + +# Distance tests +select ST_DISTANCE(geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')); +select ST_DISTANCE(geomfromtext('polygon((0 0, 1 2, 2 1, 0 0))'), geomfromtext('linestring(0 1, 1 0)')); +select ST_DISTANCE(geomfromtext('polygon((0 0, 3 6, 6 3, 0 0))'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')); +select ST_DISTANCE(geomfromtext('polygon((0 0, 3 6, 6 3, 0 0),(2 2, 3 4, 4 3, 2 2))'), geomfromtext('point(3 3)')); +select ST_DISTANCE(geomfromtext('linestring(0 0, 3 6, 6 3, 0 0)'), geomfromtext('polygon((2 2, 3 4, 4 3, 2 2))')); + + +# Operations tests +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))'))); +select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))); +select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))); +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))); +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200)'))); +select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); +select astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); + +select astext(ST_intersection(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))); + +select astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))); +select astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); + +# Buffer() tests +select astext(ST_buffer(geometryfromtext('point(1 1)'), 1)); +create table t1(geom geometrycollection); +insert into t1 values (geomfromtext('POLYGON((0 0, 10 10, 0 8, 0 0))')); +insert into t1 values (geomfromtext('POLYGON((1 1, 10 10, 0 8, 1 1))')); +select astext(geom), area(geom),area(ST_buffer(geom,2)) from t1; +select astext(ST_buffer(geom,2)) from t1; + +set @geom=geomfromtext('LINESTRING(2 1, 4 2, 2 3, 2 5)'); +set @buff=ST_buffer(@geom,1); +select astext(@buff); + +# cleanup +DROP TABLE t1; + +#Touches tests +select st_touches(geomfromtext('point(0 0)'), geomfromtext('point(1 1)')); +select st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')); +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')); +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')); +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 2)')); +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')); +select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')); + +#Equals test +SELECT ST_Equals(PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),PolyFromText('POLYGON((67 13, 67 18, 59 19, 59 13, 59 13, 67 13) )')) as result; +SELECT ST_Equals(PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),PolyFromText('POLYGON((67 13, 67 18, 59 18, 59 13, 59 13, 67 13) )')) as result; +SELECT ST_Equals(PointFromText('POINT (12 13)'),PointFromText('POINT (12 13)')) as result; diff --git a/mysql-test/t/gis-rt-precise.test b/mysql-test/t/gis-rt-precise.test new file mode 100644 index 00000000000..4cae10a9076 --- /dev/null +++ b/mysql-test/t/gis-rt-precise.test @@ -0,0 +1,64 @@ +-- source include/have_geometry.inc + +# +# test of rtree (using with spatial data) +# +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 ( + fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + g GEOMETRY NOT NULL, + SPATIAL KEY(g) +) ENGINE=MyISAM; + +SHOW CREATE TABLE t1; + +--disable_query_log +let $1=150; +let $2=150; +while ($1) +{ + eval INSERT INTO t1 (g) VALUES (GeomFromText('LineString($1 $1, $2 $2)')); + dec $1; + inc $2; +} +--enable_query_log + +SELECT count(*) FROM t1; +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 140))')); +SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); + +DROP TABLE t1; + +CREATE TABLE t1 ( + fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + g GEOMETRY NOT NULL +) ENGINE=MyISAM; + +--disable_query_log +let $1=10; +while ($1) +{ + let $2=10; + while ($2) + { + eval INSERT INTO t1 (g) VALUES (LineString(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10, $2 * 10))); + dec $2; + } + dec $1; +} +--enable_query_log + +ALTER TABLE t1 ADD SPATIAL KEY(g); +SHOW CREATE TABLE t1; +SELECT count(*) FROM t1; +EXPLAIN SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, + GeomFromText('Polygon((40 40,60 40,60 60,40 40))')); +SELECT fid, AsText(g) FROM t1 WHERE ST_Within(g, + GeomFromText('Polygon((40 40,60 40,60 60,40 40))')); + +DROP TABLE t1; + +--echo End of 5.5 tests. -- cgit v1.2.1 From 4f49cdf8d303b431343bbc77428169fdfcaae34c Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 30 Jun 2011 18:18:27 +0500 Subject: fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION If the result contains a polygon with a hole, consequitive shapes weren't calculated properly, as the hole appeared as shape in the result, but actually it's a single shape with the surrounding polygon. It's more natural to use the size of the result as a border instead of the number of resulting shapes. per-file comments: mysql-test/r/gis-precise.result fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION test result updated. mysql-test/t/gis-precise.test fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION test case added. sql/spatial.cc fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION check the data lenght instead of number of shapes. sql/spatial.h fix for bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION check the data lenght instead of number of shapes. --- mysql-test/r/gis-precise.result | 7 +++++++ mysql-test/t/gis-precise.test | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 3bdc535e6f0..b60ec2e2e8d 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -202,3 +202,10 @@ result SELECT ST_Equals(PointFromText('POINT (12 13)'),PointFromText('POINT (12 13)')) as result; result 1 +SELECT astext(ST_UNION ( +PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'), +ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))'))))); +astext(ST_UNION ( +PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'), +ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))'))))) +GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0 0,5 0,5 1.25),LINESTRING(0 0,0 5,0.555555555555556 5),LINESTRING(2.4 5,2 5)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index f37249aedee..b5c54c6b0c4 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -105,3 +105,9 @@ select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('p SELECT ST_Equals(PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),PolyFromText('POLYGON((67 13, 67 18, 59 19, 59 13, 59 13, 67 13) )')) as result; SELECT ST_Equals(PolyFromText('POLYGON((67 13, 67 18, 67 18, 59 18, 59 13, 67 13) )'),PolyFromText('POLYGON((67 13, 67 18, 59 18, 59 13, 59 13, 67 13) )')) as result; SELECT ST_Equals(PointFromText('POINT (12 13)'),PointFromText('POINT (12 13)')) as result; + +# bug #801243 Assertion `(0)' failed in Gis_geometry_collection::init_from_opresult on ST_UNION + +SELECT astext(ST_UNION ( + PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'), + ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))'))))); -- cgit v1.2.1 From a9a6597d598c735ba6b8a136864b888d8d626b70 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 30 Jun 2011 19:24:52 +0500 Subject: fix for bug #201189 ST_BUFFER asserts if radius = 0. Internal caclucations can't handle zero distance properly. As the ST_BUFFER(geom, 0) is in fact NOOP, we'll just return the 'geom' as the result here. per-file comments: mysql-test/r/gis-precise.result fix for bug #201189 ST_BUFFER asserts if radius = 0. test result updated. mysql-test/t/gis-precise.test fix for bug #201189 ST_BUFFER asserts if radius = 0. test case added. sql/item_geofunc.cc fix for bug #201189 ST_BUFFER asserts if radius = 0. return the first argument as the result of the ST_BUFFER, if the distance is 0 there. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index b60ec2e2e8d..48c00c4a468 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -209,3 +209,6 @@ astext(ST_UNION ( PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'), ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))'))))) GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0 0,5 0,5 1.25),LINESTRING(0 0,0 5,0.555555555555556 5),LINESTRING(2.4 5,2 5)) +SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); +astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)) +LINESTRING(0 0,1 1) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index b5c54c6b0c4..e75316a0805 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -111,3 +111,6 @@ SELECT ST_Equals(PointFromText('POINT (12 13)'),PointFromText('POINT (12 13)')) SELECT astext(ST_UNION ( PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'), ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))'))))); + +#bug 801189 ST_BUFFER asserts if radius = 0 +SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); -- cgit v1.2.1 From 0e6c889c83bcf6c37526e3a3fee192bb59cab92e Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 4 Jul 2011 16:03:36 +0500 Subject: bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT Collections were treated mistakenly, so the counter for the final UNION operation received the wrong value. As a fix we implement Item_func_buffer::Transporter::start_collection() method, where we set the proper operation and the operand counter. start_poly() and start_line() were also modified to function correctly for the polygon as a part of a collection. per-file comments: mysql-test/r/gis-precise.result bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT test result updated. mysql-test/t/gis-precise.test bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT test case added. sql/item_geofunc.cc bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT start_collection() implemented. sql/item_geofunc.h bug #801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT Item_func_buffer::Transporter::start_collection() defined. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 48c00c4a468..e4cc9028236 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -212,3 +212,6 @@ GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0 0,5 SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)) LINESTRING(0 0,1 1) +SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); +Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5) +78.68426 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index e75316a0805..e267bcf57c1 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -114,3 +114,6 @@ SELECT astext(ST_UNION ( #bug 801189 ST_BUFFER asserts if radius = 0 SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); + +#buf 801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT +SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); -- cgit v1.2.1 From 7f55ea121191131723c99889943f8a278c5a7b4b Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 4 Jul 2011 16:17:34 +0500 Subject: fix for bug #801212 Assertion with ST_INTERSECTION on NULL values The ::val_str() method has to return NULL if it calculated the null_value, not just set the related flag. per-file comments: mysql-test/r/gis-precise.result fix for bug #801212 Assertion with ST_INTERSECTION on NULL values test result updated. mysql-test/t/gis-precise.test fix for bug #801212 Assertion with ST_INTERSECTION on NULL values test case added. sql/item_geofunc.cc fix for bug #801212 Assertion with ST_INTERSECTION on NULL values return NULL from the val_str if we get the null_value. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index e4cc9028236..4f07333e6a3 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -215,3 +215,6 @@ LINESTRING(0 0,1 1) SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5) 78.68426 +SELECT ST_INTERSECTION(NULL, NULL); +ST_INTERSECTION(NULL, NULL) +NULL diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index e267bcf57c1..72ba6b748be 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -115,5 +115,9 @@ SELECT astext(ST_UNION ( #bug 801189 ST_BUFFER asserts if radius = 0 SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); -#buf 801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT +#bug 801199 Infinite recursion in Gcalc_function::count_internal with ST_BUFFER over MULTIPOINT SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); + +#bug 801212 Assertion with ST_INTERSECTION on NULL values +SELECT ST_INTERSECTION(NULL, NULL); + -- cgit v1.2.1 From f3b850a7b52b5947eb694b5a1f73d0425de5bb0e Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 5 Jul 2011 19:42:35 +0500 Subject: bug #804305 Crash in wkb_get_double with ST_INTERSECTION. That crash happened with the complicated topology of the result. If we found a hole in a polygon whose outside border was already found, we need to paste the hole right after it and respectively shift polygons after it. Also we need to update poly_position fields in these polygons. That last thing wasn't properly done that led to the crash. To fix that we keep the list of the found polygons and update the poly_positions that are bigger or equal to where we placed the next hole. per-file comments: mysql-test/r/gis-precise.result bug #804305 Crash in wkb_get_double with ST_INTERSECTION. test result updated. mysql-test/t/gis-precise.test bug #804305 Crash in wkb_get_double with ST_INTERSECTION. test result added. sql/gcalc_tools.cc bug #804305 Crash in wkb_get_double with ST_INTERSECTION. keep the list of the found polygons and update their poly_position fields respectively. sql/gcalc_tools.h bug #804305 Crash in wkb_get_double with ST_INTERSECTION. Gcalc_result_receiver::move_hole interface changed. --- mysql-test/r/gis-precise.result | 14 ++++++++++++++ mysql-test/t/gis-precise.test | 9 +++++++++ 2 files changed, 23 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 4f07333e6a3..75028e484dd 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -218,3 +218,17 @@ Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), SELECT ST_INTERSECTION(NULL, NULL); ST_INTERSECTION(NULL, NULL) NULL +SELECT ASTEXT(ST_INTERSECTION( +MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)), + ((0 5,3 5,3 0,0 0,0 1,2 1,2 2,0 2,0 5), (1 3,2 3,2 4,1 4,1 3)), + ((2 2,5 2,4 4,2 8,2 2)))'), +MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 4,2 5,3 5)), + ((2 2,9 2,0 2,2 6,2 2)), + ((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), + ((9 9,6 8,7 0,9 9)))'))); +ASTEXT(ST_INTERSECTION( +MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)), + ((0 5,3 5,3 0,0 0,0 1,2 1,2 2,0 2,0 5), (1 3,2 3,2 4,1 4,1 3)), + ((2 2,5 2,4 4,2 8,2 2)))'), +MULTIPOLY +MULTIPOLYGON(((2 2,3 2,2 2)),((5 2,0 2,5 2)),((2 2,0 2,1.5 5,2 5,2 2),(1 3,1 4,2 4,2 3,1 3)),((2 2,2 8,8 8,8 2,5 2,2 2),(6 4,4 4,4 6,6 6,6 4))) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 72ba6b748be..87b56dc0040 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -121,3 +121,12 @@ SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 #bug 801212 Assertion with ST_INTERSECTION on NULL values SELECT ST_INTERSECTION(NULL, NULL); +#bug 804305 Crash in wkb_get_double with ST_INTERSECTION +SELECT ASTEXT(ST_INTERSECTION( + MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)), + ((0 5,3 5,3 0,0 0,0 1,2 1,2 2,0 2,0 5), (1 3,2 3,2 4,1 4,1 3)), + ((2 2,5 2,4 4,2 8,2 2)))'), + MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((3 5,2 4,2 5,3 5)), + ((2 2,9 2,0 2,2 6,2 2)), + ((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), + ((9 9,6 8,7 0,9 9)))'))); -- cgit v1.2.1 From 13f6e1119f831ecde5a8e82e8a68f2848b2b54a1 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 7 Jul 2011 16:59:45 +0500 Subject: Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection There were actually two bugs. One was when the line that intersects itself the intersection point treated as it doesn't belong to the line. Second when edges partly coincide, wrong result produced when we try to find their intersection. per-file comments: mysql-test/r/gis-precise.result Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection test result updated. mysql-test/t/gis-precise.test Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection test case added. sql/gcalc_slicescan.cc Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection skip the intersection if it just line that intersects itself. sql/gcalc_tools.cc Fix for bug #804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection if edges coincide, just pick the first coinciding poing as an intersection. --- mysql-test/r/gis-precise.result | 26 ++++++++++++++++++++++++++ mysql-test/t/gis-precise.test | 21 +++++++++++++++++++++ 2 files changed, 47 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 75028e484dd..4be2a093119 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -232,3 +232,29 @@ MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)) ((2 2,5 2,4 4,2 8,2 2)))'), MULTIPOLY MULTIPOLYGON(((2 2,3 2,2 2)),((5 2,0 2,5 2)),((2 2,0 2,1.5 5,2 5,2 2),(1 3,1 4,2 4,2 3,1 3)),((2 2,2 8,8 8,8 2,5 2,2 2),(6 4,4 4,4 6,6 6,6 4))) +SELECT ASTEXT(ST_UNION( +MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), + (8 2,1 3,9 0,4 4))'), +MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 5,6 7,9 7,5 2,1 6,3 6))'))); +ASTEXT(ST_UNION( +MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), + (8 2,1 3,9 0,4 4))'), +MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 5,6 7,9 7,5 2,1 6,3 6))'))) +MULTILINESTRING((8 2,1 3,9 0,4 4),(5 0,2 9,8 4,3 7,0 7,3 9,6 4,4 3,3 6,3 5,4 0,6 2),(3 6,1 6,5 2,9 7,6 7,2 5)) +SELECT ST_NUMGEOMETRIES((ST_UNION(ST_UNION( +MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), + (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), + (7 8,3 1,0 9,6 0,4 8), + (9 3,0 4,5 9,6 4), + (8 2,1 3,9 0,4 4))'), +MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 0,9 3,2 5,3 6,3 2), + (2 5,6 7,9 7,5 2,1 6,3 6))')), +MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((7 7,3 7,3 1,7 8,7 7)), + ((3 5,2 4,2 5,3 5)), + ((7 7,8 7,3 7,7 7,7 7)), + ((0 5,3 5,3 4,1 4,1 3,3 3,3 0,0 0,0 5), (1 1,2 1,2 2,1 2,1 1)))')))); +ST_NUMGEOMETRIES((ST_UNION(ST_UNION( +MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), + (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), + +32 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 87b56dc0040..117daa275ee 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -130,3 +130,24 @@ SELECT ASTEXT(ST_INTERSECTION( ((2 2,9 2,0 2,2 6,2 2)), ((2 2,2 8,8 8,8 2,2 2), (4 4,4 6,6 6,6 4,4 4)), ((9 9,6 8,7 0,9 9)))'))); + +#bug 804324 Assertion 0 in Gcalc_scan_iterator::pop_suitable_intersection + +SELECT ASTEXT(ST_UNION( + MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), + (8 2,1 3,9 0,4 4))'), + MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 5,6 7,9 7,5 2,1 6,3 6))'))); + +SELECT ST_NUMGEOMETRIES((ST_UNION(ST_UNION( + MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), + (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), + (7 8,3 1,0 9,6 0,4 8), + (9 3,0 4,5 9,6 4), + (8 2,1 3,9 0,4 4))'), + MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 0,9 3,2 5,3 6,3 2), + (2 5,6 7,9 7,5 2,1 6,3 6))')), + MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((7 7,3 7,3 1,7 8,7 7)), + ((3 5,2 4,2 5,3 5)), + ((7 7,8 7,3 7,7 7,7 7)), + ((0 5,3 5,3 4,1 4,1 3,3 3,3 0,0 0,0 5), (1 1,2 1,2 2,1 2,1 1)))')))); + -- cgit v1.2.1 From e182ae27cd11548feeb59306799aea3c342e8af9 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 7 Jul 2011 21:30:51 +0500 Subject: Fix for bug #805860 Second assertion Assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos. Just typo-style mistake. Should be '||' instead of '&&'. per-file comments: mysql-test/r/gis-precise.result Fix for bug #805860 Second assertion Assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos. test result updated. mysql-test/t/gis-precise.test Fix for bug #805860 Second assertion Assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos. test case added. sql/item_geofunc.cc Fix for bug #805860 Second assertion Assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos. condition fixed. --- mysql-test/r/gis-precise.result | 11 +++++++++-- mysql-test/t/gis-precise.test | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 4be2a093119..42cc2758a03 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -160,11 +160,11 @@ insert into t1 values (geomfromtext('POLYGON((0 0, 10 10, 0 8, 0 0))')); insert into t1 values (geomfromtext('POLYGON((1 1, 10 10, 0 8, 1 1))')); select astext(geom), area(geom),area(ST_buffer(geom,2)) from t1; astext(geom) area(geom) area(ST_buffer(geom,2)) -POLYGON((0 0,10 10,0 8,0 0)) 40 101.671508403749 +POLYGON((0 0,10 10,0 8,0 0)) 40 117.241676395915 POLYGON((1 1,10 10,0 8,1 1)) 36 108.555395892665 select astext(ST_buffer(geom,2)) from t1; astext(ST_buffer(geom,2)) -POLYGON((1.41421356237309 -1.41421356237309,-1.41421356237309 1.41421356237309,0 2.82842712474619,0 6.00005026122218,-0.0960457772985613 6.00230752900675,-0.193952209526528 6.00942657999767,-0.29139139389354 6.02134109671101,-0.388128590869789 6.03802237603243,-0.483930752074584 6.05943023129893,-0.578567081710303 6.08551308911207,-0.671809592569691 6.11620811358278,-0.763433655277008 6.15144135770856,-0.853218539439872 6.19112794151823,-0.940947945408108 6.23517225655526,-1.02641052535855 6.2834681962069,-1.10940039245046 6.33589941132431,-1.18971761682496 6.39233959051784,-1.26716870725357 6.45265276445223,-1.34156707727553 6.51669363340867,-1.41273349470095 6.58430791732451,-1.48049651339678 6.65533272746751,-1.54469288631567 6.72959695884898,-1.6051679587723 6.80692170243074,-1.66177604102015 6.88712067613267,-1.71438075923078 6.97000067360251,-1.76285538403041 7.05536202966692,-1.80708313580201 7.14299910134239,-1.84695746601768 7.23270076324713,-1.88238231392335 7.32425091622068,-1.91327233795755 7.41742900792569,-1.93955312134675 7.5120105641778,-1.96116135138184 7.60776772972363,-1.978044971944 7.70446981716405,-1.99016330891247 7.8018838627003,-1.99748716815206 7.89977518736424,-1.99999890584435 7.99790796238047,-1.99769247099325 8.09604577729856,-1.99057342000233 8.19395220952653,-1.97865890328899 8.29139139389354,-1.96197762396757 8.38812859086979,-1.94056976870107 8.48393075207458,-1.91448691088793 8.5785670817103,-1.88379188641722 8.67180959256969,-1.84855864229144 8.76343365527701,-1.80887205848177 8.85321853943987,-1.76482774344474 8.94094794540811,-1.7165318037931 9.02641052535855,-1.66410058867569 9.10940039245046,-1.60766040948216 9.18971761682496,-1.54734723554777 9.26716870725357,-1.48330636659133 9.34156707727553,-1.41569208267549 9.41273349470094,-1.34466727253249 9.48049651339678,-1.27040304115102 9.54469288631567,-1.19307829756926 9.6051679587723,-1.11287932386733 9.66177604102015,-1.02999932639749 9.71438075923078,-0.944637970333077 9.76285538403041,-0.857000898657614 9.80708313580201,-0.767299236752872 9.84695746601768,-0.675749083779317 9.88238231392335,-0.582570992074307 9.91327233795755,-0.487989435822199 9.93955312134675,-0.392232270276368 9.96116135138184,-0.295530182835952 9.978044971944,-0.392232270276368 9.96116135138184,9.60776772972363 11.9611613513818,9.60981935596774 11.9615705608065,9.70653905108928 11.9783530199296,9.80396571934088 11.9903694533444,9.90186465134516 11.9975909124103,10 12,10.0981353486548 11.9975909124103,10.1960342806591 11.9903694533444,10.2934609489107 11.9783530199296,10.3901806440323 11.9615705608065,10.4859603598065 11.9400625063891,10.5805693545089 11.9138806714644,10.6737797067844 11.883088130366,10.7653668647302 11.8477590650226,10.8551101868606 11.8079785862469,10.942793473652 11.7638425286967,11.0282054883864 11.7154572200005,11.1111404660392 11.6629392246051,11.1913986089849 11.6064150629613,11.2687865683273 11.5460209067255,11.343117909694 11.4819022507099,11.4142135623731 11.4142135623731,11.4819022507099 11.343117909694,11.5460209067255 11.2687865683273,11.6064150629613 11.1913986089849,11.6629392246051 11.1111404660392,11.7154572200005 11.0282054883864,11.7638425286967 10.942793473652,11.8079785862469 10.8551101868606,11.8477590650226 10.7653668647302,11.883088130366 10.6737797067844,11.9138806714644 10.5805693545089,11.9400625063891 10.4859603598065,11.9615705608065 10.3901806440323,11.9783530199296 10.2934609489107,11.9903694533444 10.1960342806591,11.9975909124103 10.0981353486548,12 10,11.9975909124103 9.90186465134516,11.9903694533444 9.80396571934088,11.9783530199296 9.70653905108928,11.9615705608065 9.60981935596774,11.9400625063891 9.51403964019347,11.9138806714644 9.41943064549108,11.883088130366 9.32622029321556,11.8477590650226 9.23463313526982,11.8079785862469 9.14488981313944,11.7638425286967 9.057206526348,11.7154572200005 8.97179451161356,11.6629392246051 8.8888595339608,11.6064150629613 8.80860139101513,11.5460209067255 8.73121343167271,11.4819022507099 8.65688209030596,11.4142135623731 8.5857864376269,1.41421356237309 -1.41421356237309)) +POLYGON((0 -2,-0.098135348654836 -1.99759091241034,-0.196034280659121 -1.99036945334439,-0.293460948910724 -1.97835301992956,-0.390180644032257 -1.96157056080646,-0.485960359806528 -1.94006250638909,-0.580569354508925 -1.91388067146442,-0.67377970678444 -1.88308813036604,-0.76536686473018 -1.84775906502257,-0.855110186860564 -1.80797858624689,-0.942793473651995 -1.76384252869671,-1.02820548838644 -1.71545722000054,-1.1111404660392 -1.66293922460509,-1.19139860898487 -1.60641506296129,-1.26878656832729 -1.54602090672547,-1.34311790969404 -1.48190225070992,-1.41421356237309 -1.41421356237309,-1.48190225070992 -1.34311790969404,-1.54602090672547 -1.26878656832729,-1.60641506296129 -1.19139860898487,-1.66293922460509 -1.1111404660392,-1.71545722000054 -1.02820548838644,-1.76384252869671 -0.942793473651995,-1.80797858624689 -0.855110186860564,-1.84775906502257 -0.76536686473018,-1.88308813036604 -0.67377970678444,-1.91388067146442 -0.580569354508925,-1.94006250638909 -0.485960359806528,-1.96157056080646 -0.390180644032257,-1.97835301992956 -0.293460948910724,-1.99036945334439 -0.196034280659121,-1.99759091241034 -0.098135348654836,-2 0,-2 8,-1.99769247099325 8.09604577729856,-1.99057342000233 8.19395220952653,-1.97865890328899 8.29139139389354,-1.96197762396757 8.38812859086979,-1.94056976870107 8.48393075207458,-1.91448691088793 8.5785670817103,-1.88379188641722 8.67180959256969,-1.84855864229144 8.76343365527701,-1.80887205848177 8.85321853943987,-1.76482774344474 8.94094794540811,-1.7165318037931 9.02641052535855,-1.66410058867569 9.10940039245046,-1.60766040948216 9.18971761682496,-1.54734723554777 9.26716870725357,-1.48330636659133 9.34156707727553,-1.41569208267549 9.41273349470094,-1.34466727253249 9.48049651339678,-1.27040304115102 9.54469288631567,-1.19307829756926 9.6051679587723,-1.11287932386733 9.66177604102015,-1.02999932639749 9.71438075923078,-0.944637970333077 9.76285538403041,-0.857000898657614 9.80708313580201,-0.767299236752872 9.84695746601768,-0.675749083779317 9.88238231392335,-0.582570992074307 9.91327233795755,-0.487989435822199 9.93955312134675,-0.392232270276368 9.96116135138184,9.60776772972363 11.9611613513818,9.60981935596774 11.9615705608065,9.70653905108928 11.9783530199296,9.80396571934088 11.9903694533444,9.90186465134516 11.9975909124103,10 12,10.0981353486548 11.9975909124103,10.1960342806591 11.9903694533444,10.2934609489107 11.9783530199296,10.3901806440323 11.9615705608065,10.4859603598065 11.9400625063891,10.5805693545089 11.9138806714644,10.6737797067844 11.883088130366,10.7653668647302 11.8477590650226,10.8551101868606 11.8079785862469,10.942793473652 11.7638425286967,11.0282054883864 11.7154572200005,11.1111404660392 11.6629392246051,11.1913986089849 11.6064150629613,11.2687865683273 11.5460209067255,11.343117909694 11.4819022507099,11.4142135623731 11.4142135623731,11.4819022507099 11.343117909694,11.5460209067255 11.2687865683273,11.6064150629613 11.1913986089849,11.6629392246051 11.1111404660392,11.7154572200005 11.0282054883864,11.7638425286967 10.942793473652,11.8079785862469 10.8551101868606,11.8477590650226 10.7653668647302,11.883088130366 10.6737797067844,11.9138806714644 10.5805693545089,11.9400625063891 10.4859603598065,11.9615705608065 10.3901806440323,11.9783530199296 10.2934609489107,11.9903694533444 10.1960342806591,11.9975909124103 10.0981353486548,12 10,11.9975909124103 9.90186465134516,11.9903694533444 9.80396571934088,11.9783530199296 9.70653905108928,11.9615705608065 9.60981935596774,11.9400625063891 9.51403964019347,11.9138806714644 9.41943064549108,11.883088130366 9.32622029321556,11.8477590650226 9.23463313526982,11.8079785862469 9.14488981313944,11.7638425286967 9.057206526348,11.7154572200005 8.97179451161356,11.6629392246051 8.8888595339608,11.6064150629613 8.80860139101513,11.5460209067255 8.73121343167271,11.4819022507099 8.65688209030596,11.4142135623731 8.5857864376269,1.41421356237309 -1.41421356237309,1.34311790969404 -1.48190225070992,1.26878656832729 -1.54602090672547,1.19139860898487 -1.60641506296129,1.1111404660392 -1.66293922460509,1.02820548838644 -1.71545722000054,0.942793473651995 -1.76384252869671,0.855110186860564 -1.80797858624689,0.76536686473018 -1.84775906502257,0.67377970678444 -1.88308813036604,0.580569354508925 -1.91388067146442,0.485960359806528 -1.94006250638909,0.390180644032257 -1.96157056080646,0.293460948910724 -1.97835301992956,0.196034280659121 -1.99036945334439,0.098135348654836 -1.99759091241034,0 -2)) POLYGON((0.989269849411119 -0.999971215759952,0.891148838068309 -0.997035659307595,0.793290058708828 -0.989289069032301,0.69592926170357 -0.976750107148565,0.599300997740319 -0.959448981113848,0.503638052770599 -0.937427370856167,0.409170887207927 -0.910738328363497,0.316127080728489 -0.879446149876889,0.22473078401177 -0.843626220995187,0.135202178741929 -0.803364835064523,0.0477569471708416 -0.758758985290084,-0.0373942474793394 -0.709916131070988,-0.120046268522338 -0.656953939121177,-0.2 -0.6,-0.277062826370076 -0.539191520735374,-0.351049096533933 -0.474674994280042,-0.421780571086316 -0.406605846597216,-0.489086851709682 -0.335148062225815,-0.552805791678675 -0.260473789227354,-0.61278388648579 -0.182762924466179,-0.668876643647177 -0.102202680222169,-0.720948930797688 -0.0189871331799512,-0.768875301236584 0.0666832431188291,-0.812540296139623 0.154602061233829,-0.851838722709481 0.244557517031431,-0.886675907594418 0.33633289993945,-0.916967924964667 0.429707115021888,-0.942641798697117 0.524455215615996,-0.963635678181181 0.620348945248487,-0.979898987322333 0.717157287525381,-1.97989898732233 7.71715728752538,-1.99016330891247 7.8018838627003,-1.99748716815206 7.89977518736424,-1.99999890584435 7.99790796238047,-1.99769247099325 8.09604577729856,-1.99057342000233 8.19395220952653,-1.97865890328899 8.29139139389354,-1.96197762396757 8.38812859086979,-1.94056976870107 8.48393075207458,-1.91448691088793 8.5785670817103,-1.88379188641722 8.67180959256969,-1.84855864229144 8.76343365527701,-1.80887205848177 8.85321853943987,-1.76482774344474 8.94094794540811,-1.7165318037931 9.02641052535855,-1.66410058867569 9.10940039245046,-1.60766040948216 9.18971761682496,-1.54734723554777 9.26716870725357,-1.48330636659133 9.34156707727553,-1.41569208267549 9.41273349470094,-1.34466727253249 9.48049651339678,-1.27040304115102 9.54469288631567,-1.19307829756926 9.6051679587723,-1.11287932386733 9.66177604102015,-1.02999932639749 9.71438075923078,-0.944637970333077 9.76285538403041,-0.857000898657614 9.80708313580201,-0.767299236752872 9.84695746601768,-0.675749083779317 9.88238231392335,-0.582570992074307 9.91327233795755,-0.487989435822199 9.93955312134675,-0.392232270276368 9.96116135138184,9.60776772972363 11.9611613513818,9.60981935596774 11.9615705608065,9.70653905108928 11.9783530199296,9.80396571934088 11.9903694533444,9.90186465134516 11.9975909124103,10 12,10.0981353486548 11.9975909124103,10.1960342806591 11.9903694533444,10.2934609489107 11.9783530199296,10.3901806440323 11.9615705608065,10.4859603598065 11.9400625063891,10.5805693545089 11.9138806714644,10.6737797067844 11.883088130366,10.7653668647302 11.8477590650226,10.8551101868606 11.8079785862469,10.942793473652 11.7638425286967,11.0282054883864 11.7154572200005,11.1111404660392 11.6629392246051,11.1913986089849 11.6064150629613,11.2687865683273 11.5460209067255,11.343117909694 11.4819022507099,11.4142135623731 11.4142135623731,11.4819022507099 11.343117909694,11.5460209067255 11.2687865683273,11.6064150629613 11.1913986089849,11.6629392246051 11.1111404660392,11.7154572200005 11.0282054883864,11.7638425286967 10.942793473652,11.8079785862469 10.8551101868606,11.8477590650226 10.7653668647302,11.883088130366 10.6737797067844,11.9138806714644 10.5805693545089,11.9400625063891 10.4859603598065,11.9615705608065 10.3901806440323,11.9783530199296 10.2934609489107,11.9903694533444 10.1960342806591,11.9975909124103 10.0981353486548,12 10,11.9975909124103 9.90186465134516,11.9903694533444 9.80396571934088,11.9783530199296 9.70653905108928,11.9615705608065 9.60981935596774,11.9400625063891 9.51403964019347,11.9138806714644 9.41943064549108,11.883088130366 9.32622029321556,11.8477590650226 9.23463313526982,11.8079785862469 9.14488981313944,11.7638425286967 9.057206526348,11.7154572200005 8.97179451161356,11.6629392246051 8.8888595339608,11.6064150629613 8.80860139101513,11.5460209067255 8.73121343167271,11.4819022507099 8.65688209030596,11.4142135623731 8.5857864376269,2.41421356237309 -0.414213562373095,2.40660584659722 -0.421780571086316,2.33514806222581 -0.489086851709682,2.26047378922735 -0.552805791678675,2.18276292446618 -0.61278388648579,2.10220268022217 -0.668876643647177,2.01898713317995 -0.720948930797688,1.93331675688117 -0.768875301236584,1.84539793876617 -0.812540296139623,1.75544248296857 -0.851838722709481,1.66366710006055 -0.886675907594418,1.57029288497811 -0.916967924964667,1.475544784384 -0.942641798697117,1.37965105475151 -0.963635678181181,1.28284271247462 -0.979898987322333,1.18535297732928 -0.991392546384357,1.08741671062655 -0.998088666376754,0.989269849411119 -0.999971215759952)) set @geom=geomfromtext('LINESTRING(2 1, 4 2, 2 3, 2 5)'); set @buff=ST_buffer(@geom,1); @@ -258,3 +258,10 @@ MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), 32 +SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( +POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), +POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); +Round(ST_AREA(ST_BUFFER( ST_UNION( +POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), +POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6) +21.901403 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 117daa275ee..8e3bc73849f 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -151,3 +151,8 @@ SELECT ST_NUMGEOMETRIES((ST_UNION(ST_UNION( ((7 7,8 7,3 7,7 7,7 7)), ((0 5,3 5,3 4,1 4,1 3,3 3,3 0,0 0,0 5), (1 1,2 1,2 2,1 2,1 1)))')))); +#bug #805860 Second assertion Assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sinco + +SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( + POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), + POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); -- cgit v1.2.1 From 67e937095cec8aa922ff3ea971204d59ee3047ff Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 8 Jul 2011 15:38:15 +0500 Subject: Fix for bug #804259 Second assertion in Gis_geometry_collection::init_from_opresult. A polygon has no right to have holes that are actually points. So just skip them when we collect the result of an operation. per-file comments: mysql-test/r/gis-precise.result Fix for bug #804259 Second assertion in Gis_geometry_collection::init_from_opresult. test result updated. mysql-test/t/gis-precise.test Fix for bug #804259 Second assertion in Gis_geometry_collection::init_from_opresult. test case added. sql/gcalc_tools.cc Fix for bug #804259 Second assertion in Gis_geometry_collection::init_from_opresult. Skip the point in the result if it's the hole inside a polygon. --- mysql-test/r/gis-precise.result | 14 ++++++++++++++ mysql-test/t/gis-precise.test | 12 ++++++++++++ 2 files changed, 26 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 42cc2758a03..98d081f48e3 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -265,3 +265,17 @@ Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6) 21.901403 +SELECT AsText(ST_UNION(MultiPolygonFromText(' + MULTIPOLYGON(((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)), + ((0 0, 8 3, 7 4, 0 0)), + ((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)))'), +MultiPolygonFromText(' MULTIPOLYGON(((0 0, 1 9, 4 6, 0 0)), + ((0 5, 3 5, 3 4, 1 4, 1 3, 3 3, 3 0, 0 0, 0 5), (1 1, 2 1, 2 2, 1 2, 1 1)), + ((7 7, 4 7, 6 3, 7 2, 7 7)), + ((0 5, 3 5, 3 4, 1 4, 1 3, 3 3, 3 0, 0 0, 0 5), (1 1, 2 1, 2 2, 1 2, 1 1))) '))); +AsText(ST_UNION(MultiPolygonFromText(' + MULTIPOLYGON(((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)), + ((0 0, 8 3, 7 4, 0 0)), + ((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)))'), +MultiPolygonFr +POLYGON((0 0,0 5,0.555555555555556 5,1 9,2 8,8 8,8 2,7 2,5.33333333333333 2,3 1.125,3 0,0 0),(1 1,1 1.5,1.33333333333333 2,1 2,2 2,2 1.14285714285714,1.75 1,1 1),(3 1.71428571428571,3 2,3.5 2,3 1.71428571428571),(4 4,4 6,4.5 6,5.5 4,4 4)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 8e3bc73849f..30445219d90 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -156,3 +156,15 @@ SELECT ST_NUMGEOMETRIES((ST_UNION(ST_UNION( SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); + + +#buf #804259 Second assertion in Gis_geometry_collection::init_from_opresult + +SELECT AsText(ST_UNION(MultiPolygonFromText(' + MULTIPOLYGON(((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)), + ((0 0, 8 3, 7 4, 0 0)), + ((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)))'), +MultiPolygonFromText(' MULTIPOLYGON(((0 0, 1 9, 4 6, 0 0)), + ((0 5, 3 5, 3 4, 1 4, 1 3, 3 3, 3 0, 0 0, 0 5), (1 1, 2 1, 2 2, 1 2, 1 1)), + ((7 7, 4 7, 6 3, 7 2, 7 7)), + ((0 5, 3 5, 3 4, 1 4, 1 3, 3 3, 3 0, 0 0, 0 5), (1 1, 2 1, 2 2, 1 2, 1 1))) '))); -- cgit v1.2.1 From e7c9f52fd960440614c30c3f852bf74f1febe6b3 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 12 Jul 2011 11:21:20 +0500 Subject: Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple. We cannot cut a line from a polygon. So if the polygon fits the condition, and the intersection of a line and the polygon doesn't, we just skip the line. That rule wasn't applied if the line start was inside the polygon, which leaded to the assertion. per-file comments: mysql-test/r/gis-precise.result Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple. test result updated. mysql-test/t/gis-precise.test Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple. test case added. sql/gcalc_tools.cc Fix for bug #801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple. Don't mark the line as a border if it's inside a polygon that fits the result condition. --- mysql-test/r/gis-precise.result | 9 +++++++++ mysql-test/t/gis-precise.test | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 98d081f48e3..d943a534137 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -279,3 +279,12 @@ AsText(ST_UNION(MultiPolygonFromText(' ((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)))'), MultiPolygonFr POLYGON((0 0,0 5,0.555555555555556 5,1 9,2 8,8 8,8 2,7 2,5.33333333333333 2,3 1.125,3 0,0 0),(1 1,1 1.5,1.33333333333333 2,1 2,2 2,2 1.14285714285714,1.75 1,1 1),(3 1.71428571428571,3 2,3.5 2,3 1.71428571428571),(4 4,4 6,4.5 6,5.5 4,4 4)) +SELECT AsText(ST_SYMDIFFERENCE( +MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7), + (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), +Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)')))); +AsText(ST_SYMDIFFERENCE( +MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7), + (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), +Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)')))) +GEOMETRYCOLLECTION(LINESTRING(9 9,8 4,9 0,9 9,7 7),POLYGON((0 0,0 9,7 9,7 0,0 0)),LINESTRING(7 5.28571428571429,8 5,7 8)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 30445219d90..bf36e6e9628 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -158,7 +158,7 @@ SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); -#buf #804259 Second assertion in Gis_geometry_collection::init_from_opresult +#bug #804259 Second assertion in Gis_geometry_collection::init_from_opresult SELECT AsText(ST_UNION(MultiPolygonFromText(' MULTIPOLYGON(((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)), @@ -168,3 +168,12 @@ MultiPolygonFromText(' MULTIPOLYGON(((0 0, 1 9, 4 6, 0 0)), ((0 5, 3 5, 3 4, 1 4, 1 3, 3 3, 3 0, 0 0, 0 5), (1 1, 2 1, 2 2, 1 2, 1 1)), ((7 7, 4 7, 6 3, 7 2, 7 7)), ((0 5, 3 5, 3 4, 1 4, 1 3, 3 3, 3 0, 0 0, 0 5), (1 1, 2 1, 2 2, 1 2, 1 1))) '))); + + +#bug 801217 Assertion `t1->result_range' in Gcalc_operation_reducer::end_couple + +SELECT AsText(ST_SYMDIFFERENCE( + MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7), + (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), + Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)')))); + -- cgit v1.2.1 From 90c4df7a4af542707d884e53990827672bb8feea Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 13 Jul 2011 14:57:27 +0500 Subject: Fix for bug #804266 Memory corruption/valgrind warning/crash in move_hole() with ST_UNION. Second smaller hole in the polygon got link to the bigger one as it's the outer ring. Fixed by specifying the outer ring explicitly. per-file comments: mysql-test/r/gis-precise.result Fix for bug #804266 Memory corruption/valgrind warning/crash in move_hole() with ST_UNION. test result updated. mysql-test/t/gis-precise.test Fix for bug #804266 Memory corruption/valgrind warning/crash in move_hole() with ST_UNION. test case added. sql/gcalc_tools.cc Fix for bug #804266 Memory corruption/valgrind warning/crash in move_hole() with ST_UNION. specify the outer ring explicitly in the get_polygon_result parameter. sql/gcalc_tools.h Fix for bug #804266 Memory corruption/valgrind warning/crash in move_hole() with ST_UNION. add the outer ring as a parameter to the get_polygon_result. --- mysql-test/r/gis-precise.result | 13 +++++++++++++ mysql-test/t/gis-precise.test | 10 ++++++++++ 2 files changed, 23 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index d943a534137..dd27470ab5d 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -288,3 +288,16 @@ MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7), (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)')))) GEOMETRYCOLLECTION(LINESTRING(9 9,8 4,9 0,9 9,7 7),POLYGON((0 0,0 9,7 9,7 0,0 0)),LINESTRING(7 5.28571428571429,8 5,7 8)) +SELECT AsText(ST_UNION( +MultiPolygonFromText('MULTIPOLYGON(((9 9, 7 9, 1 1, 9 9)), + ((2 2, 1 2, 3 3, 2 2, 2 2)), + ((0 0, 7 5, 9 6, 0 0)), + ((7 7, 5 7, 1 5, 7 1, 7 7)))'), +MultiPolygonFromText('MULTIPOLYGON(((2 2, 2 2, 1 5, 2 7, 2 2)), + ((0 5, 3 5, 3 0, 0 0, 0 5), (1 1, 2 1, 2 4, 1 4, 1 1)))'))); +AsText(ST_UNION( +MultiPolygonFromText('MULTIPOLYGON(((9 9, 7 9, 1 1, 9 9)), + ((2 2, 1 2, 3 3, 2 2, 2 2)), + ((0 0, 7 5, 9 6, 0 0)), + +POLYGON((0 0,0 5,1 5,2 7,2 5.5,5 7,5.5 7,7 9,9 9,7 7,7 5,9 6,7 4.66666666666667,7 1,4.25 2.83333333333333,3 2,3 0,0 0),(1 1,1 4,1.33333333333333 4,1.85714285714286 2.42857142857143,1 2,1.75 2,1 1,2 2,2 1.42857142857143,1.4 1,1 1),(1.5 1,2 1.33333333333333,2 1,1.5 1),(3 2.14285714285714,3 3,3.4 3.4,4.10344827586207 2.93103448275862,3 2.14285714285714)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index bf36e6e9628..bb223b685e4 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -177,3 +177,13 @@ SELECT AsText(ST_SYMDIFFERENCE( (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)')))); +#bug 804266 Memory corruption/valgrind warning/crash in move_hole() with ST_UNION + +SELECT AsText(ST_UNION( + MultiPolygonFromText('MULTIPOLYGON(((9 9, 7 9, 1 1, 9 9)), + ((2 2, 1 2, 3 3, 2 2, 2 2)), + ((0 0, 7 5, 9 6, 0 0)), + ((7 7, 5 7, 1 5, 7 1, 7 7)))'), + MultiPolygonFromText('MULTIPOLYGON(((2 2, 2 2, 1 5, 2 7, 2 2)), + ((0 5, 3 5, 3 0, 0 0, 0 5), (1 1, 2 1, 2 4, 1 4, 1 1)))'))); + -- cgit v1.2.1 From 152f3c5e28fe2ae3fd950f15bb3de7064500ced5 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 1 Sep 2011 11:44:56 +0500 Subject: PostGIS-style 'same point' handling. --- mysql-test/r/archive_gis.result | 10 +- mysql-test/r/gis-precise.result | 26 +-- mysql-test/r/gis-rtree.result | 1 + mysql-test/r/gis.result | 12 +- mysql-test/suite/innodb/r/innodb_gis.result | 10 +- mysql-test/suite/innodb_plugin/r/innodb_gis.result | 10 +- .../suite/maria/r/maria-gis-rtree-dynamic.result | 201 +++++++++++---------- .../suite/maria/r/maria-gis-rtree-trans.result | 201 +++++++++++---------- mysql-test/suite/maria/r/maria-gis-rtree.result | 201 +++++++++++---------- 9 files changed, 342 insertions(+), 330 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result index e4cf705a76f..7f1715ab093 100644 --- a/mysql-test/r/archive_gis.result +++ b/mysql-test/r/archive_gis.result @@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r -120 120 0 0 0 1 0 1 1 0 +120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 -121 121 0 0 0 1 0 1 1 0 +121 121 1 1 0 1 0 1 1 1 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -494,12 +494,13 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; contains +center,small SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; disjoint down3,left3,right3,up3 @@ -514,9 +515,10 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within +big,center SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index dd27470ab5d..80d44da6cbf 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -79,7 +79,7 @@ select 1, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText(' 1 1 select 0, ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)')); 0 ST_Intersects(GeomFromText('LINESTRING(15 15, 50 50)'), GeomFromText('LINESTRING(16 16, 51 51)')) -0 0 +0 1 select 1, ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')); 1 ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POLYGON((50 5, 55 10, 0 45, 50 5))')) 1 1 @@ -127,10 +127,10 @@ astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFr POLYGON((26.4705882352941 23.8235294117647,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337,29.2899408284024 26.3609467455621,26.4705882352941 23.8235294117647)) select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))); astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))) -MULTIPOINT(26.4705882352941 23.8235294117647,29.2899408284024 26.3609467455621,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337) +MULTIPOINT(23.8235294117647 26.4705882352941,26.3609467455621 29.2899408284024,27.4390243902439 21.9512195121951,29.8192771084337 23.855421686747) select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))); astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))) -POINT(29.2899408284024 26.3609467455621) +POINT(26.3609467455621 29.2899408284024) select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))); astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))) POINT(20 20) @@ -148,7 +148,7 @@ astext(ST_intersection(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromte POLYGON((0 0,0 1,0.5 0.5,0 0)) select astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))); astext(ST_symdifference(geomfromtext('polygon((0 0, 1 0, 0 1, 0 0))'), geomfromtext('polygon((0 0, 1 1, 0 2, 0 0))'))) -MULTIPOLYGON(((0 0,0 1,0 0,0.5 0.5,1 0,0 0)),((0.5 0.5,0 1,0 2,1 1,0.5 0.5))) +MULTIPOLYGON(((0 0,0.5 0.5,1 0,0 0)),((0.5 0.5,0 1,0 2,1 1,0.5 0.5))) select astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))); astext(ST_UNION(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('LINESTRING(-10 -10, 200 200, 199 201, -11 -9)'))) GEOMETRYCOLLECTION(LINESTRING(-10 -10,0 0),LINESTRING(-11 -9,8 10),POLYGON((0 0,40 50,50 45,0 0)),LINESTRING(46.6666666666667 46.6666666666667,200 200,199 201,45.3333333333333 47.3333333333333)) @@ -189,7 +189,7 @@ st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')) -0 +1 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')) 1 @@ -208,13 +208,13 @@ ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0, astext(ST_UNION ( PolyFromText('POLYGON(( 2 2 ,3 2,2 7,2 2),( 0 0,8 2,1 9,0 0))'), ExteriorRing( Envelope( MultiLineStringFromText('MULTILINESTRING((3 4,5 3),(3 0,0 5))'))))) -GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0 0,5 0,5 1.25),LINESTRING(0 0,0 5,0.555555555555556 5),LINESTRING(2.4 5,2 5)) +GEOMETRYCOLLECTION(POLYGON((0 0,1 9,8 2,0 0),(2 2,2 7,3 2,2 2)),LINESTRING(0.555555555555556 5,0 5,0 0,5 0,5 1.25),LINESTRING(2 5,2.4 5)) SELECT astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)); astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)) LINESTRING(0 0,1 1) SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5) -78.68426 +78.68303 SELECT ST_INTERSECTION(NULL, NULL); ST_INTERSECTION(NULL, NULL) NULL @@ -231,7 +231,7 @@ MULTIPOLYGONFROMTEXT('MULTIPOLYGON(((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)) ((0 5,3 5,3 0,0 0,0 1,2 1,2 2,0 2,0 5), (1 3,2 3,2 4,1 4,1 3)), ((2 2,5 2,4 4,2 8,2 2)))'), MULTIPOLY -MULTIPOLYGON(((2 2,3 2,2 2)),((5 2,0 2,5 2)),((2 2,0 2,1.5 5,2 5,2 2),(1 3,1 4,2 4,2 3,1 3)),((2 2,2 8,8 8,8 2,5 2,2 2),(6 4,4 4,4 6,6 6,6 4))) +POLYGON((0 2,1 4,1 3,2 3,2 4,1 4,1.5 5,2 5,2 8,8 8,8 2,0 2),(4 4,4 6,6 6,6 4,4 4)) SELECT ASTEXT(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), (8 2,1 3,9 0,4 4))'), @@ -240,7 +240,7 @@ ASTEXT(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), (8 2,1 3,9 0,4 4))'), MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 5,6 7,9 7,5 2,1 6,3 6))'))) -MULTILINESTRING((8 2,1 3,9 0,4 4),(5 0,2 9,8 4,3 7,0 7,3 9,6 4,4 3,3 6,3 5,4 0,6 2),(3 6,1 6,5 2,9 7,6 7,2 5)) +MULTILINESTRING((3.59459459459459 2.02702702702703,4 0,4.75 0.75),(5 0,4.75 0.75),(5.36363636363636 1.36363636363636,9 0,6.17391304347826 2.26086956521739),(4.75 0.75,4.42857142857143 1.71428571428571),(4.75 0.75,5.36363636363636 1.36363636363636),(5.36363636363636 1.36363636363636,4.42857142857143 1.71428571428571),(5.36363636363636 1.36363636363636,6 2),(4.42857142857143 1.71428571428571,3.59459459459459 2.02702702702703),(4.42857142857143 1.71428571428571,4.15 2.55),(4.5 2.5,5 2,5.30769230769231 2.38461538461538),(8 2,6.17391304347826 2.26086956521739),(3.59459459459459 2.02702702702703,1 3,3.47058823529412 2.64705882352941),(3.59459459459459 2.02702702702703,3.47058823529412 2.64705882352941),(6.17391304347826 2.26086956521739,5.30769230769231 2.38461538461538),(6.17391304347826 2.26086956521739,5.58536585365854 2.73170731707317),(5.30769230769231 2.38461538461538,4.5 2.5),(5.30769230769231 2.38461538461538,5.58536585365854 2.73170731707317),(4.5 2.5,4.15 2.55),(4.5 2.5,4 3),(4.15 2.55,3.47058823529412 2.64705882352941),(4.15 2.55,4 3),(3.47058823529412 2.64705882352941,3.25 3.75),(5.58536585365854 2.73170731707317,4.76923076923077 3.38461538461538),(5.58536585365854 2.73170731707317,7.05405405405405 4.56756756756757),(4 3,3.25 3.75),(4 3,3.14285714285714 5.57142857142857),(4 3,4.76923076923077 3.38461538461538),(4.76923076923077 3.38461538461538,4 4),(4.76923076923077 3.38461538461538,6 4,4.875 5.875),(3.25 3.75,2 5),(3.25 3.75,3 5,3 5.5),(7.05405405405405 4.56756756756757,8 4,7.16 4.7),(7.05405405405405 4.56756756756757,4.875 5.875),(7.05405405405405 4.56756756756757,7.16 4.7),(7.16 4.7,5 6.5),(7.16 4.7,9 7,6 7,5 6.5),(2 5,1 6,3 6),(2 5,3 5.5),(3 5.5,3 6),(3 5.5,3.14285714285714 5.57142857142857),(3.14285714285714 5.57142857142857,3 6),(3.14285714285714 5.57142857142857,4.36363636363636 6.18181818181818),(4.875 5.875,4.36363636363636 6.18181818181818),(4.875 5.875,4.61538461538461 6.30769230769231),(3 6,2.66666666666667 7),(4.36363636363636 6.18181818181818,3 7,2.66666666666667 7),(4.36363636363636 6.18181818181818,4.61538461538461 6.30769230769231),(4.61538461538461 6.30769230769231,4 7.33333333333333),(4.61538461538461 6.30769230769231,5 6.5),(5 6.5,4 7.33333333333333),(2.18181818181818 8.45454545454546,0 7,2.66666666666667 7),(2.66666666666667 7,2.18181818181818 8.45454545454546),(4 7.33333333333333,2.44444444444444 8.62962962962963),(4 7.33333333333333,3 9,2.44444444444444 8.62962962962963),(2.18181818181818 8.45454545454546,2 9,2.44444444444444 8.62962962962963),(2.18181818181818 8.45454545454546,2.44444444444444 8.62962962962963)) SELECT ST_NUMGEOMETRIES((ST_UNION(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), @@ -257,14 +257,14 @@ ST_NUMGEOMETRIES((ST_UNION(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), -32 +183 SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6) -21.901403 +21.901344 SELECT AsText(ST_UNION(MultiPolygonFromText(' MULTIPOLYGON(((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)), ((0 0, 8 3, 7 4, 0 0)), @@ -278,7 +278,7 @@ AsText(ST_UNION(MultiPolygonFromText(' ((0 0, 8 3, 7 4, 0 0)), ((2 2, 2 8, 8 8, 8 2, 2 2), (4 4, 4 6, 6 6, 6 4, 4 4)))'), MultiPolygonFr -POLYGON((0 0,0 5,0.555555555555556 5,1 9,2 8,8 8,8 2,7 2,5.33333333333333 2,3 1.125,3 0,0 0),(1 1,1 1.5,1.33333333333333 2,1 2,2 2,2 1.14285714285714,1.75 1,1 1),(3 1.71428571428571,3 2,3.5 2,3 1.71428571428571),(4 4,4 6,4.5 6,5.5 4,4 4)) +POLYGON((0 0,0 5,0.555555555555556 5,1 9,2 8,8 8,8 2,5.33333333333333 2,3 1.125,3 0,0 0),(1 1,1 1.5,1.33333333333333 2,2 2,2 1.14285714285714,1.75 1,1 1),(3 1.71428571428571,3 2,3.5 2,3 1.71428571428571),(4 4,4 6,4.5 6,5.5 4,4 4)) SELECT AsText(ST_SYMDIFFERENCE( MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7), (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), @@ -287,7 +287,7 @@ AsText(ST_SYMDIFFERENCE( MultiLineStringFromText('MULTILINESTRING((7 7, 1 7, 8 5, 7 8, 7 7), (6 3, 3 4, 1 1, 9 9, 9 0, 8 4, 9 9))'), Envelope(GeometryFromText('MULTIPOINT(7 9, 0 0, 3 7, 1 6, 0 0)')))) -GEOMETRYCOLLECTION(LINESTRING(9 9,8 4,9 0,9 9,7 7),POLYGON((0 0,0 9,7 9,7 0,0 0)),LINESTRING(7 5.28571428571429,8 5,7 8)) +GEOMETRYCOLLECTION(POLYGON((0 0,0 9,7 9,7 0,0 0)),LINESTRING(9 9,8 4,9 0,9 9),LINESTRING(7 5.28571428571429,8 5,7.25 7.25),LINESTRING(7 7,7.25 7.25),LINESTRING(7.25 7.25,7 8),LINESTRING(7.25 7.25,9 9)) SELECT AsText(ST_UNION( MultiPolygonFromText('MULTIPOLYGON(((9 9, 7 9, 1 1, 9 9)), ((2 2, 1 2, 3 3, 2 2, 2 2)), diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 31e79a52b49..d3133389321 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -170,6 +170,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range g g 34 NULL 8 Using where SELECT fid, AsText(g) FROM t1 WHERE Within(g, GeomFromText('Polygon((140 140,160 140,160 160,140 160,140 140))')); fid AsText(g) +11 LINESTRING(140 140,160 160) DROP TABLE t1; CREATE TABLE t2 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index d30431e5419..8dabc431e8f 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -384,10 +384,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r -120 120 0 0 0 1 0 1 1 0 +120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 -121 121 0 0 0 1 0 1 1 0 +121 121 1 1 0 1 0 1 1 1 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -835,12 +835,13 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; contains +center,small SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; disjoint down3,left3,right3,up3 @@ -855,9 +856,10 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within +big,center SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); @@ -1410,7 +1412,7 @@ FROM lakes, named_places WHERE lakes.name = 'Blue Lake' AND named_places.name = 'Ashton'; AsText(ST_SymDifference(shore, boundary)) -MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(67 13,59 13,59 18,67 18,67 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) +MULTIPOLYGON(((48 6,52 18,66 23,73 9,48 6),(59 13,59 18,67 18,67 13,59 13)),((56 30,56 34,62 48,84 48,84 30,56 30))) # Conformance Item T51 SELECT count(*) FROM buildings, bridges diff --git a/mysql-test/suite/innodb/r/innodb_gis.result b/mysql-test/suite/innodb/r/innodb_gis.result index 57d61bbd586..710c403e9a0 100644 --- a/mysql-test/suite/innodb/r/innodb_gis.result +++ b/mysql-test/suite/innodb/r/innodb_gis.result @@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r -120 120 0 0 0 1 0 1 1 0 +120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 -121 121 0 0 0 1 0 1 1 0 +121 121 1 1 0 1 0 1 1 1 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -494,12 +494,13 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; contains +center,small SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; disjoint down3,left3,right3,up3 @@ -514,9 +515,10 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within +big,center SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); diff --git a/mysql-test/suite/innodb_plugin/r/innodb_gis.result b/mysql-test/suite/innodb_plugin/r/innodb_gis.result index 57d61bbd586..710c403e9a0 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb_gis.result +++ b/mysql-test/suite/innodb_plugin/r/innodb_gis.result @@ -392,10 +392,10 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r -120 120 0 0 0 1 0 1 1 0 +120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 121 120 0 0 1 0 0 0 1 0 -121 121 0 0 0 1 0 1 1 0 +121 121 1 1 0 1 0 1 1 1 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -494,12 +494,13 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS contains FROM t1 a1 JOIN t1 a2 ON Contains( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; contains +center,small SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS disjoint FROM t1 a1 JOIN t1 a2 ON Disjoint( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; disjoint down3,left3,right3,up3 @@ -514,9 +515,10 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -down2,left2,right2,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within +big,center SET @vert1 = GeomFromText('POLYGON ((0 -2, 0 2, 0 -2))'); SET @horiz1 = GeomFromText('POLYGON ((-2 0, 2 0, -2 0))'); SET @horiz2 = GeomFromText('POLYGON ((-1 0, 3 0, -1 0))'); diff --git a/mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result b/mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result index e8df5e5c8ab..843e5ae3d37 100644 --- a/mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result +++ b/mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result @@ -181,6 +181,7 @@ fid AsText(g) 8 LINESTRING(143 143,157 157) 9 LINESTRING(142 142,158 158) 10 LINESTRING(141 141,159 159) +11 LINESTRING(140 140,160 160) DROP TABLE t1; CREATE TABLE t2 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -308,403 +309,403 @@ fid AsText(g) DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +99 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +98 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +97 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +96 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +95 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +94 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +93 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +92 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +91 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +90 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +89 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +88 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +87 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +86 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +85 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +84 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +83 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +82 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +81 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +80 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +79 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +78 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +77 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +76 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +75 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +74 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +73 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +72 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +71 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +70 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +69 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +68 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +67 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +66 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +65 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +64 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +63 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +62 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +61 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +60 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +59 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +58 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +57 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +56 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +55 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +54 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +53 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +52 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +51 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +50 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +49 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +48 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +47 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +46 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +45 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +44 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +43 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +42 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +41 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +40 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +39 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +38 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +37 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +36 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +35 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +34 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +33 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +32 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +31 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +30 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +29 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +28 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +27 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +26 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +25 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +24 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +23 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +22 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +21 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +20 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +19 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +18 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +17 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +16 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +15 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +14 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +13 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +12 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +11 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +10 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +9 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +8 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +7 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +6 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +5 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +4 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +3 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +2 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +1 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +0 DROP TABLE t2; drop table if exists t1; Warnings: diff --git a/mysql-test/suite/maria/r/maria-gis-rtree-trans.result b/mysql-test/suite/maria/r/maria-gis-rtree-trans.result index b529cde47ca..8ccc1f5bfdf 100644 --- a/mysql-test/suite/maria/r/maria-gis-rtree-trans.result +++ b/mysql-test/suite/maria/r/maria-gis-rtree-trans.result @@ -181,6 +181,7 @@ fid AsText(g) 8 LINESTRING(143 143,157 157) 9 LINESTRING(142 142,158 158) 10 LINESTRING(141 141,159 159) +11 LINESTRING(140 140,160 160) DROP TABLE t1; CREATE TABLE t2 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -308,403 +309,403 @@ fid AsText(g) DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +99 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +98 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +97 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +96 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +95 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +94 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +93 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +92 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +91 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +90 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +89 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +88 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +87 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +86 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +85 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +84 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +83 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +82 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +81 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +80 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +79 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +78 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +77 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +76 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +75 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +74 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +73 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +72 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +71 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +70 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +69 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +68 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +67 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +66 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +65 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +64 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +63 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +62 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +61 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +60 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +59 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +58 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +57 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +56 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +55 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +54 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +53 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +52 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +51 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +50 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +49 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +48 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +47 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +46 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +45 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +44 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +43 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +42 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +41 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +40 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +39 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +38 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +37 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +36 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +35 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +34 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +33 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +32 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +31 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +30 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +29 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +28 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +27 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +26 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +25 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +24 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +23 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +22 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +21 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +20 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +19 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +18 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +17 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +16 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +15 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +14 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +13 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +12 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +11 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +10 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +9 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +8 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +7 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +6 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +5 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +4 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +3 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +2 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +1 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +0 DROP TABLE t2; drop table if exists t1; Warnings: diff --git a/mysql-test/suite/maria/r/maria-gis-rtree.result b/mysql-test/suite/maria/r/maria-gis-rtree.result index 514883729af..9945daae75e 100644 --- a/mysql-test/suite/maria/r/maria-gis-rtree.result +++ b/mysql-test/suite/maria/r/maria-gis-rtree.result @@ -181,6 +181,7 @@ fid AsText(g) 8 LINESTRING(143 143,157 157) 9 LINESTRING(142 142,158 158) 10 LINESTRING(141 141,159 159) +11 LINESTRING(140 140,160 160) DROP TABLE t1; CREATE TABLE t2 ( fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -308,403 +309,403 @@ fid AsText(g) DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 10 * 10 - 9), Point(10 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +99 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 9 * 10 - 9), Point(10 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +98 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 8 * 10 - 9), Point(10 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +97 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 7 * 10 - 9), Point(10 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +96 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 6 * 10 - 9), Point(10 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +95 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 5 * 10 - 9), Point(10 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +94 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 4 * 10 - 9), Point(10 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +93 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 3 * 10 - 9), Point(10 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +92 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 2 * 10 - 9), Point(10 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +91 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(10 * 10 - 9, 1 * 10 - 9), Point(10 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +90 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 10 * 10 - 9), Point(9 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +89 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 9 * 10 - 9), Point(9 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +88 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 8 * 10 - 9), Point(9 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +87 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 7 * 10 - 9), Point(9 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +86 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 6 * 10 - 9), Point(9 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +85 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 5 * 10 - 9), Point(9 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +84 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 4 * 10 - 9), Point(9 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +83 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 3 * 10 - 9), Point(9 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +82 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 2 * 10 - 9), Point(9 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +81 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(9 * 10 - 9, 1 * 10 - 9), Point(9 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +80 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 10 * 10 - 9), Point(8 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +79 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 9 * 10 - 9), Point(8 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +78 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 8 * 10 - 9), Point(8 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +77 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 7 * 10 - 9), Point(8 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +76 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 6 * 10 - 9), Point(8 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +75 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 5 * 10 - 9), Point(8 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +74 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 4 * 10 - 9), Point(8 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +73 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 3 * 10 - 9), Point(8 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +72 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 2 * 10 - 9), Point(8 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +71 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(8 * 10 - 9, 1 * 10 - 9), Point(8 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +70 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 10 * 10 - 9), Point(7 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +69 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 9 * 10 - 9), Point(7 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +68 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 8 * 10 - 9), Point(7 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +67 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 7 * 10 - 9), Point(7 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +66 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 6 * 10 - 9), Point(7 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +65 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 5 * 10 - 9), Point(7 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +64 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 4 * 10 - 9), Point(7 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +63 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 3 * 10 - 9), Point(7 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +62 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 2 * 10 - 9), Point(7 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +61 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(7 * 10 - 9, 1 * 10 - 9), Point(7 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +60 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 10 * 10 - 9), Point(6 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +59 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 9 * 10 - 9), Point(6 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +58 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 8 * 10 - 9), Point(6 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +57 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 7 * 10 - 9), Point(6 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +56 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 6 * 10 - 9), Point(6 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +55 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 5 * 10 - 9), Point(6 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +54 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 4 * 10 - 9), Point(6 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +53 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 3 * 10 - 9), Point(6 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +52 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 2 * 10 - 9), Point(6 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +51 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(6 * 10 - 9, 1 * 10 - 9), Point(6 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +50 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 10 * 10 - 9), Point(5 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +49 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 9 * 10 - 9), Point(5 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +48 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 8 * 10 - 9), Point(5 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +47 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 7 * 10 - 9), Point(5 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +46 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 6 * 10 - 9), Point(5 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +45 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 5 * 10 - 9), Point(5 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +44 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 4 * 10 - 9), Point(5 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +43 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 3 * 10 - 9), Point(5 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +42 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 2 * 10 - 9), Point(5 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +41 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(5 * 10 - 9, 1 * 10 - 9), Point(5 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +40 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 10 * 10 - 9), Point(4 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +39 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 9 * 10 - 9), Point(4 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +38 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 8 * 10 - 9), Point(4 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +37 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 7 * 10 - 9), Point(4 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +36 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 6 * 10 - 9), Point(4 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +35 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 5 * 10 - 9), Point(4 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +34 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 4 * 10 - 9), Point(4 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +33 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 3 * 10 - 9), Point(4 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +32 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 2 * 10 - 9), Point(4 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +31 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(4 * 10 - 9, 1 * 10 - 9), Point(4 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +30 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 10 * 10 - 9), Point(3 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +29 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 9 * 10 - 9), Point(3 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +28 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 8 * 10 - 9), Point(3 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +27 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 7 * 10 - 9), Point(3 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +26 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 6 * 10 - 9), Point(3 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +25 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 5 * 10 - 9), Point(3 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +24 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 4 * 10 - 9), Point(3 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +23 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 3 * 10 - 9), Point(3 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +22 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 2 * 10 - 9), Point(3 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +21 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(3 * 10 - 9, 1 * 10 - 9), Point(3 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +20 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 10 * 10 - 9), Point(2 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +19 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 9 * 10 - 9), Point(2 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +18 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 8 * 10 - 9), Point(2 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +17 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 7 * 10 - 9), Point(2 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +16 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 6 * 10 - 9), Point(2 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +15 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 5 * 10 - 9), Point(2 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +14 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 4 * 10 - 9), Point(2 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +13 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 3 * 10 - 9), Point(2 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +12 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 2 * 10 - 9), Point(2 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +11 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(2 * 10 - 9, 1 * 10 - 9), Point(2 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +10 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 10 * 10 - 9), Point(1 * 10, 10 * 10))))); SELECT count(*) FROM t2; count(*) -100 +9 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 9 * 10 - 9), Point(1 * 10, 9 * 10))))); SELECT count(*) FROM t2; count(*) -100 +8 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 8 * 10 - 9), Point(1 * 10, 8 * 10))))); SELECT count(*) FROM t2; count(*) -100 +7 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 7 * 10 - 9), Point(1 * 10, 7 * 10))))); SELECT count(*) FROM t2; count(*) -100 +6 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 6 * 10 - 9), Point(1 * 10, 6 * 10))))); SELECT count(*) FROM t2; count(*) -100 +5 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 5 * 10 - 9), Point(1 * 10, 5 * 10))))); SELECT count(*) FROM t2; count(*) -100 +4 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 4 * 10 - 9), Point(1 * 10, 4 * 10))))); SELECT count(*) FROM t2; count(*) -100 +3 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 3 * 10 - 9), Point(1 * 10, 3 * 10))))); SELECT count(*) FROM t2; count(*) -100 +2 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 2 * 10 - 9), Point(1 * 10, 2 * 10))))); SELECT count(*) FROM t2; count(*) -100 +1 DELETE FROM t2 WHERE Within(g, Envelope(GeometryFromWKB(LineString(Point(1 * 10 - 9, 1 * 10 - 9), Point(1 * 10, 1 * 10))))); SELECT count(*) FROM t2; count(*) -100 +0 DROP TABLE t2; drop table if exists t1; Warnings: -- cgit v1.2.1 From c937b7588f007d24c1cf93ee0b2da9e0e244d711 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 2 Sep 2011 09:38:17 +0500 Subject: bugs #801560 and #802194 tests added. per-file comments: mysql-test/r/gis-precise.result bugs #801560 and #802194 test result updated. mysql-test/t/gis-precise.test bugs #801560 and #802194 test case added. --- mysql-test/r/gis-precise.result | 16 ++++++++++++++++ mysql-test/t/gis-precise.test | 14 ++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 80d44da6cbf..b4ebbfbf3a8 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -301,3 +301,19 @@ MultiPolygonFromText('MULTIPOLYGON(((9 9, 7 9, 1 1, 9 9)), ((0 0, 7 5, 9 6, 0 0)), POLYGON((0 0,0 5,1 5,2 7,2 5.5,5 7,5.5 7,7 9,9 9,7 7,7 5,9 6,7 4.66666666666667,7 1,4.25 2.83333333333333,3 2,3 0,0 0),(1 1,1 4,1.33333333333333 4,1.85714285714286 2.42857142857143,1 2,1.75 2,1 1,2 2,2 1.42857142857143,1.4 1,1 1),(1.5 1,2 1.33333333333333,2 1,1.5 1),(3 2.14285714285714,3 3,3.4 3.4,4.10344827586207 2.93103448275862,3 2.14285714285714)) +SELECT AsText( ST_INTERSECTION( +LinestringFromText('LINESTRING( 3 5, 2 5, 2 4, 3 4, 3 5 ) ') , +LinestringFromText('LINESTRING( 3 5, 2 4, 2 5, 3 5 ) ') +)); +AsText( ST_INTERSECTION( +LinestringFromText('LINESTRING( 3 5, 2 5, 2 4, 3 4, 3 5 ) ') , +LinestringFromText('LINESTRING( 3 5, 2 4, 2 5, 3 5 ) ') +)) +LINESTRING(2 4,2 5,3 5) +SELECT AsText( ST_UNION( +PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 7 5 , 2 0 , 2 2 ) ) ') , +PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 3 3 , 2 5 , 2 2 ) ) ') ) ); +AsText( ST_UNION( +PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 7 5 , 2 0 , 2 2 ) ) ') , +PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 3 3 , 2 5 , 2 2 ) ) ') ) ) +POLYGON((2 0,2 5,3 3,3 2,7 5,2 0)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index bb223b685e4..4ad03d44823 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -187,3 +187,17 @@ SELECT AsText(ST_UNION( MultiPolygonFromText('MULTIPOLYGON(((2 2, 2 2, 1 5, 2 7, 2 2)), ((0 5, 3 5, 3 0, 0 0, 0 5), (1 1, 2 1, 2 4, 1 4, 1 1)))'))); +#bug 802376 ST_INTERSECTION returns wrong result on two overlapping linestrings in maria-5.3-gis + +SELECT AsText( ST_INTERSECTION( + LinestringFromText('LINESTRING( 3 5, 2 5, 2 4, 3 4, 3 5 ) ') , + LinestringFromText('LINESTRING( 3 5, 2 4, 2 5, 3 5 ) ') +)); + +#bug 801560 ST_UNION of adjacent polygons includes extra line in maria-5.3-gis + +SELECT AsText( ST_UNION( + PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 7 5 , 2 0 , 2 2 ) ) ') , + PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 3 3 , 2 5 , 2 2 ) ) ') ) ); + + -- cgit v1.2.1 From eefff87652cde1cb0c986fd167ed057e87230250 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 4 Sep 2011 19:11:04 +0500 Subject: bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. We didn't implement an empty geometry. And returning NULL instead of it is not quite correct. So here is the implementation of the empty value as GEOMETRYCOLLECTION(). per-file comments: mysql-test/r/gis-precise.result bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test result updated. mysql-test/r/gis.result bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test result updated. mysql-test/t/gis-precise.test bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test case added. mysql-test/t/gis.test bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. test case added. sql/field.cc bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. store GEOMETRYCOLLECTION() properly. sql/gcalc_tools.cc bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. create the GEOMETRYCOLLECTION() for the empty result. sql/gstream.h bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. next_symbol() added. sql/spatial.cc bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis. code modified to handle 0 geometries in the GEOMETRYCOLLECTION properly. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/r/gis.result | 23 +++++++++++++++++++---- mysql-test/t/gis-precise.test | 3 +++ mysql-test/t/gis.test | 3 ++- 4 files changed, 27 insertions(+), 5 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index b4ebbfbf3a8..a3928cd0fb0 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -317,3 +317,6 @@ AsText( ST_UNION( PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 7 5 , 2 0 , 2 2 ) ) ') , PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 3 3 , 2 5 , 2 2 ) ) ') ) ) POLYGON((2 0,2 5,3 3,3 2,7 5,2 0)) +SELECT AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))); +AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))) +GEOMETRYCOLLECTION() diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 8dabc431e8f..b3993657182 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -66,7 +66,8 @@ INSERT INTO gis_multi_polygon VALUES (119, MPolyFromWKB(AsWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))))); INSERT INTO gis_geometrycollection VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), -(121, GeometryFromWKB(AsWKB(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)))))), +(122, GeomFromText('GeometryCollection()')); INSERT into gis_geometry SELECT * FROM gis_point; INSERT into gis_geometry SELECT * FROM gis_line; INSERT into gis_geometry SELECT * FROM gis_polygon; @@ -109,6 +110,7 @@ SELECT fid, AsText(g) FROM gis_geometrycollection; fid AsText(g) 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION() SELECT fid, AsText(g) FROM gis_geometry; fid AsText(g) 101 POINT(10 10) @@ -132,6 +134,7 @@ fid AsText(g) 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) +122 GEOMETRYCOLLECTION() SELECT fid, Dimension(g) FROM gis_geometry; fid Dimension(g) 101 0 @@ -155,6 +158,7 @@ fid Dimension(g) 119 2 120 1 121 1 +122 0 SELECT fid, GeometryType(g) FROM gis_geometry; fid GeometryType(g) 101 POINT @@ -178,6 +182,7 @@ fid GeometryType(g) 119 MULTIPOLYGON 120 GEOMETRYCOLLECTION 121 GEOMETRYCOLLECTION +122 GEOMETRYCOLLECTION SELECT fid, IsEmpty(g) FROM gis_geometry; fid IsEmpty(g) 101 0 @@ -201,6 +206,7 @@ fid IsEmpty(g) 119 0 120 0 121 0 +122 0 SELECT fid, AsText(Envelope(g)) FROM gis_geometry; fid AsText(Envelope(g)) 101 POLYGON((10 10,10 10,10 10,10 10,10 10)) @@ -224,9 +230,10 @@ fid AsText(Envelope(g)) 119 POLYGON((0 0,3 0,3 3,0 3,0 0)) 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) +122 POLYGON((1.79769313486232e+308 1.79769313486232e+308,-1.79769313486232e+308 1.79769313486232e+308,-1.79769313486232e+308 -1.79769313486232e+308,1.79769313486232e+308 -1.79769313486232e+308,1.79769313486232e+308 1.79769313486232e+308)) explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21 100.00 +1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 22 100.00 Warnings: Note 1003 select st_dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,st_geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,st_isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,st_astext(st_envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry` SELECT fid, X(g) FROM gis_point; @@ -345,6 +352,7 @@ SELECT fid, NumGeometries(g) from gis_geometrycollection; fid NumGeometries(g) 120 2 121 2 +122 0 explain extended SELECT fid, NumGeometries(g) from gis_multi_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 @@ -369,10 +377,12 @@ SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection; fid AsText(GeometryN(g, 2)) 120 LINESTRING(0 0,10 10) 121 LINESTRING(3 6,7 9) +122 NULL SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; fid AsText(GeometryN(g, 1)) 120 POINT(0 0) 121 POINT(44 6) +122 NULL explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 @@ -386,16 +396,21 @@ FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second first second w c o e d t i r 120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 +120 122 0 1 0 0 1 0 0 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 1 1 1 +121 122 0 1 0 0 1 0 0 0 +122 120 1 0 0 0 1 0 0 0 +122 121 1 0 0 0 1 0 0 0 +122 122 1 1 0 1 1 0 0 0 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE g1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort -1 SIMPLE g2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) +1 SIMPLE g1 ALL NULL NULL NULL NULL 3 100.00 Using temporary; Using filesort +1 SIMPLE g2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,st_within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,st_contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,mbrequals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 4ad03d44823..d2012ee795d 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -200,4 +200,7 @@ SELECT AsText( ST_UNION( PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 7 5 , 2 0 , 2 2 ) ) ') , PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 3 3 , 2 5 , 2 2 ) ) ') ) ); +#bug 801466 ST_INTERSECTION() returns invalid value on empty intersection in maria-5.3-gis + +SELECT AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))); diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index fa6a7dc4675..25fec4cca4e 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -62,7 +62,8 @@ INSERT INTO gis_multi_polygon VALUES INSERT INTO gis_geometrycollection VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), -(121, GeometryFromWKB(AsWKB(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)))))), +(122, GeomFromText('GeometryCollection()')); INSERT into gis_geometry SELECT * FROM gis_point; INSERT into gis_geometry SELECT * FROM gis_line; -- cgit v1.2.1 From 6dfa30e938babc2cac59f2d5eac1f4d46a361b93 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sun, 4 Sep 2011 23:48:17 +0500 Subject: bug 839341 100% CPU usage with ST_UNION in maria-5.3-gis. Line loops weren't recognized when collect results. Fixed by checking if we got the same beginning point of the line. per-file comments: mysql-test/r/gis-precise.result bug 839341 100% CPU usage with ST_UNION in maria-5.3-gis. test result updated. mysql-test/t/gis-precise.test bug 839341 100% CPU usage with ST_UNION in maria-5.3-gis. test case added. sql/gcalc_tools.cc bug 839341 100% CPU usage with ST_UNION in maria-5.3-gis. check if we get the beginning node of the linestring, then cut the loop. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 2 ++ 2 files changed, 5 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index a3928cd0fb0..a370e117fe0 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -320,3 +320,6 @@ POLYGON((2 0,2 5,3 3,3 2,7 5,2 0)) SELECT AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))); AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))) GEOMETRYCOLLECTION() +SELECT AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))); +AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))) +GEOMETRYCOLLECTION(POINT(8 1),LINESTRING(2 4,2 5,3 5,3 4,2 4)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index d2012ee795d..c2d13cfe5cb 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -204,3 +204,5 @@ SELECT AsText( ST_UNION( SELECT AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))); +#bug 839341 100% CPU usage with ST_UNION in maria-5.3-gis +SELECT AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))); -- cgit v1.2.1 From 97eae1cd63e3bb05c98a4b050ec3abaf7925c382 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 5 Sep 2011 09:13:58 +0500 Subject: bug 839318 Crash in Gcalc_scan_iterator::point::get_shape with ST_DISTANCE and MULTILINESTRING in maria-5.3-gis. wrong variable was used as a result of inattentive copypaste. per-file comments: mysql-test/r/gis-precise.result bug 839318 Crash in Gcalc_scan_iterator::point::get_shape with ST_DISTANCE and MULTILINESTRING in maria-5.3-gis. test result updated. mysql-test/t/gis-precise.test bug 839318 Crash in Gcalc_scan_iterator::point::get_shape with ST_DISTANCE and MULTILINESTRING in maria-5.3-gis. test case added. sql/item_geofunc.cc bug 839318 Crash in Gcalc_scan_iterator::point::get_shape with ST_DISTANCE and MULTILINESTRING in maria-5.3-gis. use 'ev' variable instead of the 'evpos'. --- mysql-test/r/gis-precise.result | 5 +++++ mysql-test/t/gis-precise.test | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index a370e117fe0..1d61db1c98d 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -323,3 +323,8 @@ GEOMETRYCOLLECTION() SELECT AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))); AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))) GEOMETRYCOLLECTION(POINT(8 1),LINESTRING(2 4,2 5,3 5,3 4,2 4)) +SELECT ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILINESTRING( + (4 7,9 7,6 1,3 4,1 1), (3 5, 2 5, 2 4, 3 4, 3 5))')); +ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILINESTRING( + (4 7,9 7,6 1,3 4,1 1), (3 5, 2 5, 2 4, 3 4, 3 5))')) +1 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index c2d13cfe5cb..62445d3aa27 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -206,3 +206,8 @@ SELECT AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), Geomet #bug 839341 100% CPU usage with ST_UNION in maria-5.3-gis SELECT AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))); + +#bug 839318 Crash in Gcalc_scan_iterator::point::get_shape with ST_DISTANCE and MULTILINESTRING in maria-5.3-gis +SELECT ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILINESTRING( + (4 7,9 7,6 1,3 4,1 1), (3 5, 2 5, 2 4, 3 4, 3 5))')); + -- cgit v1.2.1 From a1315808b4a067fd82877ea1cfbd8867f9a8588a Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 5 Sep 2011 09:49:46 +0500 Subject: bug 839327 Crash in Gcalc_operation_reducer::end_couple with ST_UNION and MULTIPOLYGONs in 5.3-gis. When edges of a polygon coicide, it can form an pike, that is turned into a line after an operation. In this case a former polygon point can be an end of a single line, and that case wasn't properly handled. per-file comments: mysql-test/r/gis-precise.result bug 839327 Crash in Gcalc_operation_reducer::end_couple with ST_UNION and MULTIPOLYGONs in 5.3-gis. test result updated. mysql-test/t/gis-precise.test bug 839327 Crash in Gcalc_operation_reducer::end_couple with ST_UNION and MULTIPOLYGONs in 5.3-gis. test case added. sql/gcalc_tools.cc bug 839327 Crash in Gcalc_operation_reducer::end_couple with ST_UNION and MULTIPOLYGONs in 5.3-gis. in the scev_two_ends case check if we have single line ending on a polygon node. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 1d61db1c98d..68fa4661c90 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -328,3 +328,6 @@ SELECT ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILIN ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILINESTRING( (4 7,9 7,6 1,3 4,1 1), (3 5, 2 5, 2 4, 3 4, 3 5))')) 1 +SELECT AsText(ST_UNION(POLYGONFROMTEXT('POLYGON((12 9, 3 6, 3 0, 12 9))'), POLYGONFROMTEXT('POLYGON((2 2, 7 2, 4 2, 2 0, 2 2))'))); +AsText(ST_UNION(POLYGONFROMTEXT('POLYGON((12 9, 3 6, 3 0, 12 9))'), POLYGONFROMTEXT('POLYGON((2 2, 7 2, 4 2, 2 0, 2 2))'))) +GEOMETRYCOLLECTION(POLYGON((2 0,2 2,3 2,3 6,12 9,3 0,3 1,2 0)),LINESTRING(5 2,7 2)) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 62445d3aa27..cafd9a1d99a 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -211,3 +211,7 @@ SELECT AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT(' SELECT ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILINESTRING( (4 7,9 7,6 1,3 4,1 1), (3 5, 2 5, 2 4, 3 4, 3 5))')); +#bug 839327 Crash in Gcalc_operation_reducer::end_couple with ST_UNION and MULTIPOLYGONs in 5.3-gis +SELECT AsText(ST_UNION(POLYGONFROMTEXT('POLYGON((12 9, 3 6, 3 0, 12 9))'), POLYGONFROMTEXT('POLYGON((2 2, 7 2, 4 2, 2 0, 2 2))'))); + + -- cgit v1.2.1 From 3882c5d62c83f4768c022f38bf91180ce0fcc7a2 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 13 Sep 2011 13:59:11 +0500 Subject: Fix for few similar bugs: #841622 Assertion `t->rp->type == Gcalc_function::shape_line' failed in Gcalc_operation_reducer::end_line in maria-5.3-gi #841625 Assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis #841638 Assertion `!m_prev || m_prev->x != x || m_prev->y != y' failed in Gcalc_shape_transporter::int_add_point in maria-5.3-gis #841662 Third assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos #841745 Assertion `!sp0->is_bottom()' failed in Gcalc_scan_iterator::find_intersections in maria-5.3-gis They mostly was caused by inprecision of double arithmetic. Fixed by changes in how to handle multiple intersections to keep their order right. Also ST_DISTANCE(GEOM, EMPTY_GEOM) was defined as NULL. per-file comments: mysql-test/r/gis-precise.result GIS bugfixes. test result updated. mysql-test/t/gis-precise.test GIS bugfixes. test cases added. sql/gcalc_slicescan.cc GIS bugfixes. If intersections are close, add order checks to cope with the double calcualtions imprecision. sql/gcalc_slicescan.h GIS bugfixes. n_row parameter added to intersection to check their order. sql/item_geofunc.cc GIS bugfixes. ST_DISTANCE(GEOM, EMPTY_GEOM) returns NULL. --- mysql-test/r/gis-precise.result | 87 ++++++++++++++++++++++++++++++++++++++++- mysql-test/t/gis-precise.test | 65 ++++++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 2 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 68fa4661c90..5ebce7f603e 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -214,7 +214,7 @@ astext(ST_BUFFER(LineStringFromText('LINESTRING(0 0,1 1)'),0)) LINESTRING(0 0,1 1) SELECT Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5); Round(ST_Area(ST_BUFFER(MultipointFromText('MULTIPOINT(7 7,3 7,7 2,7 4 ,7 7)'), 3)), 5) -78.68303 +78.68426 SELECT ST_INTERSECTION(NULL, NULL); ST_INTERSECTION(NULL, NULL) NULL @@ -257,7 +257,7 @@ ST_NUMGEOMETRIES((ST_UNION(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), -183 +176 SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); @@ -331,3 +331,86 @@ ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILINESTRING SELECT AsText(ST_UNION(POLYGONFROMTEXT('POLYGON((12 9, 3 6, 3 0, 12 9))'), POLYGONFROMTEXT('POLYGON((2 2, 7 2, 4 2, 2 0, 2 2))'))); AsText(ST_UNION(POLYGONFROMTEXT('POLYGON((12 9, 3 6, 3 0, 12 9))'), POLYGONFROMTEXT('POLYGON((2 2, 7 2, 4 2, 2 0, 2 2))'))) GEOMETRYCOLLECTION(POLYGON((2 0,2 2,3 2,3 6,12 9,3 0,3 1,2 0)),LINESTRING(5 2,7 2)) +SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER(ST_UNION( +MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 2 5, 7 6, 1 8),(0 0 ,1 6 ,0 1, 8 9, 2 4, 6 1, 3 5, 4 8), (9 3, 5 4, 1 8, 4 2, 5 8, 3 0))' ) , +MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2, 1 5))') +), 16))); +ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER(ST_UNION( +MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 2 5, 7 6, 1 8),(0 0 ,1 6 ,0 1, 8 9, 2 4, 6 1, 3 5, 4 8), (9 3, 5 4, 1 8, 4 2, 5 8, 3 0))' ) , +MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2 +280 +SELECT ST_NUMGEOMETRIES(ST_DIFFERENCE ( +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) ) ' ), +ST_UNION ( +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 7 2 , 6 2 , 2 6 , 2 2 ) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , +ENVELOPE( +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) +) +) +), +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 9 , 1 3 , 7 3 , 8 5 ) , ( 5 0 , 8 1 , 2 0 , 7 4 , 1 0 ) , ( 9 2 , 5 2 , 6 5 , 8 8 , 0 2 ) , ( 0 8 , 3 9 , 4 0 , 1 0 ) , ( 0 0 , 7 6 , 8 3 , 0 0 ) ) ' ) +)); +ST_NUMGEOMETRIES(ST_DIFFERENCE ( +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) +126 +SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 4 5 , 3 0 , 3 1 , 4 7 , 4 2 ) , ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) +) , 1 +))); +ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , +MULTILINESTRI +659 +SELECT ASTEXT(ST_DIFFERENCE ( +POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ' ) , +ST_SYMDIFFERENCE ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 3 8 , 0 8 , 6 6 , 6 1 , 0 5 , 6 7 , 3 7 ) , ( 5 8 , 7 7 , 9 0 , 8 7 ) , ( 1 5 , 1 8 , 2 3 , 3 9 ) , ( 1 3 , 9 7 , 5 5 , 0 8 , 6 9 ) , ( 3 6 , 6 9 , 8 7 , 0 2 , 4 6 , 9 5 ) ) ' ) , +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 9 4 , 2 0 , 2 2 , 7 2 , 6 2 ) , ( 5 2 , 8 2 , 4 8 , 3 4 ) , ( 1 0 , 1 4 , 2 7 , 7 0 , 1 5 ) , ( 2 8 , 4 4 , 5 0 , 7 0 , 4 0 ) ) ' ) , +GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 3 7 , 7 3 , 5 8 , 4 8 ) , ( 3 2 , 5 0 , 9 3 , 4 4 ) , ( 6 0 , 4 2 , 7 8 , 1 3 ) ) ' ) +) +) +) +)); +ASTEXT(ST_DIFFERENCE ( +POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , +ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ' ) , +ST_SYMDIFFERENCE ( +MULTILINESTRINGFROMTEX +POLYGON((2 2,2 8,8 8,8 2,2 2),(4 4,4 6,6 6,6 4,4 4)) +SELECT ST_NUMGEOMETRIES(ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 0 8 , 1 9 , 5 7 , 2 8 , 5 8 , 6 7 ) , ( 4 5 , 8 4 , 0 3 , 5 1 ) , ( 6 8 , 2 7 , 1 6 , 9 9 , 7 2 ) , ( 9 5 , 2 8 , 1 2 , 9 6 , 2 0 ) ) ' ) , +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 7 7 , 2 7, 6 8, 7 1 , 7 7 ) ) ) ' ) +)); +ST_NUMGEOMETRIES(ST_UNION ( +MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 0 8 , 1 9 , 5 7 , 2 8 , 5 8 , 6 7 ) , ( 4 5 , 8 4 , 0 3 , 5 1 ) , ( 6 8 , 2 7 , 1 6 , 9 9 , 7 2 ) , ( 9 5 , 2 8 , 1 2 , 9 6 , 2 0 ) ) ' ) , +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( +50 +SELECT ST_BUFFER ( +LINESTRINGFROMTEXT( ' LINESTRING( 5 4 , 3 8 , 2 6 , 5 5 , 7 9 ) ' ) , +ST_DISTANCE ( +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) , +ST_DIFFERENCE ( +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) +) +) +) ; +ST_BUFFER ( +LINESTRINGFROMTEXT( ' LINESTRING( 5 4 , 3 8 , 2 6 , 5 5 , 7 9 ) ' ) , +ST_DISTANCE ( +MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) , +ST_DIFFERENCE ( +MULTIPOL +NULL +SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) ), MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) ) ; +ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , +NULL diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index cafd9a1d99a..59a9edb92d1 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -214,4 +214,69 @@ SELECT ST_DISTANCE(POINTFROMTEXT('POINT(7 1)'),MULTILINESTRINGFROMTEXT('MULTILIN #bug 839327 Crash in Gcalc_operation_reducer::end_couple with ST_UNION and MULTIPOLYGONs in 5.3-gis SELECT AsText(ST_UNION(POLYGONFROMTEXT('POLYGON((12 9, 3 6, 3 0, 12 9))'), POLYGONFROMTEXT('POLYGON((2 2, 7 2, 4 2, 2 0, 2 2))'))); +#bug 841622 Assertion `t->rp->type == Gcalc_function::shape_line' failed in Gcalc_operation_reducer::end_line in maria-5.3-gis + +SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER(ST_UNION( + MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 2 5, 7 6, 1 8),(0 0 ,1 6 ,0 1, 8 9, 2 4, 6 1, 3 5, 4 8), (9 3, 5 4, 1 8, 4 2, 5 8, 3 0))' ) , + MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2, 1 5))') + ), 16))); + +#bug 841625 Assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis + +SELECT ST_NUMGEOMETRIES(ST_DIFFERENCE ( + ST_UNION ( + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) ) ' ), + ST_UNION ( + MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 7 2 , 6 2 , 2 6 , 2 2 ) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , + ENVELOPE( + MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) + ) + ) + ), + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 9 , 1 3 , 7 3 , 8 5 ) , ( 5 0 , 8 1 , 2 0 , 7 4 , 1 0 ) , ( 9 2 , 5 2 , 6 5 , 8 8 , 0 2 ) , ( 0 8 , 3 9 , 4 0 , 1 0 ) , ( 0 0 , 7 6 , 8 3 , 0 0 ) ) ' ) +)); + + +#bug 841638 Assertion `!m_prev || m_prev->x != x || m_prev->y != y' failed in Gcalc_shape_transporter::int_add_point in maria-5.3-gis +SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( + ST_UNION ( + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 4 5 , 3 0 , 3 1 , 4 7 , 4 2 ) , ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) + ) , 1 +))); + +#bug 841745 ssertion `!sp0->is_bottom()' failed in Gcalc_scan_iterator::find_intersections in maria-5.3-gis +SELECT ASTEXT(ST_DIFFERENCE ( + POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , + ST_UNION ( + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ' ) , + ST_SYMDIFFERENCE ( + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 3 8 , 0 8 , 6 6 , 6 1 , 0 5 , 6 7 , 3 7 ) , ( 5 8 , 7 7 , 9 0 , 8 7 ) , ( 1 5 , 1 8 , 2 3 , 3 9 ) , ( 1 3 , 9 7 , 5 5 , 0 8 , 6 9 ) , ( 3 6 , 6 9 , 8 7 , 0 2 , 4 6 , 9 5 ) ) ' ) , + ST_UNION ( + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 9 4 , 2 0 , 2 2 , 7 2 , 6 2 ) , ( 5 2 , 8 2 , 4 8 , 3 4 ) , ( 1 0 , 1 4 , 2 7 , 7 0 , 1 5 ) , ( 2 8 , 4 4 , 5 0 , 7 0 , 4 0 ) ) ' ) , + GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 3 7 , 7 3 , 5 8 , 4 8 ) , ( 3 2 , 5 0 , 9 3 , 4 4 ) , ( 6 0 , 4 2 , 7 8 , 1 3 ) ) ' ) + ) + ) + ) +)); + +#bug 841773 Assertion `t0->rp->type == t1->rp->type' failed in Gcalc_operation_reducer::end_couple in maria-5.3-gis +SELECT ST_NUMGEOMETRIES(ST_UNION ( + MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 0 8 , 1 9 , 5 7 , 2 8 , 5 8 , 6 7 ) , ( 4 5 , 8 4 , 0 3 , 5 1 ) , ( 6 8 , 2 7 , 1 6 , 9 9 , 7 2 ) , ( 9 5 , 2 8 , 1 2 , 9 6 , 2 0 ) ) ' ) , + MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 7 7 , 2 7, 6 8, 7 1 , 7 7 ) ) ) ' ) +)); + +#bug 841662 Third assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos +SELECT ST_BUFFER ( + LINESTRINGFROMTEXT( ' LINESTRING( 5 4 , 3 8 , 2 6 , 5 5 , 7 9 ) ' ) , + ST_DISTANCE ( + MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) , + ST_DIFFERENCE ( + MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , + MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) + ) + ) + ) ; +SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) ), MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) ) ; + -- cgit v1.2.1 From b408b1bbbc87246df8e9728cec90ce215dc08ec2 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 13 Sep 2011 15:19:55 +0500 Subject: Fix for bug #848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis That assertion's check was too tight. Released it a bit. per-file comments: mysql-test/r/gis-precise.result Fix for bug #848901 test result updated. mysql-test/t/gis-precise.test Fix for bug #848901 test case added. sql/gcalc_slicescan.cc Fix for bug #848901 The DBUG_ASSERT check is too tight here. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 5ebce7f603e..2a70f7806bf 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -414,3 +414,6 @@ NULL SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) ), MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) ) ; ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , NULL +SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; +ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 +26 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 59a9edb92d1..467cfbcc1bd 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -279,4 +279,7 @@ SELECT ST_BUFFER ( ) ; SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) ), MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) ) ; +#bug 848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis + +SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; -- cgit v1.2.1 From 5a04ac7bf0ee359fb36f4ebc00f0aebc142d36b7 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 13 Sep 2011 18:26:16 +0500 Subject: Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis Coordinates were mistakenly reversed for MULTIPOINT. per-file comments: mysql-test/r/gis-precise.result Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis test result updated. mysql-test/t/gis-precise.test Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis test case added. sql/gcalc_tools.cc Fix for bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis coordinates set in the proper order. --- mysql-test/r/gis-precise.result | 9 ++++++--- mysql-test/t/gis-precise.test | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 2a70f7806bf..c3f77f6680f 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -127,10 +127,10 @@ astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFr POLYGON((26.4705882352941 23.8235294117647,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337,29.2899408284024 26.3609467455621,26.4705882352941 23.8235294117647)) select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))); astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50, 0 0)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45, 50 5)'))) -MULTIPOINT(23.8235294117647 26.4705882352941,26.3609467455621 29.2899408284024,27.4390243902439 21.9512195121951,29.8192771084337 23.855421686747) +MULTIPOINT(26.4705882352941 23.8235294117647,29.2899408284024 26.3609467455621,21.9512195121951 27.4390243902439,23.855421686747 29.8192771084337) select astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))); astext(ST_Intersection(GeomFromText('LINESTRING(0 0, 50 45, 40 50)'), GeomFromText('LINESTRING(50 5, 55 10, 0 45)'))) -POINT(26.3609467455621 29.2899408284024) +POINT(29.2899408284024 26.3609467455621) select astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))); astext(ST_Intersection(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('POINT(20 20)'))) POINT(20 20) @@ -416,4 +416,7 @@ ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFR NULL SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 -26 +27 +SELECT ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)))'), geomETRYFROMTEXT(' MULTILINESTRING( ( 5 1 , 3 7 , 6 1 , 7 0 ) , ( 1 6 , 8 5 , 7 5 , 5 6 ) )') )); +ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)) +MULTIPOINT(7 5,7 5.14285714285714,5.9 5.3,5.8 5.6,3 7) diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 467cfbcc1bd..8e630766004 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -283,3 +283,6 @@ SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTI SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; +#bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis +SELECT ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)))'), geomETRYFROMTEXT(' MULTILINESTRING( ( 5 1 , 3 7 , 6 1 , 7 0 ) , ( 1 6 , 8 5 , 7 5 , 5 6 ) )') )); + -- cgit v1.2.1 From 0249413a6ae4a5900b51f434b361b9efa6133ad1 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 21 Sep 2011 00:04:41 +0500 Subject: several bugs fixed here. 849789 Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis 849791 Fourth assertion `n > 0 && n < SINUSES_CALCULATED*2+1' in get_n_sincos 849789 Second assertion `m_poly_borders->next' failed in Gcalc_operation_reducer::count_slice in maria-5.3-gis 848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis per-file comments: mysql-test/r/gis-precise.result test result updated. mysql-test/r/gis.result test result updated. sql/gcalc_slicescan.cc bugfixes. sql/gcalc_slicescan.h bugfixes. sql/gcalc_tools.cc bugfixes. sql/gcalc_tools.h bugfixes. sql/item_geofunc.cc bugfixes. sql/spatial.cc bugfixes. --- mysql-test/r/gis-precise.result | 12 ++++++------ mysql-test/r/gis.result | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index c3f77f6680f..5adecfb5a35 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -189,7 +189,7 @@ st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')) -1 +0 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')) 1 @@ -257,7 +257,7 @@ ST_NUMGEOMETRIES((ST_UNION(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), -176 +185 SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); @@ -338,7 +338,7 @@ MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2, 1 5))') ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 2 5, 7 6, 1 8),(0 0 ,1 6 ,0 1, 8 9, 2 4, 6 1, 3 5, 4 8), (9 3, 5 4, 1 8, 4 2, 5 8, 3 0))' ) , MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2 -280 +275 SELECT ST_NUMGEOMETRIES(ST_DIFFERENCE ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) ) ' ), @@ -354,7 +354,7 @@ MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 9 , 1 3 , 7 3 , 8 5 ) , ( 5 0 , ST_NUMGEOMETRIES(ST_DIFFERENCE ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) -126 +123 SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , @@ -365,7 +365,7 @@ ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , MULTILINESTRI -659 +653 SELECT ASTEXT(ST_DIFFERENCE ( POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , ST_UNION ( @@ -416,7 +416,7 @@ ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFR NULL SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 -27 +25 SELECT ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)))'), geomETRYFROMTEXT(' MULTILINESTRING( ( 5 1 , 3 7 , 6 1 , 7 0 ) , ( 1 6 , 8 5 , 7 5 , 5 6 ) )') )); ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)) MULTIPOINT(7 5,7 5.14285714285714,5.9 5.3,5.8 5.6,3 7) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index b3993657182..190795855dd 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -850,7 +850,7 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -big,center,down,down2,left,left2,right,right2,small,up,up2 +down2,left2,right2,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center @@ -871,7 +871,7 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -big,center,down,down2,left,left2,right,right2,small,up,up2 +down2,left2,right2,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within big,center -- cgit v1.2.1 From 25b5019c34e717aff95bf405e7d5eb15c2bedf75 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 21 Sep 2011 09:29:37 +0500 Subject: bugs fixed 855253 Compiler error: gcalc_slicescan.cc:2036: error: suggest parentheses around comparison in operand of .|. in maria-5.3-gis 850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis per-file comments: mysql-test/r/gis.result test result updated. mysql-test/t/gis.test test case added for 850775. sql/gcalc_slicescan.cc compiler error fixed. sql/spatial.cc ST_AREA implementation for GEOMETRY_COLLECTION, POINT and LINESTRING. sql/spatial.h area() declarations added. --- mysql-test/r/gis.result | 15 +++++++++------ mysql-test/t/gis.test | 5 +++++ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 190795855dd..5a8571bb17e 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -230,7 +230,7 @@ fid AsText(Envelope(g)) 119 POLYGON((0 0,3 0,3 3,0 3,0 0)) 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) -122 POLYGON((1.79769313486232e+308 1.79769313486232e+308,-1.79769313486232e+308 1.79769313486232e+308,-1.79769313486232e+308 -1.79769313486232e+308,1.79769313486232e+308 -1.79769313486232e+308,1.79769313486232e+308 1.79769313486232e+308)) +122 NULL explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 22 100.00 @@ -396,13 +396,13 @@ FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second first second w c o e d t i r 120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 -120 122 0 1 0 0 1 0 0 0 +120 122 0 1 NULL NULL NULL 0 NULL 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 1 1 1 -121 122 0 1 0 0 1 0 0 0 -122 120 1 0 0 0 1 0 0 0 -122 121 1 0 0 0 1 0 0 0 -122 122 1 1 0 1 1 0 0 0 +121 122 0 1 NULL NULL NULL 0 NULL 0 +122 120 1 0 NULL NULL NULL 0 NULL 0 +122 121 1 0 NULL NULL NULL 0 NULL 0 +122 122 1 1 NULL NULL NULL 0 NULL 0 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -1077,6 +1077,9 @@ SPATIAL INDEX i1 (col1, col2) ERROR HY000: Incorrect arguments to SPATIAL INDEX DROP TABLE t1; DROP TABLE t2; +select ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')); +ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')) +1.5 DROP DATABASE IF EXISTS gis_ogs; CREATE DATABASE gis_ogs; USE gis_ogs; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 25fec4cca4e..359d0e8520a 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -804,6 +804,11 @@ CREATE TABLE t3 ( DROP TABLE t1; DROP TABLE t2; +#bug 850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis +select ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')); + + + # Conformance tests # # C.3.3 Geometry types and functions -- cgit v1.2.1 From 6b64baf3b9c8a6c33dd47be62c0b73ab12157760 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 21 Sep 2011 12:50:03 +0500 Subject: fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" per-file comments: mysql-test/r/gis.result fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" test result updated. mysql-test/t/gis.test fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" test case added. sql/gstream.cc fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" lookup_next_word() implemented. sql/gstream.h fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" lookup_next_word() added. sql/spatial.cc fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" name changed for the empty geometry. sql/spatial.h fix for bug 848926 GIS functions return "GEOMETRYCOLLECTION()" instead of "GEOMETRYCOLLECTION EMPTY" declarations modified. --- mysql-test/r/gis.result | 33 +++++++++++++++++++++++++-------- mysql-test/t/gis.test | 3 ++- 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 5a8571bb17e..0755f106fba 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -67,7 +67,8 @@ INSERT INTO gis_multi_polygon VALUES INSERT INTO gis_geometrycollection VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), -(122, GeomFromText('GeometryCollection()')); +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); INSERT into gis_geometry SELECT * FROM gis_point; INSERT into gis_geometry SELECT * FROM gis_line; INSERT into gis_geometry SELECT * FROM gis_polygon; @@ -110,7 +111,8 @@ SELECT fid, AsText(g) FROM gis_geometrycollection; fid AsText(g) 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) -122 GEOMETRYCOLLECTION() +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY SELECT fid, AsText(g) FROM gis_geometry; fid AsText(g) 101 POINT(10 10) @@ -134,7 +136,8 @@ fid AsText(g) 119 MULTIPOLYGON(((0 3,3 3,3 0,0 3))) 120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) 121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9)) -122 GEOMETRYCOLLECTION() +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY SELECT fid, Dimension(g) FROM gis_geometry; fid Dimension(g) 101 0 @@ -159,6 +162,7 @@ fid Dimension(g) 120 1 121 1 122 0 +123 0 SELECT fid, GeometryType(g) FROM gis_geometry; fid GeometryType(g) 101 POINT @@ -183,6 +187,7 @@ fid GeometryType(g) 120 GEOMETRYCOLLECTION 121 GEOMETRYCOLLECTION 122 GEOMETRYCOLLECTION +123 GEOMETRYCOLLECTION SELECT fid, IsEmpty(g) FROM gis_geometry; fid IsEmpty(g) 101 0 @@ -207,6 +212,7 @@ fid IsEmpty(g) 120 0 121 0 122 0 +123 0 SELECT fid, AsText(Envelope(g)) FROM gis_geometry; fid AsText(Envelope(g)) 101 POLYGON((10 10,10 10,10 10,10 10,10 10)) @@ -231,9 +237,10 @@ fid AsText(Envelope(g)) 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) 122 NULL +123 NULL explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 22 100.00 +1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 23 100.00 Warnings: Note 1003 select st_dimension(`test`.`gis_geometry`.`g`) AS `Dimension(g)`,st_geometrytype(`test`.`gis_geometry`.`g`) AS `GeometryType(g)`,st_isempty(`test`.`gis_geometry`.`g`) AS `IsEmpty(g)`,st_astext(st_envelope(`test`.`gis_geometry`.`g`)) AS `AsText(Envelope(g))` from `test`.`gis_geometry` SELECT fid, X(g) FROM gis_point; @@ -353,6 +360,7 @@ fid NumGeometries(g) 120 2 121 2 122 0 +123 0 explain extended SELECT fid, NumGeometries(g) from gis_multi_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 @@ -378,11 +386,13 @@ fid AsText(GeometryN(g, 2)) 120 LINESTRING(0 0,10 10) 121 LINESTRING(3 6,7 9) 122 NULL +123 NULL SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection; fid AsText(GeometryN(g, 1)) 120 POINT(0 0) 121 POINT(44 6) 122 NULL +123 NULL explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3 100.00 @@ -397,20 +407,27 @@ first second w c o e d t i r 120 120 1 1 0 1 0 1 1 1 120 121 0 0 1 0 0 0 1 0 120 122 0 1 NULL NULL NULL 0 NULL 0 +120 123 0 1 NULL NULL NULL 0 NULL 0 121 120 0 0 1 0 0 0 1 0 121 121 1 1 0 1 0 1 1 1 121 122 0 1 NULL NULL NULL 0 NULL 0 +121 123 0 1 NULL NULL NULL 0 NULL 0 122 120 1 0 NULL NULL NULL 0 NULL 0 122 121 1 0 NULL NULL NULL 0 NULL 0 122 122 1 1 NULL NULL NULL 0 NULL 0 +122 123 1 1 NULL NULL NULL 0 NULL 0 +123 120 1 0 NULL NULL NULL 0 NULL 0 +123 121 1 0 NULL NULL NULL 0 NULL 0 +123 122 1 1 NULL NULL NULL 0 NULL 0 +123 123 1 1 NULL NULL NULL 0 NULL 0 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE g1 ALL NULL NULL NULL NULL 3 100.00 Using temporary; Using filesort -1 SIMPLE g2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) +1 SIMPLE g1 ALL NULL NULL NULL NULL 4 100.00 Using temporary; Using filesort +1 SIMPLE g2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,st_within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,st_contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,mbrequals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; @@ -850,7 +867,7 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -down2,left2,right2,up2 +big,down2,left,left2,right,right2,small,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center @@ -871,7 +888,7 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -down2,left2,right2,up2 +big,down2,left,left2,right,right2,small,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within big,center diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 359d0e8520a..2eee4bab767 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -63,7 +63,8 @@ INSERT INTO gis_multi_polygon VALUES INSERT INTO gis_geometrycollection VALUES (120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')), (121, GeometryFromWKB(AsWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))))), -(122, GeomFromText('GeometryCollection()')); +(122, GeomFromText('GeometryCollection()')), +(123, GeomFromText('GeometryCollection EMPTY')); INSERT into gis_geometry SELECT * FROM gis_point; INSERT into gis_geometry SELECT * FROM gis_line; -- cgit v1.2.1 From d0f2e1e55176c7f674832444ea174c2445058ef7 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 21 Sep 2011 13:26:21 +0500 Subject: bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. per-file comments: mysql-test/r/gis.result bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. test result updated. mysql-test/t/gis.test bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. test case added. sql/item_geofunc.cc bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. geom_length() call fixed. sql/spatial.cc bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. Geometry_collection::geom_length implemented. sql/spatial.h bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs fixed. Geometry_collection::geom_length declaration added. --- mysql-test/r/gis.result | 3 +++ mysql-test/t/gis.test | 2 ++ 2 files changed, 5 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 0755f106fba..7f54e088cf8 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1097,6 +1097,9 @@ DROP TABLE t2; select ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')); ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')) 1.5 +select ST_LENGTH(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 100 30, 20 30), POINT(3 3), LINESTRING(20 20, 30 20))')); +ST_LENGTH(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 100 30, 20 30), POINT(3 3), LINESTRING(20 20, 30 20))')) +160 DROP DATABASE IF EXISTS gis_ogs; CREATE DATABASE gis_ogs; USE gis_ogs; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 2eee4bab767..e8fa0e6b994 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -808,6 +808,8 @@ DROP TABLE t2; #bug 850775 ST_AREA does not work on GEOMETRYCOLLECTIONs in maria-5.3-gis select ST_AREA(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 31 10, 77 80), POLYGON((0 0,4 7,1 1,0 0)), POINT(20 20))')); +#bug 855336 ST_LENGTH does not work on GEOMETRYCOLLECTIONs +select ST_LENGTH(ST_GEOMCOLLFROMTEXT(' GEOMETRYCOLLECTION(LINESTRING(100 100, 100 30, 20 30), POINT(3 3), LINESTRING(20 20, 30 20))')); # Conformance tests -- cgit v1.2.1 From 5123f59ed2b363ac25fdef374af607f93ec9d762 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 22 Sep 2011 18:53:36 +0500 Subject: fixed bugs 855485 ST_CROSSES returns different result than PostGIS for overlapping polygons 855487 ST_WITHIN returns wrong result for partially overlapping polygons 855492 ST_WITHIN returns TRUE on point on the edge of a polygon 855497 ST_ENVELOPE of GEOMETRYCOLLECTION EMPTY returns NULL and not GEOMETRYCOLLECTION EMPTY 855503 ST_EQUALS reports TRUE between a POLYGON and a MULTILINESTRING 855505 ST_TOUCHES reports TRUE for intersecting polygon and linestring Changed the way weird functions like Crosses or Touches treated. Added BORDER handling to the Gcalc_function. per-file comments: mysql-test/r/gis-precise.result GIS bugs fixed. test result updated. mysql-test/t/gis-precise.test GIS bugs fixed. test cases added. sql/gcalc_slicescan.h GIS bugs fixed. sql/gcalc_tools.cc GIS bugs fixed. sql/gcalc_tools.h GIS bugs fixed. sql/item_create.cc GIS bugs fixed. sql/item_geofunc.cc GIS bugs fixed. sql/item_geofunc.h GIS bugs fixed. sql/spatial.cc GIS bugs fixed. --- mysql-test/r/gis-precise.result | 94 ++++++++++++++++++++++++++++++----------- mysql-test/t/gis-precise.test | 36 ++++++++++------ 2 files changed, 94 insertions(+), 36 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 5adecfb5a35..ef621d11e54 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -7,7 +7,7 @@ select 0, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFro 0 0 select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')); 1 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')) -1 1 +1 0 select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); 1 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) 1 1 @@ -25,48 +25,90 @@ insert into t1 values (GeomFromText('POINT(8 2)')), (GeomFromText('POINT(8 4)')), (GeomFromText('POINT(8 6)')), (GeomFromText('POINT(8 8)')); select astext(g) from t1 where ST_Within(g, GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))')); astext(g) +POINT(2 2) +POINT(2 4) +POINT(2 6) +POINT(2 8) POINT(4 2) POINT(4 4) POINT(4 6) +POINT(4 8) POINT(6 2) POINT(6 4) POINT(6 6) +POINT(6 8) +POINT(8 2) +POINT(8 4) +POINT(8 6) +POINT(8 8) select 'Contains'; Contains Contains select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); astext(g) +POINT(2 2) +POINT(2 4) +POINT(2 6) +POINT(2 8) +POINT(4 2) POINT(4 4) +POINT(4 6) +POINT(4 8) POINT(6 2) POINT(6 4) POINT(6 6) +POINT(6 8) +POINT(8 2) +POINT(8 4) +POINT(8 6) +POINT(8 8) select 'Intersects'; Intersects Intersects select astext(g) from t1 where ST_Intersects(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); astext(g) -POINT(4 4) -POINT(6 2) -POINT(6 4) -POINT(6 6) select 'Contains'; Contains Contains select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); astext(g) +POINT(2 2) +POINT(2 4) +POINT(2 6) +POINT(2 8) +POINT(4 2) POINT(4 4) +POINT(4 6) +POINT(4 8) POINT(6 2) POINT(6 4) POINT(6 6) +POINT(6 8) +POINT(8 2) +POINT(8 4) +POINT(8 6) +POINT(8 8) select 'Contains2'; Contains2 Contains2 select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g); astext(g) +POINT(2 2) +POINT(2 4) +POINT(2 6) +POINT(2 8) +POINT(4 2) POINT(4 4) +POINT(4 6) +POINT(4 8) POINT(6 2) +POINT(6 4) POINT(6 6) +POINT(6 8) +POINT(8 2) POINT(8 4) +POINT(8 6) +POINT(8 8) DROP TABLE t1; select 0, ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); 0 ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) @@ -94,7 +136,7 @@ ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('P 1 select ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')); ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')) -0 +1 select ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')); ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')) 1 @@ -177,10 +219,10 @@ st_touches(geomfromtext('point(0 0)'), geomfromtext('point(1 1)')) 0 select st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')); st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')) -1 +0 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')) -1 +0 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')) 0 @@ -189,7 +231,7 @@ st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1.2, 1 0, 2 0, 1 1.2))')) -0 +1 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('polygon((1 1, 1 0, 2 0, 1 1))')) 1 @@ -319,7 +361,7 @@ PolygonFromText(' POLYGON( ( 2 2 , 3 2 , 3 3 , 2 5 , 2 2 ) ) ') ) ) POLYGON((2 0,2 5,3 3,3 2,7 5,2 0)) SELECT AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))); AsText(ST_INTERSECTION(LinestringFromText('LINESTRING(1 1, 2 2)'), GeometryFromText('LINESTRING(3 3, 4 4)'))) -GEOMETRYCOLLECTION() +GEOMETRYCOLLECTION EMPTY SELECT AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))); AsText(ST_UNION(GEOMETRYFROMTEXT('POINT(8 1)') ,MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 5, 2 5, 2 4, 3 4, 3 5))'))) GEOMETRYCOLLECTION(POINT(8 1),LINESTRING(2 4,2 5,3 5,3 4,2 4)) @@ -355,17 +397,6 @@ ST_NUMGEOMETRIES(ST_DIFFERENCE ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) 123 -SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( -ST_UNION ( -MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , -MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 4 5 , 3 0 , 3 1 , 4 7 , 4 2 ) , ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) -) , 1 -))); -ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( -ST_UNION ( -MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , -MULTILINESTRI -653 SELECT ASTEXT(ST_DIFFERENCE ( POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , ST_UNION ( @@ -414,9 +445,24 @@ NULL SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) ), MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) ) ; ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , NULL -SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; -ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 -25 SELECT ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)))'), geomETRYFROMTEXT(' MULTILINESTRING( ( 5 1 , 3 7 , 6 1 , 7 0 ) , ( 1 6 , 8 5 , 7 5 , 5 6 ) )') )); ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)) MULTIPOINT(7 5,7 5.14285714285714,5.9 5.3,5.8 5.6,3 7) +SELECT ST_CROSSES( GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 4, 2 5, 3 5) ) ') , POLYGONFROMTEXT(' POLYGON((2 4,3 4,3 5,2 5,2 4)) ')); +ST_CROSSES( GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 4, 2 5, 3 5) ) ') , POLYGONFROMTEXT(' POLYGON((2 4,3 4,3 5,2 5,2 4)) ')) +0 +SELECT ST_WITHIN( POLYGONFROMTEXT(' POLYGON( (0 5, 3 5, 3 4, 2 0 , 1 0, 2 4 , 0 4, 0 5) ) ') , POLYGONFROMTEXT(' POLYGON( (0 5, 3 5, 3 4, 1 4 , 1 3 , 3 3 , 3 0 , 0 0 , 0 5), ( 1 1 , 2 1 , 2 2 , 1 2 , 1 1 ) ) ') ); +ST_WITHIN( POLYGONFROMTEXT(' POLYGON( (0 5, 3 5, 3 4, 2 0 , 1 0, 2 4 , 0 4, 0 5) ) ') , POLYGONFROMTEXT(' POLYGON( (0 5, 3 5, 3 4, 1 4 , 1 3 , 3 3 , 3 0 , 0 0 , 0 5), ( 1 1 , 2 1 , 2 2 , 1 2 , 1 1 ) ) ') ) +0 +SELECT ST_WITHIN( POINTFROMTEXT(' POINT(1 2 ) ') , MULTIPOLYGONFROMTEXT(' MULTIPOLYGON( ( (0 5, 3 5, 3 0, 0 0, 0 5), ( 1 1 , 2 1 , 2 4, 1 4, 1 1 ) ) ) ')); +ST_WITHIN( POINTFROMTEXT(' POINT(1 2 ) ') , MULTIPOLYGONFROMTEXT(' MULTIPOLYGON( ( (0 5, 3 5, 3 0, 0 0, 0 5), ( 1 1 , 2 1 , 2 4, 1 4, 1 1 ) ) ) ')) +1 +select ST_ASTEXT(envelope(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION EMPTY'))); +ST_ASTEXT(envelope(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION EMPTY'))) +NULL +SELECT ST_EQUALS( GEOMETRYFROMTEXT(' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') , GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') ); +ST_EQUALS( GEOMETRYFROMTEXT(' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') , GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') ) +0 +SELECT ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ') ); +ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ') ) +0 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 8e630766004..bf5c48d11f6 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -237,14 +237,6 @@ SELECT ST_NUMGEOMETRIES(ST_DIFFERENCE ( )); -#bug 841638 Assertion `!m_prev || m_prev->x != x || m_prev->y != y' failed in Gcalc_shape_transporter::int_add_point in maria-5.3-gis -SELECT ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER ( - ST_UNION ( - MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 7 3 , 1 8 , 4 0 , 7 9 ) , ( 5 4 , 9 8 , 7 4 , 3 7 ) , ( 5 8 , 5 4 , 9 2 , 5 6 ) , ( 4 0 , 3 2 , 0 1 , 3 9 ) , ( 2 0 , 3 5 , 9 5 , 0 9 ) ) ' ) , - MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 4 5 , 3 0 , 3 1 , 4 7 , 4 2 ) , ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) - ) , 1 -))); - #bug 841745 ssertion `!sp0->is_bottom()' failed in Gcalc_scan_iterator::find_intersections in maria-5.3-gis SELECT ASTEXT(ST_DIFFERENCE ( POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , @@ -279,10 +271,30 @@ SELECT ST_BUFFER ( ) ; SELECT ST_DISTANCE ( ST_DIFFERENCE ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 5, 2 4, 3 4, 3 5) ) ) ' ) , MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) , ( ( 0 0 , 3 8 , 9 4 , 0 0 ) ) ) ' ) ), MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( (3 5, 2 4, 2 5, 3 5) ) , ( (3 5, 2 5, 2 4, 3 4, 3 5) ) , ( ( 0 0 , 8 3 , 9 5 , 0 0 ) ) ) ' ) ) ; -#bug 848901 Assertion `fabs(cur_isc->x-m_cur_intersection->x) + fabs(cur_isc->y-m_cur_intersection->y) < 0.000000000001' failed in Gcalc_scan_iterator::intersection_scan() in maria-5.3-gis - -SELECT ST_NUMGEOMETRIES( ST_SYMDIFFERENCE ( ST_SYMDIFFERENCE ( ST_INTERSECTION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 6 4 , 3 7 , 9 4 , 3 8 ) , ( 2 2 , 2 9 , 1 2 , 9 8 ) ) ' ) , ST_SYMDIFFERENCE ( MULTIPOINTFROMTEXT( ' MULTIPOINT( 6 1 , 3 8 , 3 3 , 0 6 , 7 2 , 3 4 ) ' ) , ST_BUFFER ( ST_UNION ( MULTIPOLYGONFROMTEXT( ' MULTIPOLYGON( ( ( 2 2 , 6 2 , 1 3 , 2 2 , 2 2 ) ) ) ' ) , GEOMETRYFROMTEXT( ' MULTILINESTRING( ( 1 4 , 9 9 , 3 0 , 6 6 ) , ( 3 5 , 1 0 , 5 8 , 6 1 ) , ( 8 9 , 6 1 , 5 1 , 6 2 ) , ( 2 2 , 7 5 , 5 8 , 6 9 , 3 0 ) , ( 8 0 , 8 4 , 6 7 , 5 5 ) ) ' ) ) , NUMPOINTS( EXTERIORRING( POLYGONFROMTEXT( ' POLYGON( ( 0 0 , 2 1 , 8 2 , 0 0 ) ) ' ) ) ) ) ) ) , ST_INTERSECTION ( POLYGONFROMTEXT( ' POLYGON( ( 2 3, 5 7 , 3 7 , 4 1 , 0 5, 2 3 ) ) ' ) , MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 3 , 1 4 , 6 4 , 9 1 , 3 4 , 1 8 ) , ( 9 9 , 0 3 , 1 7 , 9 9 ) ) ' ) ) ) , POLYGONFROMTEXT( ' POLYGON( ( 1 3, 7 2 , 1 5 , 3 8 , 5 0, 1 3) ) ' ) ) ) ; - #bug 848939 Wrong result with ST_INTERSECTION between linestrings and a polygon in 5.3-gis SELECT ASTEXT(ST_INTERSECTION( GEOMETRYFROMTEXT('GEOMETRYCOLLECTION(LINESTRING(7 7,5.33333333333333 7),LINESTRING(5.33333333333333 7,0 7,5 8,5.33333333333333 7),LINESTRING(5.33333333333333 7,7 2,7 7),POLYGON((0 5,3 5,3 2,1 2,1 1,3 1,3 0,0 0,0 3,2 3,2 4,0 4,0 5)))'), geomETRYFROMTEXT(' MULTILINESTRING( ( 5 1 , 3 7 , 6 1 , 7 0 ) , ( 1 6 , 8 5 , 7 5 , 5 6 ) )') )); +#bug 855485 ST_CROSSES returns different result than PostGIS for overlapping polygons + +SELECT ST_CROSSES( GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 4, 2 5, 3 5) ) ') , POLYGONFROMTEXT(' POLYGON((2 4,3 4,3 5,2 5,2 4)) ')); + +#bug 855487 ST_WITHIN returns wrong result for partially overlapping polygons + +SELECT ST_WITHIN( POLYGONFROMTEXT(' POLYGON( (0 5, 3 5, 3 4, 2 0 , 1 0, 2 4 , 0 4, 0 5) ) ') , POLYGONFROMTEXT(' POLYGON( (0 5, 3 5, 3 4, 1 4 , 1 3 , 3 3 , 3 0 , 0 0 , 0 5), ( 1 1 , 2 1 , 2 2 , 1 2 , 1 1 ) ) ') ); + +#bug 855492 ST_WITHIN returns TRUE on point on the edge of a polygon + +SELECT ST_WITHIN( POINTFROMTEXT(' POINT(1 2 ) ') , MULTIPOLYGONFROMTEXT(' MULTIPOLYGON( ( (0 5, 3 5, 3 0, 0 0, 0 5), ( 1 1 , 2 1 , 2 4, 1 4, 1 1 ) ) ) ')); + +#bug 855497 ST_ENVELOPE of GEOMETRYCOLLECTION EMPTY returns NULL and not GEOMETRYCOLLECTION EMPTY + +select ST_ASTEXT(envelope(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION EMPTY'))); + +#bug 855503 ST_EQUALS reports TRUE between a POLYGON and a MULTILINESTRING + +SELECT ST_EQUALS( GEOMETRYFROMTEXT(' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') , GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') ); + +#bug 855505 ST_TOUCHES reports TRUE for intersecting polygon and linestring + +SELECT ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ') ); + -- cgit v1.2.1 From 53ad390ff098cf6a1ef471128770b01219890058 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 23 Sep 2011 15:05:36 +0500 Subject: fix for 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON return GEOMETRYCOLLECTION EMPTY, not NULL for the query per-file comments: mysql-test/r/gis.result fix for 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON test result updated. sql/spatial.cc fix for 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON return of the Geometry::envelope() changed for the empty geometry. --- mysql-test/r/gis.result | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 7f54e088cf8..b7e5ccd6c53 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -236,8 +236,8 @@ fid AsText(Envelope(g)) 119 POLYGON((0 0,3 0,3 3,0 3,0 0)) 120 POLYGON((0 0,10 0,10 10,0 10,0 0)) 121 POLYGON((3 6,44 6,44 9,3 9,3 6)) -122 NULL -123 NULL +122 GEOMETRYCOLLECTION EMPTY +123 GEOMETRYCOLLECTION EMPTY explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 23 100.00 @@ -404,22 +404,22 @@ Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second; first second w c o e d t i r -120 120 1 1 0 1 0 1 1 1 +120 120 1 1 0 1 0 1 1 0 120 121 0 0 1 0 0 0 1 0 -120 122 0 1 NULL NULL NULL 0 NULL 0 -120 123 0 1 NULL NULL NULL 0 NULL 0 +120 122 0 1 NULL 0 NULL 0 NULL 0 +120 123 0 1 NULL 0 NULL 0 NULL 0 121 120 0 0 1 0 0 0 1 0 -121 121 1 1 0 1 0 1 1 1 -121 122 0 1 NULL NULL NULL 0 NULL 0 -121 123 0 1 NULL NULL NULL 0 NULL 0 -122 120 1 0 NULL NULL NULL 0 NULL 0 -122 121 1 0 NULL NULL NULL 0 NULL 0 -122 122 1 1 NULL NULL NULL 0 NULL 0 -122 123 1 1 NULL NULL NULL 0 NULL 0 -123 120 1 0 NULL NULL NULL 0 NULL 0 -123 121 1 0 NULL NULL NULL 0 NULL 0 -123 122 1 1 NULL NULL NULL 0 NULL 0 -123 123 1 1 NULL NULL NULL 0 NULL 0 +121 121 1 1 0 1 0 1 1 0 +121 122 0 1 NULL 0 NULL 0 NULL 0 +121 123 0 1 NULL 0 NULL 0 NULL 0 +122 120 1 0 NULL 0 NULL 0 NULL 0 +122 121 1 0 NULL 0 NULL 0 NULL 0 +122 122 1 1 NULL 1 NULL 0 NULL 0 +122 123 1 1 NULL 1 NULL 0 NULL 0 +123 120 1 0 NULL 0 NULL 0 NULL 0 +123 121 1 0 NULL 0 NULL 0 NULL 0 +123 122 1 1 NULL 1 NULL 0 NULL 0 +123 123 1 1 NULL 1 NULL 0 NULL 0 explain extended SELECT g1.fid as first, g2.fid as second, Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o, Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t, @@ -429,7 +429,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE g1 ALL NULL NULL NULL NULL 4 100.00 Using temporary; Using filesort 1 SIMPLE g2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,st_within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,st_contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,mbrequals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` +Note 1003 select `test`.`g1`.`fid` AS `first`,`test`.`g2`.`fid` AS `second`,st_within(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `w`,st_contains(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `c`,mbroverlaps(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `o`,st_equals(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `e`,mbrdisjoint(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `d`,st_touches(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `t`,mbrintersects(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `i`,st_crosses(`test`.`g1`.`g`,`test`.`g2`.`g`) AS `r` from `test`.`gis_geometrycollection` `g1` join `test`.`gis_geometrycollection` `g2` order by `test`.`g1`.`fid`,`test`.`g2`.`fid` DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE t1 ( gp point, @@ -867,7 +867,7 @@ mbroverlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrtouches FROM t1 a1 JOIN t1 a2 ON MBRTouches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrtouches -big,down2,left,left2,right,right2,small,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS mbrwithin FROM t1 a1 JOIN t1 a2 ON MBRWithin( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; mbrwithin big,center @@ -888,7 +888,7 @@ overlaps down,left,right,up SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS touches FROM t1 a1 JOIN t1 a2 ON Touches( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; touches -big,down2,left,left2,right,right2,small,up2 +big,center,down,down2,left,left2,right,right2,small,up,up2 SELECT GROUP_CONCAT(a2.name ORDER BY a2.name) AS within FROM t1 a1 JOIN t1 a2 ON Within( a1.square, a2.square) WHERE a1.name = "center" GROUP BY a1.name; within big,center -- cgit v1.2.1 From dca6ff48c1a26f8eab911f4ad246f56be5005fd7 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 23 Sep 2011 15:25:48 +0500 Subject: fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs The 'single point' event was forgotten in the relation's calculation per-file comments: mysql-test/r/gis-precise.result fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs test result updated. mysql-test/t/gis-precise.test fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs test case added. sql/gcalc_tools.cc fix for bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs scev_single_point is properly handled. --- mysql-test/r/gis-precise.result | 68 +++++++++-------------------------------- mysql-test/t/gis-precise.test | 5 +++ 2 files changed, 20 insertions(+), 53 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index ef621d11e54..209004b565f 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -7,7 +7,7 @@ select 0, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFro 0 0 select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')); 1 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POINT(10 10)')) -1 0 +1 1 select 1, ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); 1 ST_Intersects(GeomFromText('POLYGON((0 0,20 10,10 30, 0 0))'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) 1 1 @@ -25,90 +25,46 @@ insert into t1 values (GeomFromText('POINT(8 2)')), (GeomFromText('POINT(8 4)')), (GeomFromText('POINT(8 6)')), (GeomFromText('POINT(8 8)')); select astext(g) from t1 where ST_Within(g, GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))')); astext(g) -POINT(2 2) -POINT(2 4) -POINT(2 6) -POINT(2 8) -POINT(4 2) POINT(4 4) -POINT(4 6) -POINT(4 8) POINT(6 2) POINT(6 4) POINT(6 6) -POINT(6 8) -POINT(8 2) -POINT(8 4) -POINT(8 6) -POINT(8 8) select 'Contains'; Contains Contains select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); astext(g) -POINT(2 2) -POINT(2 4) -POINT(2 6) -POINT(2 8) -POINT(4 2) POINT(4 4) -POINT(4 6) -POINT(4 8) POINT(6 2) POINT(6 4) POINT(6 6) -POINT(6 8) -POINT(8 2) -POINT(8 4) -POINT(8 6) -POINT(8 8) select 'Intersects'; Intersects Intersects select astext(g) from t1 where ST_Intersects(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); astext(g) +POINT(4 4) +POINT(6 2) +POINT(6 4) +POINT(6 6) select 'Contains'; Contains Contains select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1))'), g); astext(g) -POINT(2 2) -POINT(2 4) -POINT(2 6) -POINT(2 8) -POINT(4 2) POINT(4 4) -POINT(4 6) -POINT(4 8) POINT(6 2) POINT(6 4) POINT(6 6) -POINT(6 8) -POINT(8 2) -POINT(8 4) -POINT(8 6) -POINT(8 8) select 'Contains2'; Contains2 Contains2 select astext(g) from t1 where ST_Contains(GeomFromText('POLYGON((5 1, 7 1, 7 7, 5 7, 3 3, 5 3, 5 1), (5.01 3.01, 6 5, 9 5, 8 3, 5.01 3.01))'), g); astext(g) -POINT(2 2) -POINT(2 4) -POINT(2 6) -POINT(2 8) -POINT(4 2) POINT(4 4) -POINT(4 6) -POINT(4 8) POINT(6 2) -POINT(6 4) POINT(6 6) -POINT(6 8) -POINT(8 2) POINT(8 4) -POINT(8 6) -POINT(8 8) DROP TABLE t1; select 0, ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')); 0 ST_Within(GeomFromText('LINESTRING(15 15, 50 50, 60 60)'), GeomFromText('POLYGON((10 10,30 20,20 40, 10 10))')) @@ -136,7 +92,7 @@ ST_Intersects(GeomFromText('POLYGON((0 0, 50 45, 40 50, 0 0))'), GeomFromText('P 1 select ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')); ST_contains(GeomFromText('MULTIPOLYGON(((0 0, 0 5, 5 5, 5 0, 0 0)), ((6 6, 6 11, 11 11, 11 6, 6 6)))'), GeomFromText('POINT(5 10)')) -1 +0 select ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')); ST_Disjoint(GeomFromText('POLYGON((0 0, 0 5, 5 5, 5 0, 0 0))'), GeomFromText('POLYGON((10 10, 10 15, 15 15, 15 10, 10 10))')) 1 @@ -219,10 +175,10 @@ st_touches(geomfromtext('point(0 0)'), geomfromtext('point(1 1)')) 0 select st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')); st_touches(geomfromtext('point(1 1)'), geomfromtext('point(1 1)')) -0 +1 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 1)')) -0 +1 select st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')); st_touches(geomfromtext('polygon((0 0, 2 2, 0 4, 0 0))'), geomfromtext('point(1 0)')) 0 @@ -459,10 +415,16 @@ ST_WITHIN( POINTFROMTEXT(' POINT(1 2 ) ') , MULTIPOLYGONFROMTEXT(' MULTIPOLYGON( 1 select ST_ASTEXT(envelope(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION EMPTY'))); ST_ASTEXT(envelope(ST_GEOMCOLLFROMTEXT('GEOMETRYCOLLECTION EMPTY'))) -NULL +GEOMETRYCOLLECTION EMPTY SELECT ST_EQUALS( GEOMETRYFROMTEXT(' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') , GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') ); ST_EQUALS( GEOMETRYFROMTEXT(' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') , GEOMETRYFROMTEXT(' POLYGON( (3 5, 2 5, 2 4, 3 4, 3 5) ) ') ) 0 SELECT ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ') ); ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ') ) 0 +SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT(' MULTIPOINT( 5 8 , 5 2 , 1 8 , 3 0 , 3 0 , 7 8 ) ') ); +ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT(' MULTIPOINT( 5 8 , 5 2 , 1 8 , 3 0 , 3 0 , 7 8 ) ') ) +0 +SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT('MULTIPOINT( 4 0 , 6 9 , 5 1, 1 4 )') ); +ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT('MULTIPOINT( 4 0 , 6 9 , 5 1, 1 4 )') ) +1 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index bf5c48d11f6..78b2c0287f6 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -298,3 +298,8 @@ SELECT ST_EQUALS( GEOMETRYFROMTEXT(' MULTILINESTRING( (3 5, 2 5, 2 4, 3 4, 3 5) SELECT ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ') ); +#bug 857051 ST_EQUALS returns TRUE on two nonidentical MULTIPOINTs + +SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT(' MULTIPOINT( 5 8 , 5 2 , 1 8 , 3 0 , 3 0 , 7 8 ) ') ); +SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT('MULTIPOINT( 4 0 , 6 9 , 5 1, 1 4 )') ); + -- cgit v1.2.1 From 5b83aee35dffff0de4758a2a595624a18bec2b3e Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 23 Sep 2011 15:36:56 +0500 Subject: bug #857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON actually only testcase added as the bug was fixed already. modified: mysql-test/r/gis-precise.result bug #857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON test result updated. mysql-test/t/gis-precise.test bug #857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON test case added. sql/gcalc_tools.cc superfluous variable removed. --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 3 +++ 2 files changed, 6 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 209004b565f..1bfd805d141 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -428,3 +428,6 @@ ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPO SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT('MULTIPOINT( 4 0 , 6 9 , 5 1, 1 4 )') ); ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT('MULTIPOINT( 4 0 , 6 9 , 5 1, 1 4 )') ) 1 +SELECT ST_WITHIN( MULTIPOINTFROMTEXT(' MULTIPOINT( 2 9 , 2 9 , 4 9 , 9 1 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ')); +ST_WITHIN( MULTIPOINTFROMTEXT(' MULTIPOINT( 2 9 , 2 9 , 4 9 , 9 1 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ')) +0 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 78b2c0287f6..36218c56f17 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -303,3 +303,6 @@ SELECT ST_TOUCHES( GEOMETRYFROMTEXT(' LINESTRING( 1 1 , 1 4 , 5 0 , 8 3 ) ') , P SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT(' MULTIPOINT( 5 8 , 5 2 , 1 8 , 3 0 , 3 0 , 7 8 ) ') ); SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPOINTFROMTEXT('MULTIPOINT( 4 0 , 6 9 , 5 1, 1 4 )') ); +#bug 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON +SELECT ST_WITHIN( MULTIPOINTFROMTEXT(' MULTIPOINT( 2 9 , 2 9 , 4 9 , 9 1 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ')); + -- cgit v1.2.1 From 6e7d578b2b3fad8671504785b757e53b11516b22 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Fri, 23 Sep 2011 17:00:36 +0500 Subject: bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs Line autointersection point was treated as if it doesn't belong to the line. It's in some way logical, but seems to confuse people. Fixed. per_file_comments: mysql-test/r/gis-precise.result bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs test result updated. mysql-test/t/gis-precise.test bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs test case added. sql/gcalc_tools.cc bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs Point of line autointersection handled as it belongs to the line. sql/gcalc_tools.h bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs Gcalc_function::set_i_state() added --- mysql-test/r/gis-precise.result | 3 +++ mysql-test/t/gis-precise.test | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 1bfd805d141..9086dec78a0 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -431,3 +431,6 @@ ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , MULTIPO SELECT ST_WITHIN( MULTIPOINTFROMTEXT(' MULTIPOINT( 2 9 , 2 9 , 4 9 , 9 1 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ')); ST_WITHIN( MULTIPOINTFROMTEXT(' MULTIPOINT( 2 9 , 2 9 , 4 9 , 9 1 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ')) 0 +SELECT ST_INTERSECTS( GeomFromText('MULTILINESTRING( ( 4030 3045 , 3149 2461 , 3004 3831 , 3775 2976 ) )') , GeomFromText('LINESTRING(3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29,3039.07 3175.05,3039.07 3175.05,3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29)') ); +ST_INTERSECTS( GeomFromText('MULTILINESTRING( ( 4030 3045 , 3149 2461 , 3004 3831 , 3775 2976 ) )') , GeomFromText('LINESTRING(3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29,3039.07 3175.05,3039.07 3175.05,3058.41 3187.91,3081.52 3153.19, +1 diff --git a/mysql-test/t/gis-precise.test b/mysql-test/t/gis-precise.test index 36218c56f17..1de8726a7bc 100644 --- a/mysql-test/t/gis-precise.test +++ b/mysql-test/t/gis-precise.test @@ -306,3 +306,7 @@ SELECT ST_EQUALS( MULTIPOINTFROMTEXT(' MULTIPOINT( 5 1 , 6 9 , 1 4 , 4 0 ) ') , #bug 857050 ST_WITHIN returns wrong result with MULTIPOINT and POLYGON SELECT ST_WITHIN( MULTIPOINTFROMTEXT(' MULTIPOINT( 2 9 , 2 9 , 4 9 , 9 1 ) ') , POLYGONFROMTEXT(' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ')); +#bug 857087 Wrong result with ST_INTERSECTS and LINESTRINGs + +SELECT ST_INTERSECTS( GeomFromText('MULTILINESTRING( ( 4030 3045 , 3149 2461 , 3004 3831 , 3775 2976 ) )') , GeomFromText('LINESTRING(3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29,3039.07 3175.05,3039.07 3175.05,3058.41 3187.91,3081.52 3153.19,3042.99 3127.57,3019.89 3162.29)') ); + -- cgit v1.2.1 From 0048f0b1aefa1206c6d8f35707ded2f87bc8aec1 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 5 Oct 2011 14:45:39 +0500 Subject: Valgrind warning fixed. Coordinate size limitation removed. per-file comments: mysql-test/r/gis-precise.result test result updated. sql/gcalc_slicescan.cc Check coordinate extent to pick better precidion in the ::set_double() sql/gcalc_slicescan.h free_list() can lead to valgrind warnig. Fixed sql/gcalc_tools.cc free_list() call changed. --- mysql-test/r/gis-precise.result | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/gis-precise.result b/mysql-test/r/gis-precise.result index 9086dec78a0..8c9495b1a8d 100644 --- a/mysql-test/r/gis-precise.result +++ b/mysql-test/r/gis-precise.result @@ -255,7 +255,7 @@ ST_NUMGEOMETRIES((ST_UNION(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((2 0,4 2,0 2,1 5,0 3,7 0,8 5,5 8), (6 2,4 0,3 5,3 6,4 3,6 4,3 9,0 7,3 7,8 4,2 9,5 0), -185 +192 SELECT Round(ST_AREA(ST_BUFFER( ST_UNION( POLYGONFROMTEXT('POLYGON((7 7, 7 7, 7 4, 7 7, 7 7))'), POLYGONFROMTEXT('POLYGON((7 7, 4 7, 2 9, 7 6, 7 7))')), 1)), 6); @@ -336,7 +336,7 @@ MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2, 1 5))') ST_NUMPOINTS(ST_EXTERIORRING(ST_BUFFER(ST_UNION( MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 2 5, 7 6, 1 8),(0 0 ,1 6 ,0 1, 8 9, 2 4, 6 1, 3 5, 4 8), (9 3, 5 4, 1 8, 4 2, 5 8, 3 0))' ) , MULTILINESTRINGFROMTEXT('MULTILINESTRING((3 4, 3 1, 2 7, 4 2, 6 2 -275 +278 SELECT ST_NUMGEOMETRIES(ST_DIFFERENCE ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) ) ' ), @@ -352,7 +352,7 @@ MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 9 , 1 3 , 7 3 , 8 5 ) , ( 5 0 , ST_NUMGEOMETRIES(ST_DIFFERENCE ( ST_UNION ( MULTILINESTRINGFROMTEXT( ' MULTILINESTRING( ( 2 4 , 5 0 , 2 9 , 6 2 , 0 2 ) , ( 4 3 , 5 6 , 9 4 , 0 7 , 7 2 , 2 0 , 8 2 ) , ( 5 0 , 1 5 , 3 7 , 7 7 ) , ( 2 3 , 9 5 , 2 0 , 8 1 ) , ( 0 9 , 9 3 , 2 8 , 8 1 , 9 4 ) -123 +125 SELECT ASTEXT(ST_DIFFERENCE ( POLYGONFROMTEXT( ' POLYGON( ( 2 2 , 2 8 , 8 8 , 8 2 , 2 2 ) , ( 4 4 , 4 6 , 6 6 , 6 4 , 4 4 ) ) ' ) , ST_UNION ( -- cgit v1.2.1