-
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.
Addressed Code review suggestion for muti-db test cases
Ignored file containing multi-db test from jdbc schedule. Removed set config change for multi-db Added basic test cases seperately to verify IO Triggers. Task:BABEL-2170 Signed-off-by: Deepakshi Mittal <[email protected]>
- Loading branch information
1 parent
4d891ab
commit f105495
Showing
9 changed files
with
256 additions
and
70 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
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,126 @@ | ||
CREATE TABLE babel_2170_employees | ||
( | ||
EmployeeID int NOT NULL, | ||
EmployeeName VARCHAR(50), | ||
EmployeeAddress VARCHAR(50), | ||
MonthSalary NUMERIC(10, 2) | ||
) | ||
GO | ||
|
||
INSERT INTO babel_2170_employees VALUES(1, 'ash', '1st Street', '1000'); | ||
INSERT INTO babel_2170_employees VALUES(2, 'bob', '1st Street', '2000'); | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
|
||
CREATE VIEW babel_2170_employees_view AS | ||
SELECT EmployeeID, | ||
EmployeeName, | ||
EmployeeAddress, | ||
MonthSalary | ||
FROM babel_2170_employees; | ||
GO | ||
|
||
-- Instead of Insert Trigger on View | ||
CREATE TRIGGER babel_2170_employees_view_iot_insert ON babel_2170_employees_view | ||
INSTEAD OF INSERT | ||
AS | ||
BEGIN | ||
SELECT 'Trigger babel_2170_employees_view_iot_insert Invoked' | ||
END | ||
GO | ||
|
||
INSERT INTO babel_2170_employees_view VALUES(3, 'john', '1st Street', '3000'); | ||
GO | ||
~~START~~ | ||
varchar | ||
Trigger babel_2170_employees_view_iot_insert Invoked | ||
~~END~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
|
||
SELECT EmployeeID, EmployeeName, EmployeeAddress, MonthSalary FROM babel_2170_employees_view ORDER BY EmployeeID; | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#varchar#!#numeric | ||
1#!#ash#!#1st Street#!#1000.00 | ||
2#!#bob#!#1st Street#!#2000.00 | ||
~~END~~ | ||
|
||
|
||
-- Instead of Update Trigger on View | ||
CREATE TRIGGER babel_2170_employees_view_iot_update ON babel_2170_employees_view | ||
INSTEAD OF UPDATE | ||
AS | ||
BEGIN | ||
SELECT 'Trigger babel_2170_employees_view_iot_update Invoked' | ||
END | ||
GO | ||
|
||
UPDATE babel_2170_employees_view SET MonthSalary = MonthSalary +1 WHERE EmployeeID = 2; | ||
GO | ||
~~START~~ | ||
varchar | ||
Trigger babel_2170_employees_view_iot_update Invoked | ||
~~END~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
|
||
SELECT EmployeeID, EmployeeName, EmployeeAddress, MonthSalary FROM babel_2170_employees_view ORDER BY EmployeeID; | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#varchar#!#numeric | ||
1#!#ash#!#1st Street#!#1000.00 | ||
2#!#bob#!#1st Street#!#2000.00 | ||
~~END~~ | ||
|
||
|
||
|
||
-- Instead of Delete Trigger on View | ||
CREATE TRIGGER babel_2170_employees_view_iot_delete ON babel_2170_employees_view | ||
INSTEAD OF DELETE | ||
AS | ||
BEGIN | ||
SELECT 'Trigger babel_2170_employees_view_iot_delete Invoked' | ||
END | ||
GO | ||
|
||
BEGIN TRANSACTION | ||
DELETE FROM babel_2170_employees_view WHERE EmployeeID IN (1, 2); | ||
COMMIT TRANSACTION; | ||
GO | ||
~~START~~ | ||
varchar | ||
Trigger babel_2170_employees_view_iot_delete Invoked | ||
~~END~~ | ||
|
||
~~ROW COUNT: 2~~ | ||
|
||
|
||
SELECT EmployeeID, EmployeeName, EmployeeAddress, MonthSalary FROM babel_2170_employees_view ORDER BY EmployeeID; | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#varchar#!#numeric | ||
1#!#ash#!#1st Street#!#1000.00 | ||
2#!#bob#!#1st Street#!#2000.00 | ||
~~END~~ | ||
|
||
|
||
DROP TRIGGER IF EXISTS babel_2170_employees_view_iot_insert; | ||
GO | ||
|
||
DROP TRIGGER IF EXISTS babel_2170_employees_view_iot_update; | ||
GO | ||
|
||
DROP TRIGGER IF EXISTS babel_2170_employees_view_iot_delete; | ||
GO | ||
|
||
DROP VIEW IF EXISTS babel_2170_employees_view; | ||
GO | ||
|
||
DROP TABLE IF EXISTS babel_2170_employees; | ||
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
Oops, something went wrong.