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
7b55e8b8
Commit
7b55e8b8
authored
Jun 11, 2007
by
malff/marcsql@weblab.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge50
parents
6c352d16
8725f457
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
sql/item_timefunc.cc
sql/item_timefunc.cc
+21
-11
sql/unireg.h
sql/unireg.h
+1
-0
No files found.
sql/item_timefunc.cc
View file @
7b55e8b8
...
...
@@ -51,7 +51,7 @@ static bool make_datetime(date_time_format_types format, MYSQL_TIME *ltime,
{
char
*
buff
;
CHARSET_INFO
*
cs
=
&
my_charset_bin
;
uint
length
=
30
;
uint
length
=
MAX_DATE_STRING_REP_LENGTH
;
if
(
str
->
alloc
(
length
))
return
1
;
...
...
@@ -1379,7 +1379,7 @@ String *Item_date::val_str(String *str)
MYSQL_TIME
ltime
;
if
(
get_date
(
&
ltime
,
TIME_FUZZY_DATE
))
return
(
String
*
)
0
;
if
(
str
->
alloc
(
11
))
if
(
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
null_value
=
1
;
return
(
String
*
)
0
;
...
...
@@ -1428,7 +1428,7 @@ void Item_func_curdate::fix_length_and_dec()
String
*
Item_func_curdate
::
val_str
(
String
*
str
)
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
str
->
alloc
(
11
))
if
(
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
null_value
=
1
;
return
(
String
*
)
0
;
...
...
@@ -1657,7 +1657,8 @@ String *Item_func_sec_to_time::val_str(String *str)
MYSQL_TIME
ltime
;
longlong
arg_val
=
args
[
0
]
->
val_int
();
if
((
null_value
=
args
[
0
]
->
null_value
)
||
str
->
alloc
(
19
))
if
((
null_value
=
args
[
0
]
->
null_value
)
||
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
null_value
=
1
;
return
(
String
*
)
0
;
...
...
@@ -1842,6 +1843,10 @@ String *Item_func_date_format::val_str(String *str)
size
=
max_length
;
else
size
=
format_length
(
format
);
if
(
size
<
MAX_DATE_STRING_REP_LENGTH
)
size
=
MAX_DATE_STRING_REP_LENGTH
;
if
(
format
==
str
)
str
=
&
value
;
// Save result here
if
(
str
->
alloc
(
size
))
...
...
@@ -1885,13 +1890,14 @@ String *Item_func_from_unixtime::val_str(String *str)
if
(
get_date
(
&
time_tmp
,
0
))
return
0
;
if
(
str
->
alloc
(
20
*
MY_CHARSET_BIN_MB_MAXLEN
))
if
(
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
null_value
=
1
;
return
0
;
}
make_datetime
((
DATE_TIME_FORMAT
*
)
0
,
&
time_tmp
,
str
);
return
str
;
}
...
...
@@ -1940,14 +1946,15 @@ String *Item_func_convert_tz::val_str(String *str)
if
(
get_date
(
&
time_tmp
,
0
))
return
0
;
if
(
str
->
alloc
(
20
*
MY_CHARSET_BIN_MB_MAXLEN
))
if
(
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
null_value
=
1
;
return
0
;
}
make_datetime
((
DATE_TIME_FORMAT
*
)
0
,
&
time_tmp
,
str
);
return
str
;
}
...
...
@@ -2454,6 +2461,7 @@ String *Item_datetime_typecast::val_str(String *str)
{
DBUG_ASSERT
(
fixed
==
1
);
MYSQL_TIME
ltime
;
if
(
!
get_arg0_date
(
&
ltime
,
TIME_FUZZY_DATE
)
&&
!
make_datetime
(
ltime
.
second_part
?
DATE_TIME_MICROSECOND
:
DATE_TIME
,
&
ltime
,
str
))
...
...
@@ -2532,7 +2540,8 @@ String *Item_date_typecast::val_str(String *str)
DBUG_ASSERT
(
fixed
==
1
);
MYSQL_TIME
ltime
;
if
(
!
get_arg0_date
(
&
ltime
,
TIME_FUZZY_DATE
)
&&
!
str
->
alloc
(
11
))
if
(
!
get_arg0_date
(
&
ltime
,
TIME_FUZZY_DATE
)
&&
!
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
{
make_date
((
DATE_TIME_FORMAT
*
)
0
,
&
ltime
,
str
);
return
str
;
...
...
@@ -2585,7 +2594,7 @@ String *Item_func_makedate::val_str(String *str)
{
null_value
=
0
;
get_date_from_daynr
(
days
,
&
l_time
.
year
,
&
l_time
.
month
,
&
l_time
.
day
);
if
(
str
->
alloc
(
11
))
if
(
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))
goto
err
;
make_date
((
DATE_TIME_FORMAT
*
)
0
,
&
l_time
,
str
);
return
str
;
...
...
@@ -2721,6 +2730,7 @@ String *Item_func_add_time::val_str(String *str)
days
=
(
long
)(
seconds
/
86400L
);
calc_time_from_sec
(
&
l_time3
,
(
long
)(
seconds
%
86400L
),
microseconds
);
if
(
!
is_time
)
{
get_date_from_daynr
(
days
,
&
l_time3
.
year
,
&
l_time3
.
month
,
&
l_time3
.
day
);
...
...
@@ -2836,7 +2846,7 @@ String *Item_func_maketime::val_str(String *str)
args
[
2
]
->
null_value
||
minute
<
0
||
minute
>
59
||
second
<
0
||
second
>
59
||
str
->
alloc
(
19
))))
str
->
alloc
(
MAX_DATE_STRING_REP_LENGTH
))))
return
0
;
bzero
((
char
*
)
&
ltime
,
sizeof
(
ltime
));
...
...
sql/unireg.h
View file @
7b55e8b8
...
...
@@ -74,6 +74,7 @@
#define MAX_TIME_WIDTH 23
/* -DDDDDD HH:MM:SS.###### */
#define MAX_DATETIME_FULL_WIDTH 29
/* YYYY-MM-DD HH:MM:SS.###### AM */
#define MAX_DATETIME_WIDTH 19
/* YYYY-MM-DD HH:MM:SS */
#define MAX_DATETIME_COMPRESSED_WIDTH 14
/* YYYYMMDDHHMMSS */
#define MAX_TABLES (sizeof(table_map)*8-3)
/* Max tables in join */
#define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3))
...
...
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