-
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.
Support SSMS scripting for Users and fix crash in SSMS while clicking…
… permissions (#1869) (#1972) Added three new dummy views, sys.asymmetric_keys, sys.certificates and sys.database_permissions which are required by to script users, though empty views works fine here.Open a JIRA, BABEL-4440 for fully supporting it in future. Task: BABEL-3921, BABEL-3593 Signed-off-by: Ashish Prasad <[email protected]>
- Loading branch information
Showing
26 changed files
with
494 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
USE master | ||
GO | ||
|
||
DROP VIEW sys_asymmetric_keys_vu_prepare_view | ||
GO | ||
|
||
DROP PROC sys_asymmetric_keys_vu_prepare_proc | ||
GO | ||
|
||
DROP FUNCTION sys_asymmetric_keys_vu_prepare_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,18 @@ | ||
USE master | ||
GO | ||
|
||
CREATE VIEW sys_asymmetric_keys_vu_prepare_view AS | ||
SELECT * FROM sys.asymmetric_keys | ||
GO | ||
|
||
CREATE PROC sys_asymmetric_keys_vu_prepare_proc AS | ||
SELECT * FROM sys.asymmetric_keys | ||
GO | ||
|
||
CREATE FUNCTION sys_asymmetric_keys_vu_prepare_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.asymmetric_keys WHERE key_length= 0) | ||
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,31 @@ | ||
USE master | ||
GO | ||
|
||
SELECT * FROM sys.asymmetric_keys | ||
GO | ||
~~START~~ | ||
varchar#!#int#!#int#!#char#!#nvarchar#!#varbinary#!#char#!#nvarchar#!#int#!#varbinary#!#nvarchar#!#varbinary#!#nvarchar#!#nvarchar#!#uniqueidentifier#!#sql_variant | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM sys_asymmetric_keys_vu_prepare_view | ||
GO | ||
~~START~~ | ||
varchar#!#int#!#int#!#char#!#nvarchar#!#varbinary#!#char#!#nvarchar#!#int#!#varbinary#!#nvarchar#!#varbinary#!#nvarchar#!#nvarchar#!#uniqueidentifier#!#sql_variant | ||
~~END~~ | ||
|
||
|
||
EXEC sys_asymmetric_keys_vu_prepare_proc | ||
GO | ||
~~START~~ | ||
varchar#!#int#!#int#!#char#!#nvarchar#!#varbinary#!#char#!#nvarchar#!#int#!#varbinary#!#nvarchar#!#varbinary#!#nvarchar#!#nvarchar#!#uniqueidentifier#!#sql_variant | ||
~~END~~ | ||
|
||
|
||
SELECT sys_asymmetric_keys_vu_prepare_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,11 @@ | ||
USE master | ||
GO | ||
|
||
DROP VIEW sys_certificates_vu_prepare_view | ||
GO | ||
|
||
DROP PROC sys_certificates_vu_prepare_proc | ||
GO | ||
|
||
DROP FUNCTION sys_certificates_vu_prepare_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,18 @@ | ||
USE master | ||
GO | ||
|
||
CREATE VIEW sys_certificates_vu_prepare_view AS | ||
SELECT * FROM sys.certificates | ||
GO | ||
|
||
CREATE PROC sys_certificates_vu_prepare_proc AS | ||
SELECT * FROM sys.certificates | ||
GO | ||
|
||
CREATE FUNCTION sys_certificates_vu_prepare_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.certificates WHERE key_length = 0) | ||
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,31 @@ | ||
USE master | ||
GO | ||
|
||
SELECT * FROM sys.certificates | ||
GO | ||
~~START~~ | ||
varchar#!#int#!#int#!#char#!#nvarchar#!#bit#!#nvarchar#!#nvarchar#!#varbinary#!#nvarchar#!#nvarchar#!#datetime#!#datetime#!#varbinary#!#nvarchar#!#datetime#!#int | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM sys_certificates_vu_prepare_view | ||
GO | ||
~~START~~ | ||
varchar#!#int#!#int#!#char#!#nvarchar#!#bit#!#nvarchar#!#nvarchar#!#varbinary#!#nvarchar#!#nvarchar#!#datetime#!#datetime#!#varbinary#!#nvarchar#!#datetime#!#int | ||
~~END~~ | ||
|
||
|
||
EXEC sys_certificates_vu_prepare_proc | ||
GO | ||
~~START~~ | ||
varchar#!#int#!#int#!#char#!#nvarchar#!#bit#!#nvarchar#!#nvarchar#!#varbinary#!#nvarchar#!#nvarchar#!#datetime#!#datetime#!#varbinary#!#nvarchar#!#datetime#!#int | ||
~~END~~ | ||
|
||
|
||
SELECT sys_certificates_vu_prepare_func() | ||
GO | ||
~~START~~ | ||
int | ||
0 | ||
~~END~~ | ||
|
11 changes: 11 additions & 0 deletions
11
test/JDBC/expected/sys_database_permissions-vu-cleanup.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,11 @@ | ||
USE master | ||
GO | ||
|
||
DROP VIEW sys_database_permissions_vu_prepare_view | ||
GO | ||
|
||
DROP PROC sys_database_permissions_vu_prepare_proc | ||
GO | ||
|
||
DROP FUNCTION sys_database_permissions_vu_prepare_func | ||
GO |
18 changes: 18 additions & 0 deletions
18
test/JDBC/expected/sys_database_permissions-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,18 @@ | ||
USE master | ||
GO | ||
|
||
CREATE VIEW sys_database_permissions_vu_prepare_view AS | ||
SELECT * FROM sys.database_permissions | ||
GO | ||
|
||
CREATE PROC sys_database_permissions_vu_prepare_proc AS | ||
SELECT * FROM sys.database_permissions | ||
GO | ||
|
||
CREATE FUNCTION sys_database_permissions_vu_prepare_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.database_permissions WHERE state='A') | ||
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,31 @@ | ||
USE master | ||
GO | ||
|
||
SELECT * FROM sys.database_permissions | ||
GO | ||
~~START~~ | ||
tinyint#!#nvarchar#!#int#!#int#!#int#!#int#!#char#!#nvarchar#!#char#!#nvarchar | ||
~~END~~ | ||
|
||
|
||
SELECT * FROM sys_database_permissions_vu_prepare_view | ||
GO | ||
~~START~~ | ||
tinyint#!#nvarchar#!#int#!#int#!#int#!#int#!#char#!#nvarchar#!#char#!#nvarchar | ||
~~END~~ | ||
|
||
|
||
EXEC sys_database_permissions_vu_prepare_proc | ||
GO | ||
~~START~~ | ||
tinyint#!#nvarchar#!#int#!#int#!#int#!#int#!#char#!#nvarchar#!#char#!#nvarchar | ||
~~END~~ | ||
|
||
|
||
SELECT sys_database_permissions_vu_prepare_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,11 @@ | ||
USE master | ||
GO | ||
|
||
DROP VIEW sys_asymmetric_keys_vu_prepare_view | ||
GO | ||
|
||
DROP PROC sys_asymmetric_keys_vu_prepare_proc | ||
GO | ||
|
||
DROP FUNCTION sys_asymmetric_keys_vu_prepare_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,18 @@ | ||
USE master | ||
GO | ||
|
||
CREATE VIEW sys_asymmetric_keys_vu_prepare_view AS | ||
SELECT * FROM sys.asymmetric_keys | ||
GO | ||
|
||
CREATE PROC sys_asymmetric_keys_vu_prepare_proc AS | ||
SELECT * FROM sys.asymmetric_keys | ||
GO | ||
|
||
CREATE FUNCTION sys_asymmetric_keys_vu_prepare_func() | ||
RETURNS INT | ||
AS | ||
BEGIN | ||
RETURN (SELECT COUNT(*) FROM sys.asymmetric_keys WHERE key_length= 0) | ||
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,14 @@ | ||
USE master | ||
GO | ||
|
||
SELECT * FROM sys.asymmetric_keys | ||
GO | ||
|
||
SELECT * FROM sys_asymmetric_keys_vu_prepare_view | ||
GO | ||
|
||
EXEC sys_asymmetric_keys_vu_prepare_proc | ||
GO | ||
|
||
SELECT sys_asymmetric_keys_vu_prepare_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,11 @@ | ||
USE master | ||
GO | ||
|
||
DROP VIEW sys_certificates_vu_prepare_view | ||
GO | ||
|
||
DROP PROC sys_certificates_vu_prepare_proc | ||
GO | ||
|
||
DROP FUNCTION sys_certificates_vu_prepare_func | ||
GO |
Oops, something went wrong.