aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-05-08 21:46:14 +0000
committerdrh <drh@noemail.net>2002-05-08 21:46:14 +0000
commitd5feede1ffeb19fd2948eea6efa018b01a762273 (patch)
treecc547c1b70462f5fe40dfb0a5c04e2cba4fccb2a /src
parent0f18b450adc929af0e55ae45dc64d2256c305ac4 (diff)
downloadsqlite-d5feede1ffeb19fd2948eea6efa018b01a762273.tar.gz
sqlite-d5feede1ffeb19fd2948eea6efa018b01a762273.zip
Fix for ticket #35: Ignore any ORDER BY clause on a subquery in a FROM clause. (CVS 557)
FossilOrigin-Name: 1b0ee944c9af10078aba628e85d79f8682afa2b6
Diffstat (limited to 'src')
-rw-r--r--src/parse.y10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/parse.y b/src/parse.y
index cf89bb115..744a0b914 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -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);
}