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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1f3724a5
Commit
1f3724a5
authored
Nov 20, 2014
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better comments
parent
be1c1766
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
sql/sql_select.cc
sql/sql_select.cc
+18
-0
sql/table.h
sql/table.h
+6
-0
No files found.
sql/sql_select.cc
View file @
1f3724a5
...
...
@@ -20736,6 +20736,24 @@ static void free_blobs(Field **ptr)
}
/*
@brief
Remove duplicates from a temporary table.
@detail
Remove duplicate rows from a temporary table. This is used for e.g. queries
like
select distinct count(*) as CNT from tbl group by col
Here, we get a group table with count(*) values. It is not possible to
prevent duplicates from appearing in the table (as we don't know the values
before we've done the grouping). Because of that, we have this function to
scan the temptable (maybe, multiple times) and remove the duplicate rows
Rows that do not satisfy 'having' condition are also removed.
*/
static
int
remove_duplicates
(
JOIN
*
join
,
TABLE
*
table
,
List
<
Item
>
&
fields
,
Item
*
having
)
{
...
...
sql/table.h
View file @
1f3724a5
...
...
@@ -1072,6 +1072,12 @@ public:
TABLE_LIST
*
pos_in_table_list
;
/* Element referring to this table */
/* Position in thd->locked_table_list under LOCK TABLES */
TABLE_LIST
*
pos_in_locked_tables
;
/*
Not-null for temporary tables only. Non-null values means this table is
used to compute GROUP BY, it has a unique of GROUP BY columns.
(set by create_tmp_table)
*/
ORDER
*
group
;
String
alias
;
/* alias or table name */
uchar
*
null_flags
;
...
...
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