[jOOQ/jOOQ#9981] Add improvement and apply it to
- SimpleDataKey.DATA_WINDOW_DEFINITIONS
This commit is contained in:
parent
1bc9f81217
commit
65d2396cb2
@ -1591,10 +1591,9 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
SQLDialect dialect = context.dialect();
|
||||
|
||||
// [#2791] TODO: Instead of explicitly manipulating these data() objects, future versions
|
||||
// of jOOQ should implement a push / pop semantics to clearly delimit such scope.
|
||||
// [#2791] [#9981] TODO: We have an automatic way of pushing / popping
|
||||
// these values onto the scope stack. Use that, instead
|
||||
Object renderTrailingLimit = context.data(DATA_RENDER_TRAILING_LIMIT_IF_APPLICABLE);
|
||||
Object localWindowDefinitions = context.data(DATA_WINDOW_DEFINITIONS);
|
||||
Name[] selectAliases = (Name[]) context.data(DATA_SELECT_ALIASES);
|
||||
|
||||
try {
|
||||
@ -1611,10 +1610,6 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
if (TRUE.equals(renderTrailingLimit))
|
||||
context.data().remove(DATA_RENDER_TRAILING_LIMIT_IF_APPLICABLE);
|
||||
|
||||
// [#5127] Lazy initialise this map
|
||||
if (localWindowDefinitions != null)
|
||||
context.data(DATA_WINDOW_DEFINITIONS, null);
|
||||
|
||||
if (intoTable != null
|
||||
&& !TRUE.equals(context.data(DATA_OMIT_INTO_CLAUSE))
|
||||
&& EMULATE_SELECT_INTO_AS_CTAS.contains(dialect)) {
|
||||
@ -1850,7 +1845,6 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
|
||||
|
||||
}
|
||||
finally {
|
||||
context.data(DATA_WINDOW_DEFINITIONS, localWindowDefinitions);
|
||||
if (renderTrailingLimit != null)
|
||||
context.data(DATA_RENDER_TRAILING_LIMIT_IF_APPLICABLE, renderTrailingLimit);
|
||||
if (selectAliases != null)
|
||||
|
||||
@ -678,7 +678,7 @@ final class Tools {
|
||||
* needed in the <code>SELECT</code> clause when emulating them by inlining
|
||||
* window specifications.
|
||||
*/
|
||||
DATA_WINDOW_DEFINITIONS,
|
||||
DATA_WINDOW_DEFINITIONS(true, null, 0),
|
||||
|
||||
/**
|
||||
* [#1629] The {@link Connection#getAutoCommit()} flag value before starting
|
||||
|
||||
Loading…
Reference in New Issue
Block a user