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
c43a0e0a
Commit
c43a0e0a
authored
Mar 28, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: Item_cache_temporal::convert_to_basic_const_item assumed DATETIME
this is a 10.3 version of
1c6f6dc8
parent
76013311
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
mysql-test/main/derived_cond_pushdown.result
mysql-test/main/derived_cond_pushdown.result
+1
-1
sql/item.cc
sql/item.cc
+22
-7
sql/item.h
sql/item.h
+4
-0
No files found.
mysql-test/main/derived_cond_pushdown.result
View file @
c43a0e0a
...
...
@@ -11819,7 +11819,7 @@ EXPLAIN
"access_type": "ALL",
"rows": 3,
"filtered": 100,
"attached_condition": "t1.i =
TIMESTAMP'2007-05-28 00:00:00
'"
"attached_condition": "t1.i =
DATE'2007-05-28
'"
}
}
}
...
...
sql/item.cc
View file @
c43a0e0a
...
...
@@ -10168,17 +10168,32 @@ Item *Item_cache_temporal::convert_to_basic_const_item(THD *thd)
Item
*
new_item
;
DBUG_ASSERT
(
value_cached
||
example
!=
0
);
if
(
null_value
)
new_item
=
(
Item
*
)
new
(
thd
->
mem_root
)
Item_null
(
thd
);
return
new
(
thd
->
mem_root
)
Item_null
(
thd
);
else
{
return
make_literal
(
thd
);
return
new_item
;
}
Item
*
Item_cache_datetime
::
make_literal
(
THD
*
thd
)
{
MYSQL_TIME
ltime
;
unpack_time
(
val_datetime_packed
(),
&
ltime
,
MYSQL_TIMESTAMP_DATETIME
);
new_item
=
(
Item
*
)
new
(
thd
->
mem_root
)
Item_datetime_literal
(
thd
,
&
ltime
,
decimals
);
}
return
new_item
;
return
new
(
thd
->
mem_root
)
Item_datetime_literal
(
thd
,
&
ltime
,
decimals
);
}
Item
*
Item_cache_date
::
make_literal
(
THD
*
thd
)
{
MYSQL_TIME
ltime
;
unpack_time
(
val_datetime_packed
(),
&
ltime
,
MYSQL_TIMESTAMP_DATE
);
return
new
(
thd
->
mem_root
)
Item_date_literal
(
thd
,
&
ltime
);
}
Item
*
Item_cache_time
::
make_literal
(
THD
*
thd
)
{
MYSQL_TIME
ltime
;
unpack_time
(
val_time_packed
(),
&
ltime
,
MYSQL_TIMESTAMP_TIME
);
return
new
(
thd
->
mem_root
)
Item_time_literal
(
thd
,
&
ltime
,
decimals
);
}
bool
Item_cache_real
::
cache_value
()
{
...
...
sql/item.h
View file @
c43a0e0a
...
...
@@ -6169,6 +6169,7 @@ class Item_cache_temporal: public Item_cache_int
*/
Item
*
clone_item
(
THD
*
thd
);
Item
*
convert_to_basic_const_item
(
THD
*
thd
);
virtual
Item
*
make_literal
(
THD
*
)
=
0
;
};
...
...
@@ -6180,6 +6181,7 @@ class Item_cache_time: public Item_cache_temporal
bool
cache_value
();
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_cache_time
>
(
thd
,
this
);
}
Item
*
make_literal
(
THD
*
);
};
...
...
@@ -6190,6 +6192,7 @@ class Item_cache_datetime: public Item_cache_temporal
:
Item_cache_temporal
(
thd
,
&
type_handler_datetime2
)
{
}
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_cache_datetime
>
(
thd
,
this
);
}
Item
*
make_literal
(
THD
*
);
};
...
...
@@ -6200,6 +6203,7 @@ class Item_cache_date: public Item_cache_temporal
:
Item_cache_temporal
(
thd
,
&
type_handler_newdate
)
{
}
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_cache_date
>
(
thd
,
this
);
}
Item
*
make_literal
(
THD
*
);
};
...
...
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