!1959 修复merge into全局临时表报表文件不存在的bug
Merge pull request !1959 from Cross-罗/merge_into
This commit is contained in:
@ -1317,7 +1317,7 @@ void init_gtt_storage(CmdType operation, ResultRelInfo* resultRelInfo)
|
||||
"to enable this feature.")));
|
||||
}
|
||||
|
||||
if (!(operation == CMD_UTILITY || operation == CMD_INSERT)) {
|
||||
if (!(operation == CMD_UTILITY || operation == CMD_INSERT || operation == CMD_MERGE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
11
src/test/regress/input/gtt_merge.source
Normal file
11
src/test/regress/input/gtt_merge.source
Normal file
@ -0,0 +1,11 @@
|
||||
CREATE TABLE test_template ( A INT );
|
||||
INSERT INTO test_template VALUES( 1 );
|
||||
|
||||
CREATE USER test_user WITH PASSWORD 'openGauss@123';
|
||||
GRANT ALL PRIVILEGES TO test_user;
|
||||
|
||||
\! @abs_bindir@/gsql -r -U test_user -W openGauss@123 -p @portstring@ -d regression -c "CREATE GLOBAL TEMPORARY TABLE test_gt ( ID INT, NAME TEXT );"
|
||||
SELECT pg_sleep(1);
|
||||
\! @abs_bindir@/gsql -r -U test_user -W openGauss@123 -p @portstring@ -d regression -c "MERGE INTO test_gt USING test_template ON test_template.a >= 1 WHEN NOT MATCHED THEN INSERT VALUES ( 1, '1' ) WHEN MATCHED THEN UPDATE SET name = '1'; SELECT * FROM test_gt;"
|
||||
|
||||
DROP USER test_user CASCADE;
|
||||
20
src/test/regress/output/gtt_merge.source
Normal file
20
src/test/regress/output/gtt_merge.source
Normal file
@ -0,0 +1,20 @@
|
||||
CREATE TABLE test_template ( A INT );
|
||||
INSERT INTO test_template VALUES( 1 );
|
||||
CREATE USER test_user WITH PASSWORD 'openGauss@123';
|
||||
GRANT ALL PRIVILEGES TO test_user;
|
||||
\! @abs_bindir@/gsql -r -U test_user -W openGauss@123 -p @portstring@ -d regression -c "CREATE GLOBAL TEMPORARY TABLE test_gt ( ID INT, NAME TEXT );"
|
||||
CREATE TABLE
|
||||
SELECT pg_sleep(1);
|
||||
pg_sleep
|
||||
----------
|
||||
|
||||
(1 row)
|
||||
|
||||
\! @abs_bindir@/gsql -r -U test_user -W openGauss@123 -p @portstring@ -d regression -c "MERGE INTO test_gt USING test_template ON test_template.a >= 1 WHEN NOT MATCHED THEN INSERT VALUES ( 1, '1' ) WHEN MATCHED THEN UPDATE SET name = '1'; SELECT * FROM test_gt;"
|
||||
MERGE 1
|
||||
id | name
|
||||
----+------
|
||||
1 | 1
|
||||
(1 row)
|
||||
|
||||
DROP USER test_user CASCADE;
|
||||
@ -319,6 +319,7 @@ test: gtt_function
|
||||
test: gtt_prepare
|
||||
test: gtt_parallel_1 gtt_parallel_2
|
||||
test: gtt_clean
|
||||
test: gtt_merge
|
||||
|
||||
#openGauss synchronization test cases
|
||||
test: partiton_pathkey_col_plan partiton_pathkey_col_randomexec partiton_pathkey_row_plan partiton_pathkey_row_randomexec
|
||||
|
||||
Reference in New Issue
Block a user