-
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.
Implemented sys.availability_replicas and sys.availability_groups as …
…an empty views (#2184) (#2252) This PR implements sys.availability_replicas and sys.availability_groups as an empty views to support Object Explorer Database enumeration with SSMS version 19.2. Complete support will be added in future. Tested this PR changes with SSMS version 19.2 Issues Resolved BABEL-4636 Signed-off-by: Rohit Bhagat <[email protected]>
- Loading branch information
1 parent
e365613
commit dfcf5d7
Showing
16 changed files
with
280 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
DROP VIEW sys_availability_groups_test_view | ||
GO | ||
|
||
DROP PROC sys_availability_groups_test_proc | ||
GO | ||
|
||
DROP FUNCTION sys_availability_groups_test_func | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
CREATE VIEW sys_availability_groups_test_view | ||
AS | ||
SELECT * FROM sys.availability_groups; | ||
GO | ||
|
||
CREATE PROC sys_availability_groups_test_proc | ||
AS | ||
SELECT * FROM sys.availability_groups | ||
GO | ||
|
||
CREATE FUNCTION sys_availability_groups_test_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.availability_groups) | ||
END | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
SELECT * FROM sys.availability_groups | ||
GO | ||
~~START~~ | ||
uniqueidentifier#!#varchar#!#nvarchar#!#nvarchar#!#int#!#int#!#tinyint#!#nvarchar#!#smallint#!#bit#!#bit#!#bit#!#bit#!#tinyint#!#nvarchar#!#int#!#bigint#!#bit | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM sys_availability_groups_test_view | ||
GO | ||
~~START~~ | ||
uniqueidentifier#!#varchar#!#nvarchar#!#nvarchar#!#int#!#int#!#tinyint#!#nvarchar#!#smallint#!#bit#!#bit#!#bit#!#bit#!#tinyint#!#nvarchar#!#int#!#bigint#!#bit | ||
~~END~~ | ||
|
||
|
||
EXEC sys_availability_groups_test_proc | ||
GO | ||
~~START~~ | ||
uniqueidentifier#!#varchar#!#nvarchar#!#nvarchar#!#int#!#int#!#tinyint#!#nvarchar#!#smallint#!#bit#!#bit#!#bit#!#bit#!#tinyint#!#nvarchar#!#int#!#bigint#!#bit | ||
~~END~~ | ||
|
||
|
||
SELECT sys_availability_groups_test_func() | ||
GO | ||
~~START~~ | ||
int | ||
0 | ||
~~END~~ | ||
|
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,8 @@ | ||
DROP VIEW sys_availability_replicas_test_view | ||
GO | ||
|
||
DROP PROC sys_availability_replicas_test_proc | ||
GO | ||
|
||
DROP FUNCTION sys_availability_replicas_test_func | ||
GO |
17 changes: 17 additions & 0 deletions
17
test/JDBC/expected/sys_availability_replicas-vu-prepare.out
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,17 @@ | ||
CREATE VIEW sys_availability_replicas_test_view | ||
AS | ||
SELECT * FROM sys.availability_replicas; | ||
GO | ||
|
||
CREATE PROC sys_availability_replicas_test_proc | ||
AS | ||
SELECT * FROM sys.availability_replicas | ||
GO | ||
|
||
CREATE FUNCTION sys_availability_replicas_test_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.availability_replicas) | ||
END | ||
GO |
28 changes: 28 additions & 0 deletions
28
test/JDBC/expected/sys_availability_replicas-vu-verify.out
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,28 @@ | ||
SELECT * FROM sys.availability_replicas | ||
GO | ||
~~START~~ | ||
uniqueidentifier#!#uniqueidentifier#!#int#!#nvarchar#!#varbinary#!#nvarchar#!#tinyint#!#nvarchar#!#tinyint#!#nvarchar#!#int#!#tinyint#!#nvarchar#!#tinyint#!#nvarchar#!#datetime#!#datetime#!#int#!#nvarchar#!#nvarchar#!#tinyint#!#nvarchar | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM sys_availability_replicas_test_view | ||
GO | ||
~~START~~ | ||
uniqueidentifier#!#uniqueidentifier#!#int#!#nvarchar#!#varbinary#!#nvarchar#!#tinyint#!#nvarchar#!#tinyint#!#nvarchar#!#int#!#tinyint#!#nvarchar#!#tinyint#!#nvarchar#!#datetime#!#datetime#!#int#!#nvarchar#!#nvarchar#!#tinyint#!#nvarchar | ||
~~END~~ | ||
|
||
|
||
EXEC sys_availability_replicas_test_proc | ||
GO | ||
~~START~~ | ||
uniqueidentifier#!#uniqueidentifier#!#int#!#nvarchar#!#varbinary#!#nvarchar#!#tinyint#!#nvarchar#!#tinyint#!#nvarchar#!#int#!#tinyint#!#nvarchar#!#tinyint#!#nvarchar#!#datetime#!#datetime#!#int#!#nvarchar#!#nvarchar#!#tinyint#!#nvarchar | ||
~~END~~ | ||
|
||
|
||
SELECT sys_availability_replicas_test_func() | ||
GO | ||
~~START~~ | ||
int | ||
0 | ||
~~END~~ | ||
|
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,8 @@ | ||
DROP VIEW sys_availability_groups_test_view | ||
GO | ||
|
||
DROP PROC sys_availability_groups_test_proc | ||
GO | ||
|
||
DROP FUNCTION sys_availability_groups_test_func | ||
GO |
17 changes: 17 additions & 0 deletions
17
test/JDBC/input/views/sys_availability_groups-vu-prepare.sql
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,17 @@ | ||
CREATE VIEW sys_availability_groups_test_view | ||
AS | ||
SELECT * FROM sys.availability_groups; | ||
GO | ||
|
||
CREATE PROC sys_availability_groups_test_proc | ||
AS | ||
SELECT * FROM sys.availability_groups | ||
GO | ||
|
||
CREATE FUNCTION sys_availability_groups_test_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.availability_groups) | ||
END | ||
GO |
11 changes: 11 additions & 0 deletions
11
test/JDBC/input/views/sys_availability_groups-vu-verify.sql
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,11 @@ | ||
SELECT * FROM sys.availability_groups | ||
GO | ||
|
||
SELECT * FROM sys_availability_groups_test_view | ||
GO | ||
|
||
EXEC sys_availability_groups_test_proc | ||
GO | ||
|
||
SELECT sys_availability_groups_test_func() | ||
GO |
8 changes: 8 additions & 0 deletions
8
test/JDBC/input/views/sys_availability_replicas-vu-cleanup.sql
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,8 @@ | ||
DROP VIEW sys_availability_replicas_test_view | ||
GO | ||
|
||
DROP PROC sys_availability_replicas_test_proc | ||
GO | ||
|
||
DROP FUNCTION sys_availability_replicas_test_func | ||
GO |
17 changes: 17 additions & 0 deletions
17
test/JDBC/input/views/sys_availability_replicas-vu-prepare.sql
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,17 @@ | ||
CREATE VIEW sys_availability_replicas_test_view | ||
AS | ||
SELECT * FROM sys.availability_replicas; | ||
GO | ||
|
||
CREATE PROC sys_availability_replicas_test_proc | ||
AS | ||
SELECT * FROM sys.availability_replicas | ||
GO | ||
|
||
CREATE FUNCTION sys_availability_replicas_test_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.availability_replicas) | ||
END | ||
GO |
11 changes: 11 additions & 0 deletions
11
test/JDBC/input/views/sys_availability_replicas-vu-verify.sql
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,11 @@ | ||
SELECT * FROM sys.availability_replicas | ||
GO | ||
|
||
SELECT * FROM sys_availability_replicas_test_view | ||
GO | ||
|
||
EXEC sys_availability_replicas_test_proc | ||
GO | ||
|
||
SELECT sys_availability_replicas_test_func() | ||
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