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
2707af2d
Commit
2707af2d
authored
Aug 30, 2019
by
Ruihang Xia
Committed by
Igor Babaev
Aug 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(1)mod: counter type from longlong to ha_rows
(2)fix: bug when call create tmp table
parent
95f35bb7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_union.cc
sql/sql_union.cc
+8
-13
No files found.
sql/sql_class.h
View file @
2707af2d
...
...
@@ -5870,7 +5870,7 @@ class select_unit_ext :public select_unit
};
int
send_data
(
List
<
Item
>
&
items
);
void
change_select
();
int
unfold_record
(
longlong
cnt
);
int
unfold_record
(
ha_rows
cnt
);
bool
send_eof
();
bool
force_enable_index_if_needed
()
{
...
...
sql/sql_union.cc
View file @
2707af2d
...
...
@@ -330,11 +330,6 @@ select_unit::create_result_table(THD *thd_arg, List<Item> *column_types,
tmp_table_param
.
bit_fields_as_long
=
bit_fields_as_long
;
tmp_table_param
.
hidden_field_count
=
hidden
;
/*
At least one of `duplicate_cnt` and `intersect_cnt` are used.
in this case table can keep unique actually.
*/
if
(
hidden
>
0
)
is_union_distinct
=
true
;
if
(
!
(
table
=
create_tmp_table
(
thd_arg
,
&
tmp_table_param
,
*
column_types
,
(
ORDER
*
)
0
,
is_union_distinct
,
1
,
options
,
HA_POS_ERROR
,
alias
,
...
...
@@ -499,7 +494,7 @@ bool select_unit_ext::disable_index_if_needed(SELECT_LEX *curr_sl)
-1 conversion happened
*/
int
select_unit_ext
::
unfold_record
(
longlong
cnt
)
int
select_unit_ext
::
unfold_record
(
ha_rows
cnt
)
{
DBUG_ASSERT
(
cnt
>
0
);
...
...
@@ -840,7 +835,7 @@ bool select_unit_ext::send_eof()
else
if
(
need_unfold
)
{
/* unfold if is ALL operation */
longlong
dup_cnt
;
ha_rows
dup_cnt
;
if
(
unlikely
(
table
->
file
->
ha_rnd_init_with_error
(
1
)))
return
1
;
do
...
...
@@ -854,7 +849,7 @@ bool select_unit_ext::send_eof()
}
break
;
}
dup_cnt
=
duplicate_cnt
->
val_int
();
dup_cnt
=
(
ha_rows
)
duplicate_cnt
->
val_int
();
/* delete record if not exist in the second operand */
if
(
dup_cnt
==
0
)
{
...
...
@@ -865,7 +860,7 @@ bool select_unit_ext::send_eof()
{
longlong
add_cnt
=
additional_cnt
->
val_int
();
if
(
dup_cnt
>
add_cnt
&&
add_cnt
>
0
)
dup_cnt
=
add_cnt
;
dup_cnt
=
(
ha_rows
)
add_cnt
;
}
if
(
dup_cnt
==
1
)
...
...
@@ -1576,9 +1571,7 @@ bool st_select_lex_unit::prepare(TABLE_LIST *derived_arg,
if
(
join_union_item_types
(
thd
,
types
,
union_part_count
+
1
))
goto
err
;
if
(
union_result
->
create_result_table
(
thd
,
&
types
,
MY_TEST
(
union_distinct
)
||
have_except_all_or_intersect_all
||
have_intersect
,
MY_TEST
(
union_distinct
),
create_options
,
&
derived_arg
->
alias
,
false
,
instantiate_tmp_table
,
false
,
...
...
@@ -1698,7 +1691,9 @@ bool st_select_lex_unit::prepare(TABLE_LIST *derived_arg,
}
bool
error
=
union_result
->
create_result_table
(
thd
,
&
types
,
MY_TEST
(
union_distinct
),
MY_TEST
(
union_distinct
)
||
have_except_all_or_intersect_all
||
have_intersect
,
create_options
,
&
empty_clex_str
,
false
,
instantiate_tmp_table
,
false
,
hidden
);
...
...
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