Skip to content

Commit

Permalink
Change the compiler validation to support disabling PS cache
Browse files Browse the repository at this point in the history
  • Loading branch information
daneshk committed Nov 11, 2024
1 parent 7069131 commit ca23498
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ public static void validateOptions(SyntaxNodeAnalysisContext ctx, String name, E
case Constants.Options.ROW_FETCH_SIZE:
case Constants.Options.CACHED_METADATA_FIELD_COUNT:
case Constants.Options.CACHED_METADATA_FIELD_SIZE:
case Constants.Options.PREPARED_STATEMENT_THRESHOLD:
case Constants.Options.PREPARED_STATEMENT_CACHE_QUERIES:
case Constants.Options.PREPARED_STATEMENT_CACHE_SIZE_MIB:
int sizeVal = Integer.parseInt(getTerminalNodeValue(valueNode, "1"));
if (sizeVal <= 0) {
DiagnosticInfo diagnosticInfo = new DiagnosticInfo(POSTGRESQL_102.getCode(),
Expand All @@ -164,6 +161,17 @@ public static void validateOptions(SyntaxNodeAnalysisContext ctx, String name, E
DiagnosticFactory.createDiagnostic(diagnosticInfo, valueNode.location()));
}
break;
case Constants.Options.PREPARED_STATEMENT_THRESHOLD:
case Constants.Options.PREPARED_STATEMENT_CACHE_QUERIES:
case Constants.Options.PREPARED_STATEMENT_CACHE_SIZE_MIB:
int thresholdVal = Integer.parseInt(getTerminalNodeValue(valueNode, "0"));
if (thresholdVal < 0) {
DiagnosticInfo diagnosticInfo = new DiagnosticInfo(POSTGRESQL_101.getCode(),
POSTGRESQL_101.getMessage(), POSTGRESQL_101.getSeverity());
ctx.reportDiagnostic(
DiagnosticFactory.createDiagnostic(diagnosticInfo, valueNode.location()));
}
break;
default:
// Can ignore all the other fields
}
Expand Down

0 comments on commit ca23498

Please sign in to comment.