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
b0e6db14
Commit
b0e6db14
authored
Jun 24, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport for #10568: Function 'LAST_DAY(date)' does not return NULL for invalid argument.
parent
66330a9d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+15
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+7
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+1
-1
No files found.
mysql-test/r/func_time.result
View file @
b0e6db14
...
...
@@ -611,3 +611,18 @@ SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAY
count(*)
3
DROP TABLE t1;
select last_day('2005-00-00');
last_day('2005-00-00')
NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '2005-00-00'
select last_day('2005-00-01');
last_day('2005-00-01')
NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '2005-00-01'
select last_day('2005-01-00');
last_day('2005-01-00')
NULL
Warnings:
Warning 1292 Truncated incorrect datetime value: '2005-01-00'
mysql-test/t/func_time.test
View file @
b0e6db14
...
...
@@ -307,3 +307,10 @@ INSERT INTO t1 VALUES (NOW());
SELECT
count
(
*
)
FROM
t1
WHERE
d
>
FROM_DAYS
(
TO_DAYS
(
@
TMP
))
AND
d
<=
FROM_DAYS
(
TO_DAYS
(
@
TMP
)
+
1
);
DROP
TABLE
t1
;
#
# Bug #10568
#
select
last_day
(
'2005-00-00'
);
select
last_day
(
'2005-00-01'
);
select
last_day
(
'2005-01-00'
);
sql/item_timefunc.cc
View file @
b0e6db14
...
...
@@ -2817,7 +2817,7 @@ String *Item_func_str_to_date::val_str(String *str)
bool
Item_func_last_day
::
get_date
(
TIME
*
ltime
,
uint
fuzzy_date
)
{
if
(
get_arg0_date
(
ltime
,
fuzzy_date
))
if
(
get_arg0_date
(
ltime
,
fuzzy_date
&
~
TIME_FUZZY_DATE
))
return
1
;
uint
month_idx
=
ltime
->
month
-
1
;
ltime
->
day
=
days_in_month
[
month_idx
];
...
...
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