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
75ac5789
Commit
75ac5789
authored
Mar 11, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: typos, comments, whitespace
parent
bf1ca14f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
18 deletions
+16
-18
mysql-test/r/type_time.result
mysql-test/r/type_time.result
+2
-2
mysql-test/t/type_time.test
mysql-test/t/type_time.test
+2
-2
sql/item.h
sql/item.h
+3
-3
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-8
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+2
-3
No files found.
mysql-test/r/type_time.result
View file @
75ac5789
...
...
@@ -822,7 +822,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and <cache>(length(TIME'10:20:30')) = 30 + rand()
# Old mode, TIMESTAMP literal,
z
on-zero YYYYMMDD, no propagation
# Old mode, TIMESTAMP literal,
n
on-zero YYYYMMDD, no propagation
SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-01 10:20:30';
a
34:20:30
...
...
@@ -860,7 +860,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIME'10:20:30' and <cache>(length(TIME'10:20:30')) = 30 + rand()
# Old mode, TIMESTAMP-alike literal,
z
on-zero YYYYMMDD, no propagation
# Old mode, TIMESTAMP-alike literal,
n
on-zero YYYYMMDD, no propagation
SELECT * FROM t1 WHERE a='0000-00-01 10:20:30';
a
34:20:30
...
...
mysql-test/t/type_time.test
View file @
75ac5789
...
...
@@ -506,7 +506,7 @@ SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 10:20:30' AND LENGTH(a)=8;
EXPLAIN
EXTENDED
SELECT
*
FROM
t1
WHERE
a
=
TIMESTAMP
'0000-00-00 10:20:30'
AND
LENGTH
(
a
)
=
30
+
RAND
();
--
echo
# Old mode, TIMESTAMP literal,
z
on-zero YYYYMMDD, no propagation
--
echo
# Old mode, TIMESTAMP literal,
n
on-zero YYYYMMDD, no propagation
SELECT
*
FROM
t1
WHERE
a
=
TIMESTAMP
'0000-00-01 10:20:30'
;
SELECT
*
FROM
t1
WHERE
a
=
TIMESTAMP
'0000-00-01 10:20:30'
AND
LENGTH
(
a
)
=
8
;
EXPLAIN
EXTENDED
...
...
@@ -522,7 +522,7 @@ SELECT * FROM t1 WHERE a='0000-00-00 10:20:30' AND LENGTH(a)=8;
EXPLAIN
EXTENDED
SELECT
*
FROM
t1
WHERE
a
=
'0000-00-00 10:20:30'
AND
LENGTH
(
a
)
=
30
+
RAND
();
--
echo
# Old mode, TIMESTAMP-alike literal,
z
on-zero YYYYMMDD, no propagation
--
echo
# Old mode, TIMESTAMP-alike literal,
n
on-zero YYYYMMDD, no propagation
SELECT
*
FROM
t1
WHERE
a
=
'0000-00-01 10:20:30'
;
SELECT
*
FROM
t1
WHERE
a
=
'0000-00-01 10:20:30'
AND
LENGTH
(
a
)
=
8
;
EXPLAIN
EXTENDED
...
...
sql/item.h
View file @
75ac5789
...
...
@@ -1365,7 +1365,7 @@ class Item: public Value_source,
/*
Get time with automatic DATE/DATETIME to TIME conversion.
Perform
ce a reserv
e operation to get_date_with_conversion().
Perform
es a revers
e operation to get_date_with_conversion().
Suppose:
- we have a set of items (typically with the native MYSQL_TYPE_TIME type)
whose item->get_date() return TIME1 value, and
...
...
@@ -3842,7 +3842,7 @@ class Item_date_literal_for_invalid_dates: public Item_date_literal
Item_date_literal_for_invalid_dates::get_date()
(unlike the regular Item_date_literal::get_date())
does not check the result for NO_ZERO_IN_DATE and NO_ZER_DATE,
does not check the result for NO_ZERO_IN_DATE and NO_ZER
O
_DATE,
always returns success (false), and does not produce error/warning messages.
We need these _for_invalid_dates classes to be able to rewrite:
...
...
@@ -5588,7 +5588,7 @@ class Item_cache: public Item_basic_constant,
virtual
void
store
(
Item
*
item
);
virtual
bool
cache_value
()
=
0
;
bool
basic_const_item
()
const
{
return
MY_TEST
(
example
&&
example
->
basic_const_item
()
);
}
{
return
example
&&
example
->
basic_const_item
(
);
}
virtual
void
clear
()
{
null_value
=
TRUE
;
value_cached
=
FALSE
;
}
bool
is_null
()
{
return
!
has_value
();
}
virtual
bool
is_expensive
()
...
...
sql/item_cmpfunc.cc
View file @
75ac5789
...
...
@@ -525,8 +525,7 @@ void Item_bool_rowready_func2::fix_length_and_dec()
int
Arg_comparator
::
set_compare_func
(
Item_func_or_sum
*
item
,
Item_result
type
)
{
owner
=
item
;
func
=
comparator_matrix
[
type
]
[
is_owner_equal_func
()];
func
=
comparator_matrix
[
type
][
is_owner_equal_func
()];
switch
(
type
)
{
case
TIME_RESULT
:
...
...
@@ -708,7 +707,7 @@ int Arg_comparator::set_cmp_func(Item_func_or_sum *owner_arg,
@return cache item or original value.
*/
Item
**
Arg_comparator
::
cache_converted_constant
(
THD
*
thd
_arg
,
Item
**
value
,
Item
**
Arg_comparator
::
cache_converted_constant
(
THD
*
thd
,
Item
**
value
,
Item
**
cache_item
,
Item_result
type
)
{
...
...
@@ -717,12 +716,12 @@ Item** Arg_comparator::cache_converted_constant(THD *thd_arg, Item **value,
Also, get_datetime_value creates Item_cache internally.
Unless fixed, we should not do it here.
*/
if
(
!
thd
_arg
->
lex
->
is_ps_or_view_context_analysis
()
&&
if
(
!
thd
->
lex
->
is_ps_or_view_context_analysis
()
&&
(
*
value
)
->
const_item
()
&&
type
!=
(
*
value
)
->
result_type
()
&&
type
!=
TIME_RESULT
)
{
Item_cache
*
cache
=
Item_cache
::
get_cache
(
thd
_arg
,
*
value
,
type
);
cache
->
setup
(
thd
_arg
,
*
value
);
Item_cache
*
cache
=
Item_cache
::
get_cache
(
thd
,
*
value
,
type
);
cache
->
setup
(
thd
,
*
value
);
*
cache_item
=
cache
;
return
cache_item
;
}
...
...
@@ -2172,7 +2171,7 @@ void Item_func_between::fix_length_and_dec()
if
(
m_compare_type
==
TIME_RESULT
)
compare_as_dates
=
find_date_time_item
(
args
,
3
,
0
);
/* See the comment
about the similar block in Item_bool_func2
*/
/* See the comment
for Item_func::convert_const_compared_to_int_field
*/
if
(
args
[
0
]
->
real_item
()
->
type
()
==
FIELD_ITEM
&&
!
thd
->
lex
->
is_ps_or_view_context_analysis
())
{
...
...
@@ -4286,7 +4285,7 @@ void Item_func_in::fix_length_and_dec()
values on the right can be compared as integers and adjust the
comparison type accordingly.
See the comment about the similar block in Item_bool_func2
And see the comment for Item_func::convert_const_compared_to_int_field
*/
if
(
args
[
0
]
->
real_item
()
->
type
()
==
FIELD_ITEM
&&
!
thd
->
lex
->
is_view_context_analysis
()
&&
m_compare_type
!=
INT_RESULT
)
...
...
sql/item_cmpfunc.h
View file @
75ac5789
...
...
@@ -529,14 +529,13 @@ class Item_bool_rowready_func2 :public Item_bool_func2_with_rev
clone
->
cmp
.
comparators
=
0
;
}
return
clone
;
}
}
};
/**
XOR inherits from Item_bool_func because it is not optimized yet.
Later, when XOR is optimized, it needs to inherit from
Item_cond instead. See WL#5800.
Item_cond instead. See WL#5800.
*/
class
Item_func_xor
:
public
Item_bool_func
{
...
...
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