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
2c00c272
Commit
2c00c272
authored
Mar 30, 2011
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.1 -> 5.5 merge
parents
9b7799d5
fbed52c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+12
-0
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+12
-0
sql/item.cc
sql/item.cc
+5
-1
sql/item_timefunc.h
sql/item_timefunc.h
+5
-2
No files found.
mysql-test/r/func_time.result
View file @
2c00c272
...
...
@@ -1365,6 +1365,18 @@ SET GLOBAL SQL_MODE=DEFAULT;
SELECT FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1);
FORMAT(YEAR(STR_TO_DATE('',GET_FORMAT(TIME,''))),1)
NULL
#
# Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING
#
SELECT CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025));
CAST((MONTH(FROM_UNIXTIME(@@GLOBAL.SQL_MODE))) AS BINARY(1025))
NULL
#
# Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME
#
SELECT ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR);
ADDDATE(MONTH(FROM_UNIXTIME(NULL)),INTERVAL 1 HOUR)
NULL
End of 5.1 tests
#
# Bug#57039: constant subtime expression returns incorrect result.
...
...
mysql-test/t/func_time.test
View file @
2c00c272
...
...
@@ -882,6 +882,18 @@ SET GLOBAL SQL_MODE=DEFAULT;
SELECT
FORMAT
(
YEAR
(
STR_TO_DATE
(
''
,
GET_FORMAT
(
TIME
,
''
))),
1
);
--
echo
#
--
echo
# Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING
--
echo
#
SELECT
CAST
((
MONTH
(
FROM_UNIXTIME
(
@@
GLOBAL
.
SQL_MODE
)))
AS
BINARY
(
1025
));
--
echo
#
--
echo
# Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME
--
echo
#
SELECT
ADDDATE
(
MONTH
(
FROM_UNIXTIME
(
NULL
)),
INTERVAL
1
HOUR
);
--
echo
End
of
5.1
tests
--
echo
#
...
...
sql/item.cc
View file @
2c00c272
...
...
@@ -997,8 +997,12 @@ bool Item::get_date(MYSQL_TIME *ltime,uint fuzzydate)
}
else
{
longlong
value
=
val_int
();
int
was_cut
;
longlong
value
=
val_int
();
if
(
null_value
)
goto
err
;
if
(
number_to_datetime
(
value
,
ltime
,
fuzzydate
,
&
was_cut
)
==
LL
(
-
1
))
{
char
buff
[
22
],
*
end
;
...
...
sql/item_timefunc.h
View file @
2c00c272
...
...
@@ -144,8 +144,11 @@ class Item_func_month :public Item_func
{
DBUG_ASSERT
(
fixed
==
1
);
return
(
double
)
Item_func_month
::
val_int
();
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
(),
collation
.
collation
);
return
null_value
?
0
:
str
;
longlong
nr
=
val_int
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
collation
.
collation
);
return
str
;
}
const
char
*
func_name
()
const
{
return
"month"
;
}
enum
Item_result
result_type
()
const
{
return
INT_RESULT
;
}
...
...
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