Skip to content

Commit 8570781

Browse files
committed
WL#9435 Axis order in WKB parsing functions
This WL modifies all from_wkb functions to take into consideration spatial reference systems latitude-longitude and longitude-latitude axis. An nonobligatory options argument and an option argument value to override the default and specify a particular axis order is also added.
1 parent 5b45849 commit 8570781

File tree

9 files changed

+1328
-142
lines changed

9 files changed

+1328
-142
lines changed

mysql-test/r/gis.result

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,7 @@ POLYGON((67 13,67 18,59 18,59 13,67 13))
13561356
Warnings:
13571357
Warning 3565 There's no spatial reference system with SRID 101. The axis order is unknown.
13581358
Warning 3565 There's no spatial reference system with SRID 101. The axis order is unknown.
1359+
Warning 3565 There's no spatial reference system with SRID 101. The axis order is unknown.
13591360
# Conformance Item T10
13601361
SELECT ST_SRID(boundary)
13611362
FROM named_places
@@ -3425,48 +3426,78 @@ Warning 3565 There's no spatial reference system with SRID 1. The axis order is
34253426
SELECT ST_SRID(ST_GEOMCOLLFROMWKB(@wkb_gc, 1));
34263427
ST_SRID(ST_GEOMCOLLFROMWKB(@wkb_gc, 1))
34273428
1
3429+
Warnings:
3430+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34283431
SELECT ST_SRID(ST_GEOMETRYCOLLECTIONFROMWKB(@wkb_gc, 1));
34293432
ST_SRID(ST_GEOMETRYCOLLECTIONFROMWKB(@wkb_gc, 1))
34303433
1
3434+
Warnings:
3435+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34313436
SELECT ST_SRID(ST_GEOMETRYFROMWKB(@wkb_pt, 1));
34323437
ST_SRID(ST_GEOMETRYFROMWKB(@wkb_pt, 1))
34333438
1
3439+
Warnings:
3440+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34343441
SELECT ST_SRID(ST_GEOMFROMWKB(@wkb_pt, 1));
34353442
ST_SRID(ST_GEOMFROMWKB(@wkb_pt, 1))
34363443
1
3444+
Warnings:
3445+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34373446
SELECT ST_SRID(ST_LINEFROMWKB(@wkb_ls, 1));
34383447
ST_SRID(ST_LINEFROMWKB(@wkb_ls, 1))
34393448
1
3449+
Warnings:
3450+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34403451
SELECT ST_SRID(ST_LINESTRINGFROMWKB(@wkb_ls, 1));
34413452
ST_SRID(ST_LINESTRINGFROMWKB(@wkb_ls, 1))
34423453
1
3454+
Warnings:
3455+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34433456
SELECT ST_SRID(ST_MLINEFROMWKB(@wkb_mls, 1));
34443457
ST_SRID(ST_MLINEFROMWKB(@wkb_mls, 1))
34453458
1
3459+
Warnings:
3460+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34463461
SELECT ST_SRID(ST_MPOINTFROMWKB(@wkb_mpt, 1));
34473462
ST_SRID(ST_MPOINTFROMWKB(@wkb_mpt, 1))
34483463
1
3464+
Warnings:
3465+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34493466
SELECT ST_SRID(ST_MPOLYFROMWKB(@wkb_mpy, 1));
34503467
ST_SRID(ST_MPOLYFROMWKB(@wkb_mpy, 1))
34513468
1
3469+
Warnings:
3470+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34523471
SELECT ST_SRID(ST_MULTILINESTRINGFROMWKB(@wkb_mls, 1));
34533472
ST_SRID(ST_MULTILINESTRINGFROMWKB(@wkb_mls, 1))
34543473
1
3474+
Warnings:
3475+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34553476
SELECT ST_SRID(ST_MULTIPOINTFROMWKB(@wkb_mpt, 1));
34563477
ST_SRID(ST_MULTIPOINTFROMWKB(@wkb_mpt, 1))
34573478
1
3479+
Warnings:
3480+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34583481
SELECT ST_SRID(ST_MULTIPOLYGONFROMWKB(@wkb_mpy, 1));
34593482
ST_SRID(ST_MULTIPOLYGONFROMWKB(@wkb_mpy, 1))
34603483
1
3484+
Warnings:
3485+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34613486
SELECT ST_SRID(ST_POINTFROMWKB(@wkb_pt, 1));
34623487
ST_SRID(ST_POINTFROMWKB(@wkb_pt, 1))
34633488
1
3489+
Warnings:
3490+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34643491
SELECT ST_SRID(ST_POLYFROMWKB(@wkb_py, 1));
34653492
ST_SRID(ST_POLYFROMWKB(@wkb_py, 1))
34663493
1
3494+
Warnings:
3495+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34673496
SELECT ST_SRID(ST_POLYGONFROMWKB(@wkb_py, 1));
34683497
ST_SRID(ST_POLYGONFROMWKB(@wkb_py, 1))
34693498
1
3499+
Warnings:
3500+
Warning 3565 There's no spatial reference system with SRID 1. The axis order is unknown.
34703501
SELECT ST_SRID(ST_GEOMCOLLFROMTEXT(@wkt_gc, 4294967295));
34713502
ST_SRID(ST_GEOMCOLLFROMTEXT(@wkt_gc, 4294967295))
34723503
4294967295
@@ -3550,48 +3581,78 @@ Warning 3565 There's no spatial reference system with SRID 4294967295. The axis
35503581
SELECT ST_SRID(ST_GEOMCOLLFROMWKB(@wkb_gc, 4294967295));
35513582
ST_SRID(ST_GEOMCOLLFROMWKB(@wkb_gc, 4294967295))
35523583
4294967295
3584+
Warnings:
3585+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35533586
SELECT ST_SRID(ST_GEOMETRYCOLLECTIONFROMWKB(@wkb_gc, 4294967295));
35543587
ST_SRID(ST_GEOMETRYCOLLECTIONFROMWKB(@wkb_gc, 4294967295))
35553588
4294967295
3589+
Warnings:
3590+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35563591
SELECT ST_SRID(ST_GEOMETRYFROMWKB(@wkb_pt, 4294967295));
35573592
ST_SRID(ST_GEOMETRYFROMWKB(@wkb_pt, 4294967295))
35583593
4294967295
3594+
Warnings:
3595+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35593596
SELECT ST_SRID(ST_GEOMFROMWKB(@wkb_pt, 4294967295));
35603597
ST_SRID(ST_GEOMFROMWKB(@wkb_pt, 4294967295))
35613598
4294967295
3599+
Warnings:
3600+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35623601
SELECT ST_SRID(ST_LINEFROMWKB(@wkb_ls, 4294967295));
35633602
ST_SRID(ST_LINEFROMWKB(@wkb_ls, 4294967295))
35643603
4294967295
3604+
Warnings:
3605+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35653606
SELECT ST_SRID(ST_LINESTRINGFROMWKB(@wkb_ls, 4294967295));
35663607
ST_SRID(ST_LINESTRINGFROMWKB(@wkb_ls, 4294967295))
35673608
4294967295
3609+
Warnings:
3610+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35683611
SELECT ST_SRID(ST_MLINEFROMWKB(@wkb_mls, 4294967295));
35693612
ST_SRID(ST_MLINEFROMWKB(@wkb_mls, 4294967295))
35703613
4294967295
3614+
Warnings:
3615+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35713616
SELECT ST_SRID(ST_MPOINTFROMWKB(@wkb_mpt, 4294967295));
35723617
ST_SRID(ST_MPOINTFROMWKB(@wkb_mpt, 4294967295))
35733618
4294967295
3619+
Warnings:
3620+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35743621
SELECT ST_SRID(ST_MPOLYFROMWKB(@wkb_mpy, 4294967295));
35753622
ST_SRID(ST_MPOLYFROMWKB(@wkb_mpy, 4294967295))
35763623
4294967295
3624+
Warnings:
3625+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35773626
SELECT ST_SRID(ST_MULTILINESTRINGFROMWKB(@wkb_mls, 4294967295));
35783627
ST_SRID(ST_MULTILINESTRINGFROMWKB(@wkb_mls, 4294967295))
35793628
4294967295
3629+
Warnings:
3630+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35803631
SELECT ST_SRID(ST_MULTIPOINTFROMWKB(@wkb_mpt, 4294967295));
35813632
ST_SRID(ST_MULTIPOINTFROMWKB(@wkb_mpt, 4294967295))
35823633
4294967295
3634+
Warnings:
3635+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35833636
SELECT ST_SRID(ST_MULTIPOLYGONFROMWKB(@wkb_mpy, 4294967295));
35843637
ST_SRID(ST_MULTIPOLYGONFROMWKB(@wkb_mpy, 4294967295))
35853638
4294967295
3639+
Warnings:
3640+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35863641
SELECT ST_SRID(ST_POINTFROMWKB(@wkb_pt, 4294967295));
35873642
ST_SRID(ST_POINTFROMWKB(@wkb_pt, 4294967295))
35883643
4294967295
3644+
Warnings:
3645+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35893646
SELECT ST_SRID(ST_POLYFROMWKB(@wkb_py, 4294967295));
35903647
ST_SRID(ST_POLYFROMWKB(@wkb_py, 4294967295))
35913648
4294967295
3649+
Warnings:
3650+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35923651
SELECT ST_SRID(ST_POLYGONFROMWKB(@wkb_py, 4294967295));
35933652
ST_SRID(ST_POLYGONFROMWKB(@wkb_py, 4294967295))
35943653
4294967295
3654+
Warnings:
3655+
Warning 3565 There's no spatial reference system with SRID 4294967295. The axis order is unknown.
35953656
SELECT ST_SRID(ST_GEOMCOLLFROMTEXT(@wkt_gc, 4294967296));
35963657
ERROR 22003: SRID value is out of range in 'st_geomcollfromtext'
35973658
SELECT ST_SRID(ST_GEOMCOLLFROMTXT(@wkt_gc, 4294967296));

