[jOOQ/jOOQ#2370] [jOOQ/jOOQ#8528] Interpret DROP TEMP TABLE
This commit is contained in:
parent
faad3f34a3
commit
4e0fedd5a4
@ -531,6 +531,7 @@ final class DDLInterpreter {
|
||||
|
||||
private final void accept0(DropTableImpl query) {
|
||||
Table<?> table = query.$table();
|
||||
|
||||
MutableSchema schema = getSchema(table.getSchema());
|
||||
|
||||
// TODO schema == null
|
||||
@ -543,6 +544,8 @@ final class DDLInterpreter {
|
||||
}
|
||||
else if (!table(existing.type))
|
||||
throw objectNotTable(table);
|
||||
else if (query.$temporary() && existing.type != TableType.TEMPORARY)
|
||||
throw objectNotTemporaryTable(table);
|
||||
|
||||
drop(schema.tables, existing, query.$cascade());
|
||||
}
|
||||
@ -756,6 +759,10 @@ final class DDLInterpreter {
|
||||
return new DataDefinitionException("Object is not a table: " + table.getQualifiedName());
|
||||
}
|
||||
|
||||
private static final DataDefinitionException objectNotTemporaryTable(Table<?> table) {
|
||||
return new DataDefinitionException("Object is not a temporary table: " + table.getQualifiedName());
|
||||
}
|
||||
|
||||
private static final DataDefinitionException objectNotView(Table<?> table) {
|
||||
return new DataDefinitionException("Object is not a view: " + table.getQualifiedName());
|
||||
}
|
||||
|
||||
@ -106,9 +106,10 @@ final class DropTableImpl extends AbstractRowCountQuery implements
|
||||
this.temporary = temporary;
|
||||
}
|
||||
|
||||
final Table<?> $table() { return table; }
|
||||
final boolean $ifExists() { return ifExists; }
|
||||
final Cascade $cascade() { return cascade; }
|
||||
final Table<?> $table() { return table; }
|
||||
final boolean $temporary() { return temporary; }
|
||||
final boolean $ifExists() { return ifExists; }
|
||||
final Cascade $cascade() { return cascade; }
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// XXX: DSL API
|
||||
|
||||
Loading…
Reference in New Issue
Block a user