Skip to content

Commit

Permalink
Added test cases for IOT
Browse files Browse the repository at this point in the history
- cross db triggers
- cross schema triggers
- Bulk insert and inserted tables

Task: BABEL-2170

Signed-off-by: Deepakshi Mittal <[email protected]>
  • Loading branch information
deepakshi-mittal committed Oct 9, 2023
1 parent 34c3d17 commit 25bcbd8
Show file tree
Hide file tree
Showing 6 changed files with 474 additions and 40 deletions.
47 changes: 47 additions & 0 deletions test/JDBC/expected/BABEL-2170-vu-cleanup.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
-- clean all objects in first database
USE db1_BABEL2170;
GO

DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_insert;
GO

DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_update;
GO

DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_delete;
GO

DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_bulkinsert;
GO

DROP VIEW IF EXISTS babel_2170_vu_employees_view;
GO

DROP VIEW IF EXISTS babel_2170_vu_employees_view_bulkinsert;
GO

DROP TABLE IF EXISTS babel_2170_vu_employees;
GO

-- schema_2170 object cleanup
DROP TRIGGER IF EXISTS schema_2170.babel_2170_vu_employees_view_iot_update;
GO

DROP VIEW IF EXISTS schema_2170.babel_2170_vu_employees_view;
GO

DROP TABLE IF EXISTS schema_2170.babel_2170_vu_employees;
GO
-- clean all objects in second database
USE db2_BABEL2170;
GO

DROP TRIGGER IF EXISTS babel_2170_vu_employees_view_iot_insert;
GO

Expand All @@ -13,6 +51,15 @@ GO
DROP TABLE IF EXISTS babel_2170_vu_employees;
GO

USE MASTER;
GO

DROP DATABASE db1_BABEL2170;
GO

DROP DATABASE db2_BABEL2170;
GO

SELECT name FROM sys.sysobjects WHERE name LIKE 'babel_2170%' ORDER BY name;
GO
~~START~~
Expand Down
90 changes: 90 additions & 0 deletions test/JDBC/expected/BABEL-2170-vu-prepare.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-- We will create two databases db1_BABEL2170, db2_BABEL2170
CREATE DATABASE db1_BABEL2170;
GO

USE db1_BABEL2170;
GO

CREATE TABLE babel_2170_vu_employees
(
EmployeeID int NOT NULL,
Expand Down Expand Up @@ -29,3 +36,86 @@ SELECT EmployeeID,
FROM babel_2170_vu_employees
WHERE EmployeeName LIKE 'a%';
GO

CREATE VIEW babel_2170_vu_employees_view_bulkinsert AS
SELECT EmployeeID,
EmployeeName,
EmployeeAddress,
MonthSalary
FROM babel_2170_vu_employees
WHERE EmployeeName LIKE 'b%';
GO

CREATE SCHEMA schema_2170;
GO

CREATE TABLE schema_2170.babel_2170_vu_employees
(
EmployeeID int NOT NULL,
EmployeeName VARCHAR(50),
EmployeeAddress VARCHAR(50),
MonthSalary NUMERIC(10, 2)
)
GO

INSERT INTO schema_2170.babel_2170_vu_employees VALUES(1, 'amber', '1st Street', '1000');
INSERT INTO schema_2170.babel_2170_vu_employees VALUES(2, 'angel', '1st Street', '2000');
INSERT INTO schema_2170.babel_2170_vu_employees VALUES(3, 'ana', '1st Street', '3000');
INSERT INTO schema_2170.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 schema_2170.babel_2170_vu_employees_view AS
SELECT EmployeeID,
EmployeeName,
EmployeeAddress,
MonthSalary
FROM schema_2170.babel_2170_vu_employees
WHERE EmployeeName LIKE 'a%';
GO

CREATE DATABASE db2_BABEL2170;
GO

USE db2_BABEL2170;
GO

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

Loading

0 comments on commit 25bcbd8

Please sign in to comment.