Remove unneeded pSchema field from the Expr structure. (CVS 4434)

FossilOrigin-Name: b2d605a2714245febb316a24edc7a076e21a3849
This commit is contained in:
drh 2007-09-18 15:55:07 +00:00
parent adfb9b0501
commit 728b577934
5 changed files with 23 additions and 21 deletions

@ -1,5 +1,5 @@
C Add\sa\sparameter\sto\sspecify\sthe\ssize\sof\sthe\soutput\sbuffer\spassed\sto\sxGetTempname()\sand\sxFullPathname().\sThis,\sand\sthe\sprevious\scommit,\sare\schanges\sto\sthe\spublic\svfs\sAPI\sintroduced\sin\s3.5.0.\s(CVS\s4433) C Remove\sunneeded\spSchema\sfield\sfrom\sthe\sExpr\sstructure.\s(CVS\s4434)
D 2007-09-17T07:02:57 D 2007-09-18T15:55:07
F Makefile.in cbfb898945536a8f9ea8b897e1586dd1fdbcc5db F Makefile.in cbfb898945536a8f9ea8b897e1586dd1fdbcc5db
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499 F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -79,7 +79,7 @@ F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a
F src/alter.c c9f30b4d6fbf7eff7c5518b002a217d4ecd13bcf F src/alter.c c9f30b4d6fbf7eff7c5518b002a217d4ecd13bcf
F src/analyze.c 49b4bd45eb286d833793ed6bf72355a5c1974865 F src/analyze.c 49b4bd45eb286d833793ed6bf72355a5c1974865
F src/attach.c 02fd8779270b1df1c63e7ba6e6655b960fa0f3d5 F src/attach.c 02fd8779270b1df1c63e7ba6e6655b960fa0f3d5
F src/auth.c d41c34f3150b3b8248d364770ef922bbcefbff82 F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
F src/btmutex.c 442be6f068d77ca9ffd69899cf0a3943c244548c F src/btmutex.c 442be6f068d77ca9ffd69899cf0a3943c244548c
F src/btree.c ed7c4825b0d30a8a77c43b468009cfa8a31c967a F src/btree.c ed7c4825b0d30a8a77c43b468009cfa8a31c967a
F src/btree.h d0736ebca4b6eafbdd823c46a8de574cea078211 F src/btree.h d0736ebca4b6eafbdd823c46a8de574cea078211
@ -90,7 +90,7 @@ F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131
F src/date.c 49c5a6d2de6c12000905b4d36868b07d3011bbf6 F src/date.c 49c5a6d2de6c12000905b4d36868b07d3011bbf6
F src/delete.c 849846d06d29851dde0d9f424a5de5817eb140d1 F src/delete.c 849846d06d29851dde0d9f424a5de5817eb140d1
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
F src/expr.c 7853a8161ec0b0fce62fc8da921db557899f1ec1 F src/expr.c 20a45339a6ba1e98c07e7f2039e8ffad0290fb77
F src/func.c 9d88141c4cffb3a04719e5a0fda65cde34bfa1e5 F src/func.c 9d88141c4cffb3a04719e5a0fda65cde34bfa1e5
F src/hash.c 45a7005aac044b6c86bd7e49c44bc15d30006d6c F src/hash.c 45a7005aac044b6c86bd7e49c44bc15d30006d6c
F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53 F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
@ -132,7 +132,7 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 82089379833e361ba8a2ae65316a2173785300c0 F src/shell.c 82089379833e361ba8a2ae65316a2173785300c0
F src/sqlite.h.in 26b53ebd71d051bdefb6ba326f6742747c188cb7 F src/sqlite.h.in 26b53ebd71d051bdefb6ba326f6742747c188cb7
F src/sqlite3ext.h a93f59cdee3638dc0c9c086f80df743a4e68c3cb F src/sqlite3ext.h a93f59cdee3638dc0c9c086f80df743a4e68c3cb
F src/sqliteInt.h bb126b074352ef0ee20399883172161baf5eead2 F src/sqliteInt.h 3bd074087852e6efa56df64926971b8af751bf35
F src/sqliteLimit.h 1bcbbdfa856f8b71b561abb31edb864b0eca1d12 F src/sqliteLimit.h 1bcbbdfa856f8b71b561abb31edb864b0eca1d12
F src/table.c 1aeb9eab57b4235db86fe15a35dec76fb445a9c4 F src/table.c 1aeb9eab57b4235db86fe15a35dec76fb445a9c4
F src/tclsqlite.c 9659ec914abfdb35e184eee908d07eba11a39018 F src/tclsqlite.c 9659ec914abfdb35e184eee908d07eba11a39018
@ -580,7 +580,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 ad3687b16e9420d8bbaa3a645aaf803813b36061 P 8b29f5fbfc723cdf67cf3410cd01f7c17ea39a4b
R 47f0785310596c6f237d4e202feaacc9 R c3880261fcbeb041d8dcc6ffc4cf831e
U danielk1977 U drh
Z 83729562c61099b61142e11a997b9c6e Z 7b960caa2f9eed42bfce40d8a538e199

