Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
9d0fbcc4
Commit
9d0fbcc4
authored
Sep 17, 2021
by
Monty
Committed by
Sergei Petrunia
Jan 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comments in the optimizer
parent
6252a281
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
sql/sql_select.cc
sql/sql_select.cc
+11
-0
sql/sql_window.cc
sql/sql_window.cc
+10
-0
No files found.
sql/sql_select.cc
View file @
9d0fbcc4
...
...
@@ -26818,6 +26818,17 @@ change_to_use_tmp_fields(THD *thd, Ref_ptr_array ref_pointer_array,
for (uint i= 0; (item= it++); i++)
{
Field *field;
/*
SUM_FUNC_ITEM will be replaced by the calculated value which is
stored in the temporary table.
The first part of the following test is for items that are expressions
with SUM_FUNC_ITEMS, like 'sum(a)+1'. In this case we keep the original
item, which contain an Item_ref that points to the SUM_FUNC_ITEM that
will be replaced with a pointer to the calculated value.
The second test is for window functions. Window functions contains
only pointers to Item_refs, which will be adjusted to point to the
temporary table.
*/
enum Item::Type item_type= item->type();
if ((item->with_sum_func() && item_type != Item::SUM_FUNC_ITEM) ||
item->with_window_func())
...
...
sql/sql_window.cc
View file @
9d0fbcc4
...
...
@@ -423,6 +423,16 @@ ORDER *st_select_lex::find_common_window_func_partition_fields(THD *thd)
#define CMP_GT_C 1 // Greater than and compatible
#define CMP_GT 2 // Greater then
/*
This function is used for sorting ORDER/PARTITION BY clauses of window
functions and so must implement an order relation on ORDER BY clauses"
It is called by a sorting function.
The function return's CMP_EQ (=0) if the values are identical.
If not equal, it returns a stable value < or > than 0.
*/
static
int
compare_order_elements
(
ORDER
*
ord1
,
int
weight1
,
ORDER
*
ord2
,
int
weight2
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment