MDEV-32401 expression cache lead to crash if table of wrong type created and the cache switched off - #5727
Open
forkfun wants to merge 1 commit into
Open
MDEV-32401 expression cache lead to crash if table of wrong type created and the cache switched off#5727forkfun wants to merge 1 commit into
forkfun wants to merge 1 commit into
Conversation
…ted and the cache switched off 1) take into account TMP_TABLE_ALL_COLUMNS when we are modifying agg_item->result_field 2) remove unused now "bool materialized_subquery;"
|
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One moderate documentation/invariant issue and two minor comment issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Fixes an expression-cache crash involving aggregate result_field handling for temporary tables.
Changes:
- Controls aggregate field updates with
TMP_TABLE_ALL_COLUMNS. - Removes obsolete materialized-subquery state.
- Adds regression coverage for TEXT, CAST, and INT cases.
Review findings:
sql/sql_priv.h: nit (3 votes)—correct the typo and wording in the new comment.sql/sql_priv.h: moderate (1 vote)—clarify or enforce the comment’s broaderresult_fieldinvariant.sql/sql_select.cc: nit (1 vote)—update stale rationale describing the removed condition.
| File | Reviewed change |
|---|---|
sql/sql_select.cc |
Adjusts aggregate result-field handling. |
sql/sql_priv.h |
Defines and documents the temporary-table option. |
sql/sql_class.h |
Removes obsolete state. |
sql/sql_class.cc |
Removes obsolete initialization. |
sql/item_subselect.cc |
Removes obsolete state assignment. |
mysql-test/main/subselect_cache.test |
Adds regression queries. |
mysql-test/main/subselect_cache.result |
Records expected results. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+62
to
+64
| Include all colums in temporary table, i.e. do not ignore aggregate and | ||
| constants, i.e. the temporary table created for other purposes than | ||
| aggregation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Cherry-picked from 3d0ea3d (10.6 backport: #5492)