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
ee584137
Commit
ee584137
authored
Jul 06, 2020
by
Eugene Kosov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix clang compilation
parent
846174c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
107 deletions
+116
-107
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+39
-35
sql/item_subselect.h
sql/item_subselect.h
+77
-72
No files found.
sql/item_cmpfunc.h
View file @
ee584137
...
...
@@ -367,36 +367,37 @@ class Item_in_optimizer: public Item_bool_func
Item_bool_func
(
thd
,
a
,
b
),
cache
(
0
),
expr_cache
(
0
),
save_cache
(
0
),
result_for_null_param
(
UNKNOWN
)
{
m_with_subquery
=
true
;
}
bool
fix_fields
(
THD
*
,
Item
**
);
bool
fix_fields
(
THD
*
,
Item
**
)
override
;
bool
fix_left
(
THD
*
thd
);
table_map
not_null_tables
()
const
{
return
0
;
}
bool
is_null
();
longlong
val_int
();
void
cleanup
();
enum
Functype
functype
()
const
{
return
IN_OPTIMIZER_FUNC
;
}
const
char
*
func_name
()
const
{
return
"<in_optimizer>"
;
}
table_map
not_null_tables
()
const
override
{
return
0
;
}
bool
is_null
()
override
;
longlong
val_int
()
override
;
void
cleanup
()
override
;
enum
Functype
functype
()
const
override
{
return
IN_OPTIMIZER_FUNC
;
}
const
char
*
func_name
()
const
override
{
return
"<in_optimizer>"
;
}
Item_cache
**
get_cache
()
{
return
&
cache
;
}
void
keep_top_level_cache
();
Item
*
transform
(
THD
*
thd
,
Item_transformer
transformer
,
uchar
*
arg
);
virtual
Item
*
expr_cache_insert_transformer
(
THD
*
thd
,
uchar
*
unused
)
;
bool
is_expensive_processor
(
void
*
arg
);
bool
is_expensive
();
void
set_join_tab_idx
(
uint
join_tab_idx_arg
)
Item
*
transform
(
THD
*
thd
,
Item_transformer
transformer
,
uchar
*
arg
)
override
;
Item
*
expr_cache_insert_transformer
(
THD
*
thd
,
uchar
*
unused
)
override
;
bool
is_expensive_processor
(
void
*
arg
)
override
;
bool
is_expensive
()
override
;
void
set_join_tab_idx
(
uint
join_tab_idx_arg
)
override
{
args
[
1
]
->
set_join_tab_idx
(
join_tab_idx_arg
);
}
v
irtual
void
get_cache_parameters
(
List
<
Item
>
&
parameters
)
;
v
oid
get_cache_parameters
(
List
<
Item
>
&
parameters
)
override
;
bool
is_top_level_item
()
const
override
;
bool
eval_not_null_tables
(
void
*
opt_arg
);
bool
find_not_null_fields
(
table_map
allowed
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
,
bool
merge
);
bool
eval_not_null_tables
(
void
*
opt_arg
)
override
;
bool
find_not_null_fields
(
table_map
allowed
)
override
;
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
,
bool
merge
)
override
;
bool
invisible_mode
();
void
reset_cache
()
{
cache
=
NULL
;
}
v
irtual
void
print
(
String
*
str
,
enum_query_type
query_type
)
;
v
oid
print
(
String
*
str
,
enum_query_type
query_type
)
override
;
void
restore_first_argument
();
Item
*
get_wrapped_in_subselect_item
()
{
return
args
[
1
];
}
Item
*
get_copy
(
THD
*
thd
)
Item
*
get_copy
(
THD
*
thd
)
override
{
return
get_item_copy
<
Item_in_optimizer
>
(
thd
,
this
);
}
enum
precedence
precedence
()
const
{
return
args
[
1
]
->
precedence
();
}
enum
precedence
precedence
()
const
override
{
return
args
[
1
]
->
precedence
();
}
};
...
...
@@ -601,17 +602,17 @@ class Item_func_not :public Item_bool_func
public:
Item_func_not
(
THD
*
thd
,
Item
*
a
)
:
Item_bool_func
(
thd
,
a
),
abort_on_null
(
FALSE
)
{}
v
irtual
void
top_level_item
()
{
abort_on_null
=
1
;
}
v
oid
top_level_item
()
override
{
abort_on_null
=
1
;
}
bool
is_top_level_item
()
const
override
{
return
abort_on_null
;
}
longlong
val_int
();
enum
Functype
functype
()
const
{
return
NOT_FUNC
;
}
const
char
*
func_name
()
const
{
return
"not"
;
}
bool
find_not_null_fields
(
table_map
allowed
)
{
return
false
;
}
enum
precedence
precedence
()
const
{
return
BANG_PRECEDENCE
;
}
Item
*
neg_transformer
(
THD
*
thd
);
bool
fix_fields
(
THD
*
,
Item
**
);
v
irtual
void
print
(
String
*
str
,
enum_query_type
query_type
)
;
Item
*
get_copy
(
THD
*
thd
)
longlong
val_int
()
override
;
enum
Functype
functype
()
const
override
{
return
NOT_FUNC
;
}
const
char
*
func_name
()
const
override
{
return
"not"
;
}
bool
find_not_null_fields
(
table_map
allowed
)
override
{
return
false
;
}
enum
precedence
precedence
()
const
override
{
return
BANG_PRECEDENCE
;
}
Item
*
neg_transformer
(
THD
*
thd
)
override
;
bool
fix_fields
(
THD
*
,
Item
**
)
override
;
v
oid
print
(
String
*
str
,
enum_query_type
query_type
)
override
;
Item
*
get_copy
(
THD
*
thd
)
override
{
return
get_item_copy
<
Item_func_not
>
(
thd
,
this
);
}
};
...
...
@@ -889,19 +890,22 @@ class Item_func_opt_neg :public Item_bool_func
Item_func_opt_neg
(
THD
*
thd
,
List
<
Item
>
&
list
)
:
Item_bool_func
(
thd
,
list
),
negated
(
0
),
pred_level
(
0
)
{}
public:
inline
void
top_level_item
()
{
pred_level
=
1
;
}
void
top_level_item
()
override
{
pred_level
=
1
;
}
bool
is_top_level_item
()
const
override
{
return
pred_level
;
}
Item
*
neg_transformer
(
THD
*
thd
)
Item
*
neg_transformer
(
THD
*
thd
)
override
{
negated
=
!
negated
;
return
this
;
}
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
;
CHARSET_INFO
*
compare_collation
()
const
{
return
cmp_collation
.
collation
;
}
Item
*
propagate_equal_fields
(
THD
*
,
const
Context
&
,
COND_EQUAL
*
)
=
0
;
bool
eq
(
const
Item
*
item
,
bool
binary_cmp
)
const
override
;
CHARSET_INFO
*
compare_collation
()
const
override
{
return
cmp_collation
.
collation
;
}
Item
*
propagate_equal_fields
(
THD
*
,
const
Context
&
,
COND_EQUAL
*
)
override
=
0
;
};
class
Item_func_between
:
public
Item_func_opt_neg
{
protected:
...
...
sql/item_subselect.h
View file @
ee584137
...
...
@@ -163,7 +163,7 @@ class Item_subselect :public Item_result_field,
select_result_interceptor
*
result
);
~
Item_subselect
();
void
cleanup
();
void
cleanup
()
override
;
virtual
void
reset
()
{
eliminated
=
FALSE
;
...
...
@@ -173,22 +173,23 @@ class Item_subselect :public Item_result_field,
Set the subquery result to a default value consistent with the semantics of
the result row produced for queries with implicit grouping.
*/
void
no_rows_in_result
()
=
0
;
void
no_rows_in_result
()
override
=
0
;
virtual
bool
select_transformer
(
JOIN
*
join
);
bool
assigned
()
{
return
value_assigned
;
}
void
assigned
(
bool
a
)
{
value_assigned
=
a
;
}
enum
Type
type
()
const
;
bool
is_null
()
enum
Type
type
()
const
override
;
bool
is_null
()
override
{
update_null_value
();
return
null_value
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
bool
with_subquery
()
const
{
DBUG_ASSERT
(
fixed
);
return
true
;
}
bool
with_sum_func
()
const
{
return
m_with_sum_func
;
}
With_sum_func_cache
*
get_with_sum_func_cache
()
{
return
this
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
)
override
;
bool
with_subquery
()
const
override
{
DBUG_ASSERT
(
fixed
);
return
true
;
}
bool
with_sum_func
()
const
override
{
return
m_with_sum_func
;
}
With_sum_func_cache
*
get_with_sum_func_cache
()
override
{
return
this
;
}
bool
mark_as_dependent
(
THD
*
thd
,
st_select_lex
*
select
,
Item
*
item
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
,
bool
merge
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
,
bool
merge
)
override
;
void
recalc_used_tables
(
st_select_lex
*
new_parent
,
bool
after_pullout
);
virtual
bool
exec
();
/*
...
...
@@ -202,13 +203,13 @@ class Item_subselect :public Item_result_field,
forced_const
=
TRUE
;
}
virtual
bool
fix_length_and_dec
();
table_map
used_tables
()
const
;
table_map
not_null_tables
()
const
{
return
0
;
}
bool
const_item
()
const
;
table_map
used_tables
()
const
override
;
table_map
not_null_tables
()
const
override
{
return
0
;
}
bool
const_item
()
const
override
;
inline
table_map
get_used_tables_cache
()
{
return
used_tables_cache
;
}
Item
*
get_tmp_table_item
(
THD
*
thd
);
void
update_used_tables
();
v
irtual
void
print
(
String
*
str
,
enum_query_type
query_type
)
;
Item
*
get_tmp_table_item
(
THD
*
thd
)
override
;
void
update_used_tables
()
override
;
v
oid
print
(
String
*
str
,
enum_query_type
query_type
)
override
;
virtual
bool
have_guarded_conds
()
{
return
FALSE
;
}
bool
change_engine
(
subselect_engine
*
eng
)
{
...
...
@@ -223,7 +224,7 @@ class Item_subselect :public Item_result_field,
*/
bool
is_evaluated
()
const
;
bool
is_uncacheable
()
const
;
bool
is_expensive
();
bool
is_expensive
()
override
;
/*
Used by max/min subquery to initialize value presence registration
...
...
@@ -231,13 +232,13 @@ class Item_subselect :public Item_result_field,
*/
virtual
void
reset_value_registration
()
{}
enum_parsing_place
place
()
{
return
parsing_place
;
}
bool
walk
(
Item_processor
processor
,
bool
walk_subquery
,
void
*
arg
);
bool
unknown_splocal_processor
(
void
*
arg
);
bool
mark_as_eliminated_processor
(
void
*
arg
);
bool
eliminate_subselect_processor
(
void
*
arg
);
bool
set_fake_select_as_master_processor
(
void
*
arg
);
bool
enumerate_field_refs_processor
(
void
*
arg
);
bool
check_vcol_func_processor
(
void
*
arg
)
bool
walk
(
Item_processor
processor
,
bool
walk_subquery
,
void
*
arg
)
override
;
bool
unknown_splocal_processor
(
void
*
arg
)
override
;
bool
mark_as_eliminated_processor
(
void
*
arg
)
override
;
bool
eliminate_subselect_processor
(
void
*
arg
)
override
;
bool
set_fake_select_as_master_processor
(
void
*
arg
)
override
;
bool
enumerate_field_refs_processor
(
void
*
arg
)
override
;
bool
check_vcol_func_processor
(
void
*
arg
)
override
{
return
mark_unsupported_function
(
"select ..."
,
arg
,
VCOL_IMPOSSIBLE
);
}
...
...
@@ -250,27 +251,27 @@ class Item_subselect :public Item_result_field,
@retval TRUE if the predicate is expensive
@retval FALSE otherwise
*/
bool
is_expensive_processor
(
void
*
arg
)
{
return
is_expensive
();
}
bool
is_expensive_processor
(
void
*
arg
)
override
{
return
is_expensive
();
}
/**
Get the SELECT_LEX structure associated with this Item.
@return the SELECT_LEX structure associated with this Item
*/
st_select_lex
*
get_select_lex
();
virtual
bool
expr_cache_is_needed
(
THD
*
)
;
v
irtual
void
get_cache_parameters
(
List
<
Item
>
&
parameters
)
;
virtual
bool
is_subquery_processor
(
void
*
opt_arg
)
{
return
1
;
}
bool
exists2in_processor
(
void
*
opt_arg
)
{
return
0
;
}
bool
limit_index_condition_pushdown_processor
(
void
*
opt_arg
)
bool
expr_cache_is_needed
(
THD
*
)
override
;
v
oid
get_cache_parameters
(
List
<
Item
>
&
parameters
)
override
;
bool
is_subquery_processor
(
void
*
opt_arg
)
override
{
return
1
;
}
bool
exists2in_processor
(
void
*
opt_arg
)
override
{
return
0
;
}
bool
limit_index_condition_pushdown_processor
(
void
*
opt_arg
)
override
{
return
TRUE
;
}
void
register_as_with_rec_ref
(
With_element
*
with_elem
);
void
init_expr_cache_tracker
(
THD
*
thd
);
Item
*
build_clone
(
THD
*
thd
)
{
return
0
;
}
Item
*
get_copy
(
THD
*
thd
)
{
return
0
;
}
Item
*
build_clone
(
THD
*
thd
)
override
{
return
0
;
}
Item
*
get_copy
(
THD
*
thd
)
override
{
return
0
;
}
bool
wrap_tvc_into_select
(
THD
*
thd
,
st_select_lex
*
tvc_sl
);
...
...
@@ -393,37 +394,40 @@ class Item_exists_subselect :public Item_subselect
emb_on_expr_nest
(
NULL
),
optimizer
(
0
),
exists_transformed
(
0
)
{}
subs_type
substype
()
{
return
EXISTS_SUBS
;
}
void
reset
()
subs_type
substype
()
override
{
return
EXISTS_SUBS
;
}
void
reset
()
override
{
eliminated
=
FALSE
;
value
=
0
;
}
void
no_rows_in_result
();
void
no_rows_in_result
()
override
;
const
Type_handler
*
type_handler
()
const
{
return
&
type_handler_bool
;
}
longlong
val_int
();
double
val_real
();
String
*
val_str
(
String
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
bool
val_bool
();
bool
get_date
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
)
const
Type_handler
*
type_handler
()
const
override
{
return
&
type_handler_bool
;
}
longlong
val_int
()
override
;
double
val_real
()
override
;
String
*
val_str
(
String
*
)
override
;
my_decimal
*
val_decimal
(
my_decimal
*
)
override
;
bool
val_bool
()
override
;
bool
get_date
(
THD
*
thd
,
MYSQL_TIME
*
ltime
,
date_mode_t
fuzzydate
)
override
{
return
get_date_from_int
(
thd
,
ltime
,
fuzzydate
);
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
bool
fix_length_and_dec
();
void
print
(
String
*
str
,
enum_query_type
query_type
);
bool
select_transformer
(
JOIN
*
join
);
void
top_level_item
()
{
abort_on_null
=
1
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
)
override
;
bool
fix_length_and_dec
()
override
;
void
print
(
String
*
str
,
enum_query_type
query_type
)
override
;
bool
select_transformer
(
JOIN
*
join
)
override
;
void
top_level_item
()
override
{
abort_on_null
=
1
;
}
bool
is_top_level_item
()
const
override
{
return
abort_on_null
;
}
bool
exists2in_processor
(
void
*
opt_arg
);
bool
exists2in_processor
(
void
*
opt_arg
)
override
;
Item
*
expr_cache_insert_transformer
(
THD
*
thd
,
uchar
*
unused
);
Item
*
expr_cache_insert_transformer
(
THD
*
thd
,
uchar
*
unused
)
override
;
void
mark_as_condition_AND_part
(
TABLE_LIST
*
embedding
)
void
mark_as_condition_AND_part
(
TABLE_LIST
*
embedding
)
override
{
emb_on_expr_nest
=
embedding
;
}
v
irtual
void
under_not
(
Item_func_not
*
upper
)
{
upper_not
=
upper
;
};
v
oid
under_not
(
Item_func_not
*
upper
)
override
{
upper_not
=
upper
;
};
void
set_exists_transformed
()
{
exists_transformed
=
TRUE
;
}
...
...
@@ -601,7 +605,7 @@ class Item_in_subselect :public Item_exists_subselect
if
(
pushed_cond_guards
)
pushed_cond_guards
[
i
]
=
v
;
}
bool
have_guarded_conds
()
{
return
MY_TEST
(
pushed_cond_guards
);
}
bool
have_guarded_conds
()
override
{
return
MY_TEST
(
pushed_cond_guards
);
}
Item_func_not_all
*
upper_item
;
// point on NOT/NOP before ALL/SOME subquery
...
...
@@ -611,41 +615,42 @@ class Item_in_subselect :public Item_exists_subselect
in_strategy
(
SUBS_NOT_TRANSFORMED
),
pushed_cond_guards
(
NULL
),
func
(
NULL
),
do_not_convert_to_sj
(
FALSE
),
is_jtbm_merged
(
FALSE
),
is_jtbm_const_tab
(
FALSE
),
upper_item
(
0
)
{}
void
cleanup
();
subs_type
substype
()
{
return
IN_SUBS
;
}
void
reset
()
void
cleanup
()
override
;
subs_type
substype
()
override
{
return
IN_SUBS
;
}
void
reset
()
override
{
eliminated
=
FALSE
;
value
=
0
;
null_value
=
0
;
was_null
=
0
;
}
bool
select_transformer
(
JOIN
*
join
);
bool
select_transformer
(
JOIN
*
join
)
override
;
bool
create_in_to_exists_cond
(
JOIN
*
join_arg
);
bool
inject_in_to_exists_cond
(
JOIN
*
join_arg
);
virtual
bool
exec
()
;
longlong
val_int
();
double
val_real
();
String
*
val_str
(
String
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
bool
val_bool
();
bool
exec
()
override
;
longlong
val_int
()
override
;
double
val_real
()
override
;
String
*
val_str
(
String
*
)
override
;
my_decimal
*
val_decimal
(
my_decimal
*
)
override
;
bool
val_bool
()
override
;
bool
test_limit
(
st_select_lex_unit
*
unit
);
void
print
(
String
*
str
,
enum_query_type
query_type
);
enum
precedence
precedence
()
const
{
return
CMP_PRECEDENCE
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
bool
fix_length_and_dec
();
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
,
bool
merge
);
bool
const_item
()
const
void
print
(
String
*
str
,
enum_query_type
query_type
)
override
;
enum
precedence
precedence
()
const
override
{
return
CMP_PRECEDENCE
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
)
override
;
bool
fix_length_and_dec
()
override
;
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
,
bool
merge
)
override
;
bool
const_item
()
const
override
{
return
Item_subselect
::
const_item
()
&&
left_expr
->
const_item
();
}
void
update_used_tables
();
void
update_used_tables
()
override
;
bool
setup_mat_engine
();
bool
init_left_expr_cache
();
/* Inform 'this' that it was computed, and contains a valid result. */
void
set_first_execution
()
{
if
(
first_execution
)
first_execution
=
FALSE
;
}
bool
expr_cache_is_needed
(
THD
*
thd
);
bool
expr_cache_is_needed
(
THD
*
thd
)
override
;
inline
bool
left_expr_has_null
();
void
disable_cond_guard_for_const_null_left_expr
(
int
i
)
...
...
@@ -737,13 +742,13 @@ class Item_in_subselect :public Item_exists_subselect
DBUG_VOID_RETURN
;
}
bool
walk
(
Item_processor
processor
,
bool
walk_subquery
,
void
*
arg
)
bool
walk
(
Item_processor
processor
,
bool
walk_subquery
,
void
*
arg
)
override
{
return
left_expr
->
walk
(
processor
,
walk_subquery
,
arg
)
||
Item_subselect
::
walk
(
processor
,
walk_subquery
,
arg
);
}
bool
exists2in_processor
(
void
*
opt_arg
__attribute__
((
unused
)))
bool
exists2in_processor
(
void
*
opt_arg
__attribute__
((
unused
)))
override
{
return
0
;
};
...
...
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