From 0015053b9e5f7b03ac3983458abdf76198b2c4d3 Mon Sep 17 00:00:00 2001 From: slguan Date: Tue, 23 Jul 2019 15:04:09 +0800 Subject: [PATCH] Fix the issue #156 --- src/inc/sql.y | 4 ++-- src/util/src/sql.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/inc/sql.y b/src/inc/sql.y index bf3c184a0f..8d8709d085 100755 --- a/src/inc/sql.y +++ b/src/inc/sql.y @@ -408,7 +408,7 @@ limit_opt(A) ::= LIMIT signed(X). {A.limit = X; A.offset = 0;} limit_opt(A) ::= LIMIT signed(X) OFFSET signed(Y). {A.limit = X; A.offset = Y;} limit_opt(A) ::= LIMIT signed(X) COMMA signed(Y). - {A.limit = Y; A.offset = X;} + {A.limit = X; A.offset = Y;} %type slimit_opt {SLimitVal} slimit_opt(A) ::= . {A.limit = -1; A.offset = 0;} @@ -416,7 +416,7 @@ slimit_opt(A) ::= SLIMIT signed(X). {A.limit = X; A.offset = 0;} slimit_opt(A) ::= SLIMIT signed(X) SOFFSET signed(Y). {A.limit = X; A.offset = Y;} slimit_opt(A) ::= SLIMIT signed(X) COMMA signed(Y). - {A.limit = Y; A.offset = X;} + {A.limit = X; A.offset = Y;} %type where_opt {tSQLExpr*} %destructor where_opt {tSQLExprDestroy($$);} diff --git a/src/util/src/sql.c b/src/util/src/sql.c index b402c85ca9..4a91773d12 100644 --- a/src/util/src/sql.c +++ b/src/util/src/sql.c @@ -1892,12 +1892,10 @@ static void yy_reduce( {yygotominor.yy294.limit = yymsp[0].minor.yy189; yygotominor.yy294.offset = 0;} break; case 122: /* limit_opt ::= LIMIT signed OFFSET signed */ + case 123: /* limit_opt ::= LIMIT signed COMMA signed */ yytestcase(yyruleno==123); case 126: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==126); -{yygotominor.yy294.limit = yymsp[-2].minor.yy189; yygotominor.yy294.offset = yymsp[0].minor.yy189;} - break; - case 123: /* limit_opt ::= LIMIT signed COMMA signed */ case 127: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==127); -{yygotominor.yy294.limit = yymsp[0].minor.yy189; yygotominor.yy294.offset = yymsp[-2].minor.yy189;} +{yygotominor.yy294.limit = yymsp[-2].minor.yy189; yygotominor.yy294.offset = yymsp[0].minor.yy189;} break; case 130: /* expr ::= LP expr RP */ {yygotominor.yy370 = yymsp[-1].minor.yy370; } -- GitLab