mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Fix a bug in the GROUP BY alias name resolution. The bug was by
check-in (6305). Discovered by regression test on 64-bit linux. Test cases added so that the problems is detected on 32-bit systems. (CVS 6332) FossilOrigin-Name: fa0008502ec4f891bfed4a11f01650d274f95c44
This commit is contained in:
@ -14,7 +14,7 @@
|
||||
** resolve all identifiers by associating them with a particular
|
||||
** table and column.
|
||||
**
|
||||
** $Id: resolve.c,v 1.18 2009/02/24 10:14:40 danielk1977 Exp $
|
||||
** $Id: resolve.c,v 1.19 2009/03/02 01:22:40 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <stdlib.h>
|
||||
@ -65,6 +65,7 @@ static void resolveAlias(
|
||||
db = pParse->db;
|
||||
pDup = sqlite3ExprDup(db, pOrig, 0);
|
||||
if( pDup==0 ) return;
|
||||
sqlite3TokenCopy(db, &pDup->token, &pOrig->token);
|
||||
if( pDup->op!=TK_COLUMN && zType[0]!='G' ){
|
||||
pDup = sqlite3PExpr(pParse, TK_AS, pDup, 0, 0);
|
||||
if( pDup==0 ) return;
|
||||
|
Reference in New Issue
Block a user