1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix for ticket #35: Ignore any ORDER BY clause on a subquery in a FROM clause. (CVS 557)

FossilOrigin-Name: 1b0ee944c9af10078aba628e85d79f8682afa2b6
This commit is contained in:
drh
2002-05-08 21:46:14 +00:00
parent 0f18b450ad
commit d5feede1ff
4 changed files with 33 additions and 10 deletions

View File

@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
** @(#) $Id: parse.y,v 1.62 2002/04/20 14:24:42 drh Exp $
** @(#) $Id: parse.y,v 1.63 2002/05/08 21:46:15 drh Exp $
*/
%token_prefix TK_
%token_type {Token}
@ -283,10 +283,18 @@ seltablist(A) ::= stl_prefix(X) ids(Y) as ids(Z). {
seltablist(A) ::= stl_prefix(X) LP select(S) RP. {
A = sqliteIdListAppend(X,0);
A->a[A->nId-1].pSelect = S;
if( S->pOrderBy ){
sqliteExprListDelete(S->pOrderBy);
S->pOrderBy = 0;
}
}
seltablist(A) ::= stl_prefix(X) LP select(S) RP as ids(Z). {
A = sqliteIdListAppend(X,0);
A->a[A->nId-1].pSelect = S;
if( S->pOrderBy ){
sqliteExprListDelete(S->pOrderBy);
S->pOrderBy = 0;
}
sqliteIdListAddAlias(A,&Z);
}