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
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
Show 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()
...
@@ -7275,16 +7275,17 @@ longlong Item_cache_int::val_int()
return
value
;
return
value
;
}
}
void
Item_cache_datetime
::
cache_value_int
()
bool
Item_cache_datetime
::
cache_value_int
()
{
{
if
(
!
example
)
if
(
!
example
)
return
;
return
FALSE
;
value_cached
=
TRUE
;
value_cached
=
TRUE
;
/* Assume here that the underlying item will do correct conversion.*/
/* Assume here that the underlying item will do correct conversion.*/
int_value
=
example
->
val_int_result
();
int_value
=
example
->
val_int_result
();
null_value
=
example
->
null_value
;
null_value
=
example
->
null_value
;
unsigned_flag
=
example
->
unsigned_flag
;
unsigned_flag
=
example
->
unsigned_flag
;
return
TRUE
;
}
}
...
@@ -7316,8 +7317,8 @@ void Item_cache_datetime::store(Item *item, longlong val_arg)
...
@@ -7316,8 +7317,8 @@ void Item_cache_datetime::store(Item *item, longlong val_arg)
String
*
Item_cache_datetime
::
val_str
(
String
*
str
)
String
*
Item_cache_datetime
::
val_str
(
String
*
str
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
str_value_cached
)
if
(
!
str_value_cached
&&
!
cache_value
()
)
cache_value
()
;
return
NULL
;
return
&
str_value
;
return
&
str_value
;
}
}
...
@@ -7325,8 +7326,8 @@ String *Item_cache_datetime::val_str(String *str)
...
@@ -7325,8 +7326,8 @@ String *Item_cache_datetime::val_str(String *str)
my_decimal
*
Item_cache_datetime
::
val_decimal
(
my_decimal
*
decimal_val
)
my_decimal
*
Item_cache_datetime
::
val_decimal
(
my_decimal
*
decimal_val
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
value_cached
)
if
(
!
value_cached
&&
!
cache_value_int
()
)
cache_value_int
()
;
return
NULL
;
int2my_decimal
(
E_DEC_FATAL_ERROR
,
int_value
,
unsigned_flag
,
decimal_val
);
int2my_decimal
(
E_DEC_FATAL_ERROR
,
int_value
,
unsigned_flag
,
decimal_val
);
return
decimal_val
;
return
decimal_val
;
}
}
...
@@ -7334,16 +7335,16 @@ my_decimal *Item_cache_datetime::val_decimal(my_decimal *decimal_val)
...
@@ -7334,16 +7335,16 @@ my_decimal *Item_cache_datetime::val_decimal(my_decimal *decimal_val)
double
Item_cache_datetime
::
val_real
()
double
Item_cache_datetime
::
val_real
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
value_cached
)
if
(
!
value_cached
&&
!
cache_value_int
()
)
cache_value_int
()
;
return
0.0
;
return
(
double
)
int_value
;
return
(
double
)
int_value
;
}
}
longlong
Item_cache_datetime
::
val_int
()
longlong
Item_cache_datetime
::
val_int
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
if
(
!
value_cached
)
if
(
!
value_cached
&&
!
cache_value_int
()
)
cache_value_int
()
;
return
0
;
return
int_value
;
return
int_value
;
}
}
...
...
sql/item.h
View file @
5606aed1
...
@@ -3177,7 +3177,7 @@ public:
...
@@ -3177,7 +3177,7 @@ public:
completely relies on the ability of the underlying item to do the
completely relies on the ability of the underlying item to do the
correct conversion.
correct conversion.
*/
*/
void
cache_value_int
();
bool
cache_value_int
();
bool
cache_value
();
bool
cache_value
();
};
};
...
...
sql/item_sum.cc
View file @
5606aed1
...
@@ -1207,6 +1207,7 @@ void Item_sum_hybrid::setup(Item *item, Item *value_arg)
...
@@ -1207,6 +1207,7 @@ void Item_sum_hybrid::setup(Item *item, Item *value_arg)
{
{
value
=
Item_cache
::
get_cache
(
item
);
value
=
Item_cache
::
get_cache
(
item
);
value
->
setup
(
item
);
value
->
setup
(
item
);
if
(
value_arg
)
value
->
store
(
value_arg
);
value
->
store
(
value_arg
);
cmp
=
new
Arg_comparator
();
cmp
=
new
Arg_comparator
();
cmp
->
set_cmp_func
(
this
,
args
,
(
Item
**
)
&
value
,
FALSE
);
cmp
->
set_cmp_func
(
this
,
args
,
(
Item
**
)
&
value
,
FALSE
);
...
...
sql/item_timefunc.cc
View file @
5606aed1
...
@@ -876,12 +876,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
...
@@ -876,12 +876,7 @@ static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
const
char
*
start
=
str
;
const
char
*
start
=
str
;
for
(
value
=
0
;
str
!=
end
&&
my_isdigit
(
cs
,
*
str
)
;
str
++
)
for
(
value
=
0
;
str
!=
end
&&
my_isdigit
(
cs
,
*
str
)
;
str
++
)
value
=
value
*
LL
(
10
)
+
(
longlong
)
(
*
str
-
'0'
);
value
=
value
*
LL
(
10
)
+
(
longlong
)
(
*
str
-
'0'
);
if
(
transform_msec
&&
i
==
count
-
1
)
// microseconds always last
msec_length
=
6
-
(
str
-
start
);
{
int
msec_length
=
6
-
(
str
-
start
);
if
(
msec_length
>
0
)
value
*=
(
long
)
log_10_int
[
msec_length
];
}
values
[
i
]
=
value
;
values
[
i
]
=
value
;
while
(
str
!=
end
&&
!
my_isdigit
(
cs
,
*
str
))
while
(
str
!=
end
&&
!
my_isdigit
(
cs
,
*
str
))
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