Skip to content

Commit

Permalink
Merge branch 'postgres12_fixes' into 'master'
Browse files Browse the repository at this point in the history
postgres12 fixes

See merge request codekeeper/codekeeper!375
  • Loading branch information
Endeavourl committed Oct 10, 2019
2 parents 57da860 + 2eb95e8 commit 9de39f2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apgdiff/antlr-src/SQLLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,11 @@ private final Deque<String> _tags = new ArrayDeque<String>();
STDIN: [sS] [tT] [dD] [iI] [nN];
STDOUT: [sS] [tT] [dD] [oO] [uU] [tT];
STORAGE: [sS] [tT] [oO] [rR] [aA] [gG] [eE];
STORED: [sS] [tT] [oO] [rR] [eE] [dD];
STRICT: [sS] [tT] [rR] [iI] [cC] [tT];
STRIP: [sS] [tT] [rR] [iI] [pP];
SUBSCRIPTION: [sS] [uU] [bB] [sS] [cC] [rR] [iI] [pP] [tT] [iI] [oO] [nN];
SUPPORT: [sS] [uU] [pP] [pP] [oO] [rR] [tT];
SYSID: [sS] [yY] [sS] [iI] [dD];
SYSTEM: [sS] [yY] [sS] [tT] [eE] [mM];

Expand Down
2 changes: 2 additions & 0 deletions apgdiff/antlr-src/SQLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -2044,9 +2044,11 @@ tokens_nonreserved
| STDIN
| STDOUT
| STORAGE
| STORED
| STRICT
| STRIP
| SUBSCRIPTION
| SUPPORT
| SYSID
| SYSTEM
| TABLES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ public enum SupportedVersion {
VERSION_9_5 (90500, "9.5"),
VERSION_9_6 (90600, "9.6"),
VERSION_10 (100000, "10.0"),
VERSION_11 (110000, "11.0");
VERSION_11 (110000, "11.0"),
VERSION_12 (120000, "12.0");

private final int version;
private final String text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private AbstractPgTable getTable(ResultSet res, AbstractSchema schema) throws SQ
t.setComment(loader.args, PgDiffUtils.quoteString(comment));
}

if (res.getBoolean("has_oids")){
if (!SupportedVersion.VERSION_12.isLE(loader.version) && res.getBoolean("has_oids")){
t.setHasOids(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,12 @@ private static void addKeywords(Map<String, Keyword> keywords) {
keywords.put("stdin", new Keyword("stdin", UNRESERVED_KEYWORD));
keywords.put("stdout", new Keyword("stdout", UNRESERVED_KEYWORD));
keywords.put("storage", new Keyword("storage", UNRESERVED_KEYWORD));
keywords.put("stored", new Keyword("stored", UNRESERVED_KEYWORD));
keywords.put("strict", new Keyword("strict", UNRESERVED_KEYWORD));
keywords.put("strip", new Keyword("strip", UNRESERVED_KEYWORD));
keywords.put("subscription", new Keyword("subscription", UNRESERVED_KEYWORD));
keywords.put("substring", new Keyword("substring", COL_NAME_KEYWORD));
keywords.put("support", new Keyword("support", UNRESERVED_KEYWORD));
keywords.put("symmetric", new Keyword("symmetric", RESERVED_KEYWORD));
keywords.put("sysid", new Keyword("sysid", UNRESERVED_KEYWORD));
keywords.put("system", new Keyword("system", UNRESERVED_KEYWORD));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ SELECT -- GENERAL
c.relowner::bigint,
c.relacl::text AS aclarray,
c.relpersistence AS persistence,
c.relhasoids AS has_oids,
c.reloptions,
tc.reloptions AS toast_reloptions,
tabsp.spcname AS table_space,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT
oid,
relhasoids AS has_oids
FROM
pg_catalog.pg_class
Binary file not shown.

0 comments on commit 9de39f2

Please sign in to comment.