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
23d4c95b
Commit
23d4c95b
authored
Oct 05, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-8896 Dead code in stored_field_cmp_to_item()
parent
93371739
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
82 deletions
+0
-82
sql/item.cc
sql/item.cc
+0
-20
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+0
-58
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+0
-4
No files found.
sql/item.cc
View file @
23d4c95b
...
...
@@ -8618,26 +8618,6 @@ int stored_field_cmp_to_item(THD *thd, Field *field, Item *item)
if
(
item
->
null_value
)
return
0
;
String
*
field_result
=
field
->
val_str
(
&
field_tmp
);
enum_field_types
field_type
=
field
->
type
();
if
(
field_type
==
MYSQL_TYPE_DATE
||
field_type
==
MYSQL_TYPE_DATETIME
||
field_type
==
MYSQL_TYPE_TIMESTAMP
)
{
enum_mysql_timestamp_type
type
=
MYSQL_TIMESTAMP_ERROR
;
if
(
field_type
==
MYSQL_TYPE_DATE
)
type
=
MYSQL_TIMESTAMP_DATE
;
else
type
=
MYSQL_TIMESTAMP_DATETIME
;
const
char
*
field_name
=
field
->
field_name
;
MYSQL_TIME
field_time
,
item_time
;
get_mysql_time_from_str
(
thd
,
field_result
,
type
,
field_name
,
&
field_time
);
get_mysql_time_from_str
(
thd
,
item_result
,
type
,
field_name
,
&
item_time
);
return
my_time_compare
(
&
field_time
,
&
item_time
);
}
return
sortcmp
(
field_result
,
item_result
,
field
->
charset
());
}
if
(
res_type
==
INT_RESULT
)
...
...
sql/item_cmpfunc.cc
View file @
23d4c95b
...
...
@@ -596,64 +596,6 @@ int Arg_comparator::set_compare_func(Item_func_or_sum *item, Item_result type)
return
0
;
}
/**
Parse date provided in a string to a MYSQL_TIME.
@param[in] thd Thread handle
@param[in] str A string to convert
@param[in] warn_type Type of the timestamp for issuing the warning
@param[in] warn_name Field name for issuing the warning
@param[out] l_time The MYSQL_TIME objects is initialized.
Parses a date provided in the string str into a MYSQL_TIME object.
The date is used for comparison, that is fuzzy dates are allowed
independently of sql_mode.
If the string contains an incorrect date or doesn't correspond to a date at
all then a warning is issued. The warn_type and the warn_name arguments are
used as the name and the type of the field when issuing the warning. If any
input was discarded (trailing or non-timestamp-y characters), return value
will be TRUE.
@return Status flag
@retval FALSE Success.
@retval True Indicates failure.
*/
bool
get_mysql_time_from_str
(
THD
*
thd
,
String
*
str
,
timestamp_type
warn_type
,
const
char
*
warn_name
,
MYSQL_TIME
*
l_time
)
{
bool
value
;
MYSQL_TIME_STATUS
status
;
int
flags
=
TIME_FUZZY_DATES
|
MODE_INVALID_DATES
;
ErrConvString
err
(
str
);
DBUG_ASSERT
(
warn_type
!=
MYSQL_TIMESTAMP_TIME
);
if
(
!
str_to_datetime
(
str
->
charset
(),
str
->
ptr
(),
str
->
length
(),
l_time
,
flags
,
&
status
))
{
DBUG_ASSERT
(
l_time
->
time_type
==
MYSQL_TIMESTAMP_DATETIME
||
l_time
->
time_type
==
MYSQL_TIMESTAMP_DATE
);
/*
Do not return yet, we may still want to throw a "trailing garbage"
warning.
*/
value
=
FALSE
;
}
else
{
DBUG_ASSERT
(
l_time
->
time_type
!=
MYSQL_TIMESTAMP_TIME
);
DBUG_ASSERT
(
status
.
warnings
!=
0
);
// Must be set by set_to_datetime()
value
=
TRUE
;
}
if
(
status
.
warnings
>
0
)
make_truncated_value_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
&
err
,
warn_type
,
warn_name
);
return
value
;
}
/**
Prepare the comparator (set the comparison function) for comparing
...
...
sql/item_cmpfunc.h
View file @
23d4c95b
...
...
@@ -2393,10 +2393,6 @@ longlong get_datetime_value(THD *thd, Item ***item_arg, Item **cache_arg,
enum_field_types
f_type
,
bool
*
is_null
);
bool
get_mysql_time_from_str
(
THD
*
thd
,
String
*
str
,
timestamp_type
warn_type
,
const
char
*
warn_name
,
MYSQL_TIME
*
l_time
);
class
Comp_creator
{
public:
...
...
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