Repository: incubator-trafodion Updated Branches: refs/heads/master 6a8b0f438 -> 4418ed3dc
jira TRAFODION-2225 misc enhancement -- merge update clause can be specified as: update set a = 10, b = 20; -- RETURNS keyword can now be used as an identifier Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/ae050f34 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/ae050f34 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/ae050f34 Branch: refs/heads/master Commit: ae050f34e21061f1ffa0a8d10776e440e4e52e09 Parents: 1ace253 Author: Anoop Sharma <anoop.sha...@esgyn.com> Authored: Thu Sep 15 21:36:32 2016 +0000 Committer: Anoop Sharma <anoop.sha...@esgyn.com> Committed: Thu Sep 15 21:36:32 2016 +0000 ---------------------------------------------------------------------- core/sql/parser/sqlparser.y | 3 ++- core/sql/regress/executor/EXPECTED015.SB | 16 ++++++++++++++++ core/sql/regress/executor/TEST015 | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae050f34/core/sql/parser/sqlparser.y ---------------------------------------------------------------------- diff --git a/core/sql/parser/sqlparser.y b/core/sql/parser/sqlparser.y index 7804a73..c9a4d67 100755 --- a/core/sql/parser/sqlparser.y +++ b/core/sql/parser/sqlparser.y @@ -19564,7 +19564,7 @@ merge_stmt_when_matched : TOK_WHEN TOK_MATCHED TOK_THEN TOK_UPDATE TOK_SET m } /* type item */ -merge_stmt_set_clause : set_clause +merge_stmt_set_clause : set_update_commit_list /* type ptr_placeholder */ merge_stmt_when_not_matched : TOK_WHEN TOK_NOT TOK_MATCHED TOK_THEN TOK_INSERT merge_insert_with_values @@ -33665,6 +33665,7 @@ nonreserved_func_word: TOK_ABS | TOK_RESTORE | TOK_RESUME | TOK_RETRIES + | TOK_RETURNS | TOK_RMAX | TOK_RMIN | TOK_ROUND http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae050f34/core/sql/regress/executor/EXPECTED015.SB ---------------------------------------------------------------------- diff --git a/core/sql/regress/executor/EXPECTED015.SB b/core/sql/regress/executor/EXPECTED015.SB index 5dd74f6..a80f143 100755 --- a/core/sql/regress/executor/EXPECTED015.SB +++ b/core/sql/regress/executor/EXPECTED015.SB @@ -631,6 +631,22 @@ A B C --- 4 row(s) selected. >> +>>merge into t015t3 on a = 1 ++> when matched then update set b = 20, c = 40; + +--- 1 row(s) updated. +>>select * from t015t3; + +A B C +----------- ----------- ----------- + + 1 20 40 + 2 3 4 + 3 3 4 + 4 5 6 + +--- 4 row(s) selected. +>> >>-- test fix to bugzilla 3405 >>delete from t015t3; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ae050f34/core/sql/regress/executor/TEST015 ---------------------------------------------------------------------- diff --git a/core/sql/regress/executor/TEST015 b/core/sql/regress/executor/TEST015 index b574f77..bcf05e4 100755 --- a/core/sql/regress/executor/TEST015 +++ b/core/sql/regress/executor/TEST015 @@ -404,6 +404,10 @@ merge into t015t3 using (select * from t015t4) as t015t4 when not matched then insert values (t015t4.a,t015t4.b,t015t4.c); select * from t015t3; +merge into t015t3 on a = 1 + when matched then update set b = 20, c = 40; +select * from t015t3; + -- test fix to bugzilla 3405 delete from t015t3; delete from t015t4;