-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update expected output of some test files when parallel query is enfo…
…rced (2_X_DEV) (#2187) Update expected output of some test files in case of parallel query as query plan changed. Also unblock these tests from parallel query jdbc ignore file. Cherry-pick commit 8efbb63 from BABEL_3_X_DEV to BABEL_2_X_DEV. Reason for expected output diff in case of parallel query mode - ``` # Output rows ORDER changes. BABEL-2514 - order changes because of UNION BABEL-2998 - order changes because of UNION (updated expected output for this according to BABEL_2_X_DEV as commit that fixed this tests is not cherry-picked from BABEL_3_X_DEV) BABEL-328-vu-verify - order changes because of JOIN TestSQLQueries - order changes because of JOIN BABEL-1444 - We don't share state of the GUC "role" with parallel worker which will result in current_setting('role') to return none # Query plan change BABEL-1363 BABEL-2843 BABEL-2844 BABEL-2902 BABEL-2903 BABEL-3248 BABEL-3295 BABEL-3513-vu-prepare BABEL-3513-vu-verify BABEL-4281 babel_collection binary-index-vu-verify ``` Task: BABEL-4643 Signed-off-by: Sandeep Kumawat <[email protected]>
- Loading branch information
1 parent
1f4e191
commit 71dd99f
Showing
34 changed files
with
4,768 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
-- psql | ||
-- Test setup -- | ||
ALTER SYSTEM SET babelfishpg_tsql.migration_mode = 'multi-db'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
USE MASTER; | ||
GO | ||
|
||
DECLARE @usr CHAR(30) | ||
DECLARE @cur_usr CHAR(30) | ||
SET @usr = user | ||
SET @cur_usr = current_user | ||
SELECT 'user: '+ @usr | ||
SELECT 'current_user: '+ @cur_usr | ||
GO | ||
~~START~~ | ||
varchar | ||
user: dbo | ||
~~END~~ | ||
|
||
~~START~~ | ||
varchar | ||
current_user: dbo | ||
~~END~~ | ||
|
||
|
||
CREATE TABLE dbo.t1 | ||
(id INT IDENTITY(100, 1) NOT NULL, | ||
description VARCHAR(30) NOT NULL, | ||
usr VARCHAR(30) NOT NULL DEFAULT USER, | ||
cur_usr VARCHAR(30) NOT NULL DEFAULT CURRENT_USER); | ||
GO | ||
|
||
INSERT INTO dbo.t1 (description) VALUES ('Orange'); | ||
INSERT INTO dbo.t1 (description) VALUES ('Blue'); | ||
INSERT INTO dbo.t1 (description, usr) VALUES ('Green', 'Bob'); | ||
INSERT INTO dbo.t1 (description, cur_usr) VALUES ('Purple', 'Alice'); | ||
INSERT INTO dbo.t1 (description, usr, cur_usr) VALUES ('Red', 'Mike', 'Dave'); | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
|
||
SELECT * FROM dbo.t1 ORDER BY id; | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#varchar#!#varchar | ||
100#!#Orange#!#dbo#!#dbo | ||
101#!#Blue#!#dbo#!#dbo | ||
102#!#Green#!#Bob#!#dbo | ||
103#!#Purple#!#dbo#!#Alice | ||
104#!#Red#!#Mike#!#Dave | ||
~~END~~ | ||
|
||
|
||
DROP TABLE dbo.t1; | ||
GO | ||
|
||
-- Test properties after USE | ||
CREATE DATABASE db1; | ||
GO | ||
|
||
SELECT current_setting('role'); | ||
GO | ||
~~START~~ | ||
text | ||
none | ||
~~END~~ | ||
|
||
SELECT current_setting('search_path'); | ||
GO | ||
~~START~~ | ||
text | ||
master_dbo, "$user", sys, pg_catalog | ||
~~END~~ | ||
|
||
SELECT session_user, current_user, user; | ||
GO | ||
~~START~~ | ||
nvarchar#!#varchar#!#nvarchar | ||
dbo#!#dbo#!#dbo | ||
~~END~~ | ||
|
||
SELECT user_name(); | ||
GO | ||
~~START~~ | ||
nvarchar | ||
dbo | ||
~~END~~ | ||
|
||
|
||
USE db1; | ||
GO | ||
|
||
SELECT current_setting('role'); | ||
GO | ||
~~START~~ | ||
text | ||
none | ||
~~END~~ | ||
|
||
SELECT current_setting('search_path'); | ||
GO | ||
~~START~~ | ||
text | ||
dbo, "$user", sys, pg_catalog | ||
~~END~~ | ||
|
||
SELECT session_user, current_user, user; | ||
GO | ||
~~START~~ | ||
nvarchar#!#varchar#!#nvarchar | ||
dbo#!#dbo#!#dbo | ||
~~END~~ | ||
|
||
SELECT user_name(); | ||
GO | ||
~~START~~ | ||
nvarchar | ||
dbo | ||
~~END~~ | ||
|
||
|
||
-- Error: Test DROP | ||
DROP DATABASE db1; | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: Cannot drop database "db1" because it is currently in use)~~ | ||
|
||
|
||
SELECT current_setting('role'); | ||
GO | ||
~~START~~ | ||
text | ||
none | ||
~~END~~ | ||
|
||
SELECT current_setting('search_path'); | ||
GO | ||
~~START~~ | ||
text | ||
dbo, "$user", sys, pg_catalog | ||
~~END~~ | ||
|
||
SELECT session_user, current_user, user; | ||
GO | ||
~~START~~ | ||
nvarchar#!#varchar#!#nvarchar | ||
dbo#!#dbo#!#dbo | ||
~~END~~ | ||
|
||
SELECT user_name(); | ||
GO | ||
~~START~~ | ||
nvarchar | ||
dbo | ||
~~END~~ | ||
|
||
|
||
-- Test DROP when using another database | ||
USE MASTER; | ||
GO | ||
|
||
SELECT current_setting('role'); | ||
GO | ||
~~START~~ | ||
text | ||
none | ||
~~END~~ | ||
|
||
SELECT current_setting('search_path'); | ||
GO | ||
~~START~~ | ||
text | ||
master_dbo, "$user", sys, pg_catalog | ||
~~END~~ | ||
|
||
SELECT session_user, current_user, user; | ||
GO | ||
~~START~~ | ||
nvarchar#!#varchar#!#nvarchar | ||
dbo#!#dbo#!#dbo | ||
~~END~~ | ||
|
||
SELECT user_name(); | ||
GO | ||
~~START~~ | ||
nvarchar | ||
dbo | ||
~~END~~ | ||
|
||
|
||
DROP DATABASE db1; | ||
GO | ||
|
||
SELECT current_setting('role'); | ||
GO | ||
~~START~~ | ||
text | ||
none | ||
~~END~~ | ||
|
||
SELECT current_setting('search_path'); | ||
GO | ||
~~START~~ | ||
text | ||
master_dbo, "$user", sys, pg_catalog | ||
~~END~~ | ||
|
||
SELECT session_user, current_user, user; | ||
GO | ||
~~START~~ | ||
nvarchar#!#varchar#!#nvarchar | ||
dbo#!#dbo#!#dbo | ||
~~END~~ | ||
|
||
SELECT user_name(); | ||
GO | ||
~~START~~ | ||
nvarchar | ||
dbo | ||
~~END~~ | ||
|
||
|
||
-- Test CREATE | ||
CREATE DATABASE db1; | ||
GO | ||
|
||
SELECT current_setting('role'); | ||
GO | ||
~~START~~ | ||
text | ||
none | ||
~~END~~ | ||
|
||
SELECT current_setting('search_path'); | ||
GO | ||
~~START~~ | ||
text | ||
master_dbo, "$user", sys, pg_catalog | ||
~~END~~ | ||
|
||
SELECT session_user, current_user, user; | ||
GO | ||
~~START~~ | ||
nvarchar#!#varchar#!#nvarchar | ||
dbo#!#dbo#!#dbo | ||
~~END~~ | ||
|
||
SELECT user_name(); | ||
GO | ||
~~START~~ | ||
nvarchar | ||
dbo | ||
~~END~~ | ||
|
||
|
||
-- Clean up | ||
DROP DATABASE db1; | ||
GO |
Oops, something went wrong.