-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test changes for 'Fix error when trying to drop columns from temp tab…
…les.' (#2753) (#2779) Tests for babelfish-for-postgresql/postgresql_modified_for_babelfish#410 Task: BABEL-4912 Signed-off-by: Jason Teng <[email protected]>
- Loading branch information
Showing
7 changed files
with
152 additions
and
79 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
-- BABEL-4912 test ALTER TABLE for temp tables | ||
CREATE TABLE #t1 (a INT IDENTITY PRIMARY KEY NOT NULL, b INT) | ||
GO | ||
|
||
INSERT INTO #t1 (b) values (1) | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int#!#int | ||
1#!#1 | ||
~~END~~ | ||
|
||
|
||
ALTER TABLE #t1 DROP COLUMN b | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int | ||
1 | ||
~~END~~ | ||
|
||
|
||
ALTER TABLE #t1 ADD b varchar(20) | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int#!#varchar | ||
1#!#<NULL> | ||
~~END~~ | ||
|
||
|
||
ALTER TABLE #t1 ADD c AS a + 1 | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#int | ||
1#!#<NULL>#!#2 | ||
~~END~~ | ||
|
||
|
||
ALTER TABLE #t1 DROP COLUMN a | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: cannot drop a column used by a generated column)~~ | ||
|
||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#int | ||
1#!#<NULL>#!#2 | ||
~~END~~ | ||
|
||
|
||
ALTER TABLE #t1 DROP COLUMN b | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int#!#int | ||
1#!#2 | ||
~~END~~ | ||
|
||
|
||
ALTER TABLE #t1 DROP COLUMN c | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
~~START~~ | ||
int | ||
1 | ||
~~END~~ | ||
|
||
|
||
DROP TABLE #t1 | ||
GO |
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
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
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,48 @@ | ||
-- BABEL-4912 test ALTER TABLE for temp tables | ||
CREATE TABLE #t1 (a INT IDENTITY PRIMARY KEY NOT NULL, b INT) | ||
GO | ||
|
||
INSERT INTO #t1 (b) values (1) | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
ALTER TABLE #t1 DROP COLUMN b | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
ALTER TABLE #t1 ADD b varchar(20) | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
ALTER TABLE #t1 ADD c AS a + 1 | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
ALTER TABLE #t1 DROP COLUMN a | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
ALTER TABLE #t1 DROP COLUMN b | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
ALTER TABLE #t1 DROP COLUMN c | ||
GO | ||
|
||
SELECT * FROM #t1 | ||
GO | ||
|
||
DROP TABLE #t1 | ||
GO |
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