From f73ca8885dba607df3a010d52e4b8251e3e4fcc1 Mon Sep 17 00:00:00 2001 From: dimitr Date: Thu, 30 May 2013 08:20:53 +0000 Subject: [PATCH] Fixed regression CORE-4108: Server crashes when executing sql query "delete from mytable order by id desc rows 2". --- src/dsql/pass1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dsql/pass1.cpp b/src/dsql/pass1.cpp index 9778bd9b20d..1257919b78d 100644 --- a/src/dsql/pass1.cpp +++ b/src/dsql/pass1.cpp @@ -1443,7 +1443,7 @@ static ValueListNode* pass1_group_by_list(DsqlCompilerScratch* dsqlScratch, Valu if ((field = ExprNode::as(sub))) { // check for alias or field node - if (field->dsqlQualifier.isEmpty() && field->dsqlName.hasData()) + if (selectList && field->dsqlQualifier.isEmpty() && field->dsqlName.hasData()) { // AB: Check first against the select list for matching column. // When no matches at all are found we go on with our @@ -2277,7 +2277,7 @@ ValueListNode* PASS1_sort(DsqlCompilerScratch* dsqlScratch, ValueListNode* input ValueExprNode* aliasNode = NULL; // check for alias or field node - if (field->dsqlQualifier.isEmpty() && field->dsqlName.hasData()) + if (selectList && field->dsqlQualifier.isEmpty() && field->dsqlName.hasData()) { // AB: Check first against the select list for matching column. // When no matches at all are found we go on with our