You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ChrisSamo632 (via GitHub)" <gi...@apache.org> on 2023/06/13 22:03:46 UTC

[GitHub] [nifi] ChrisSamo632 commented on a diff in pull request #7245: NIFI-8831 Support using MSSQL as nifi registry relation database engine

ChrisSamo632 commented on code in PR #7245:
URL: https://github.com/apache/nifi/pull/7245#discussion_r1228740757


##########
nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/security/authorization/database/DatabaseUserGroupProvider.java:
##########
@@ -121,7 +129,9 @@ public void checkInheritability(final String proposedFingerprint) throws Authori
     @Override
     public User addUser(final User user) throws AuthorizationAccessException {
         Validate.notNull(user);
-        final String sql = "INSERT INTO UGP_USER(IDENTIFIER, IDENTITY) VALUES (?, ?)";
+        final String sql = (databaseType instanceof SQLServerDatabaseType)
+                ? "INSERT INTO UGP_USER(IDENTIFIER, [IDENTITY]) VALUES (?, ?)"
+                : "INSERT INTO UGP_USER(IDENTIFIER, IDENTITY) VALUES (?, ?)";

Review Comment:
   ```suggestion
                   final String sql = "INSERT INTO UGP_USER(IDENTIFIER, \"IDENTITY\") VALUES (?, ?)";
   ```
   
   Consider escaping with double quotes instead, which is the ANSI/ISO standard, so hopefully works across all supported database types



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org