mariadb/mysql-test/suite/compat/oracle/t/update.test
Nikita Malyavin e33064e0fc MDEV-27769 Assertion failed in Field::ptr_in_record upon UPDATE in ORACLE mode
table->move_fields has some limitations:
1. It cannot be used in cascade
2. It should always have a restoring pair

In this case, an error has occurred before the field ptr was restored, returning
from the function in that state. Even in case of an error, the table can be
reused afterwards and table->field[i]->ptr is not reset in between.

The solution is to restore the field pointers immanently whenever they've been
deviated.

Also add an assertion that ensures that table fields are restored after the use
in close_thread_tables.
2025-01-26 16:15:46 +01:00

19 lines
485 B
Text

SET @save_sql_mode=@@global.sql_mode;
SET sql_mode=ORACLE;
SET GLOBAL sql_mode='ORACLE';
--echo # MDEV-27769 Assertion failed in Field::ptr_in_record upon UPDATE
CREATE TABLE t (s geometry, t text) engine innodb;
INSERT IGNORE INTO t () VALUES ();
--error ER_CANT_CREATE_GEOMETRY_OBJECT
UPDATE IGNORE t SET t= '', s = 0;
--error ER_CANT_CREATE_GEOMETRY_OBJECT
UPDATE IGNORE t SET t= '', s = 0;
ALTER TABLE t force;
DROP TABLE t;
# Test cleanup
SET GLOBAL sql_mode=@save_sql_mode;