summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2005-01-25 14:30:38 -0800
committerigor@rurik.mysql.com <>2005-01-25 14:30:38 -0800
commit34fa69a194eefe4ce4019c368e1233b079c1edf3 (patch)
tree7e46acd40fd2b057851a2bab7eb39a56f8ae9fc4 /sql/sql_yacc.yy
parentea1bd1d5e5f86c8c8d9d569524d7d62d878ddc22 (diff)
downloadmariadb-git-34fa69a194eefe4ce4019c368e1233b079c1edf3.tar.gz
order_by.result, order_by.test:
Added a test case for bug #7672. sql_yacc.yy: Fixed bug #7672. Made queries of the form (SELECT ...) ORDER BY ... to be equivalent to SELECT ... ORDER BY ...
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 7b72c73a915..6d0237f5615 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4033,11 +4033,14 @@ optional_order_or_limit:
send_error(&lex->thd->net, ER_SYNTAX_ERROR);
YYABORT;
}
- if (mysql_new_select(lex))
- YYABORT;
- mysql_init_select(lex);
- lex->select->linkage=NOT_A_SELECT;
- lex->select->select_limit=lex->thd->variables.select_limit;
+ if (lex->select != &lex->select_lex)
+ {
+ if (mysql_new_select(lex))
+ YYABORT;
+ mysql_init_select(lex);
+ lex->select->linkage=NOT_A_SELECT;
+ lex->select->select_limit=lex->thd->variables.select_limit;
+ }
}
opt_order_clause limit_clause
;