Fix a crash that can follow a malloc failure in sqlite3ValueFromExpr(). Ticket #3468. (CVS 5851)
FossilOrigin-Name: 0996783b1b7e6dda166565071cbd19f23e7edbbc
This commit is contained in:
parent
99dfe5eb47
commit
f150c9de55
18
manifest
18
manifest
@ -1,5 +1,5 @@
|
||||
C Add\sthe\ssqlite3_extended_errcode()\sinterface.\s\sChange\sto\sreturn\nSQLITE_BUSY\sinstead\sof\sSQLITE_ERROR\swhen\sa\sCOMMIT\sis\sattempted\sand\sone\nor\smore\squeries\sare\sstill\spending.\s(CVS\s5850)
|
||||
D 2008-10-30T15:03:16
|
||||
C Fix\sa\scrash\sthat\scan\sfollow\sa\smalloc\sfailure\sin\ssqlite3ValueFromExpr().\sTicket\s#3468.\s(CVS\s5851)
|
||||
D 2008-10-30T17:21:13
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in da817da72422f9b876602c225fcd17d6ca4182f7
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@ -93,7 +93,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
|
||||
F sqlite3.def a1be7b9a4b8b51ac41c6ff6e8e44a14ef66b338b
|
||||
F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
|
||||
F src/alter.c f462b637bac6c6576a9b7bc6da59c7a82ed5aab2
|
||||
F src/alter.c a03c9236476f0469eb830bcd16ac30b695e09b83
|
||||
F src/analyze.c 747ce8cb6b318bb0d0576cfb5277aed98cbbeb5c
|
||||
F src/attach.c 208881c87160d9e2c73a46cf86116c5a6d66f9d7
|
||||
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
|
||||
@ -197,7 +197,7 @@ F src/vdbeapi.c 6798c70cf176d23594ec557db88190ca8c7fa860
|
||||
F src/vdbeaux.c e007aa723a059b1e5357c15420eea84095de828a
|
||||
F src/vdbeblob.c b0dcebfafedcf9c0addc7901ad98f6f986c08935
|
||||
F src/vdbefifo.c 20fda2a7c4c0bcee1b90eb7e545fefcdbf2e1de7
|
||||
F src/vdbemem.c ead88713b852576e2a924bc4ae696964bfbaec0a
|
||||
F src/vdbemem.c c0e9d9947db8968762c7621369f821bb181c1c86
|
||||
F src/vtab.c 527c180e9c5fca417c9167d02af4b5039f892b4b
|
||||
F src/walker.c 488c2660e13224ff70c0c82761118efb547f8f0d
|
||||
F src/where.c 1853c1bfb567a415d904d70a4613dc07b00c74c5
|
||||
@ -208,7 +208,7 @@ F test/all.test 03cdd58d389e35bee8d57b7d24357b827aecc463
|
||||
F test/alter.test 6353aae6839e486c9b7d8f73b1f4a1e98e57332c
|
||||
F test/alter2.test dd55146e812622c8fc51fd2216bcd8dca8880752
|
||||
F test/alter3.test 25b95a136708f22b87184fa6a4309eea03d65153
|
||||
F test/altermalloc.test 11116c58953b6275a48a87c2912b7d4b72c52840
|
||||
F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc
|
||||
F test/analyze.test ad5329098fe4de4a96852231d53e3e9e6283ad4b
|
||||
F test/async.test 0ed384c12d556ce38a4fe21fd41cda7e6dbf55be
|
||||
F test/async2.test 8998e089b0fbb3d84cdd51c25a78833486d721af
|
||||
@ -652,7 +652,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
P dc5308c7629abe6a3bad21489c8e97087c264e5a
|
||||
R 5295e43b763246c263ebf9a171998453
|
||||
U drh
|
||||
Z 61bb1497945a9a8883e7532aff687652
|
||||
P 4c6a90a16627b1664bf7f15ab40b440b3bd60b48
|
||||
R 18a1372ede481036089807fde4a470c0
|
||||
U danielk1977
|
||||
Z 8cc2bcfa926e2577f603891ab838a0a1
|
||||
|
@ -1 +1 @@
|
||||
4c6a90a16627b1664bf7f15ab40b440b3bd60b48
|
||||
0996783b1b7e6dda166565071cbd19f23e7edbbc
|
@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that used to generate VDBE code
|
||||
** that implements the ALTER TABLE command.
|
||||
**
|
||||
** $Id: alter.c,v 1.48 2008/08/08 14:19:41 drh Exp $
|
||||
** $Id: alter.c,v 1.49 2008/10/30 17:21:13 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@ -441,11 +441,11 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
|
||||
Expr *pDflt; /* Default value for the new column */
|
||||
sqlite3 *db; /* The database connection; */
|
||||
|
||||
if( pParse->nErr ) return;
|
||||
db = pParse->db;
|
||||
if( pParse->nErr || db->mallocFailed ) return;
|
||||
pNew = pParse->pNewTable;
|
||||
assert( pNew );
|
||||
|
||||
db = pParse->db;
|
||||
assert( sqlite3BtreeHoldsAllMutexes(db) );
|
||||
iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
|
||||
zDb = db->aDb[iDb].zName;
|
||||
|
@ -15,7 +15,7 @@
|
||||
** only within the VDBE. Interface routines refer to a Mem using the
|
||||
** name sqlite_value
|
||||
**
|
||||
** $Id: vdbemem.c,v 1.123 2008/09/16 12:06:08 danielk1977 Exp $
|
||||
** $Id: vdbemem.c,v 1.124 2008/10/30 17:21:13 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@ -985,6 +985,7 @@ int sqlite3ValueFromExpr(
|
||||
assert( pExpr->token.z[1]=='\'' );
|
||||
assert( pExpr->token.z[pExpr->token.n-1]=='\'' );
|
||||
pVal = sqlite3ValueNew(db);
|
||||
if( !pVal ) goto no_mem;
|
||||
nVal = pExpr->token.n - 3;
|
||||
zVal = (char*)pExpr->token.z + 2;
|
||||
sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2,
|
||||
|
@ -12,7 +12,7 @@
|
||||
# focus of this script is testing the ALTER TABLE statement and
|
||||
# specifically out-of-memory conditions within that command.
|
||||
#
|
||||
# $Id: altermalloc.test,v 1.9 2008/08/04 20:13:27 drh Exp $
|
||||
# $Id: altermalloc.test,v 1.10 2008/10/30 17:21:13 danielk1977 Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@ -39,6 +39,7 @@ do_malloc_test altermalloc-1 -tclprep {
|
||||
ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT NULL;
|
||||
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT 'default-text';
|
||||
ALTER TABLE t1 RENAME TO t2;
|
||||
ALTER TABLE t2 ADD COLUMN d BLOB DEFAULT X'ABCD';
|
||||
}
|
||||
|
||||
# Test malloc() failure on an ALTER TABLE on a virtual table.
|
||||
|
Loading…
x
Reference in New Issue
Block a user