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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
684405e7
Commit
684405e7
authored
Mar 17, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lp:737092 Assertion `item->null_value' failed in get_datetime_value in 5.1-micro
Implement Item_func_coalesce::get_date()
parent
256185c5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
0 deletions
+25
-0
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+3
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+6
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+15
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-0
No files found.
mysql-test/r/func_time.result
View file @
684405e7
...
...
@@ -1494,3 +1494,6 @@ least(1, f1)
Warnings:
Warning 1292 Incorrect datetime value: '1' for column 'f1' at row 1
drop table t1;
select now() > coalesce(time('21:43:24'), date('2010-05-03'));
now() > coalesce(time('21:43:24'), date('2010-05-03'))
1
mysql-test/t/func_time.test
View file @
684405e7
...
...
@@ -932,3 +932,9 @@ create table t1 (f1 timestamp);
insert
into
t1
values
(
'0000-00-00 00:00:00'
);
select
least
(
1
,
f1
)
from
t1
;
drop
table
t1
;
#
# lp:737092 Assertion `item->null_value' failed in get_datetime_value in 5.1-micro
#
select
now
()
>
coalesce
(
time
(
'21:43:24'
),
date
(
'2010-05-03'
));
sql/item_cmpfunc.cc
View file @
684405e7
...
...
@@ -2901,6 +2901,21 @@ double Item_func_coalesce::real_op()
}
bool
Item_func_coalesce
::
get_date
(
MYSQL_TIME
*
ltime
,
uint
fuzzydate
)
{
DBUG_ASSERT
(
fixed
==
1
);
null_value
=
0
;
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
{
bool
res
=
args
[
i
]
->
get_date
(
ltime
,
fuzzydate
);
if
(
!
args
[
i
]
->
null_value
)
return
res
;
}
null_value
=
1
;
return
0
;
}
my_decimal
*
Item_func_coalesce
::
decimal_op
(
my_decimal
*
decimal_value
)
{
DBUG_ASSERT
(
fixed
==
1
);
...
...
sql/item_cmpfunc.h
View file @
684405e7
...
...
@@ -675,6 +675,7 @@ public:
const
char
*
func_name
()
const
{
return
"coalesce"
;
}
table_map
not_null_tables
()
const
{
return
0
;
}
enum_field_types
field_type
()
const
{
return
cached_field_type
;
}
bool
get_date
(
MYSQL_TIME
*
ltime
,
uint
fuzzydate
);
};
...
...
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