[jOOQ/jOOQ#18068] ROWNUM transformation prevents FOR UPDATE

transformation in SQL Server
This commit is contained in:
Lukas Eder 2025-03-25 11:22:33 +01:00
parent c0f49a4cf2
commit 200526ef21

View File

@ -1608,9 +1608,6 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
@ -1844,6 +1841,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
// [#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 transformRownumToLimit = context.data(DATA_TRANSFORM_ROWNUM_TO_LIMIT);
Name[] selectAliases = (Name[]) context.data(DATA_SELECT_ALIASES);
@ -1877,6 +1875,8 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
if (TRUE.equals(renderTrailingLimit))
context.data().remove(DATA_RENDER_TRAILING_LIMIT_IF_APPLICABLE);
if (TRUE.equals(transformRownumToLimit))
context.data().remove(DATA_TRANSFORM_ROWNUM_TO_LIMIT);
if (intoTable != null
&& !TRUE.equals(context.data(DATA_OMIT_INTO_CLAUSE))
@ -2150,6 +2150,8 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
}
finally {
if (transformRownumToLimit != null)
context.data(DATA_TRANSFORM_ROWNUM_TO_LIMIT, transformRownumToLimit);
if (renderTrailingLimit != null)
context.data(DATA_RENDER_TRAILING_LIMIT_IF_APPLICABLE, renderTrailingLimit);
if (selectAliases != null)