Description:
If it is possible it nice to have "insert validation" when we insert the Lat and Long data to the column with SRID.
How to repeat:
Example:
1) Sample table
root@localhost [GIS]> CREATE TABLE geom (
-> p POINT NOT NULL SRID 0,
-> g GEOMETRY NOT NULL SRID 4326,
-> GeoHash5 varchar(5) GENERATED ALWAYS AS (st_geohash(`g`,5)) VIRTUAL,
-> GeoHash8 varchar(8) GENERATED ALWAYS AS (st_geohash(`g`,8)) VIRTUAL
-> );
2) Insert the data order with latitude-longitude to the column p.
root@localhost [GIS]> INSERT INTO geom(p,g) VALUES(ST_GeomFromText('POINT(35.671482 139.718695)'),ST_GeomFromText('POINT(35.671482 139.718695)',4326));
Query OK, 1 row affected (0.00 sec)
root@localhost [GIS]> select st_geohash(p,5),st_geohash(g,5),GeoHash5,GeoHash8 from geom;
ERROR 1690 (22003): latitude value is out of range in 'st_geohash'
3) Insert the data order with longitude-latitude to the column p.
It is working fine without error.
root@localhost [GIS]> INSERT INTO geom(p,g) VALUES(ST_GeomFromText('POINT(139.718695 35.671482)'),ST_GeomFromText('POINT(35.671482 139.718695)',4326));
Query OK, 1 row affected (0.00 sec)
root@localhost [GIS]> select st_geohash(p,5),st_geohash(g,5),GeoHash5,GeoHash8 from geom;
+-----------------+-----------------+----------+----------+
| st_geohash(p,5) | st_geohash(g,5) | GeoHash5 | GeoHash8 |
+-----------------+-----------------+----------+----------+
| xn76g | xn76g | xn76g | xn76gmu1 |
+-----------------+-----------------+----------+----------+
1 row in set (0.00 sec)
root@localhost [GIS]>