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
0f642188
Commit
0f642188
authored
May 10, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12771 Remove Item_func_xxx::decimal_precision() for case and abbreviations
parent
cd32f842
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
37 deletions
+0
-37
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+0
-22
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+0
-15
No files found.
sql/item_cmpfunc.cc
View file @
0f642188
...
...
@@ -2218,16 +2218,6 @@ void Item_func_between::print(String *str, enum_query_type query_type)
}
uint
Item_func_case_abbreviation2
::
decimal_precision2
(
Item
**
args
)
const
{
int
arg0_int_part
=
args
[
0
]
->
decimal_int_part
();
int
arg1_int_part
=
args
[
1
]
->
decimal_int_part
();
int
max_int_part
=
MY_MAX
(
arg0_int_part
,
arg1_int_part
);
int
precision
=
max_int_part
+
decimals
;
return
MY_MIN
(
precision
,
DECIMAL_MAX_PRECISION
);
}
double
Item_func_ifnull
::
real_op
()
{
...
...
@@ -3201,18 +3191,6 @@ Item* Item_func_case::propagate_equal_fields(THD *thd, const Context &ctx, COND_
}
uint
Item_func_case
::
decimal_precision
()
const
{
int
max_int_part
=
0
;
for
(
uint
i
=
0
;
i
<
ncases
;
i
+=
2
)
set_if_bigger
(
max_int_part
,
args
[
i
+
1
]
->
decimal_int_part
());
if
(
else_expr_num
!=
-
1
)
set_if_bigger
(
max_int_part
,
args
[
else_expr_num
]
->
decimal_int_part
());
return
MY_MIN
(
max_int_part
+
decimals
,
DECIMAL_MAX_PRECISION
);
}
/**
@todo
Fix this so that it prints the whole CASE expression
...
...
sql/item_cmpfunc.h
View file @
0f642188
...
...
@@ -1009,7 +1009,6 @@ class Item_func_case_abbreviation2 :public Item_func_case_expression
if
(
!
aggregate_for_result
(
func_name
(),
items
,
2
,
true
))
fix_attributes
(
items
,
2
);
}
uint
decimal_precision2
(
Item
**
args
)
const
;
void
cache_type_info
(
const
Item
*
source
,
bool
maybe_null_arg
)
{
...
...
@@ -1064,10 +1063,6 @@ class Item_func_ifnull :public Item_func_case_abbreviation2
const
char
*
func_name
()
const
{
return
"ifnull"
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
uint
decimal_precision
()
const
{
return
Item_func_case_abbreviation2
::
decimal_precision2
(
args
);
}
Item
*
get_copy
(
THD
*
thd
,
MEM_ROOT
*
mem_root
)
{
return
get_item_copy
<
Item_func_ifnull
>
(
thd
,
mem_root
,
this
);
}
};
...
...
@@ -1128,10 +1123,6 @@ class Item_func_if :public Item_func_case_abbreviation2_switch
{
fix_length_and_dec2_eliminate_null
(
args
+
1
);
}
uint
decimal_precision
()
const
{
return
Item_func_case_abbreviation2
::
decimal_precision2
(
args
+
1
);
}
const
char
*
func_name
()
const
{
return
"if"
;
}
bool
eval_not_null_tables
(
void
*
opt_arg
);
void
fix_after_pullout
(
st_select_lex
*
new_parent
,
Item
**
ref
);
...
...
@@ -1156,10 +1147,6 @@ class Item_func_nvl2 :public Item_func_case_abbreviation2_switch
{
fix_length_and_dec2_eliminate_null
(
args
+
1
);
}
uint
decimal_precision
()
const
{
return
Item_func_case_abbreviation2
::
decimal_precision2
(
args
+
1
);
}
Item
*
get_copy
(
THD
*
thd
,
MEM_ROOT
*
mem_root
)
{
return
get_item_copy
<
Item_func_nvl2
>
(
thd
,
mem_root
,
this
);
}
};
...
...
@@ -1219,7 +1206,6 @@ class Item_func_nullif :public Item_func_case_expression
my_decimal
*
decimal_op
(
my_decimal
*
);
void
fix_length_and_dec
();
bool
walk
(
Item_processor
processor
,
bool
walk_subquery
,
void
*
arg
);
uint
decimal_precision
()
const
{
return
args
[
2
]
->
decimal_precision
();
}
const
char
*
func_name
()
const
{
return
"nullif"
;
}
void
print
(
String
*
str
,
enum_query_type
query_type
);
void
split_sum_func
(
THD
*
thd
,
Ref_ptr_array
ref_pointer_array
,
...
...
@@ -2056,7 +2042,6 @@ class Item_func_case :public Item_func_case_expression,
bool
date_op
(
MYSQL_TIME
*
ltime
,
uint
fuzzydate
);
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
void
fix_length_and_dec
();
uint
decimal_precision
()
const
;
table_map
not_null_tables
()
const
{
return
0
;
}
const
char
*
func_name
()
const
{
return
"case"
;
}
enum
precedence
precedence
()
const
{
return
BETWEEN_PRECEDENCE
;
}
...
...
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