1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

When flattening a SELECT query, do not discard collation sequences explicitly attached to expressions in the parent query. Fix for #3997. (CVS 6949)

FossilOrigin-Name: b2784cf5d8b520fb714efdb2d2746b2c88b56edf
This commit is contained in:
danielk1977
2009-07-28 13:30:30 +00:00
parent 3190f4b5f1
commit 0a458e5e2f
4 changed files with 86 additions and 9 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
** $Id: select.c,v 1.524 2009/06/12 03:27:27 drh Exp $
** $Id: select.c,v 1.525 2009/07/28 13:30:31 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -2355,6 +2355,9 @@ static Expr *substExpr(
assert( pEList!=0 && pExpr->iColumn<pEList->nExpr );
assert( pExpr->pLeft==0 && pExpr->pRight==0 );
pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0);
if( pExpr->pColl ){
pNew->pColl = pExpr->pColl;
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;
}