Skip to content
Merged
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 @@ -145,6 +145,7 @@ and missing syntax gets added on demand — [open an issue](https://github.com/J
| **DML** | `INSERT` · `UPDATE` · `UPSERT` · `MERGE` · `DELETE` · `TRUNCATE TABLE` |
| **Oracle RETURNING** | Named output binds (`INTO :name`), JDBC output parameters (`INTO ?`), and `BULK COLLECT INTO` |
| **DDL** | `CREATE …` · `ALTER …` · `DROP …` |
| **DuckDB macro removal** | `DROP MACRO [IF EXISTS] name` · `DROP MACRO TABLE [IF EXISTS] name` |
| **Oracle vector types** | `VECTOR(*, *)` · `VECTOR(*, FLOAT32)` · `VECTOR(3, *)`, including dense and sparse storage formats |
| **PostgreSQL ownership** | `DROP OWNED` · `REASSIGN OWNED` |
| **Two-phase commit** | PostgreSQL `PREPARE TRANSACTION` · `COMMIT PREPARED` · `ROLLBACK PREPARED` · MySQL `XA START`/`END`/`PREPARE`/`COMMIT`/`ROLLBACK`/`RECOVER` |
Expand Down
2 changes: 2 additions & 0 deletions src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -25373,6 +25373,8 @@ Drop Drop():
|
[ <K_PUBLIC> { drop.setPublicSynonym(true); } ] tk=<K_SYNONYM>
|
tk=<K_MACRO> [ LOOKAHEAD(1) <K_TABLE> { multiWordType = "MACRO TABLE"; } ]
|
tk=<K_SEQUENCE>
|
tk=<K_TRIGGER>
Expand Down
18 changes: 18 additions & 0 deletions src/test/java/net/sf/jsqlparser/statement/drop/DropTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
import net.sf.jsqlparser.statement.Statements;
import static net.sf.jsqlparser.test.TestUtils.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

public class DropTest {

Expand Down Expand Up @@ -85,6 +88,21 @@ public void testDropIfExists() throws JSQLParserException {
assertEqualsObjectTree(parsed, created);
}

@ParameterizedTest
@ValueSource(strings = {"DROP MACRO simple", "DROP MACRO IF EXISTS main.named",
"DROP MACRO TABLE rows_at", "DROP MACRO TABLE IF EXISTS main.\"user rows\""})
void testDuckDbDropMacroRoundTrip(String statement) throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(statement);
}

@Test
void testDuckDbDropTableMacroTypeAndName() throws JSQLParserException {
Drop drop = (Drop) CCJSqlParserUtil.parse("DROP MACRO TABLE IF EXISTS main.rows_at");
assertEquals("MACRO TABLE", drop.getType());
assertEquals("main.rows_at", drop.getName().getFullyQualifiedName());
assertTrue(drop.isIfExists());
}

@Test
public void testDropRestrictIssue510() throws JSQLParserException {
String statement = "DROP TABLE TABLE2 RESTRICT";
Expand Down
Loading