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
95b4ff00
Commit
95b4ff00
authored
Feb 21, 2011
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
a5f20712
659ff293
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
12 deletions
+27
-12
mysql-test/r/func_time.result
mysql-test/r/func_time.result
+9
-1
mysql-test/t/func_time.test
mysql-test/t/func_time.test
+7
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+5
-8
sql/item_timefunc.h
sql/item_timefunc.h
+6
-3
No files found.
mysql-test/r/func_time.result
View file @
95b4ff00
...
...
@@ -136,7 +136,7 @@ dayname("1962-03-03") dayname("1962-03-03")+0
Saturday 5
select monthname("1972-03-04"),monthname("1972-03-04")+0;
monthname("1972-03-04") monthname("1972-03-04")+0
March
3
March
0
select time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T');
time_format(19980131000000,'%H|%I|%k|%l|%i|%p|%r|%S|%T')
00|12|0|12|00|AM|12:00:00 AM|00|00:00:00
...
...
@@ -1368,3 +1368,11 @@ SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR);
SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR)
NULL
#
# BUG#59895 - setting storage engine to null segfaults mysqld
#
SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1;
MONTHNAME(0) MONTHNAME(0) IS NULL MONTHNAME(0) + 1
NULL 1 NULL
SET storage_engine=NULL;
ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL'
#
mysql-test/t/func_time.test
View file @
95b4ff00
...
...
@@ -881,4 +881,11 @@ SELECT WEEK(STR_TO_DATE(NULL,0));
SELECT
SUBDATE
(
STR_TO_DATE
(
NULL
,
0
),
INTERVAL
1
HOUR
);
--
echo
#
--
echo
# BUG#59895 - setting storage engine to null segfaults mysqld
--
echo
#
SELECT
MONTHNAME
(
0
),
MONTHNAME
(
0
)
IS
NULL
,
MONTHNAME
(
0
)
+
1
;
--
error
ER_WRONG_VALUE_FOR_VAR
SET
storage_engine
=
NULL
;
--
echo
#
sql/item_timefunc.cc
View file @
95b4ff00
...
...
@@ -1133,16 +1133,13 @@ String* Item_func_monthname::val_str(String* str)
{
DBUG_ASSERT
(
fixed
==
1
);
const
char
*
month_name
;
uint
month
=
(
uint
)
val_int
();
uint
err
;
MYSQL_TIME
ltime
;
if
(
null_value
||
!
month
)
{
null_value
=
1
;
return
(
String
*
)
0
;
}
null_value
=
0
;
month_name
=
locale
->
month_names
->
type_names
[
month
-
1
];
if
((
null_value
=
(
get_arg0_date
(
&
ltime
,
TIME_FUZZY_DATE
)
||
!
ltime
.
month
)))
return
(
String
*
)
0
;
month_name
=
locale
->
month_names
->
type_names
[
ltime
.
month
-
1
];
str
->
copy
(
month_name
,
(
uint
)
strlen
(
month_name
),
&
my_charset_utf8_bin
,
collation
.
collation
,
&
err
);
return
str
;
...
...
sql/item_timefunc.h
View file @
95b4ff00
...
...
@@ -163,16 +163,19 @@ class Item_func_month :public Item_func
};
class
Item_func_monthname
:
public
Item_
func_month
class
Item_func_monthname
:
public
Item_
str_func
{
MY_LOCALE
*
locale
;
public:
Item_func_monthname
(
Item
*
a
)
:
Item_
func_month
(
a
)
{}
Item_func_monthname
(
Item
*
a
)
:
Item_
str_func
(
a
)
{}
const
char
*
func_name
()
const
{
return
"monthname"
;
}
String
*
val_str
(
String
*
str
);
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
();
bool
check_partition_func_processor
(
uchar
*
int_arg
)
{
return
TRUE
;}
bool
check_valid_arguments_processor
(
uchar
*
int_arg
)
{
return
!
has_date_args
();
}
};
...
...
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