SQLite

View Ticket
Login
2014-04-14
19:48
Make sure the undocumented sqlite_rename_parent() function does not crash even if it is invoked with NULL arguments. Ticket [264b970c4379fd4b94] (check-in: c6fa8d0d user: drh tags: trunk)
19:48 Fixed ticket [264b970c]: Crash when calling sqlite_rename_parent() with NULL parameters. plus 5 other changes (artifact: b9804f7e user: drh)
19:46 New ticket [264b970c]. (artifact: 9c40070d user: drh)

Ticket Hash: 264b970c4379fd4b94c1173d9623d619675f20c7
Title: Crash when calling sqlite_rename_parent() with NULL parameters.
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2014-04-14 19:48:16
Version Found In: 3.8.4.3
User Comments:
drh added on 2014-04-14 19:46:52:

The sqlite_rename_parent() SQL function is an undocumented function used as part of the implementation of ALTER TABLE. This function should never be access by an application. But if an application does invoke the function and gives it a NULL parameter in the 1st or 2nd argument, a crash might result.

SELECT sqlite_rename_parent(NULL,1,1);

The problem appears to have existed since ALTER TABLE was first enhanced to be able to deal with foreign key constraints, by check-in [b4a10c39e726dc190] on 2009-09-26 for SQLite version 3.6.19.