mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix another segfault that can occur following a malloc failure in the SQL compiler. (CVS 4748)
FossilOrigin-Name: 9d98a3f0dded4ee7ed53872f48ee8592ff077f92
This commit is contained in:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Fix\sa\scouple\sof\ssegfaults\sthat\scould\soccur\safter\sa\smalloc()\sfailure\sin\sthe\sSQL\scompiler.\s(CVS\s4747)
|
C Fix\sanother\ssegfault\sthat\scan\soccur\sfollowing\sa\smalloc\sfailure\sin\sthe\sSQL\scompiler.\s(CVS\s4748)
|
||||||
D 2008-01-23T15:44:51
|
D 2008-01-23T17:13:41
|
||||||
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
|
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
|
||||||
F Makefile.in bc2b5df3e3d0d4b801b824b7ef6dec43812b049b
|
F Makefile.in bc2b5df3e3d0d4b801b824b7ef6dec43812b049b
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -132,7 +132,7 @@ F src/pragma.c 2bb8d6882b9a330e041acd05fb6aff5a01bf0a08
|
|||||||
F src/prepare.c 1b0601ca3f97a9d253cc08697484e3045a1678e9
|
F src/prepare.c 1b0601ca3f97a9d253cc08697484e3045a1678e9
|
||||||
F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910
|
F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910
|
||||||
F src/random.c 02ef38b469237482f1ea14a78b2087cfbaec48bd
|
F src/random.c 02ef38b469237482f1ea14a78b2087cfbaec48bd
|
||||||
F src/select.c 8aa0f336afc707eed9acc110e71f5efbacf5a065
|
F src/select.c cf9243f67fcd70349181deff97f7774c5f63cb51
|
||||||
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
|
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
|
||||||
F src/shell.c ca06cb687c40a8bff6307b5fad41a0e86a0f8558
|
F src/shell.c ca06cb687c40a8bff6307b5fad41a0e86a0f8558
|
||||||
F src/sqlite.h.in 2a7e3776534bbe6ff2cdc058f3abebe91e7e429f
|
F src/sqlite.h.in 2a7e3776534bbe6ff2cdc058f3abebe91e7e429f
|
||||||
@@ -367,7 +367,7 @@ F test/lock2.test 018b846f6f3b3b695fad07e317b7988442b556f4
|
|||||||
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
|
F test/lock3.test 615111293cf32aa2ed16d01c6611737651c96fb9
|
||||||
F test/lock4.test f358fa835dff485d462072eee991111f09e87441
|
F test/lock4.test f358fa835dff485d462072eee991111f09e87441
|
||||||
F test/main.test 82c222989e02ea09abd58d453828ffd71806b6bf
|
F test/main.test 82c222989e02ea09abd58d453828ffd71806b6bf
|
||||||
F test/malloc.test d596bd25b1d8c8a8192fdc91815b37cae3228a50
|
F test/malloc.test 72b7bec7906ff11f72ad81a0575c16fcf4094d04
|
||||||
F test/malloc2.test bacb55551f6f4dc58c538589a8d3e29b127ef8d0
|
F test/malloc2.test bacb55551f6f4dc58c538589a8d3e29b127ef8d0
|
||||||
F test/malloc3.test 5d3839afd98bff92b82d13405f41c96e77ac2a6b
|
F test/malloc3.test 5d3839afd98bff92b82d13405f41c96e77ac2a6b
|
||||||
F test/malloc4.test f0e5e0f639f61e2776a6c3f5308f836b3ad8b3c7
|
F test/malloc4.test f0e5e0f639f61e2776a6c3f5308f836b3ad8b3c7
|
||||||
@@ -614,7 +614,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
|
|||||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||||
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
||||||
P 45c59802f6d35c7745b96c578ab43d5a336fe822
|
P 6bd8db3839d57a738cae2196679819186968b40e
|
||||||
R 23c7c27195b1f31b653e1bbd1b07f4e2
|
R 0cea1a07ac3b7597749c9337fddee227
|
||||||
U danielk1977
|
U danielk1977
|
||||||
Z 05ee4244fbaa32d388c5ec67cdef8a06
|
Z a6a6578ea50042aa916ced737f8619d2
|
||||||
|
@@ -1 +1 @@
|
|||||||
6bd8db3839d57a738cae2196679819186968b40e
|
9d98a3f0dded4ee7ed53872f48ee8592ff077f92
|
10
src/select.c
10
src/select.c
@@ -12,7 +12,7 @@
|
|||||||
** This file contains C code routines that are called by the parser
|
** This file contains C code routines that are called by the parser
|
||||||
** to handle SELECT statements in SQLite.
|
** to handle SELECT statements in SQLite.
|
||||||
**
|
**
|
||||||
** $Id: select.c,v 1.408 2008/01/23 15:44:51 danielk1977 Exp $
|
** $Id: select.c,v 1.409 2008/01/23 17:13:41 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -1676,15 +1676,15 @@ static int processCompoundOrderBy(
|
|||||||
while( pSelect && moreToDo ){
|
while( pSelect && moreToDo ){
|
||||||
moreToDo = 0;
|
moreToDo = 0;
|
||||||
for(i=0; i<pOrderBy->nExpr; i++){
|
for(i=0; i<pOrderBy->nExpr; i++){
|
||||||
int iCol;
|
int iCol = -1;
|
||||||
Expr *pE, *pDup;
|
Expr *pE, *pDup;
|
||||||
if( pOrderBy->a[i].done ) continue;
|
if( pOrderBy->a[i].done ) continue;
|
||||||
pE = pOrderBy->a[i].pExpr;
|
pE = pOrderBy->a[i].pExpr;
|
||||||
pDup = sqlite3ExprDup(db, pE);
|
pDup = sqlite3ExprDup(db, pE);
|
||||||
if( pDup==0 ){
|
if( !db->mallocFailed ){
|
||||||
return 1;
|
assert(pDup);
|
||||||
|
iCol = matchOrderByTermToExprList(pParse, pSelect, pDup, i+1, 1, 0);
|
||||||
}
|
}
|
||||||
iCol = matchOrderByTermToExprList(pParse, pSelect, pDup, i+1, 1, 0);
|
|
||||||
sqlite3ExprDelete(pDup);
|
sqlite3ExprDelete(pDup);
|
||||||
if( iCol<0 ){
|
if( iCol<0 ){
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
# to see what happens in the library if a malloc were to really fail
|
# to see what happens in the library if a malloc were to really fail
|
||||||
# due to an out-of-memory situation.
|
# due to an out-of-memory situation.
|
||||||
#
|
#
|
||||||
# $Id: malloc.test,v 1.56 2008/01/23 15:44:51 danielk1977 Exp $
|
# $Id: malloc.test,v 1.57 2008/01/23 17:13:41 danielk1977 Exp $
|
||||||
|
|
||||||
set testdir [file dirname $argv0]
|
set testdir [file dirname $argv0]
|
||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
@@ -573,6 +573,14 @@ ifcapable {pager_pragmas} {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ifcapable compound {
|
||||||
|
do_malloc_test 24 -start 19 -sqlprep {
|
||||||
|
CREATE TABLE t1(a, b, c)
|
||||||
|
} -sqlbody {
|
||||||
|
SELECT 1 FROM t1 UNION SELECT 2 FROM t1 ORDER BY 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Ensure that no file descriptors were leaked.
|
# Ensure that no file descriptors were leaked.
|
||||||
do_test malloc-99.X {
|
do_test malloc-99.X {
|
||||||
catch {db close}
|
catch {db close}
|
||||||
|
Reference in New Issue
Block a user