forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More specific error message on creation of windows login for NT Servi…
…ce domain (babelfish-for-postgresql#2828) Currently in babelfish, when a new windows login is created for NT Service domain - it raises an error on space character. With this change babelfish will check for the NT Service domain and print an error specifically indicating this is not supported in Babelfish and added relevant test cases. NT Service may be spelled in mixed case. Issues Resolved: BABEL-4212 Signed-off-by: P Aswini Kumar <[email protected]>
- Loading branch information
Showing
6 changed files
with
325 additions
and
0 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 |
---|---|---|
|
@@ -2966,3 +2966,117 @@ GO | |
~~ERROR (Message: 'EXTERNAL NAME' is not currently supported in Babelfish)~~ | ||
|
||
|
||
-- create login from windows | ||
-- Add 'dummydomain' domain entry | ||
exec sys.babelfish_add_domain_mapping_entry 'dummydomain', 'dummydomain.babel'; | ||
GO | ||
|
||
CREATE LOGIN [NT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Service' domain is not yet supported in Babelfish.)~~ | ||
|
||
|
||
CREATE LOGIN [\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: The login name '\MSSQLSERVER' is invalid. The domain can not be empty.)~~ | ||
|
||
|
||
CREATE LOGIN [NT Servicesomething\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Servicesomething\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT ServiceNT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT ServiceNT Service\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT ServiceNT SerViCe\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT ServiceNT SerViCe\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [somethingNT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'somethingNT Service\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT Service\NT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: The login name 'NT Service\NT Service\MSSQLSERVER' has invalid length. Login name length should be between 1 and 20 for windows login.)~~ | ||
|
||
|
||
CREATE LOGIN [NT S\ervice\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT S\ervice\MSSQLSERVER' is not a valid name because it contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT Service\\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Service\\MSSQLSERVER' is not a valid name because it contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN ["NT Service"\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: '"NT Service"\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [[NT Service]\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: syntax error near '\' at line 1 and character position 26)~~ | ||
|
||
|
||
CREATE LOGIN [["NT Service"]\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: syntax error near '\' at line 1 and character position 28)~~ | ||
|
||
|
||
CREATE LOGIN [NT Service\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[test] | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Service' domain is not yet supported in Babelfish.)~~ | ||
|
||
|
||
CREATE LOGIN [NT SerViCe\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[test] | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT SerViCe' domain is not yet supported in Babelfish.)~~ | ||
|
||
|
||
CREATE LOGIN [dummydomain\NT Service] FROM WINDOWS | ||
GO | ||
|
||
-- Dropping 'nt [email protected]' | ||
DROP LOGIN [dummydomain\NT Service] | ||
GO | ||
|
||
-- Remove entry for 'dummydomain' | ||
exec babelfish_remove_domain_mapping_entry 'dummydomain' | ||
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 |
---|---|---|
|
@@ -2974,3 +2974,117 @@ GO | |
~~ERROR (Message: 'EXTERNAL NAME' is not currently supported in Babelfish)~~ | ||
|
||
|
||
-- create login from windows | ||
-- Add 'dummydomain' domain entry | ||
exec sys.babelfish_add_domain_mapping_entry 'dummydomain', 'dummydomain.babel'; | ||
GO | ||
|
||
CREATE LOGIN [NT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Service' domain is not yet supported in Babelfish.)~~ | ||
|
||
|
||
CREATE LOGIN [\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: The login name '\MSSQLSERVER' is invalid. The domain can not be empty.)~~ | ||
|
||
|
||
CREATE LOGIN [NT Servicesomething\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Servicesomething\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT ServiceNT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT ServiceNT Service\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT ServiceNT SerViCe\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT ServiceNT SerViCe\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [somethingNT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'somethingNT Service\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT Service\NT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: The login name 'NT Service\NT Service\MSSQLSERVER' has invalid length. Login name length should be between 1 and 20 for windows login.)~~ | ||
|
||
|
||
CREATE LOGIN [NT S\ervice\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT S\ervice\MSSQLSERVER' is not a valid name because it contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [NT Service\\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Service\\MSSQLSERVER' is not a valid name because it contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN ["NT Service"\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: '"NT Service"\MSSQLSERVER' is not valid because the domain name contains invalid characters.)~~ | ||
|
||
|
||
CREATE LOGIN [[NT Service]\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: syntax error near '\' at line 1 and character position 26)~~ | ||
|
||
|
||
CREATE LOGIN [["NT Service"]\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: syntax error near '\' at line 1 and character position 28)~~ | ||
|
||
|
||
CREATE LOGIN [NT Service\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[test] | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT Service' domain is not yet supported in Babelfish.)~~ | ||
|
||
|
||
CREATE LOGIN [NT SerViCe\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[test] | ||
GO | ||
~~ERROR (Code: 33557097)~~ | ||
|
||
~~ERROR (Message: 'NT SerViCe' domain is not yet supported in Babelfish.)~~ | ||
|
||
|
||
CREATE LOGIN [dummydomain\NT Service] FROM WINDOWS | ||
GO | ||
|
||
-- Dropping 'nt [email protected]' | ||
DROP LOGIN [dummydomain\NT Service] | ||
GO | ||
|
||
-- Remove entry for 'dummydomain' | ||
exec babelfish_remove_domain_mapping_entry 'dummydomain' | ||
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 |
---|---|---|
|
@@ -1642,6 +1642,64 @@ AS | |
EXTERNAL NAME babel_3571 | ||
GO | ||
|
||
-- create login from windows | ||
-- Add 'dummydomain' domain entry | ||
exec sys.babelfish_add_domain_mapping_entry 'dummydomain', 'dummydomain.babel'; | ||
GO | ||
|
||
CREATE LOGIN [NT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT Servicesomething\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT ServiceNT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT ServiceNT SerViCe\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [somethingNT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT Service\NT Service\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT S\ervice\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT Service\\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN ["NT Service"\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [[NT Service]\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [["NT Service"]\MSSQLSERVER] FROM WINDOWS | ||
GO | ||
|
||
CREATE LOGIN [NT Service\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[test] | ||
GO | ||
|
||
CREATE LOGIN [NT SerViCe\MSSQLSERVER] FROM WINDOWS WITH DEFAULT_DATABASE=[test] | ||
GO | ||
|
||
CREATE LOGIN [dummydomain\NT Service] FROM WINDOWS | ||
GO | ||
|
||
-- Dropping 'nt [email protected]' | ||
DROP LOGIN [dummydomain\NT Service] | ||
GO | ||
|
||
-- Remove entry for 'dummydomain' | ||
exec babelfish_remove_domain_mapping_entry 'dummydomain' | ||
GO | ||
|
||
-- INSERT BULK is No op. No point in failing this | ||
INSERT BULK babel_3571 ( | ||
ID INT PRIMARY KEY NOT NULL IDENTITY(1,1), | ||
|