1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Add a testcase() to confirm that an OOM on sqlite3DbStrNDup() is handled

correctly in trigger.c.

FossilOrigin-Name: 343e55992f503efa662e49bb0f3c0d798defd0a11f2ee1c36968902fa7e06823
This commit is contained in:
drh
2017-06-08 14:35:21 +00:00
parent ca66f6c6f4
commit d96cc6fbcb
3 changed files with 9 additions and 8 deletions

View File

@@ -306,6 +306,7 @@ void sqlite3FinishTrigger(
if( v==0 ) goto triggerfinish_cleanup;
sqlite3BeginWriteOperation(pParse, 0, iDb);
z = sqlite3DbStrNDup(db, (char*)pAll->z, pAll->n);
testcase( z==0 );
sqlite3NestedParse(pParse,
"INSERT INTO %Q.%s VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')",
db->aDb[iDb].zDbSName, MASTER_NAME, zName,