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
3e1f3d3e
Commit
3e1f3d3e
authored
Mar 27, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A cleanup in Item_sum: removing dead code
parent
f78eb52f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
37 deletions
+13
-37
sql/item_sum.cc
sql/item_sum.cc
+0
-19
sql/item_sum.h
sql/item_sum.h
+9
-14
sql/item_windowfunc.h
sql/item_windowfunc.h
+4
-4
No files found.
sql/item_sum.cc
View file @
3e1f3d3e
...
...
@@ -2679,25 +2679,6 @@ bool Item_sum_and::add()
** reset result of a Item_sum with is saved in a tmp_table
*************************************************************************/
void
Item_sum_num
::
reset_field
()
{
double
nr
=
args
[
0
]
->
val_real
();
uchar
*
res
=
result_field
->
ptr
;
if
(
maybe_null
)
{
if
(
args
[
0
]
->
null_value
)
{
nr
=
0.0
;
result_field
->
set_null
();
}
else
result_field
->
set_notnull
();
}
float8store
(
res
,
nr
);
}
void
Item_sum_hybrid
::
reset_field
()
{
Item
*
UNINIT_VAR
(
tmp_item
),
*
arg0
;
...
...
sql/item_sum.h
View file @
3e1f3d3e
...
...
@@ -722,24 +722,16 @@ class Aggregator_simple : public Aggregator
class
Item_sum_num
:
public
Item_sum
{
protected:
/*
val_xxx() functions may be called several times during the execution of a
query. Derived classes that require extensive calculation in val_xxx()
maintain cache of aggregate value. This variable governs the validity of
that cache.
*/
bool
is_evaluated
;
public:
Item_sum_num
(
THD
*
thd
)
:
Item_sum
(
thd
)
,
is_evaluated
(
FALSE
)
{}
Item_sum_num
(
THD
*
thd
)
:
Item_sum
(
thd
)
{}
Item_sum_num
(
THD
*
thd
,
Item
*
item_par
)
:
Item_sum
(
thd
,
item_par
)
,
is_evaluated
(
FALSE
)
{}
Item_sum
(
thd
,
item_par
)
{}
Item_sum_num
(
THD
*
thd
,
Item
*
a
,
Item
*
b
)
:
Item_sum
(
thd
,
a
,
b
)
,
is_evaluated
(
FALSE
)
{}
Item_sum
(
thd
,
a
,
b
)
{}
Item_sum_num
(
THD
*
thd
,
List
<
Item
>
&
list
)
:
Item_sum
(
thd
,
list
)
,
is_evaluated
(
FALSE
)
{}
Item_sum
(
thd
,
list
)
{}
Item_sum_num
(
THD
*
thd
,
Item_sum_num
*
item
)
:
Item_sum
(
thd
,
item
)
,
is_evaluated
(
item
->
is_evaluated
)
{}
Item_sum
(
thd
,
item
)
{}
bool
fix_fields
(
THD
*
,
Item
**
);
longlong
val_int
()
{
return
val_int_from_real
();
/* Real as default */
}
String
*
val_str
(
String
*
str
);
...
...
@@ -748,7 +740,6 @@ class Item_sum_num :public Item_sum
{
return
type_handler
()
->
Item_get_date_with_warn
(
thd
,
this
,
ltime
,
fuzzydate
);
}
void
reset_field
();
};
...
...
@@ -1705,6 +1696,7 @@ class Item_sum_udf_float :public Item_sum_num
double
val_real
()
{
DBUG_ASSERT
(
fixed
==
1
);
return
0.0
;
}
void
clear
()
{}
bool
add
()
{
return
0
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
};
void
update_field
()
{}
};
...
...
@@ -1723,6 +1715,7 @@ class Item_sum_udf_int :public Item_sum_num
double
val_real
()
{
DBUG_ASSERT
(
fixed
==
1
);
return
0
;
}
void
clear
()
{}
bool
add
()
{
return
0
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
};
void
update_field
()
{}
};
...
...
@@ -1741,6 +1734,7 @@ class Item_sum_udf_decimal :public Item_sum_num
my_decimal
*
val_decimal
(
my_decimal
*
)
{
DBUG_ASSERT
(
fixed
==
1
);
return
0
;
}
void
clear
()
{}
bool
add
()
{
return
0
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
};
void
update_field
()
{}
};
...
...
@@ -1762,6 +1756,7 @@ class Item_sum_udf_str :public Item_sum_num
enum
Sumfunctype
sum_func
()
const
{
return
UDF_SUM_FUNC
;
}
void
clear
()
{}
bool
add
()
{
return
0
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
};
void
update_field
()
{}
};
...
...
sql/item_windowfunc.h
View file @
3e1f3d3e
...
...
@@ -130,6 +130,7 @@ class Item_sum_row_number: public Item_sum_int
return
false
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
}
void
update_field
()
{}
enum
Sumfunctype
sum_func
()
const
...
...
@@ -193,11 +194,8 @@ class Item_sum_rank: public Item_sum_int
return
cur_rank
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
}
void
update_field
()
{}
/*
void reset_field();
TODO: ^^ what does this do ? It is not called ever?
*/
enum
Sumfunctype
sum_func
()
const
{
...
...
@@ -261,6 +259,7 @@ class Item_sum_dense_rank: public Item_sum_int
first_add
=
true
;
}
bool
add
();
void
reset_field
()
{
DBUG_ASSERT
(
0
);
}
void
update_field
()
{}
longlong
val_int
()
{
...
...
@@ -460,6 +459,7 @@ class Item_sum_window_with_row_count : public Item_sum_num
void
set_row_count
(
ulonglong
count
)
{
partition_row_count_
=
count
;
}
void
reset_field
()
{
DBUG_ASSERT
(
0
);
}
protected:
longlong
get_row_count
()
{
return
partition_row_count_
;
}
private:
...
...
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