1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Do not ignore alias "a" in a query of the form "SELECT ... FROM (...) AS a" Fix for #3935. Also expand upon (6751) to fix some similar obscure memory leaks. (CVS 6831)

FossilOrigin-Name: 42f9d1e56483a59353bff57d75f09ed67e1d9c3c
This commit is contained in:
danielk1977
2009-07-01 14:56:39 +00:00
parent 96d48e963a
commit 9b87d7b904
5 changed files with 73 additions and 15 deletions

View File

@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
** $Id: build.c,v 1.554 2009/06/25 11:50:21 drh Exp $
** $Id: build.c,v 1.555 2009/07/01 14:56:40 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -3221,8 +3221,13 @@ SrcList *sqlite3SrcListAppendFromTerm(
pItem->zAlias = sqlite3NameFromToken(db, pAlias);
}
pItem->pSelect = pSubquery;
pItem->pOn = pOn;
pItem->pUsing = pUsing;
if( p->nSrc>1 ){
pItem->pOn = pOn;
pItem->pUsing = pUsing;
}else{
sqlite3ExprDelete(db, pOn);
sqlite3IdListDelete(db, pUsing);
}
return p;
}