mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Remove or rename local variables that shadow other variables or parameters. (CVS 6005)
FossilOrigin-Name: e7e9fa4fa1b7fc0668f4e3a51873ee5d11893f42
This commit is contained in:
24
manifest
24
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Add\sexplicit\scasts\sto\ssilence\snuisance\swarnings\sfrom\sVC++.\s(CVS\s6004)
|
C Remove\sor\srename\slocal\svariables\sthat\sshadow\sother\svariables\sor\sparameters.\s(CVS\s6005)
|
||||||
D 2008-12-10T16:45:51
|
D 2008-12-10T17:20:00
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in f7e4c81c347b04f7b0f1c1b081a168645d7b8af7
|
F Makefile.in f7e4c81c347b04f7b0f1c1b081a168645d7b8af7
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -103,7 +103,7 @@ F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a
|
|||||||
F src/btree.c ba7baa987f9723882ef4655886327622e02a497f
|
F src/btree.c ba7baa987f9723882ef4655886327622e02a497f
|
||||||
F src/btree.h 179c3ea813780df78a289a8f5130db18e6d4616e
|
F src/btree.h 179c3ea813780df78a289a8f5130db18e6d4616e
|
||||||
F src/btreeInt.h 7ef2c872371d7508657f8d7a4efe651c741d6ee6
|
F src/btreeInt.h 7ef2c872371d7508657f8d7a4efe651c741d6ee6
|
||||||
F src/build.c ce642b06016d94b0dbc34d379bac82b597baf8d5
|
F src/build.c 01919ad8f5d259b534e04896454e3ed5a344074f
|
||||||
F src/callback.c e970e5beddbdb23f89a6d05cb1a6419d9f755624
|
F src/callback.c e970e5beddbdb23f89a6d05cb1a6419d9f755624
|
||||||
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
|
F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
|
||||||
F src/date.c 80b158ab6d14f07bc81df8415c5ab2c477947d42
|
F src/date.c 80b158ab6d14f07bc81df8415c5ab2c477947d42
|
||||||
@@ -115,7 +115,7 @@ F src/global.c 91723e45a2ad03ae5bb97a0a0d2dbb1a0e69527b
|
|||||||
F src/hash.c 582c00618efe2051785e66ba1b6430d5a129de3f
|
F src/hash.c 582c00618efe2051785e66ba1b6430d5a129de3f
|
||||||
F src/hash.h 28f38ebb1006a5beedcb013bcdfe31befe7437ae
|
F src/hash.h 28f38ebb1006a5beedcb013bcdfe31befe7437ae
|
||||||
F src/hwtime.h 4a1d45f4cae1f402ea19686acf24acf4f0cb53cb
|
F src/hwtime.h 4a1d45f4cae1f402ea19686acf24acf4f0cb53cb
|
||||||
F src/insert.c 73c4b33767d9540f8ead5d903504ed93f48ad147
|
F src/insert.c 665a0e747044b39e87ed42989e9514ac9e16accd
|
||||||
F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
|
F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e
|
||||||
F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3
|
F src/legacy.c aac57bd984e666059011ea01ec4383892a253be3
|
||||||
F src/loadext.c 2f53996c693a347edc2d773e9217dde49d96ae64
|
F src/loadext.c 2f53996c693a347edc2d773e9217dde49d96ae64
|
||||||
@@ -145,13 +145,13 @@ F src/parse.y 1f4b7ad690864911919da0c76fa96fd72694185e
|
|||||||
F src/pcache.c 16dc8da6e6ba6250f8dfd9ee46036db1cbceedc6
|
F src/pcache.c 16dc8da6e6ba6250f8dfd9ee46036db1cbceedc6
|
||||||
F src/pcache.h f20c3e82dd6da622c3fe296170cb1801f9a2d75a
|
F src/pcache.h f20c3e82dd6da622c3fe296170cb1801f9a2d75a
|
||||||
F src/pcache1.c fb6cf5b80996ed316842d25005f4981bef7ce548
|
F src/pcache1.c fb6cf5b80996ed316842d25005f4981bef7ce548
|
||||||
F src/pragma.c 539e28c90e782fa909a3b3a6849d18a9eb11a548
|
F src/pragma.c 88050d5afa74fcae1bb260311fe05918f04bc8a5
|
||||||
F src/prepare.c fcadb25d2ad722d87103517333c825b56b79a770
|
F src/prepare.c 26808c3d6ad2cd85a67969b14fd77bfbe92aaffb
|
||||||
F src/printf.c e29d9475c63e1dbfae005b98da3a60e07b5c1ca5
|
F src/printf.c e29d9475c63e1dbfae005b98da3a60e07b5c1ca5
|
||||||
F src/random.c 67bf41b20f1983a0e481e7abb98d64704ee26884
|
F src/random.c 67bf41b20f1983a0e481e7abb98d64704ee26884
|
||||||
F src/resolve.c 6dd09880a8a9b74f5bc1aa2ae4247b1afe6acd65
|
F src/resolve.c 6dd09880a8a9b74f5bc1aa2ae4247b1afe6acd65
|
||||||
F src/rowset.c 2256fa4a928f750e2f3d6fc733523034beceb1d6
|
F src/rowset.c 2256fa4a928f750e2f3d6fc733523034beceb1d6
|
||||||
F src/select.c 1d3616e4e48f6c15a0c69bf14bc5423f31624f87
|
F src/select.c e5b3b244e349cc42401fb62a6c14ea09ea46403c
|
||||||
F src/shell.c 484bddeefac9314be18d4a60d401e93848274ee8
|
F src/shell.c 484bddeefac9314be18d4a60d401e93848274ee8
|
||||||
F src/sqlite.h.in 619a82b485fbf02276ecb8b1cc629f0c8bcda4ca
|
F src/sqlite.h.in 619a82b485fbf02276ecb8b1cc629f0c8bcda4ca
|
||||||
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
|
F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
|
||||||
@@ -198,10 +198,10 @@ F src/vdbe.c fce160c74aad54d14e2bdd8a30443fd78f7b26c5
|
|||||||
F src/vdbe.h 03516f28bf5aca00a53c4dccd6c313f96adb94f6
|
F src/vdbe.h 03516f28bf5aca00a53c4dccd6c313f96adb94f6
|
||||||
F src/vdbeInt.h e6e80a99ce634983b7cc2498843b4d2e5540900a
|
F src/vdbeInt.h e6e80a99ce634983b7cc2498843b4d2e5540900a
|
||||||
F src/vdbeapi.c 20722164e7701a0747eaea03cddbbe0de5cb37bf
|
F src/vdbeapi.c 20722164e7701a0747eaea03cddbbe0de5cb37bf
|
||||||
F src/vdbeaux.c bdf1b3cdf97692eedd4ab4d60510531ab3019683
|
F src/vdbeaux.c 2b7bfb736a9ad9f48b82149a47c8f430e5df730a
|
||||||
F src/vdbeblob.c b0dcebfafedcf9c0addc7901ad98f6f986c08935
|
F src/vdbeblob.c b0dcebfafedcf9c0addc7901ad98f6f986c08935
|
||||||
F src/vdbemem.c 15dc139e0b9e328e63971e02a7552e8da73b16e8
|
F src/vdbemem.c 15dc139e0b9e328e63971e02a7552e8da73b16e8
|
||||||
F src/vtab.c 02c51eac45dbff1a1d6e73f58febf92ecb563f7f
|
F src/vtab.c c4bd078008a7d031f2d88c8a5b67a60eb5966254
|
||||||
F src/walker.c 488c2660e13224ff70c0c82761118efb547f8f0d
|
F src/walker.c 488c2660e13224ff70c0c82761118efb547f8f0d
|
||||||
F src/where.c c5a21be6d5705d1c2c6f5d56a97785e4752791d2
|
F src/where.c c5a21be6d5705d1c2c6f5d56a97785e4752791d2
|
||||||
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
|
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
|
||||||
@@ -664,7 +664,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
|||||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
P 18bbcafc16bb985a7c74e07ffb9c4f28273a7cfd
|
P da1cbfa766f7f379c01f4ac9c1210462d8d7c590
|
||||||
R 16b9d8cfa7d0b4c8f37a0a76a742de3d
|
R a2d9934353d665c83ba1bf37542e5a35
|
||||||
U drh
|
U drh
|
||||||
Z 23fbcb130f7b999f989b3af42a01d87f
|
Z 8d8b858819df06179da86dc62696f90a
|
||||||
|
@@ -1 +1 @@
|
|||||||
da1cbfa766f7f379c01f4ac9c1210462d8d7c590
|
e7e9fa4fa1b7fc0668f4e3a51873ee5d11893f42
|
@@ -22,7 +22,7 @@
|
|||||||
** COMMIT
|
** COMMIT
|
||||||
** ROLLBACK
|
** ROLLBACK
|
||||||
**
|
**
|
||||||
** $Id: build.c,v 1.504 2008/12/05 15:24:16 drh Exp $
|
** $Id: build.c,v 1.505 2008/12/10 17:20:00 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -2046,7 +2046,6 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
|
|||||||
|
|
||||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||||
if( IsVirtual(pTab) ){
|
if( IsVirtual(pTab) ){
|
||||||
Vdbe *v = sqlite3GetVdbe(pParse);
|
|
||||||
if( v ){
|
if( v ){
|
||||||
sqlite3VdbeAddOp0(v, OP_VBegin);
|
sqlite3VdbeAddOp0(v, OP_VBegin);
|
||||||
}
|
}
|
||||||
|
39
src/insert.c
39
src/insert.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 INSERT statements in SQLite.
|
** to handle INSERT statements in SQLite.
|
||||||
**
|
**
|
||||||
** $Id: insert.c,v 1.253 2008/11/19 09:05:27 danielk1977 Exp $
|
** $Id: insert.c,v 1.254 2008/12/10 17:20:00 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -572,24 +572,24 @@ void sqlite3Insert(
|
|||||||
** goto L
|
** goto L
|
||||||
** M: ...
|
** M: ...
|
||||||
*/
|
*/
|
||||||
int regRec; /* Register to hold packed record */
|
int regRec; /* Register to hold packed record */
|
||||||
int regRowid; /* Register to hold temp table ROWID */
|
int regTempRowid; /* Register to hold temp table ROWID */
|
||||||
int addrTop; /* Label "L" */
|
int addrTop; /* Label "L" */
|
||||||
int addrIf; /* Address of jump to M */
|
int addrIf; /* Address of jump to M */
|
||||||
|
|
||||||
srcTab = pParse->nTab++;
|
srcTab = pParse->nTab++;
|
||||||
regRec = sqlite3GetTempReg(pParse);
|
regRec = sqlite3GetTempReg(pParse);
|
||||||
regRowid = sqlite3GetTempReg(pParse);
|
regTempRowid = sqlite3GetTempReg(pParse);
|
||||||
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, srcTab, nColumn);
|
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, srcTab, nColumn);
|
||||||
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, dest.iParm);
|
addrTop = sqlite3VdbeAddOp1(v, OP_Yield, dest.iParm);
|
||||||
addrIf = sqlite3VdbeAddOp1(v, OP_If, regEof);
|
addrIf = sqlite3VdbeAddOp1(v, OP_If, regEof);
|
||||||
sqlite3VdbeAddOp3(v, OP_MakeRecord, regFromSelect, nColumn, regRec);
|
sqlite3VdbeAddOp3(v, OP_MakeRecord, regFromSelect, nColumn, regRec);
|
||||||
sqlite3VdbeAddOp2(v, OP_NewRowid, srcTab, regRowid);
|
sqlite3VdbeAddOp2(v, OP_NewRowid, srcTab, regTempRowid);
|
||||||
sqlite3VdbeAddOp3(v, OP_Insert, srcTab, regRec, regRowid);
|
sqlite3VdbeAddOp3(v, OP_Insert, srcTab, regRec, regTempRowid);
|
||||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, addrTop);
|
sqlite3VdbeAddOp2(v, OP_Goto, 0, addrTop);
|
||||||
sqlite3VdbeJumpHere(v, addrIf);
|
sqlite3VdbeJumpHere(v, addrIf);
|
||||||
sqlite3ReleaseTempReg(pParse, regRec);
|
sqlite3ReleaseTempReg(pParse, regRec);
|
||||||
sqlite3ReleaseTempReg(pParse, regRowid);
|
sqlite3ReleaseTempReg(pParse, regTempRowid);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
/* This is the case if the data for the INSERT is coming from a VALUES
|
/* This is the case if the data for the INSERT is coming from a VALUES
|
||||||
@@ -690,7 +690,6 @@ void sqlite3Insert(
|
|||||||
/* If this is not a view, open the table and and all indices */
|
/* If this is not a view, open the table and and all indices */
|
||||||
if( !isView ){
|
if( !isView ){
|
||||||
int nIdx;
|
int nIdx;
|
||||||
int i;
|
|
||||||
|
|
||||||
baseCur = pParse->nTab;
|
baseCur = pParse->nTab;
|
||||||
nIdx = sqlite3OpenTableAndIndices(pParse, pTab, baseCur, OP_OpenWrite);
|
nIdx = sqlite3OpenTableAndIndices(pParse, pTab, baseCur, OP_OpenWrite);
|
||||||
@@ -746,7 +745,7 @@ void sqlite3Insert(
|
|||||||
*/
|
*/
|
||||||
endOfLoop = sqlite3VdbeMakeLabel(v);
|
endOfLoop = sqlite3VdbeMakeLabel(v);
|
||||||
if( triggers_exist & TRIGGER_BEFORE ){
|
if( triggers_exist & TRIGGER_BEFORE ){
|
||||||
int regRowid;
|
int regTrigRowid;
|
||||||
int regCols;
|
int regCols;
|
||||||
int regRec;
|
int regRec;
|
||||||
|
|
||||||
@@ -756,19 +755,19 @@ void sqlite3Insert(
|
|||||||
** we do not know what the unique ID will be (because the insert has
|
** we do not know what the unique ID will be (because the insert has
|
||||||
** not happened yet) so we substitute a rowid of -1
|
** not happened yet) so we substitute a rowid of -1
|
||||||
*/
|
*/
|
||||||
regRowid = sqlite3GetTempReg(pParse);
|
regTrigRowid = sqlite3GetTempReg(pParse);
|
||||||
if( keyColumn<0 ){
|
if( keyColumn<0 ){
|
||||||
sqlite3VdbeAddOp2(v, OP_Integer, -1, regRowid);
|
sqlite3VdbeAddOp2(v, OP_Integer, -1, regTrigRowid);
|
||||||
}else if( useTempTable ){
|
}else if( useTempTable ){
|
||||||
sqlite3VdbeAddOp3(v, OP_Column, srcTab, keyColumn, regRowid);
|
sqlite3VdbeAddOp3(v, OP_Column, srcTab, keyColumn, regTrigRowid);
|
||||||
}else{
|
}else{
|
||||||
int j1;
|
int j1;
|
||||||
assert( pSelect==0 ); /* Otherwise useTempTable is true */
|
assert( pSelect==0 ); /* Otherwise useTempTable is true */
|
||||||
sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regRowid);
|
sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regTrigRowid);
|
||||||
j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regRowid);
|
j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regTrigRowid);
|
||||||
sqlite3VdbeAddOp2(v, OP_Integer, -1, regRowid);
|
sqlite3VdbeAddOp2(v, OP_Integer, -1, regTrigRowid);
|
||||||
sqlite3VdbeJumpHere(v, j1);
|
sqlite3VdbeJumpHere(v, j1);
|
||||||
sqlite3VdbeAddOp1(v, OP_MustBeInt, regRowid);
|
sqlite3VdbeAddOp1(v, OP_MustBeInt, regTrigRowid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cannot have triggers on a virtual table. If it were possible,
|
/* Cannot have triggers on a virtual table. If it were possible,
|
||||||
@@ -807,9 +806,9 @@ void sqlite3Insert(
|
|||||||
if( !isView ){
|
if( !isView ){
|
||||||
sqlite3TableAffinityStr(v, pTab);
|
sqlite3TableAffinityStr(v, pTab);
|
||||||
}
|
}
|
||||||
sqlite3VdbeAddOp3(v, OP_Insert, newIdx, regRec, regRowid);
|
sqlite3VdbeAddOp3(v, OP_Insert, newIdx, regRec, regTrigRowid);
|
||||||
sqlite3ReleaseTempReg(pParse, regRec);
|
sqlite3ReleaseTempReg(pParse, regRec);
|
||||||
sqlite3ReleaseTempReg(pParse, regRowid);
|
sqlite3ReleaseTempReg(pParse, regTrigRowid);
|
||||||
sqlite3ReleaseTempRange(pParse, regCols, pTab->nCol);
|
sqlite3ReleaseTempRange(pParse, regCols, pTab->nCol);
|
||||||
|
|
||||||
/* Fire BEFORE or INSTEAD OF triggers */
|
/* Fire BEFORE or INSTEAD OF triggers */
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
*************************************************************************
|
*************************************************************************
|
||||||
** This file contains code used to implement the PRAGMA command.
|
** This file contains code used to implement the PRAGMA command.
|
||||||
**
|
**
|
||||||
** $Id: pragma.c,v 1.195 2008/11/21 00:10:35 aswift Exp $
|
** $Id: pragma.c,v 1.196 2008/12/10 17:20:01 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -394,9 +394,7 @@ void sqlite3Pragma(
|
|||||||
** Return the number of pages in the specified database.
|
** Return the number of pages in the specified database.
|
||||||
*/
|
*/
|
||||||
if( sqlite3StrICmp(zLeft,"page_count")==0 ){
|
if( sqlite3StrICmp(zLeft,"page_count")==0 ){
|
||||||
Vdbe *v;
|
|
||||||
int iReg;
|
int iReg;
|
||||||
v = sqlite3GetVdbe(pParse);
|
|
||||||
if( !v || sqlite3ReadSchema(pParse) ) goto pragma_out;
|
if( !v || sqlite3ReadSchema(pParse) ) goto pragma_out;
|
||||||
sqlite3CodeVerifySchema(pParse, iDb);
|
sqlite3CodeVerifySchema(pParse, iDb);
|
||||||
iReg = ++pParse->nMem;
|
iReg = ++pParse->nMem;
|
||||||
@@ -1309,7 +1307,6 @@ void sqlite3Pragma(
|
|||||||
"unlocked", "shared", "reserved", "pending", "exclusive"
|
"unlocked", "shared", "reserved", "pending", "exclusive"
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
Vdbe *v = sqlite3GetVdbe(pParse);
|
|
||||||
sqlite3VdbeSetNumCols(v, 2);
|
sqlite3VdbeSetNumCols(v, 2);
|
||||||
pParse->nMem = 2;
|
pParse->nMem = 2;
|
||||||
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "database", SQLITE_STATIC);
|
sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "database", SQLITE_STATIC);
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
** interface, and routines that contribute to loading the database schema
|
** interface, and routines that contribute to loading the database schema
|
||||||
** from disk.
|
** from disk.
|
||||||
**
|
**
|
||||||
** $Id: prepare.c,v 1.101 2008/11/19 16:52:44 danielk1977 Exp $
|
** $Id: prepare.c,v 1.102 2008/12/10 17:20:01 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -547,7 +547,6 @@ static int sqlite3Prepare(
|
|||||||
for(i=0; i<db->nDb; i++) {
|
for(i=0; i<db->nDb; i++) {
|
||||||
Btree *pBt = db->aDb[i].pBt;
|
Btree *pBt = db->aDb[i].pBt;
|
||||||
if( pBt ){
|
if( pBt ){
|
||||||
int rc;
|
|
||||||
rc = sqlite3BtreeSchemaLocked(pBt);
|
rc = sqlite3BtreeSchemaLocked(pBt);
|
||||||
if( rc ){
|
if( rc ){
|
||||||
const char *zDb = db->aDb[i].zName;
|
const char *zDb = db->aDb[i].zName;
|
||||||
|
49
src/select.c
49
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.490 2008/12/06 16:10:42 drh Exp $
|
** $Id: select.c,v 1.491 2008/12/10 17:20:01 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
@@ -786,8 +786,8 @@ static void generateSortTail(
|
|||||||
int nColumn, /* Number of columns of data */
|
int nColumn, /* Number of columns of data */
|
||||||
SelectDest *pDest /* Write the sorted results here */
|
SelectDest *pDest /* Write the sorted results here */
|
||||||
){
|
){
|
||||||
int brk = sqlite3VdbeMakeLabel(v);
|
int addrBreak = sqlite3VdbeMakeLabel(v); /* Jump here to exit loop */
|
||||||
int cont = sqlite3VdbeMakeLabel(v);
|
int addrContinue = sqlite3VdbeMakeLabel(v); /* Jump here for next cycle */
|
||||||
int addr;
|
int addr;
|
||||||
int iTab;
|
int iTab;
|
||||||
int pseudoTab = 0;
|
int pseudoTab = 0;
|
||||||
@@ -805,8 +805,8 @@ static void generateSortTail(
|
|||||||
sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, nColumn);
|
sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, nColumn);
|
||||||
sqlite3VdbeAddOp2(v, OP_OpenPseudo, pseudoTab, eDest==SRT_Output);
|
sqlite3VdbeAddOp2(v, OP_OpenPseudo, pseudoTab, eDest==SRT_Output);
|
||||||
}
|
}
|
||||||
addr = 1 + sqlite3VdbeAddOp2(v, OP_Sort, iTab, brk);
|
addr = 1 + sqlite3VdbeAddOp2(v, OP_Sort, iTab, addrBreak);
|
||||||
codeOffset(v, p, cont);
|
codeOffset(v, p, addrContinue);
|
||||||
regRow = sqlite3GetTempReg(pParse);
|
regRow = sqlite3GetTempReg(pParse);
|
||||||
regRowid = sqlite3GetTempReg(pParse);
|
regRowid = sqlite3GetTempReg(pParse);
|
||||||
sqlite3VdbeAddOp3(v, OP_Column, iTab, pOrderBy->nExpr + 1, regRow);
|
sqlite3VdbeAddOp3(v, OP_Column, iTab, pOrderBy->nExpr + 1, regRow);
|
||||||
@@ -864,13 +864,12 @@ static void generateSortTail(
|
|||||||
|
|
||||||
/* The bottom of the loop
|
/* The bottom of the loop
|
||||||
*/
|
*/
|
||||||
sqlite3VdbeResolveLabel(v, cont);
|
sqlite3VdbeResolveLabel(v, addrContinue);
|
||||||
sqlite3VdbeAddOp2(v, OP_Next, iTab, addr);
|
sqlite3VdbeAddOp2(v, OP_Next, iTab, addr);
|
||||||
sqlite3VdbeResolveLabel(v, brk);
|
sqlite3VdbeResolveLabel(v, addrBreak);
|
||||||
if( eDest==SRT_Output || eDest==SRT_Coroutine ){
|
if( eDest==SRT_Output || eDest==SRT_Coroutine ){
|
||||||
sqlite3VdbeAddOp2(v, OP_Close, pseudoTab, 0);
|
sqlite3VdbeAddOp2(v, OP_Close, pseudoTab, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1151,13 +1150,14 @@ static int selectColumnsFromExprList(
|
|||||||
int *pnCol, /* Write the number of columns here */
|
int *pnCol, /* Write the number of columns here */
|
||||||
Column **paCol /* Write the new column list here */
|
Column **paCol /* Write the new column list here */
|
||||||
){
|
){
|
||||||
sqlite3 *db = pParse->db;
|
sqlite3 *db = pParse->db; /* Database connection */
|
||||||
int i, j, cnt;
|
int i, j; /* Loop counters */
|
||||||
Column *aCol, *pCol;
|
int cnt; /* Index added to make the name unique */
|
||||||
int nCol;
|
Column *aCol, *pCol; /* For looping over result columns */
|
||||||
Expr *p;
|
int nCol; /* Number of columns in the result set */
|
||||||
char *zName;
|
Expr *p; /* Expression for a single result column */
|
||||||
int nName;
|
char *zName; /* Column name */
|
||||||
|
int nName; /* Size of name in zName[] */
|
||||||
|
|
||||||
*pnCol = nCol = pEList->nExpr;
|
*pnCol = nCol = pEList->nExpr;
|
||||||
aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol);
|
aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol);
|
||||||
@@ -1171,18 +1171,18 @@ static int selectColumnsFromExprList(
|
|||||||
/* If the column contains an "AS <name>" phrase, use <name> as the name */
|
/* If the column contains an "AS <name>" phrase, use <name> as the name */
|
||||||
zName = sqlite3DbStrDup(db, zName);
|
zName = sqlite3DbStrDup(db, zName);
|
||||||
}else{
|
}else{
|
||||||
Expr *pCol = p;
|
Expr *pColExpr = p; /* The expression that is the result column name */
|
||||||
Table *pTab;
|
Table *pTab; /* Table associated with this expression */
|
||||||
while( pCol->op==TK_DOT ) pCol = pCol->pRight;
|
while( pColExpr->op==TK_DOT ) pColExpr = pColExpr->pRight;
|
||||||
if( pCol->op==TK_COLUMN && (pTab = pCol->pTab)!=0 ){
|
if( pColExpr->op==TK_COLUMN && (pTab = pColExpr->pTab)!=0 ){
|
||||||
/* For columns use the column name name */
|
/* For columns use the column name name */
|
||||||
int iCol = pCol->iColumn;
|
int iCol = pColExpr->iColumn;
|
||||||
if( iCol<0 ) iCol = pTab->iPKey;
|
if( iCol<0 ) iCol = pTab->iPKey;
|
||||||
zName = sqlite3MPrintf(db, "%s",
|
zName = sqlite3MPrintf(db, "%s",
|
||||||
iCol>=0 ? pTab->aCol[iCol].zName : "rowid");
|
iCol>=0 ? pTab->aCol[iCol].zName : "rowid");
|
||||||
}else{
|
}else{
|
||||||
/* Use the original text of the column expression as its name */
|
/* Use the original text of the column expression as its name */
|
||||||
Token *pToken = (pCol->span.z?&pCol->span:&pCol->token);
|
Token *pToken = (pColExpr->span.z?&pColExpr->span:&pColExpr->token);
|
||||||
zName = sqlite3MPrintf(db, "%T", pToken);
|
zName = sqlite3MPrintf(db, "%T", pToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1210,7 +1210,6 @@ static int selectColumnsFromExprList(
|
|||||||
pCol->zName = zName;
|
pCol->zName = zName;
|
||||||
}
|
}
|
||||||
if( db->mallocFailed ){
|
if( db->mallocFailed ){
|
||||||
int j;
|
|
||||||
for(j=0; j<i; j++){
|
for(j=0; j<i; j++){
|
||||||
sqlite3DbFree(db, aCol[j].zName);
|
sqlite3DbFree(db, aCol[j].zName);
|
||||||
}
|
}
|
||||||
@@ -3747,13 +3746,13 @@ int sqlite3Select(
|
|||||||
** GROUP BY clause.
|
** GROUP BY clause.
|
||||||
*/
|
*/
|
||||||
if( pGroupBy ){
|
if( pGroupBy ){
|
||||||
int i; /* Loop counter */
|
int k; /* Loop counter */
|
||||||
struct ExprList_item *pItem; /* For looping over expression in a list */
|
struct ExprList_item *pItem; /* For looping over expression in a list */
|
||||||
|
|
||||||
for(i=p->pEList->nExpr, pItem=p->pEList->a; i>0; i--, pItem++){
|
for(k=p->pEList->nExpr, pItem=p->pEList->a; k>0; k--, pItem++){
|
||||||
pItem->iAlias = 0;
|
pItem->iAlias = 0;
|
||||||
}
|
}
|
||||||
for(i=pGroupBy->nExpr, pItem=pGroupBy->a; i>0; i--, pItem++){
|
for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){
|
||||||
pItem->iAlias = 0;
|
pItem->iAlias = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
** to version 2.8.7, all this code was combined into the vdbe.c source file.
|
** to version 2.8.7, all this code was combined into the vdbe.c source file.
|
||||||
** But that file was getting too big so this subroutines were split out.
|
** But that file was getting too big so this subroutines were split out.
|
||||||
**
|
**
|
||||||
** $Id: vdbeaux.c,v 1.424 2008/12/09 02:51:24 drh Exp $
|
** $Id: vdbeaux.c,v 1.425 2008/12/10 17:20:01 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -1333,10 +1333,10 @@ static int vdbeCommit(sqlite3 *db, Vdbe *p){
|
|||||||
|
|
||||||
/* Select a master journal file name */
|
/* Select a master journal file name */
|
||||||
do {
|
do {
|
||||||
u32 random;
|
u32 iRandom;
|
||||||
sqlite3DbFree(db, zMaster);
|
sqlite3DbFree(db, zMaster);
|
||||||
sqlite3_randomness(sizeof(random), &random);
|
sqlite3_randomness(sizeof(iRandom), &iRandom);
|
||||||
zMaster = sqlite3MPrintf(db, "%s-mj%08X", zMainFile, random&0x7fffffff);
|
zMaster = sqlite3MPrintf(db, "%s-mj%08X", zMainFile, iRandom&0x7fffffff);
|
||||||
if( !zMaster ){
|
if( !zMaster ){
|
||||||
return SQLITE_NOMEM;
|
return SQLITE_NOMEM;
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
*************************************************************************
|
*************************************************************************
|
||||||
** This file contains code used to help implement virtual tables.
|
** This file contains code used to help implement virtual tables.
|
||||||
**
|
**
|
||||||
** $Id: vtab.c,v 1.78 2008/11/13 19:12:36 danielk1977 Exp $
|
** $Id: vtab.c,v 1.79 2008/12/10 17:20:01 drh Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -762,8 +762,8 @@ FuncDef *sqlite3VtabOverloadFunction(
|
|||||||
Table *pTab;
|
Table *pTab;
|
||||||
sqlite3_vtab *pVtab;
|
sqlite3_vtab *pVtab;
|
||||||
sqlite3_module *pMod;
|
sqlite3_module *pMod;
|
||||||
void (*xFunc)(sqlite3_context*,int,sqlite3_value**);
|
void (*xFunc)(sqlite3_context*,int,sqlite3_value**) = 0;
|
||||||
void *pArg;
|
void *pArg = 0;
|
||||||
FuncDef *pNew;
|
FuncDef *pNew;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
char *zLowerName;
|
char *zLowerName;
|
||||||
|
Reference in New Issue
Block a user