@ -1 +1 @@
8b29f5fbfc723cdf67cf3410cd01f7c17ea39a4b b2d605a2714245febb316a24edc7a076e21a3849

@ -14,7 +14,7 @@
** systems that do not need this facility may omit it by recompiling ** systems that do not need this facility may omit it by recompiling
** the library with -DSQLITE_OMIT_AUTHORIZATION=1 ** the library with -DSQLITE_OMIT_AUTHORIZATION=1
** **
** $Id: auth.c,v 1.28 2007/09/01 18:24:55 danielk1977 Exp $ ** $Id: auth.c,v 1.29 2007/09/18 15:55:07 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@ -105,6 +105,7 @@ static void sqliteAuthBadReturnCode(Parse *pParse, int rc){
void sqlite3AuthRead( void sqlite3AuthRead(
Parse *pParse, /* The parser context */ Parse *pParse, /* The parser context */
Expr *pExpr, /* The expression to check authorization on */ Expr *pExpr, /* The expression to check authorization on */
Schema *pSchema, /* The schema of the expression */
SrcList *pTabList /* All table that pExpr might refer to */ SrcList *pTabList /* All table that pExpr might refer to */
){ ){
sqlite3 *db = pParse->db; sqlite3 *db = pParse->db;
@ -118,7 +119,7 @@ void sqlite3AuthRead(
if( db->xAuth==0 ) return; if( db->xAuth==0 ) return;
if( pExpr->op!=TK_COLUMN ) return; if( pExpr->op!=TK_COLUMN ) return;
iDb = sqlite3SchemaToIndex(pParse->db, pExpr->pSchema); iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
if( iDb<0 ){ if( iDb<0 ){
/* An attempt to read a column out of a subquery or other /* An attempt to read a column out of a subquery or other
** temporary table. */ ** temporary table. */

@ -12,7 +12,7 @@
** This file contains routines used for analyzing expressions and ** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite. ** for generating VDBE code that evaluates expressions in SQLite.
** **
** $Id: expr.c,v 1.312 2007/09/01 18:24:55 danielk1977 Exp $ ** $Id: expr.c,v 1.313 2007/09/18 15:55:07 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@ -1014,6 +1014,7 @@ static int lookupName(
struct SrcList_item *pItem; /* Use for looping over pSrcList items */ struct SrcList_item *pItem; /* Use for looping over pSrcList items */
struct SrcList_item *pMatch = 0; /* The matching pSrcList item */ struct SrcList_item *pMatch = 0; /* The matching pSrcList item */
NameContext *pTopNC = pNC; /* First namecontext in the list */ NameContext *pTopNC = pNC; /* First namecontext in the list */
Schema *pSchema = 0; /* Schema of the expression */
assert( pColumnToken && pColumnToken->z ); /* The Z in X.Y.Z cannot be NULL */ assert( pColumnToken && pColumnToken->z ); /* The Z in X.Y.Z cannot be NULL */
zDb = sqlite3NameFromToken(db, pDbToken); zDb = sqlite3NameFromToken(db, pDbToken);
@ -1052,7 +1053,7 @@ static int lookupName(
} }
if( 0==(cntTab++) ){ if( 0==(cntTab++) ){
pExpr->iTable = pItem->iCursor; pExpr->iTable = pItem->iCursor;
pExpr->pSchema = pTab->pSchema; pSchema = pTab->pSchema;
pMatch = pItem; pMatch = pItem;
} }
for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){ for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
@ -1062,7 +1063,7 @@ static int lookupName(
cnt++; cnt++;
pExpr->iTable = pItem->iCursor; pExpr->iTable = pItem->iCursor;
pMatch = pItem; pMatch = pItem;
pExpr->pSchema = pTab->pSchema; pSchema = pTab->pSchema;
/* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
pExpr->iColumn = j==pTab->iPKey ? -1 : j; pExpr->iColumn = j==pTab->iPKey ? -1 : j;
pExpr->affinity = pTab->aCol[j].affinity; pExpr->affinity = pTab->aCol[j].affinity;
@ -1116,7 +1117,7 @@ static int lookupName(
int iCol; int iCol;
Column *pCol = pTab->aCol; Column *pCol = pTab->aCol;
pExpr->pSchema = pTab->pSchema; pSchema = pTab->pSchema;
cntTab++; cntTab++;
for(iCol=0; iCol < pTab->nCol; iCol++, pCol++) { for(iCol=0; iCol < pTab->nCol; iCol++, pCol++) {
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ if( sqlite3StrICmp(pCol->zName, zCol)==0 ){
@ -1263,7 +1264,7 @@ lookupname_end_2:
sqlite3_free(zCol); sqlite3_free(zCol);
if( cnt==1 ){ if( cnt==1 ){
assert( pNC!=0 ); assert( pNC!=0 );
sqlite3AuthRead(pParse, pExpr, pNC->pSrcList); sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
if( pMatch && !pMatch->pSelect ){ if( pMatch && !pMatch->pSelect ){
pExpr->pTab = pMatch->pTab; pExpr->pTab = pMatch->pTab;
} }

@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.608 2007/09/03 15:19:35 drh Exp $ ** @(#) $Id: sqliteInt.h,v 1.609 2007/09/18 15:55:07 drh Exp $
*/ */
#ifndef _SQLITEINT_H_ #ifndef _SQLITEINT_H_
#define _SQLITEINT_H_ #define _SQLITEINT_H_
@ -736,7 +736,7 @@ struct Table {
int nModuleArg; /* Number of arguments to the module */ int nModuleArg; /* Number of arguments to the module */
char **azModuleArg; /* Text of all module args. [0] is module name */ char **azModuleArg; /* Text of all module args. [0] is module name */
#endif #endif
Schema *pSchema; Schema *pSchema; /* Schema that contains this table */
}; };
/* /*
@ -1015,7 +1015,7 @@ struct Expr {
Select *pSelect; /* When the expression is a sub-select. Also the Select *pSelect; /* When the expression is a sub-select. Also the
** right side of "<expr> IN (<select>)" */ ** right side of "<expr> IN (<select>)" */
Table *pTab; /* Table for OP_Column expressions. */ Table *pTab; /* Table for OP_Column expressions. */
Schema *pSchema; /* Schema *pSchema; */
#if defined(SQLITE_TEST) || SQLITE_MAX_EXPR_DEPTH>0 #if defined(SQLITE_TEST) || SQLITE_MAX_EXPR_DEPTH>0
int nHeight; /* Height of the tree headed by this node */ int nHeight; /* Height of the tree headed by this node */
#endif #endif
@ -1746,7 +1746,7 @@ int sqlite3JoinType(Parse*, Token*, Token*, Token*);
void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int); void sqlite3CreateForeignKey(Parse*, ExprList*, Token*, ExprList*, int);
void sqlite3DeferForeignKey(Parse*, int); void sqlite3DeferForeignKey(Parse*, int);
#ifndef SQLITE_OMIT_AUTHORIZATION #ifndef SQLITE_OMIT_AUTHORIZATION
void sqlite3AuthRead(Parse*,Expr*,SrcList*); void sqlite3AuthRead(Parse*,Expr*,Schema*,SrcList*);
int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*); int sqlite3AuthCheck(Parse*,int, const char*, const char*, const char*);
void sqlite3AuthContextPush(Parse*, AuthContext*, const char*); void sqlite3AuthContextPush(Parse*, AuthContext*, const char*);
void sqlite3AuthContextPop(AuthContext*); void sqlite3AuthContextPop(AuthContext*);