Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ and missing syntax gets added on demand — [open an issue](https://github.com/J
| **ClickHouse column selection** | `COLUMNS('regexp')` select items with chained `APPLY`, `EXCEPT`, and `REPLACE` transformers |
| **DML** | `INSERT` · `UPDATE` · `UPSERT` · `MERGE` · `DELETE` · `TRUNCATE TABLE` |
| **DDL** | `CREATE …` · `ALTER …` · `DROP …` |
| **PostgreSQL ownership** | `DROP OWNED` · `REASSIGN OWNED` |
| **MySQL table maintenance** | `ANALYZE` · `CHECK` · `OPTIMIZE` · `REPAIR TABLE` |
| **PostgreSQL RLS** | `CREATE POLICY` · `ALTER TABLE … ENABLE`/`DISABLE`/`FORCE`/`NO FORCE ROW LEVEL SECURITY` |
| **Informix constraints** | `ALTER TABLE … ADD CONSTRAINT` with trailing constraint names for primary, unique, foreign and check constraints; enable with `parser.withDialect(Dialect.INFORMIX)` |
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/net/sf/jsqlparser/parser/feature/Feature.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import net.sf.jsqlparser.statement.grant.Grant;
import net.sf.jsqlparser.statement.merge.Merge;
import net.sf.jsqlparser.statement.refresh.RefreshMaterializedViewStatement;
import net.sf.jsqlparser.statement.role.ReassignOwned;
import net.sf.jsqlparser.statement.select.Fetch;
import net.sf.jsqlparser.statement.select.First;
import net.sf.jsqlparser.statement.select.KSQLWindow;
Expand Down Expand Up @@ -502,6 +503,12 @@ public enum Feature {
* @see Drop
*/
drop, dropTable, dropIndex, dropView, dropSchema, dropSequence, dropTableIfExists, dropIndexIfExists, dropViewIfExists, dropSchemaIfExists, dropSequenceIfExists,
/**
* PostgreSQL "REASSIGN OWNED BY ... TO ..." statement is allowed
*
* @see ReassignOwned
*/
reassignOwned,

/**
* SQL "CREATE DATABASE" statement is allowed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
import net.sf.jsqlparser.statement.refresh.RefreshMaterializedViewStatement;
import net.sf.jsqlparser.statement.role.AlterRole;
import net.sf.jsqlparser.statement.role.CreateRole;
import net.sf.jsqlparser.statement.role.ReassignOwned;
import net.sf.jsqlparser.statement.select.FromItemVisitor;
import net.sf.jsqlparser.statement.select.FromItemVisitorAdapter;
import net.sf.jsqlparser.statement.select.MySqlSelectIntoClause;
Expand Down Expand Up @@ -546,6 +547,11 @@ public <S> Void visit(Drop drop, S context) {
return null;
}

@Override
public <S> Void visit(ReassignOwned statement, S context) {
return schemaOnly();
}

@Override
public <S> Void visit(PragmaStatement pragmaStatement, S context) {
analysis.claimTopLevel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import net.sf.jsqlparser.statement.role.CreateRole;
import net.sf.jsqlparser.statement.role.AlterRole;
import net.sf.jsqlparser.statement.role.ReassignOwned;
import net.sf.jsqlparser.statement.grant.Revoke;
import net.sf.jsqlparser.statement.grant.AlterDefaultPrivileges;
import net.sf.jsqlparser.statement.create.type.CreateType;
Expand Down Expand Up @@ -175,6 +176,14 @@ default void visit(Drop drop) {
this.visit(drop, null);
}

default <S> T visit(ReassignOwned statement, S context) {
return null;
}

default void visit(ReassignOwned statement) {
this.visit(statement, null);
}

<S> T visit(Truncate truncate, S context);

default void visit(Truncate truncate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import net.sf.jsqlparser.statement.role.CreateRole;
import net.sf.jsqlparser.statement.role.AlterRole;
import net.sf.jsqlparser.statement.role.ReassignOwned;
import net.sf.jsqlparser.statement.role.RoleOption;
import net.sf.jsqlparser.statement.grant.Revoke;
import net.sf.jsqlparser.statement.grant.AlterDefaultPrivileges;
Expand Down Expand Up @@ -368,6 +369,11 @@ public <S> T visit(Drop drop, S context) {
return null;
}

@Override
public <S> T visit(ReassignOwned statement, S context) {
return null;
}

@Override
public <S> T visit(Truncate truncate, S context) {
return truncate.getTable().accept(fromItemVisitor, context);
Expand Down
Loading
Loading