[jOOQ/jOOQ#10271] Cannot create or drop catalog-qualified schema in SQL
Server
This commit is contained in:
parent
0303a99687
commit
a695f742f7
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
@ -97,34 +100,52 @@ implements
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
if (createSchemaIfNotExists && !supportsIfNotExists(ctx)) {
|
||||
Tools.beginTryCatch(ctx, DDLStatementType.CREATE_SCHEMA);
|
||||
accept0(ctx);
|
||||
Tools.endTryCatch(ctx, DDLStatementType.CREATE_SCHEMA);
|
||||
}
|
||||
else {
|
||||
accept0(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
accept0(ctx);
|
||||
}
|
||||
|
||||
private final void accept0(Context<?> ctx) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (createSchemaIfNotExists && !supportsIfNotExists(ctx)) {
|
||||
Tools.beginTryCatch(ctx, DDLStatementType.CREATE_SCHEMA);
|
||||
accept1(ctx);
|
||||
Tools.endTryCatch(ctx, DDLStatementType.CREATE_SCHEMA);
|
||||
}
|
||||
else {
|
||||
accept1(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
private final void accept1(Context<?> ctx) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
accept2(ctx);
|
||||
}
|
||||
|
||||
private final void accept2(Context<?> ctx) {
|
||||
ctx.start(Clause.CREATE_SCHEMA_NAME)
|
||||
.visit(K_CREATE);
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
@ -131,17 +134,35 @@ implements
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
if (dropSchemaIfExists && !supportsIfExists(ctx)) {
|
||||
Tools.beginTryCatch(ctx, DDLStatementType.DROP_SCHEMA);
|
||||
accept0(ctx);
|
||||
Tools.endTryCatch(ctx, DDLStatementType.DROP_SCHEMA);
|
||||
}
|
||||
else {
|
||||
accept0(ctx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
accept0(ctx);
|
||||
}
|
||||
|
||||
private void accept0(Context<?> ctx) {
|
||||
if (dropSchemaIfExists && !supportsIfExists(ctx)) {
|
||||
Tools.beginTryCatch(ctx, DDLStatementType.DROP_SCHEMA);
|
||||
accept1(ctx);
|
||||
Tools.endTryCatch(ctx, DDLStatementType.DROP_SCHEMA);
|
||||
}
|
||||
else {
|
||||
accept1(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
private void accept1(Context<?> ctx) {
|
||||
ctx.start(Clause.DROP_SCHEMA_SCHEMA)
|
||||
.visit(K_DROP);
|
||||
|
||||
|
||||
@ -37,7 +37,10 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
|
||||
@ -101,6 +101,7 @@ final class Names {
|
||||
static final Name N_DAYOFWEEK = unquotedName("dayofweek");
|
||||
static final Name N_DAYOFYEAR = unquotedName("dayofyear");
|
||||
static final Name N_DAYS_BETWEEN = unquotedName("days_between");
|
||||
static final Name N_DB_NAME = unquotedName("db_name");
|
||||
static final Name N_DECODE = unquotedName("decode");
|
||||
static final Name N_DEGREES = unquotedName("degrees");
|
||||
static final Name N_DUAL = unquotedName("dual");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user