Commit 4e22221a authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Removed quotes from group names

parent acb4e2b9
......@@ -16,7 +16,7 @@ public class PrivateRowsQueryExecutor extends QueryExecutor {
CustomJobOwner user = (CustomJobOwner) jobOwner;
statement.execute("SET my.tap_groups = \"{"
+ String.join(",", user.getGroups().stream()
.map(g -> "'" + g.replace("'", "''") + "'")
.map(g -> g.replace("'", "''"))
.collect(Collectors.toList()))
+ "}\"");
}
......
......@@ -19,7 +19,7 @@ public class PrivateRowsQueryExecutorTest {
Statement mockedStatement = mock(Statement.class);
queryExecutor.executeQuery(mockedStatement, "", user);
verify(mockedStatement).execute(eq("SET my.tap_groups = \"{'group1','group2'}\""));
verify(mockedStatement).execute(eq("SET my.tap_groups = \"{group1,group2}\""));
user = new CustomJobOwner("anonymous", Arrays.asList());
queryExecutor.executeQuery(mockedStatement, "", user);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment