Skip to content

Commit c7e4ca2

Browse files
committed
Mark support for v13, update test / comment URLs accordingly.
As per discussionsin Issue #912 , SQLancer works fine with Postgres v13. This commit updates the test harness to run against Postgres v13 (instead of v12 currently). Also, the documentation links in README & code-comment URLs point to unreleased / outdated postgres documentation versions - For e.g. links were pointing to different postgres version documentations like devel (unreleased) / current / v12 or even v9.5 / v11 (both already EOL). This commit ensures that all www.postgresql.org documentation links in the comments, point to the supported version of postgres (which as of this commit is v13). As and when we advance support for a more recent version, we should update the doc links accordingly too.
1 parent 1267252 commit c7e4ca2

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ jobs:
467467
- name: Set up PostgreSQL
468468
uses: harmon758/postgresql-action@v1.0.0
469469
with:
470-
postgresql version: '12'
470+
postgresql version: '13'
471471
postgresql user: 'sqlancer'
472472
postgresql password: 'sqlancer'
473473
postgresql db: 'test'

src/sqlancer/postgres/PostgresProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public enum Action implements AbstractAction<PostgresGlobalState> {
109109
RESET_ROLE((g) -> new SQLQueryAdapter("RESET ROLE")), //
110110
COMMENT_ON(PostgresCommentGenerator::generate), //
111111
RESET((g) -> new SQLQueryAdapter("RESET ALL") /*
112-
* https://www.postgresql.org/docs/devel/sql-reset.html TODO: also
112+
* https://www.postgresql.org/docs/13/sql-reset.html TODO: also
113113
* configuration parameter
114114
*/), //
115115
NOTIFY(PostgresNotifyGenerator::createNotify), //

src/sqlancer/postgres/ast/PostgresFunctionWithUnknownResult.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ public enum PostgresFunctionWithUnknownResult {
1919
TEXT("text", PostgresDataType.TEXT, PostgresDataType.INET),
2020
INET_SAME_FAMILY("inet_same_family", PostgresDataType.BOOLEAN, PostgresDataType.INET, PostgresDataType.INET),
2121

22-
// https://www.postgresql.org/docs/devel/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE
22+
// https://www.postgresql.org/docs/13/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE
2323
// PG_RELOAD_CONF("pg_reload_conf", PostgresDataType.BOOLEAN), // too much output
2424
// PG_ROTATE_LOGFILE("pg_rotate_logfile", PostgresDataType.BOOLEAN), prints warning
2525

26-
// https://www.postgresql.org/docs/devel/functions-info.html#FUNCTIONS-INFO-SESSION-TABLE
26+
// https://www.postgresql.org/docs/13/functions-info.html#FUNCTIONS-INFO-SESSION-TABLE
2727
CURRENT_DATABASE("current_database", PostgresDataType.TEXT), // name
2828
// CURRENT_QUERY("current_query", PostgresDataType.TEXT), // can generate false positives
2929
CURRENT_SCHEMA("current_schema", PostgresDataType.TEXT), // name
@@ -87,7 +87,7 @@ public PostgresExpression[] getArguments(PostgresDataType returnType, PostgresEx
8787
TO_HEX("to_hex", PostgresDataType.INT, PostgresDataType.TEXT),
8888
TRANSLATE("translate", PostgresDataType.TEXT, PostgresDataType.TEXT, PostgresDataType.TEXT, PostgresDataType.TEXT),
8989
// mathematical functions
90-
// https://www.postgresql.org/docs/9.5/functions-math.html
90+
// https://www.postgresql.org/docs/13/functions-math.html
9191
ABS("abs", PostgresDataType.REAL, PostgresDataType.REAL),
9292
CBRT("cbrt", PostgresDataType.REAL, PostgresDataType.REAL), CEILING("ceiling", PostgresDataType.REAL), //
9393
DEGREES("degrees", PostgresDataType.REAL), EXP("exp", PostgresDataType.REAL), LN("ln", PostgresDataType.REAL),
@@ -98,7 +98,7 @@ public PostgresExpression[] getArguments(PostgresDataType returnType, PostgresEx
9898
FLOOR("floor", PostgresDataType.REAL),
9999

100100
// trigonometric functions - complete
101-
// https://www.postgresql.org/docs/12/functions-math.html#FUNCTIONS-MATH-TRIG-TABLE
101+
// https://www.postgresql.org/docs/13/functions-math.html#FUNCTIONS-MATH-TRIG-TABLE
102102
ACOS("acos", PostgresDataType.REAL), //
103103
ACOSD("acosd", PostgresDataType.REAL), //
104104
ASIN("asin", PostgresDataType.REAL), //
@@ -117,20 +117,20 @@ public PostgresExpression[] getArguments(PostgresDataType returnType, PostgresEx
117117
TAND("tand", PostgresDataType.REAL), //
118118

119119
// hyperbolic functions - complete
120-
// https://www.postgresql.org/docs/12/functions-math.html#FUNCTIONS-MATH-HYP-TABLE
120+
// https://www.postgresql.org/docs/13/functions-math.html#FUNCTIONS-MATH-HYP-TABLE
121121
SINH("sinh", PostgresDataType.REAL), //
122122
COSH("cosh", PostgresDataType.REAL), //
123123
TANH("tanh", PostgresDataType.REAL), //
124124
ASINH("asinh", PostgresDataType.REAL), //
125125
ACOSH("acosh", PostgresDataType.REAL), //
126126
ATANH("atanh", PostgresDataType.REAL), //
127127

128-
// https://www.postgresql.org/docs/devel/functions-binarystring.html
128+
// https://www.postgresql.org/docs/13/functions-binarystring.html
129129
GET_BIT("get_bit", PostgresDataType.INT, PostgresDataType.TEXT, PostgresDataType.INT),
130130
GET_BYTE("get_byte", PostgresDataType.INT, PostgresDataType.TEXT, PostgresDataType.INT),
131131

132132
// range functions
133-
// https://www.postgresql.org/docs/devel/functions-range.html#RANGE-FUNCTIONS-TABLE
133+
// https://www.postgresql.org/docs/13/functions-range.html#RANGE-FUNCTIONS-TABLE
134134
RANGE_LOWER("lower", PostgresDataType.INT, PostgresDataType.RANGE), //
135135
RANGE_UPPER("upper", PostgresDataType.INT, PostgresDataType.RANGE), //
136136
RANGE_ISEMPTY("isempty", PostgresDataType.BOOLEAN, PostgresDataType.RANGE), //
@@ -140,7 +140,7 @@ public PostgresExpression[] getArguments(PostgresDataType returnType, PostgresEx
140140
RANGE_UPPER_INF("upper_inf", PostgresDataType.BOOLEAN, PostgresDataType.RANGE), //
141141
RANGE_MERGE("range_merge", PostgresDataType.RANGE, PostgresDataType.RANGE, PostgresDataType.RANGE), //
142142

143-
// https://www.postgresql.org/docs/devel/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE
143+
// https://www.postgresql.org/docs/13/functions-admin.html#FUNCTIONS-ADMIN-DBSIZE
144144
GET_COLUMN_SIZE("get_column_size", PostgresDataType.INT, PostgresDataType.TEXT);
145145
// PG_DATABASE_SIZE("pg_database_size", PostgresDataType.INT, PostgresDataType.INT);
146146
// PG_SIZE_BYTES("pg_size_bytes", PostgresDataType.INT, PostgresDataType.TEXT);

src/sqlancer/postgres/gen/PostgresSetGenerator.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private PostgresSetGenerator() {
1414
}
1515

1616
private enum ConfigurationOption {
17-
// https://www.postgresql.org/docs/11/runtime-config-wal.html
17+
// https://www.postgresql.org/docs/13/runtime-config-wal.html
1818
// This parameter can only be set at server start.
1919
// WAL_LEVEL("wal_level", (r) -> Randomly.fromOptions("replica", "minimal", "logical")),
2020
// FSYNC("fsync", (r) -> Randomly.fromOptions(1, 0)),
@@ -37,7 +37,7 @@ private enum ConfigurationOption {
3737
// archive_mode
3838
// archive_command
3939
// archive_timeout
40-
// https://www.postgresql.org/docs/11/runtime-config-statistics.html
40+
// https://www.postgresql.org/docs/13/runtime-config-statistics.html
4141
// 19.9.1. Query and Index Statistics Collector
4242
TRACK_ACTIVITIES("track_activities", (r) -> Randomly.fromOptions(1, 0)),
4343
// track_activity_query_size
@@ -46,7 +46,7 @@ private enum ConfigurationOption {
4646
TRACK_FUNCTIONS("track_functions", (r) -> Randomly.fromOptions("'none'", "'pl'", "'all'")),
4747
// stats_temp_directory
4848
// TODO 19.9.2. Statistics Monitoring
49-
// https://www.postgresql.org/docs/11/runtime-config-autovacuum.html
49+
// https://www.postgresql.org/docs/13/runtime-config-autovacuum.html
5050
// all can only be set at server-conf time
5151
// 19.11. Client Connection Defaults
5252
VACUUM_FREEZE_TABLE_AGE("vacuum_freeze_table_age", (r) -> Randomly.fromOptions(0, 5, 10, 100, 500, 2000000000)),
@@ -60,7 +60,7 @@ private enum ConfigurationOption {
6060
// 19.13. Version and Platform Compatibility
6161
DEFAULT_WITH_OIDS("default_with_oids", (r) -> Randomly.fromOptions(0, 1)),
6262
SYNCHRONIZED_SEQSCANS("synchronize_seqscans", (r) -> Randomly.fromOptions(0, 1)),
63-
// https://www.postgresql.org/docs/devel/runtime-config-query.html
63+
// https://www.postgresql.org/docs/13/runtime-config-query.html
6464
ENABLE_BITMAPSCAN("enable_bitmapscan", (r) -> Randomly.fromOptions(1, 0)),
6565
ENABLE_GATHERMERGE("enable_gathermerge", (r) -> Randomly.fromOptions(1, 0)),
6666
ENABLE_HASHJOIN("enable_hashjoin", (r) -> Randomly.fromOptions(1, 0)),
@@ -78,7 +78,7 @@ private enum ConfigurationOption {
7878
ENABLE_SORT("enable_sort", (r) -> Randomly.fromOptions(1, 0)),
7979
ENABLE_TIDSCAN("enable_tidscan", (r) -> Randomly.fromOptions(1, 0)),
8080
// 19.7.2. Planner Cost Constants (complete as of March 2020)
81-
// https://www.postgresql.org/docs/current/runtime-config-query.html#RUNTIME-CONFIG-QUERY-CONSTANTS
81+
// https://www.postgresql.org/docs/13/runtime-config-query.html#RUNTIME-CONFIG-QUERY-CONSTANTS
8282
SEQ_PAGE_COST("seq_page_cost", (r) -> Randomly.fromOptions(0d, 0.00001, 0.05, 0.1, 1, 10, 10000)),
8383
RANDOM_PAGE_COST("random_page_cost", (r) -> Randomly.fromOptions(0d, 0.00001, 0.05, 0.1, 1, 10, 10000)),
8484
CPU_TUPLE_COST("cpu_tuple_cost", (r) -> Randomly.fromOptions(0d, 0.00001, 0.05, 0.1, 1, 10, 10000)),
@@ -94,7 +94,7 @@ private enum ConfigurationOption {
9494
JIT_OPTIMIZE_ABOVE_COST("jit_optimize_above_cost",
9595
(r) -> Randomly.fromOptions(0, r.getLong(-1, Long.MAX_VALUE))),
9696
// 19.7.3. Genetic Query Optimizer (complete as of March 2020)
97-
// https://www.postgresql.org/docs/current/runtime-config-query.html#RUNTIME-CONFIG-QUERY-GEQO
97+
// https://www.postgresql.org/docs/13/runtime-config-query.html#RUNTIME-CONFIG-QUERY-GEQO
9898
GEQO("geqo", (r) -> Randomly.fromOptions(1, 0)),
9999
GEQO_THRESHOLD("geqo_threshold", (r) -> r.getInteger(2, 2147483647)),
100100
GEQO_EFFORT("geqo_effort", (r) -> r.getInteger(1, 10)),
@@ -103,7 +103,7 @@ private enum ConfigurationOption {
103103
GEQO_SELECTION_BIAS("geqo_selection_bias", (r) -> Randomly.fromOptions(1.5, 1.8, 2.0)),
104104
GEQO_SEED("geqo_seed", (r) -> Randomly.fromOptions(0, 0.5, 1)),
105105
// 19.7.4. Other Planner Options (complete as of March 2020)
106-
// https://www.postgresql.org/docs/current/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER
106+
// https://www.postgresql.org/docs/13/runtime-config-query.html#RUNTIME-CONFIG-QUERY-OTHER
107107
DEFAULT_STATISTICS_TARGET("default_statistics_target", (r) -> r.getInteger(1, 10000)),
108108
CONSTRAINT_EXCLUSION("constraint_exclusion", (r) -> Randomly.fromOptions("on", "off", "partition")),
109109
CURSOR_TUPLE_FRACTION("cursor_tuple_fraction",

0 commit comments

Comments
 (0)