New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"where" condition applies wrongly [CORE5798] #6061
Comments
Commented by: @livius2 What is the purpose of this reevaluation? |
Commented by: @dyemanov Expression results are not stored/materialized inside the sort file, only the involved fields (if any). This is dictated by the sorting architecture, it knows nothing about select lists or query predicates or whatever else not belonging to the sorting itself. Everything not present inside the sort file must be re-evaluated after the sorting. |
Commented by: @livius2 what if field is gathered from subquery? is see this numbers SELECT --------------------------- Current memory = 1672221600 --------------------------- SELECT --------------------------- Current memory = 1672209704 |
Commented by: fbbt (fbbt) >>The same issue as in CORE4925. It's not about the WHERE clause, but about expressions begin re-evaluated after the sort. |
Commented by: @dyemanov In your case, the derived table is not materialized, thus redundant evaluations. This is really a different issue, although also an implementation detail. |
Submitted by: fbbt (fbbt)
Votes: 1
SET GENERATOR G TO 0;
SELECT * FROM
(SELECT GEN_ID(G, 1) as GenValue FROM T)
WHERE mod(GenValue, 2) = 0
----
result: 3, 5, 7, 9, 11, 13, ...
must be: 2, 4, 6, 8, 10, ...
The text was updated successfully, but these errors were encountered: