1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-32456: incorrect result of gis function in view protocol

There are 3 diff in result:
1) NULL value from SELECT
Due to incorrect truncating of the hex value, incorrect value is
written instead of original value to the view frm. This results in reading
incorrect value from frm, so eventual result is NULL.
2) 'Name_exp1' in column name (in gis.test)
This was because the identifier in SELECT is longer than 64 characters,
so 'Name_exp1' alias is also written to the view frm.
3)diff in explain extended
This was because the query plan for view protocol doesn't
contain database name. As a fix, disable view protocol for that particular
query.
This commit is contained in:
Rucha Deodhar
2024-07-09 23:44:44 +05:30
parent 4a89f79b6a
commit 1f28350b59
7 changed files with 34 additions and 21 deletions

View File

@ -433,8 +433,8 @@ gc geometrycollection YES NULL
gm geometry YES NULL
fid int(11) NO NULL
DROP TABLE t1;
SELECT ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)'))));
ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)'))))
SELECT ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)')))) AS val;
val
POINT(1 4)
explain extended SELECT ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)'))));
id select_type table type possible_keys key key_len ref rows filtered Extra
@ -668,11 +668,11 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (ST_pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null
drop table t1;
select (ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000))));
(ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000))))
select (ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000)))) AS val;
val
POINT(10 10)
select (ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440))));
(ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440))))
select (ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440)))) AS val;
val
POINT(10 10)
create table t1 (g GEOMETRY);
select * from t1;

View File

@ -433,8 +433,8 @@ gc geometrycollection YES NULL
gm geometry YES NULL
fid int(11) NO NULL
DROP TABLE t1;
SELECT ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)'))));
ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)'))))
SELECT ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)')))) AS val;
val
POINT(1 4)
explain extended SELECT ST_AsText(ST_GeometryFromWKB(ST_AsWKB(ST_GeometryFromText('POINT(1 4)'))));
id select_type table type possible_keys key key_len ref rows filtered Extra
@ -668,11 +668,11 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (ST_pointfromtext('point(1,1)'));
ERROR 23000: Column 'fl' cannot be null
drop table t1;
select (ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000))));
(ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000))))
select (ST_asWKT(ST_geomfromwkb((0x000000000140240000000000004024000000000000)))) AS val;
val
POINT(10 10)
select (ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440))));
(ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440))))
select (ST_asWKT(ST_geomfromwkb((0x010100000000000000000024400000000000002440)))) AS val;
val
POINT(10 10)
create table t1 (g GEOMETRY);
select * from t1;