-
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.
Fix failing test cases in github, added to upadte schedule
Task: BABEL-2170 Signed-off-by: Deepakshi Mittal <[email protected]>
- Loading branch information
1 parent
25bcbd8
commit 5981054
Showing
9 changed files
with
280 additions
and
144 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,70 @@ | ||
CREATE TABLE babel_2170_vu_employees | ||
( | ||
EmployeeID int NOT NULL, | ||
EmployeeName VARCHAR(50), | ||
EmployeeAddress VARCHAR(50), | ||
MonthSalary NUMERIC(10, 2) | ||
) | ||
GO | ||
|
||
INSERT INTO babel_2170_vu_employees VALUES(1, 'amber', '1st Street', '1000'); | ||
INSERT INTO babel_2170_vu_employees VALUES(2, 'angel', '1st Street', '2000'); | ||
INSERT INTO babel_2170_vu_employees VALUES(3, 'ana', '1st Street', '3000'); | ||
INSERT INTO babel_2170_vu_employees VALUES(4, 'adam', '1st Street', '4000'); | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
~~ROW COUNT: 1~~ | ||
|
||
|
||
CREATE VIEW babel_2170_vu_employees_view AS | ||
SELECT EmployeeID, | ||
EmployeeName, | ||
EmployeeAddress, | ||
MonthSalary | ||
FROM babel_2170_vu_employees | ||
WHERE EmployeeName LIKE 'a%'; | ||
GO | ||
|
||
CREATE TRIGGER babel_2170_vu_employees_view_iot_tx_update ON babel_2170_vu_employees_view | ||
INSTEAD OF UPDATE | ||
AS | ||
BEGIN | ||
BEGIN TRAN; | ||
INSERT INTO babel_2170_vu_employees_view VALUES(5, 'alex', '1st Street', '5000'); | ||
ROLLBACK tran; | ||
END | ||
GO | ||
|
||
UPDATE babel_2170_vu_employees_view SET MonthSalary = MonthSalary +1 WHERE EmployeeID = 3; | ||
GO | ||
~~ROW COUNT: 1~~ | ||
|
||
~~ERROR (Code: 3609)~~ | ||
|
||
~~ERROR (Message: The transaction ended in the trigger. The batch has been aborted.)~~ | ||
|
||
|
||
SELECT EmployeeID, EmployeeName, EmployeeAddress, MonthSalary FROM babel_2170_vu_employees_view ORDER BY EmployeeID; | ||
GO | ||
~~START~~ | ||
int#!#varchar#!#varchar#!#numeric | ||
1#!#amber#!#1st Street#!#1000.00 | ||
2#!#angel#!#1st Street#!#2000.00 | ||
3#!#ana#!#1st Street#!#3000.00 | ||
4#!#adam#!#1st Street#!#4000.00 | ||
~~END~~ | ||
|
||
|
||
DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_tx_update; | ||
GO | ||
|
||
DROP VIEW IF EXISTS babel_2170_vu_employees_view; | ||
GO | ||
|
||
DROP TABLE IF EXISTS babel_2170_vu_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
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 @@ | ||
CREATE TABLE babel_2170_vu_employees | ||
( | ||
EmployeeID int NOT NULL, | ||
EmployeeName VARCHAR(50), | ||
EmployeeAddress VARCHAR(50), | ||
MonthSalary NUMERIC(10, 2) | ||
) | ||
GO | ||
|
||
INSERT INTO babel_2170_vu_employees VALUES(1, 'amber', '1st Street', '1000'); | ||
INSERT INTO babel_2170_vu_employees VALUES(2, 'angel', '1st Street', '2000'); | ||
INSERT INTO babel_2170_vu_employees VALUES(3, 'ana', '1st Street', '3000'); | ||
INSERT INTO babel_2170_vu_employees VALUES(4, 'adam', '1st Street', '4000'); | ||
GO | ||
|
||
CREATE VIEW babel_2170_vu_employees_view AS | ||
SELECT EmployeeID, | ||
EmployeeName, | ||
EmployeeAddress, | ||
MonthSalary | ||
FROM babel_2170_vu_employees | ||
WHERE EmployeeName LIKE 'a%'; | ||
GO | ||
|
||
CREATE TRIGGER babel_2170_vu_employees_view_iot_tx_update ON babel_2170_vu_employees_view | ||
INSTEAD OF UPDATE | ||
AS | ||
BEGIN | ||
BEGIN TRAN; | ||
INSERT INTO babel_2170_vu_employees_view VALUES(5, 'alex', '1st Street', '5000'); | ||
ROLLBACK tran; | ||
END | ||
GO | ||
|
||
UPDATE babel_2170_vu_employees_view SET MonthSalary = MonthSalary +1 WHERE EmployeeID = 3; | ||
GO | ||
|
||
SELECT EmployeeID, EmployeeName, EmployeeAddress, MonthSalary FROM babel_2170_vu_employees_view ORDER BY EmployeeID; | ||
GO | ||
|
||
DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_tx_update; | ||
GO | ||
|
||
DROP VIEW IF EXISTS babel_2170_vu_employees_view; | ||
GO | ||
|
||
DROP TABLE IF EXISTS babel_2170_vu_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
Oops, something went wrong.