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
cefa8fe1
Commit
cefa8fe1
authored
Nov 12, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MONTHNAME() & DAYNAME() are now UCS2 compatible
parent
87c7aa4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
sql/item_timefunc.cc
sql/item_timefunc.cc
+9
-3
sql/item_timefunc.h
sql/item_timefunc.h
+12
-2
No files found.
sql/item_timefunc.cc
View file @
cefa8fe1
...
...
@@ -153,14 +153,17 @@ longlong Item_func_month::val_int()
String
*
Item_func_monthname
::
val_str
(
String
*
str
)
{
uint
month
=
(
uint
)
Item_func_month
::
val_int
();
uint
month
=
(
uint
)
Item_func_month
::
val_int
();
if
(
!
month
)
// This is also true for NULL
{
null_value
=
1
;
return
(
String
*
)
0
;
}
null_value
=
0
;
return
&
month_names
[
month
-
1
];
String
*
m
=&
month_names
[
month
-
1
];
str
->
copy
(
m
->
ptr
(),
m
->
length
(),
m
->
charset
(),
thd_charset
());
return
str
;
}
// Returns the quarter of the year
...
...
@@ -234,7 +237,10 @@ String* Item_func_dayname::val_str(String* str)
uint
weekday
=
(
uint
)
val_int
();
// Always Item_func_daynr()
if
(
null_value
)
return
(
String
*
)
0
;
return
&
day_names
[
weekday
];
String
*
d
=&
day_names
[
weekday
];
str
->
copy
(
d
->
ptr
(),
d
->
length
(),
d
->
charset
(),
thd_charset
());
return
str
;
}
...
...
sql/item_timefunc.h
View file @
cefa8fe1
...
...
@@ -85,7 +85,12 @@ class Item_func_monthname :public Item_func_month
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
()
{
decimals
=
0
;
max_length
=
10
;
maybe_null
=
1
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
10
*
thd_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
@@ -192,7 +197,12 @@ class Item_func_dayname :public Item_func_weekday
const
char
*
func_name
()
const
{
return
"dayname"
;
}
String
*
val_str
(
String
*
str
);
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
9
;
maybe_null
=
1
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
9
*
thd_charset
()
->
mbmaxlen
;
maybe_null
=
1
;
}
};
...
...
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