mysql-test/suite/gis/r/gis_bugs_crashes.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,7 @@ Warning 3565 There's no spatial reference system with SRID 10. The axis order is
11331133
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
11341134
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function st_union will be done in SRID 0.
11351135
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
1136+
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
11361137
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function st_union will be done in SRID 0.
11371138
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function mbrcontains will be done in SRID 0.
11381139
SELECT ST_INTERSECTS(ST_SYMDIFFERENCE(
@@ -1193,6 +1194,7 @@ Warning 3565 There's no spatial reference system with SRID 10. The axis order is
11931194
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
11941195
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function st_union will be done in SRID 0.
11951196
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
1197+
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
11961198
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function st_union will be done in SRID 0.
11971199
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function mbrcontains will be done in SRID 0.
11981200
SELECT ST_CONTAINS(ST_UNION(
@@ -1280,6 +1282,8 @@ ST_INTERSECTION(
12801282
ST_GEOM
12811283
NULL
12821284
Warnings:
1285+
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
1286+
Warning 3565 There's no spatial reference system with SRID 10. The axis order is unknown.
12831287
Warning 3519 There's no spatial reference system with SRID 10. Calculations in function st_symdifference will be done in SRID 0.
12841288
SELECT ST_DISJOINT(ST_GEOMFROMTEXT(
12851289
'MULTIPOINT(189.7654 2)'),

0 commit comments

Comments
 (0)