From: Pallavi Sontakke Date: Fri, 17 Jun 2016 09:09:21 +0000 (+0530) Subject: Add test for complex-update issue #38 X-Git-Tag: XL9_5_R1_2~41 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d6370adb88ddaacc91ed053821c1c36d6e5f72f0;p=postgres-xl.git Add test for complex-update issue #38 --- diff --git a/src/test/regress/expected/xl_known_bugs.out b/src/test/regress/expected/xl_known_bugs.out index bd210881a2..064390e2a0 100644 --- a/src/test/regress/expected/xl_known_bugs.out +++ b/src/test/regress/expected/xl_known_bugs.out @@ -751,3 +751,45 @@ FETCH FIRST xl_ins_cur; COMMIT; drop table xl_PLine; ------------------------------------------ +-- Issue #38 - complex update +-- In complex update using FROM list with explicit join, equation clause ‘=’ for integer is not supported +-- distributed by default by HASH(tmpunique1) +CREATE TABLE xl_tmp ( +tmpunique1 int4, +stringu1 name, +stringu2 name, +string4 name +); +-- distributed by default by HASH(unique1) +CREATE TABLE xl_onek ( +unique1 int4, +unique2 int4, +two int4, +four int4, +stringu1 name, +stringu2 name, +string4 name +); +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_onek.unique1 <= 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_onek.unique1 = 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_tmp.tmpunique1 <= 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_tmp.tmpunique1 = 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; +drop table xl_tmp; +drop table xl_onek; +------------------------------------------ diff --git a/src/test/regress/sql/xl_known_bugs.sql b/src/test/regress/sql/xl_known_bugs.sql index 093e0419e9..38803c9886 100644 --- a/src/test/regress/sql/xl_known_bugs.sql +++ b/src/test/regress/sql/xl_known_bugs.sql @@ -302,3 +302,54 @@ COMMIT; drop table xl_PLine; ------------------------------------------ + +-- Issue #38 - complex update + +-- In complex update using FROM list with explicit join, equation clause ‘=’ for integer is not supported + +-- distributed by default by HASH(tmpunique1) +CREATE TABLE xl_tmp ( +tmpunique1 int4, +stringu1 name, +stringu2 name, +string4 name +); +-- distributed by default by HASH(unique1) +CREATE TABLE xl_onek ( +unique1 int4, +unique2 int4, +two int4, +four int4, +stringu1 name, +stringu2 name, +string4 name +); + +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_onek.unique1 <= 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; + +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_onek.unique1 = 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; + +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_tmp.tmpunique1 <= 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; + +UPDATE xl_tmp + SET stringu1 = xl_onek.stringu1 + FROM xl_onek + WHERE xl_tmp.tmpunique1 = 3 and + xl_onek.unique1 = xl_tmp.tmpunique1; + +drop table xl_tmp; +drop table xl_onek; + +------------------------------------------