Skip to content

Commit

Permalink
Add additional variable prefix
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Bigerl <bigerl@mail.upb.de>
  • Loading branch information
nck-mlcnv and bigerl authored Sep 13, 2024
1 parent b72d8cd commit 575e853
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private static List<String> instantiateTemplateQueries(QuerySource querySource,
final var match = matcher.group();
if (variables.containsKey(match)) continue;
String variableName = match.replaceAll("%%", "");
while (templateQueryString.contains("?" + variableName)) { // generate random variable name with 20 characters until it is unique
while (templateQueryString.contains("?" + variableName) || templateQueryString.contains("$" + variableName)) { // generate random variable name with 20 characters until it is unique
variableName = IntStream.range(0, 20).mapToObj(m -> String.valueOf(charset.charAt(random.nextInt(charset.length())))).collect(Collectors.joining());
}
final var variable = "?" + variableName;
Expand Down

0 comments on commit 575e853

Please sign in to comment.