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

MDEV-20207: Assertion ! is_set() failed in Diagnostics_area::set_eof_status

upon HANDLER READ

Analysis: The error state is not stored while checking condition and key
name.
Fix: Return true while checking condition and key name if error is reported
because geometry object can't be created from the data in the index value
for HANDLER READ.
This commit is contained in:
Rucha Deodhar
2022-01-27 01:03:52 +05:30
parent 25ccf8f6dc
commit 9b2d36660b
9 changed files with 145 additions and 1 deletions

View File

@ -1845,3 +1845,19 @@ a b
HANDLER t1 CLOSE; HANDLER t1 CLOSE;
DROP TABLE t1; DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
#
# 10.2 Test
#
# MDEV-20207: Assertion `! is_set()' failed in
# Diagnostics_area::set_eof_status upon HANDLER READ
#
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 'test.t1'
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
HANDLER h READ a = (0);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
HANDLER h CLOSE;
DROP TABLE t1;
# End of 10.2 Test

View File

@ -80,3 +80,23 @@ HANDLER t1 CLOSE;
DROP TABLE t1; DROP TABLE t1;
--echo End of 5.1 tests --echo End of 5.1 tests
--echo #
--echo # 10.2 Test
--echo #
--echo # MDEV-20207: Assertion `! is_set()' failed in
--echo # Diagnostics_area::set_eof_status upon HANDLER READ
--echo #
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
--error ER_CANT_CREATE_GEOMETRY_OBJECT
HANDLER h READ a = (0);
HANDLER h CLOSE;
DROP TABLE t1;
--echo # End of 10.2 Test

View File

@ -1748,3 +1748,19 @@ HANDLER t1 READ `PRIMARY` PREV;
f1 f2 f1 f2
3 3 3 3
DROP TABLE t1; DROP TABLE t1;
#
# 10.2 Test
#
# MDEV-20207: Assertion `! is_set()' failed in
# Diagnostics_area::set_eof_status upon HANDLER READ
#
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 'test.t1'
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
HANDLER h READ a = (0);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
HANDLER h CLOSE;
DROP TABLE t1;
# End of 10.2 Test

View File

@ -31,3 +31,23 @@ HANDLER t1 OPEN;
HANDLER t1 READ FIRST WHERE f2 <= 1; HANDLER t1 READ FIRST WHERE f2 <= 1;
HANDLER t1 READ `PRIMARY` PREV; HANDLER t1 READ `PRIMARY` PREV;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # 10.2 Test
--echo #
--echo # MDEV-20207: Assertion `! is_set()' failed in
--echo # Diagnostics_area::set_eof_status upon HANDLER READ
--echo #
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
--error ER_CANT_CREATE_GEOMETRY_OBJECT
HANDLER h READ a = (0);
HANDLER h CLOSE;
DROP TABLE t1;
--echo # End of 10.2 Test

View File

@ -312,3 +312,19 @@ Note 1050 Table 'v' already exists
handler v read next; handler v read next;
ERROR 42S02: Unknown table 'v' in HANDLER ERROR 42S02: Unknown table 'v' in HANDLER
drop view v; drop view v;
#
# 10.2 Test
#
# MDEV-20207: Assertion `! is_set()' failed in
# Diagnostics_area::set_eof_status upon HANDLER READ
#
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 'test.t1'
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
HANDLER h READ a = (0);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
HANDLER h CLOSE;
DROP TABLE t1;
# End of 10.2 Test

View File

@ -354,3 +354,23 @@ execute stmt;
--error ER_UNKNOWN_TABLE --error ER_UNKNOWN_TABLE
handler v read next; handler v read next;
drop view v; drop view v;
--echo #
--echo # 10.2 Test
--echo #
--echo # MDEV-20207: Assertion `! is_set()' failed in
--echo # Diagnostics_area::set_eof_status upon HANDLER READ
--echo #
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
--error ER_CANT_CREATE_GEOMETRY_OBJECT
HANDLER h READ a = (0);
HANDLER h CLOSE;
DROP TABLE t1;
--echo # End of 10.2 Test

View File

@ -1931,3 +1931,17 @@ test.t1 preload_keys status OK
HANDLER t1 READ FIRST; HANDLER t1 READ FIRST;
ERROR 42S02: Unknown table 't1' in HANDLER ERROR 42S02: Unknown table 't1' in HANDLER
End of 5.1 tests End of 5.1 tests
#
# 10.2 Test
#
# MDEV-20207: Assertion `! is_set()' failed in
# Diagnostics_area::set_eof_status upon HANDLER READ
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
HANDLER h READ a = (0);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
HANDLER h CLOSE;
DROP TABLE t1;
# End of 10.2 Test

View File

@ -169,3 +169,23 @@ HANDLER t1 READ FIRST;
--echo End of 5.1 tests --echo End of 5.1 tests
--echo #
--echo # 10.2 Test
--echo #
--echo # MDEV-20207: Assertion `! is_set()' failed in
--echo # Diagnostics_area::set_eof_status upon HANDLER READ
--echo #
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a POINT, KEY(a));
HANDLER t1 OPEN h;
--error ER_CANT_CREATE_GEOMETRY_OBJECT
HANDLER h READ a = (0);
HANDLER h CLOSE;
DROP TABLE t1;
--echo # End of 10.2 Test

View File

@ -613,8 +613,10 @@ mysql_ha_fix_cond_and_key(SQL_HANDLER *handler,
if (!in_prepare) if (!in_prepare)
{ {
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set); MY_BITMAP *old_map= dbug_tmp_use_all_columns(table, &table->write_set);
(void) item->save_in_field(key_part->field, 1); int res= item->save_in_field(key_part->field, 1);
dbug_tmp_restore_column_map(&table->write_set, old_map); dbug_tmp_restore_column_map(&table->write_set, old_map);
if (res)
return 1;
} }
key_len+= key_part->store_length; key_len+= key_part->store_length;
keypart_map= (keypart_map << 1) | 1; keypart_map= (keypart_map << 1) | 1;