forked from pgjdbc/pgjdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MAX_QUERY_MEMORY_BYTES to PGProperty to use it in QueryExecutorIm…
…pl as limitTupleBytes.
- Loading branch information
1 parent
b60a01c
commit b5da9da
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,7 +390,12 @@ public enum PGProperty { | |
"When connections that are not explicitly closed are garbage collected, log the stacktrace from the opening of the connection to trace the leak source"), | ||
|
||
/** | ||
* Specifies size of buffer during fetching result set. Can be specified as specified size or | ||
* The allowed memory size in bytes, what a query can use (iData made attribute) | ||
*/ | ||
MAX_QUERY_MEMORY_BYTES("maxQueryMemoryBytes", Long.toString(Long.MAX_VALUE), "The allowed memory size in bytes, what a query can use"), | ||
|
||
/** | ||
* Specifies size of buffer during fetching result th. Can be specified as specified size or | ||
* percent of heap memory. | ||
*/ | ||
MAX_RESULT_BUFFER( | ||
|
@@ -1010,6 +1015,22 @@ public int getInt(Properties properties) throws PSQLException { | |
} | ||
} | ||
|
||
/** | ||
* Return the long value for this connection parameter in the given {@code Properties} | ||
* | ||
* @param properties properties to take actual value from | ||
* @return evaluated value for this connection parameter converted to long | ||
* @throws PSQLException if it cannot be converted to long. | ||
*/ | ||
public long getLong(Properties properties) throws PSQLException { | ||
String value = get(properties); | ||
try { | ||
return Long.parseLong(value); | ||
Check failure on line 1028 in pgjdbc/src/main/java/org/postgresql/PGProperty.java GitHub Actions / CheckerFramework
|
||
} catch (NumberFormatException nfe) { | ||
throw new PSQLException(GT.tr("{0} parameter value must be a long but was: {1}", getName(), value), PSQLState.INVALID_PARAMETER_VALUE, nfe); | ||
} | ||
} | ||
|
||
/** | ||
* Set the boolean value for this connection parameter in the given {@link Properties}. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters