[MDEV-28266] Crash in Field_string::type_handler when calling procedures Created: 2022-04-08  Updated: 2022-05-10  Resolved: 2022-04-13

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.6
Fix Version/s: 10.3.35, 10.4.25, 10.5.16, 10.6.8, 10.7.4, 10.8.3, 10.9.1

Type: Bug Priority: Critical
Reporter: Oleksandr Byelkin Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
Relates

 Description   

CREATE TABLE t (f INT);
 
--delimiter $
CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW
    FOR x IN (SELECT * FROM json_table(NULL, '$' COLUMNS(a CHAR(1) path '$.*')) tmp)  
    DO set @a=1; END FOR $
--delimiter ;
 
INSERT INTO t () values ();
 
# Cleanup
DROP TABLE t;



 Comments   
Comment by Oleksandr Byelkin [ 2022-04-08 ]

Fix for 10.6, but I think it will be better to push it in 10.6 with the test and in 10.3 without test (syntax is incompatible).

commit e3e59c9e38d5405942b6449a2cdc044e67c27790 (HEAD -> bb-10.6-MDEV-28266, origin/bb-10.6-MDEV-28266)
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Fri Apr 8 10:37:17 2022 +0200
 
    MDEV-28266 Crash in Field_string::type_handler when calling procedures
    
    In case of only metadata request the cursor lack the call to redirect
    Field::orig_table to the temporary table.

Comment by Oleksandr Byelkin [ 2022-04-11 ]

commit 4218c3b1cfcb0af7268a45df34861d954ded29f0 (HEAD -> bb-10.6-MDEV-28266, origin/bb-10.6-MDEV-28266)
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date:   Fri Apr 8 10:37:17 2022 +0200
 
    MDEV-28266 Crash in Field_string::type_handler when calling procedures
    
    on_table_fill_finished() should always be done at the end of open()
    even if result is not Select_materialize but (for example)
    Select_fetch_into_spvars.

Comment by Sergei Golubchik [ 2022-04-11 ]

4218c3b1cfcb0af7268a45df34861d954ded29f0 is ok to push (presuming it passes all tests, as always. I didn't check buildbot myself)

Generated at Thu Feb 08 09:59:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.