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
5606aed1
Commit
5606aed1
authored
Dec 14, 2009
by
Evgeny Potemkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-merge fix.
parent
aceea234
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
18 deletions
+15
-18
sql/item.cc
sql/item.cc
+11
-10
sql/item.h
sql/item.h
+1
-1
sql/item_sum.cc
sql/item_sum.cc
+2
-1
sql/item_timefunc.cc
sql/item_timefunc.cc
+1
-6
No files found.
sql/item.cc
View file @
5606aed1
...
...
@@ -7275,16 +7275,17 @@ longlong Item_cache_int::val_int()
return
value
;
}
void
Item_cache_datetime
::
cache_value_int
()
bool
Item_cache_datetime
::
cache_value_int
()
{
if
(
!
example
)
return
;
return
FALSE
;
value_cached
=
TRUE
;
/* Assume here that the underlying item will do correct conversion.*/
int_value
=
example
->
val_int_result
();
null_value
=
example
->
null_value
;
unsigned_flag
=
example
->
unsigned_flag
;
return
TRUE
;
}
...
...
@@ -7316,8 +7317,8 @@ void Item_cache_datetime::store(Item *item, longlong val_arg)
String
*
Item_cache_datetime
::
val_str
(
String
*
str
)
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
str_value_cached
)
cache_value
()
;
if
(
!
str_value_cached
&&
!
cache_value
()
)
return
NULL
;
return
&
str_value
;
}
...
...
@@ -7325,8 +7326,8 @@ String *Item_cache_datetime::val_str(String *str)
my_decimal
*
Item_cache_datetime
::
val_decimal
(
my_decimal
*
decimal_val
)
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
value_cached
)
cache_value_int
()
;
if
(
!
value_cached
&&
!
cache_value_int
()
)
return
NULL
;
int2my_decimal
(
E_DEC_FATAL_ERROR
,
int_value
,
unsigned_flag
,
decimal_val
);
return
decimal_val
;
}
...
...
@@ -7334,16 +7335,16 @@ my_decimal *Item_cache_datetime::val_decimal(my_decimal *decimal_val)
double
Item_cache_datetime
::
val_real
()
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
value_cached
)
cache_value_int
()
;
if
(
!
value_cached
&&
!
cache_value_int
()
)
return
0.0
;
return
(
double
)
int_value
;
}
longlong
Item_cache_datetime
::
val_int
()
{
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
value_cached
)
cache_value_int
()
;
if
(
!
value_cached
&&
!
cache_value_int
()
)
return
0
;
return
int_value
;
}
...
...
sql/item.h
View file @
5606aed1
...
...
@@ -3177,7 +3177,7 @@ class Item_cache_datetime: public Item_cache
completely relies on the ability of the underlying item to do the
correct conversion.
*/
void
cache_value_int
();
bool
cache_value_int
();
bool
cache_value
();
};
...
...
sql/item_sum.cc
View file @
5606aed1
...
...
@@ -1207,7 +1207,8 @@ void Item_sum_hybrid::setup(Item *item, Item *value_arg)
{
value
=
Item_cache
::
get_cache
(
item
);
value
->
setup
(
item
);
value
->
store
(
value_arg
);
if
(
value_arg
)
value
->
store
(
value_arg
);
cmp
=
new
Arg_comparator
();
cmp
->
set_cmp_func
(
this
,
args
,
(
Item
**
)
&
value
,
FALSE
);
collation
.
set
(
item
->
collation
);
...
...
sql/item_timefunc.cc
View file @
5606aed1
...
...
@@ -876,12 +876,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
const
char
*
start
=
str
;
for
(
value
=
0
;
str
!=
end
&&
my_isdigit
(
cs
,
*
str
)
;
str
++
)
value
=
value
*
LL
(
10
)
+
(
longlong
)
(
*
str
-
'0'
);
if
(
transform_msec
&&
i
==
count
-
1
)
// microseconds always last
{
int
msec_length
=
6
-
(
str
-
start
);
if
(
msec_length
>
0
)
value
*=
(
long
)
log_10_int
[
msec_length
];
}
msec_length
=
6
-
(
str
-
start
);
values
[
i
]
=
value
;
while
(
str
!=
end
&&
!
my_isdigit
(
cs
,
*
str
))
str
++
;
...
...
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