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
1ff79562
Commit
1ff79562
authored
May 04, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12692 Split Item_func_between::fix_length_and_dec
parent
fe127562
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
5 deletions
+41
-5
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-5
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+5
-0
sql/sql_type.cc
sql/sql_type.cc
+19
-0
sql/sql_type.h
sql/sql_type.h
+10
-0
No files found.
sql/item_cmpfunc.cc
View file @
1ff79562
...
...
@@ -2032,7 +2032,6 @@ void Item_func_between::fix_after_pullout(st_select_lex *new_parent, Item **ref)
void
Item_func_between
::
fix_length_and_dec
()
{
THD
*
thd
=
current_thd
;
max_length
=
1
;
/*
...
...
@@ -2044,14 +2043,16 @@ void Item_func_between::fix_length_and_dec()
if
(
m_comparator
.
aggregate_for_comparison
(
Item_func_between
::
func_name
(),
args
,
3
,
true
))
{
DBUG_ASSERT
(
thd
->
is_error
());
DBUG_ASSERT
(
current_
thd
->
is_error
());
return
;
}
if
(
m_comparator
.
cmp_type
()
==
STRING_RESULT
&&
agg_arg_charsets_for_comparison
(
cmp_collation
,
args
,
3
))
return
;
m_comparator
.
type_handler
()
->
Item_func_between_fix_length_and_dec
(
this
);
}
bool
Item_func_between
::
fix_length_and_dec_numeric
(
THD
*
thd
)
{
/* See the comment about the similar block in Item_bool_func2 */
if
(
args
[
0
]
->
real_item
()
->
type
()
==
FIELD_ITEM
&&
!
thd
->
lex
->
is_ps_or_view_context_analysis
())
...
...
@@ -2069,6 +2070,7 @@ void Item_func_between::fix_length_and_dec()
}
}
}
return
false
;
}
...
...
sql/item_cmpfunc.h
View file @
1ff79562
...
...
@@ -885,6 +885,11 @@ class Item_func_between :public Item_func_opt_neg
const
char
*
func_name
()
const
{
return
"between"
;
}
enum
precedence
precedence
()
const
{
return
BETWEEN_PRECEDENCE
;
}
void
fix_length_and_dec
();
bool
fix_length_and_dec_string
(
THD
*
)
{
return
agg_arg_charsets_for_comparison
(
cmp_collation
,
args
,
3
);
}
bool
fix_length_and_dec_numeric
(
THD
*
);
virtual
void
print
(
String
*
str
,
enum_query_type
query_type
);
bool
eval_not_null_tables
(
void
*
opt_arg
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
);
...
...
sql/sql_type.cc
View file @
1ff79562
...
...
@@ -2713,6 +2713,25 @@ Type_handler_string_result::Item_func_hybrid_field_type_get_date(
/***************************************************************************/
bool
Type_handler_numeric
::
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
{
return
func
->
fix_length_and_dec_numeric
(
current_thd
);
}
bool
Type_handler_temporal_result
::
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
{
return
func
->
fix_length_and_dec_numeric
(
current_thd
);
}
bool
Type_handler_string_result
::
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
{
return
func
->
fix_length_and_dec_string
(
current_thd
);
}
longlong
Type_handler_row
::
Item_func_between_val_int
(
Item_func_between
*
func
)
const
{
...
...
sql/sql_type.h
View file @
1ff79562
...
...
@@ -779,6 +779,8 @@ class Type_handler
virtual
bool
Item_func_min_max_get_date
(
Item_func_min_max
*
,
MYSQL_TIME
*
,
ulonglong
fuzzydate
)
const
=
0
;
virtual
bool
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
=
0
;
virtual
longlong
Item_func_between_val_int
(
Item_func_between
*
func
)
const
=
0
;
...
...
@@ -1012,6 +1014,11 @@ class Type_handler_row: public Type_handler
DBUG_ASSERT
(
0
);
return
true
;
}
bool
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
{
DBUG_ASSERT
(
0
);
return
true
;
}
longlong
Item_func_between_val_int
(
Item_func_between
*
func
)
const
;
cmp_item
*
make_cmp_item
(
THD
*
thd
,
CHARSET_INFO
*
cs
)
const
;
in_vector
*
make_in_vector
(
THD
*
thd
,
const
Item_func_in
*
f
,
uint
nargs
)
const
;
...
...
@@ -1093,6 +1100,7 @@ class Type_handler_numeric: public Type_handler
Item
*
target_expr
,
Item
*
target_value
,
Item_bool_func2
*
source
,
Item
*
source_expr
,
Item
*
source_const
)
const
;
bool
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
;
bool
Item_char_typecast_fix_length_and_dec
(
Item_char_typecast
*
)
const
;
};
...
...
@@ -1321,6 +1329,7 @@ class Type_handler_temporal_result: public Type_handler
my_decimal
*
)
const
;
bool
Item_func_min_max_get_date
(
Item_func_min_max
*
,
MYSQL_TIME
*
,
ulonglong
fuzzydate
)
const
;
bool
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
;
longlong
Item_func_between_val_int
(
Item_func_between
*
func
)
const
;
bool
Item_func_in_fix_comparator_compatible_types
(
THD
*
thd
,
Item_func_in
*
)
const
;
...
...
@@ -1406,6 +1415,7 @@ class Type_handler_string_result: public Type_handler
my_decimal
*
)
const
;
bool
Item_func_min_max_get_date
(
Item_func_min_max
*
,
MYSQL_TIME
*
,
ulonglong
fuzzydate
)
const
;
bool
Item_func_between_fix_length_and_dec
(
Item_func_between
*
func
)
const
;
longlong
Item_func_between_val_int
(
Item_func_between
*
func
)
const
;
cmp_item
*
make_cmp_item
(
THD
*
thd
,
CHARSET_INFO
*
cs
)
const
;
in_vector
*
make_in_vector
(
THD
*
,
const
Item_func_in
*
,
uint
nargs
)
const
;
...
...
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