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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]