Allow the SQLITE_MAX_EXPR_DEPTH compile-time parameter to be set to 0 in
order to disable expression depth checking. Ticket #3143. (CVS 5166) FossilOrigin-Name: 5ceef40e397fc535173996404345b93f695e8cac
This commit is contained in:
parent
1ca0ed4692
commit
0224d26d37
@ -11,7 +11,7 @@
|
||||
#
|
||||
# Randomized test cases for the rtree extension.
|
||||
#
|
||||
# $Id: rtree4.test,v 1.1 2008/05/27 00:06:02 drh Exp $
|
||||
# $Id: rtree4.test,v 1.2 2008/05/28 13:49:35 drh Exp $
|
||||
#
|
||||
|
||||
set testdir [file join [file dirname $argv0] .. .. test]
|
||||
@ -222,7 +222,6 @@ for {set nDim 1} {$nDim<=5} {incr nDim} {
|
||||
do_test rtree-$nDim.2.$i.8 {
|
||||
list $where [db eval "SELECT id FROM rx $where ORDER BY id"]
|
||||
} [list $where [db eval "SELECT id FROM bx $where ORDER BY id"]]
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
18
manifest
18
manifest
@ -1,5 +1,5 @@
|
||||
C In\stest3.c,\suse\stype\s'u32'\sinstead\sof\s'unsigned\sint'\sto\sremove\sa\swarning/error\sfrom\snative\sx86_64\scompile.\s(CVS\s5165)
|
||||
D 2008-05-27T20:17:01
|
||||
C Allow\sthe\sSQLITE_MAX_EXPR_DEPTH\scompile-time\sparameter\sto\sbe\sset\sto\s0\sin\norder\sto\sdisable\sexpression\sdepth\schecking.\s\sTicket\s#3143.\s(CVS\s5166)
|
||||
D 2008-05-28T13:49:35
|
||||
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
|
||||
F Makefile.in 79aeba12300a54903f1b1257c1e7c190234045dd
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@ -70,7 +70,7 @@ F ext/rtree/rtree.test ec173a9420ff012e4d29b3063add143583a597a7
|
||||
F ext/rtree/rtree1.test 7504a4bd3aaad379d2d712bbb05fc75460e8537d
|
||||
F ext/rtree/rtree2.test 3402e9d57cac67651779130bafd4162772d2420e
|
||||
F ext/rtree/rtree3.test 46d1959aa651d3df8b64d93762d3061c62b38105
|
||||
F ext/rtree/rtree4.test f285c08f664804558c267dc8e222e7ecd4dfbc6d
|
||||
F ext/rtree/rtree4.test 029a2a09bd021ed9e38ded7bea31f73b8dca2480
|
||||
F ext/rtree/rtree_perf.tcl 0fabb6d5c48cb8024e042ce5d4bb88998b6ec1cb
|
||||
F ext/rtree/rtree_util.tcl ee0a0311eb12175319d78bfb37302320496cee6e
|
||||
F ext/rtree/viewrtree.tcl 09526398dae87a5a87c5aac2b3854dbaf8376869
|
||||
@ -104,7 +104,7 @@ F src/callback.c 77b302b0d41468dcda78c70e706e5b84577f0fa0
|
||||
F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131
|
||||
F src/date.c b305ced9f4da66b51ef020d9bf31c6c92fc0c6bb
|
||||
F src/delete.c d3fc5987f2eb88f7b9549d58a5dfea079a83fe8b
|
||||
F src/expr.c 89f192b22b8c06b61d9b944cb59f42370d80e362
|
||||
F src/expr.c 52fbb644cf5e9b70329e95c67552e74c3cba81b7
|
||||
F src/fault.c 1f6177188edb00641673e462f3fab8cba9f7422b
|
||||
F src/func.c 77a910a1ca7613d291fd0b5cba3be14c02f0dce0
|
||||
F src/hash.c fd8cb06fb54c2fe7d48c9195792059a2e5be8b70
|
||||
@ -143,7 +143,7 @@ F src/select.c da43ce3080112aa77863e9c570c1df19a892acb8
|
||||
F src/shell.c a12ea645271b7876c8f080146f48e20b00d367ec
|
||||
F src/sqlite.h.in bd32c7e159cf5f18f7de32d7e53a61e7218d4b53
|
||||
F src/sqlite3ext.h faacd0e6a81aabee0861c6d7883c9172e74ef5b3
|
||||
F src/sqliteInt.h 70a2b0bf856bbdb86b10d994ea863f6591ab7144
|
||||
F src/sqliteInt.h cfcb83222431108aa51565efecf3a084360ad4a6
|
||||
F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8
|
||||
F src/table.c 1fa8f8113ac9cbc09ae4801c6d2a7f0af82c5822
|
||||
F src/tclsqlite.c c57e740e30bd6dda678796eed62c7f0e64689834
|
||||
@ -590,7 +590,7 @@ F tool/speedtest16.c 6f5bc019dcf8b6537f379bbac0408a9e1a86f0b6
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c e74126bc12178fa29904f711bb100212a5448041
|
||||
F tool/speedtest8inst1.c 025879132979a5fdec11218472cba6cf8f6ec854
|
||||
P 1518827e48bc3a259b6079a5a4b8dca47b265172
|
||||
R 71fe853769612a115cd254179d576c17
|
||||
U shane
|
||||
Z 1538412614f587f7b2507f1507eb264e
|
||||
P 02447e4e47659d70f014529e9baa3bf8ff75844c
|
||||
R 04ded18baa8178434a3cbb20f973bb3d
|
||||
U drh
|
||||
Z 9c47218eaabe6b95bde0ff5933047777
|
||||
|
@ -1 +1 @@
|
||||
02447e4e47659d70f014529e9baa3bf8ff75844c
|
||||
5ceef40e397fc535173996404345b93f695e8cac
|
@ -12,7 +12,7 @@
|
||||
** This file contains routines used for analyzing expressions and
|
||||
** for generating VDBE code that evaluates expressions in SQLite.
|
||||
**
|
||||
** $Id: expr.c,v 1.371 2008/05/01 17:16:53 drh Exp $
|
||||
** $Id: expr.c,v 1.372 2008/05/28 13:49:36 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@ -738,7 +738,6 @@ void sqlite3ExprListCheckLength(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The following three functions, heightOfExpr(), heightOfExprList()
|
||||
** and heightOfSelect(), are used to determine the maximum height
|
||||
** of any expression tree referenced by the structure passed as the
|
||||
@ -748,6 +747,7 @@ void sqlite3ExprListCheckLength(
|
||||
** to by pnHeight, the second parameter, then set *pnHeight to that
|
||||
** value.
|
||||
*/
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
static void heightOfExpr(Expr *p, int *pnHeight){
|
||||
if( p ){
|
||||
if( p->nHeight>*pnHeight ){
|
||||
@ -775,6 +775,7 @@ static void heightOfSelect(Select *p, int *pnHeight){
|
||||
heightOfSelect(p->pPrior, pnHeight);
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_MAX_EXPR_DEPTH>0 */
|
||||
|
||||
/*
|
||||
** Set the Expr.nHeight variable in the structure passed as an
|
||||
@ -783,6 +784,7 @@ static void heightOfSelect(Select *p, int *pnHeight){
|
||||
** has a height equal to the maximum height of any other
|
||||
** referenced Expr plus one.
|
||||
*/
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
void sqlite3ExprSetHeight(Expr *p){
|
||||
int nHeight = 0;
|
||||
heightOfExpr(p->pLeft, &nHeight);
|
||||
@ -791,16 +793,19 @@ void sqlite3ExprSetHeight(Expr *p){
|
||||
heightOfSelect(p->pSelect, &nHeight);
|
||||
p->nHeight = nHeight + 1;
|
||||
}
|
||||
#endif /* SQLITE_MAX_EXPR_DEPTH>0 */
|
||||
|
||||
/*
|
||||
** Return the maximum height of any expression tree referenced
|
||||
** by the select statement passed as an argument.
|
||||
*/
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
int sqlite3SelectExprHeight(Select *p){
|
||||
int nHeight = 0;
|
||||
heightOfSelect(p, &nHeight);
|
||||
return nHeight;
|
||||
}
|
||||
#endif /* SQLITE_MAX_EXPR_DEPTH>0 */
|
||||
|
||||
/*
|
||||
** Delete an entire expression list.
|
||||
|
@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** Internal interface definitions for SQLite.
|
||||
**
|
||||
** @(#) $Id: sqliteInt.h,v 1.704 2008/05/13 13:27:34 drh Exp $
|
||||
** @(#) $Id: sqliteInt.h,v 1.705 2008/05/28 13:49:36 drh Exp $
|
||||
*/
|
||||
#ifndef _SQLITEINT_H_
|
||||
#define _SQLITEINT_H_
|
||||
@ -1142,8 +1142,7 @@ struct Expr {
|
||||
Select *pSelect; /* When the expression is a sub-select. Also the
|
||||
** right side of "<expr> IN (<select>)" */
|
||||
Table *pTab; /* Table for OP_Column expressions. */
|
||||
/* Schema *pSchema; */
|
||||
#if defined(SQLITE_TEST) || SQLITE_MAX_EXPR_DEPTH>0
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
int nHeight; /* Height of the tree headed by this node */
|
||||
#endif
|
||||
};
|
||||
@ -1533,9 +1532,7 @@ struct Parse {
|
||||
int nVtabLock; /* Number of virtual tables to lock */
|
||||
Table **apVtabLock; /* Pointer to virtual tables needing locking */
|
||||
#endif
|
||||
#if defined(SQLITE_TEST) || SQLITE_MAX_EXPR_DEPTH>0
|
||||
int nHeight; /* Expression tree height of current sub-select */
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef SQLITE_OMIT_VIRTUALTABLE
|
||||
@ -2198,11 +2195,12 @@ int sqlite3FindInIndex(Parse *, Expr *, int);
|
||||
#define sqlite3JournalSize(pVfs) ((pVfs)->szOsFile)
|
||||
#endif
|
||||
|
||||
#if defined(SQLITE_TEST) || SQLITE_MAX_EXPR_DEPTH>0
|
||||
#if SQLITE_MAX_EXPR_DEPTH>0
|
||||
void sqlite3ExprSetHeight(Expr *);
|
||||
int sqlite3SelectExprHeight(Select *);
|
||||
#else
|
||||
#define sqlite3ExprSetHeight(x)
|
||||
#define sqlite3SelectExprHeight(x) 0
|
||||
#endif
|
||||
|
||||
u32 sqlite3Get4byte(const u8*);
|
||||
|
Loading…
x
Reference in New Issue
Block a user