Merge trunk changes. Fix a possible NULL-pointer deference in WITH clause

name resolution.

FossilOrigin-Name: 7f953b568baa3eede0b9c144be0b9bc86496341a
This commit is contained in:
drh 2014-01-16 04:37:13 +00:00
commit 7b19f25247
6 changed files with 18 additions and 16 deletions

View File

@ -1,5 +1,5 @@
C Remove\san\sALWAYS()\sthat\sis\sno\slonger\salways\strue.
D 2014-01-15T20:10:15.729
C Merge\strunk\schanges.\s\sFix\sa\spossible\sNULL-pointer\sdeference\sin\sWITH\sclause\nname\sresolution.
D 2014-01-16T04:37:13.145
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -206,7 +206,7 @@ F src/os.c 1b147e4cf7cc39e618115c14a086aed44bc91ace
F src/os.h 4a46270a64e9193af4a0aaa3bc2c66dc07c29b3f
F src/os_common.h 92815ed65f805560b66166e3583470ff94478f04
F src/os_unix.c 3a4dcb554d3c915075766162f28c3fd4cdb75968
F src/os_win.c 16eac0961603182ffc10c02b39fe830126538e07
F src/os_win.c 1b21af72c5fa6f9e519a5fcab33e80d182b1aedb
F src/pager.c efa923693e958696eee69b205a20bfbc402c8480
F src/pager.h ffd5607f7b3e4590b415b007a4382f693334d428
F src/parse.y 824eeb752c026b551bda2b66163889d7664b42e4
@ -219,8 +219,8 @@ F src/printf.c 85d07756e45d7496d19439dcae3e6e9e0090f269
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c ae278d8ce037883323f677e78c241f64289f12ec
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c ab437f252415754963b1adfa501120d5364da3ef
F src/shell.c a3541193d5fce37e91dad8ef46a9505aa7c9b344
F src/select.c c9af659146dd1fe924fbfb14a7477f6b2b90f03b
F src/shell.c 9f3bc02a658b8f61d2cbe60cfc482f660c1c6c48
F src/sqlite.h.in d94a8b89522f526ba711182ee161e06f8669bcc9
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc
@ -1111,7 +1111,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
F tool/lemon.c 6842b2e7af12835f9f6e55808a0b1861cd0696fe
F tool/lemon.c 07aba6270d5a5016ba8107b09e431eea4ecdc123
F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
F tool/logest.c 7ad625cac3d54012b27d468b7af6612f78b9ba75
F tool/mkautoconfamal.sh f8d8dbf7d62f409ebed5134998bf5b51d7266383
@ -1150,7 +1150,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 3908e2ea2e7e5f466cbbbffdc27e0fe8dc9751ac
R ec33026d9a1a4e4ae1384253da1cbe65
P c95823cd451f7721174393817a801403647467db f61a70589ac7e05008a362bd9d5b7bde5d07a758
R 8a379a80b7992f91c6a6d54869d6bc5d
U drh
Z d40f91394b02fb8b902b74395abcc185
Z 69979a1b738527f03c61f40bf3b0d3cb

View File

@ -1 +1 @@
c95823cd451f7721174393817a801403647467db
7f953b568baa3eede0b9c144be0b9bc86496341a

View File

@ -3224,7 +3224,7 @@ static void winShmEnterMutex(void){
static void winShmLeaveMutex(void){
sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}
#ifdef SQLITE_DEBUG
#ifndef NDEBUG
static int winShmMutexHeld(void) {
return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER));
}

View File

@ -1378,8 +1378,9 @@ static void generateColumnNames(
sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT);
}
}else{
sqlite3VdbeSetColName(v, i, COLNAME_NAME,
sqlite3DbStrDup(db, pEList->a[i].zSpan), SQLITE_DYNAMIC);
const char *z = pEList->a[i].zSpan;
z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z);
sqlite3VdbeSetColName(v, i, COLNAME_NAME, z, SQLITE_DYNAMIC);
}
}
generateColumnTypes(pParse, pTabList, pEList);
@ -3491,8 +3492,8 @@ static int convertCompoundSelectToSubquery(Walker *pWalker, Select *p){
** return NULL.
*/
static struct Cte *searchWith(With *pWith, struct SrcList_item *pItem){
if( pItem->zDatabase==0 ){
const char *zName = pItem->zName;
const char *zName;
if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){
With *p;
for(p=pWith; p; p=p->pOuter){
int i;

View File

@ -597,6 +597,7 @@ static void output_c_string(FILE *out, const char *z){
*/
static void output_html_string(FILE *out, const char *z){
int i;
if( z==0 ) z = "";
while( *z ){
for(i=0; z[i]
&& z[i]!='<'

View File

@ -83,7 +83,7 @@ static void lemon_addtext(
zBuf[*pnUsed] = 0;
}
static int lemon_vsprintf(char *str, const char *zFormat, va_list ap){
int i, j, k, c, size;
int i, j, k, c;
int nUsed = 0;
const char *z;
char zTemp[50];