[jOOQ/jOOQ#11389] Add parser support for PL/SQL style variable
declarations in function / procedure headers
This commit is contained in:
parent
3388425005
commit
2894896386
@ -99,9 +99,9 @@ final class BlockImpl extends AbstractRowCountQuery implements Block {
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = 6881305779639901498L;
|
||||
private static final Set<SQLDialect> REQUIRES_EXECUTE_IMMEDIATE_ON_DDL = SQLDialect.supportedBy(FIREBIRD);
|
||||
private static final Set<SQLDialect> SUPPORTS_NULL_STATEMENT = SQLDialect.supportedBy(POSTGRES);
|
||||
private static final long serialVersionUID = 6881305779639901498L;
|
||||
private static final Set<SQLDialect> REQUIRES_EXECUTE_IMMEDIATE_ON_DDL = SQLDialect.supportedBy(FIREBIRD);
|
||||
private static final Set<SQLDialect> SUPPORTS_NULL_STATEMENT = SQLDialect.supportedBy(POSTGRES);
|
||||
|
||||
|
||||
|
||||
@ -115,8 +115,8 @@ final class BlockImpl extends AbstractRowCountQuery implements Block {
|
||||
|
||||
|
||||
|
||||
private final Collection<? extends Statement> statements;
|
||||
final boolean alwaysWrapInBeginEnd;
|
||||
final Collection<? extends Statement> statements;
|
||||
final boolean alwaysWrapInBeginEnd;
|
||||
|
||||
BlockImpl(Configuration configuration, Collection<? extends Statement> statements, boolean alwaysWrapInBeginEnd) {
|
||||
super(configuration);
|
||||
|
||||
@ -73,6 +73,7 @@ import static org.jooq.impl.DSL.atan;
|
||||
import static org.jooq.impl.DSL.atan2;
|
||||
import static org.jooq.impl.DSL.avg;
|
||||
import static org.jooq.impl.DSL.avgDistinct;
|
||||
import static org.jooq.impl.DSL.begin;
|
||||
import static org.jooq.impl.DSL.bitAnd;
|
||||
import static org.jooq.impl.DSL.bitCount;
|
||||
import static org.jooq.impl.DSL.bitLength;
|
||||
@ -290,6 +291,7 @@ import static org.jooq.impl.DSL.splitPart;
|
||||
import static org.jooq.impl.DSL.sql;
|
||||
import static org.jooq.impl.DSL.sqrt;
|
||||
import static org.jooq.impl.DSL.square;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.stddevPop;
|
||||
import static org.jooq.impl.DSL.stddevSamp;
|
||||
import static org.jooq.impl.DSL.sum;
|
||||
@ -954,7 +956,7 @@ final class ParserContext {
|
||||
|
||||
case 'B':
|
||||
if (!parseResultQuery && peekKeyword("BEGIN"))
|
||||
return parseBlock();
|
||||
return parseBlock(false);
|
||||
|
||||
break;
|
||||
|
||||
@ -974,7 +976,7 @@ final class ParserContext {
|
||||
|
||||
case 'D':
|
||||
if (!parseResultQuery && peekKeyword("DECLARE") && requireProEdition())
|
||||
return parseBlock();
|
||||
return parseBlock(true);
|
||||
else if (!parseResultQuery && (peekKeyword("DELETE") || peekKeyword("DEL")))
|
||||
return parseDelete(null);
|
||||
else if (!parseResultQuery && peekKeyword("DROP"))
|
||||
@ -986,7 +988,7 @@ final class ParserContext {
|
||||
|
||||
case 'E':
|
||||
if (!parseResultQuery && peekKeyword("EXECUTE BLOCK AS BEGIN"))
|
||||
return parseBlock();
|
||||
return parseBlock(false);
|
||||
else if (!parseResultQuery && peekKeyword("EXEC"))
|
||||
return parseExec();
|
||||
|
||||
@ -2942,14 +2944,14 @@ final class ParserContext {
|
||||
}
|
||||
}
|
||||
|
||||
private final Block parseBlock() {
|
||||
private final Block parseBlock(boolean allowDeclare) {
|
||||
List<Statement> statements = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (parseKeywordIf("DECLARE") && requireProEdition())
|
||||
if (allowDeclare && parseKeywordIf("DECLARE") && requireProEdition())
|
||||
|
||||
|
||||
|
||||
@ -3059,6 +3061,16 @@ final class ParserContext {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -5376,6 +5388,18 @@ final class ParserContext {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user