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
17265468
Commit
17265468
authored
May 11, 2007
by
holyfoot/hf@mysql.com/hfmain.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merging fixes
parent
069314ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
mysql-test/r/type_datetime.result
mysql-test/r/type_datetime.result
+2
-2
mysql-test/t/type_datetime.test
mysql-test/t/type_datetime.test
+1
-1
sql/item_func.cc
sql/item_func.cc
+6
-3
sql/my_decimal.h
sql/my_decimal.h
+1
-0
No files found.
mysql-test/r/type_datetime.result
View file @
17265468
...
...
@@ -328,8 +328,8 @@ least(cast('01-01-01' as datetime), '01-01-02') + 0
select cast(least(cast('01-01-01' as datetime), '01-01-02') as signed);
cast(least(cast('01-01-01' as datetime), '01-01-02') as signed)
20010101000000
select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal);
cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal)
select cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal
(20,2)
);
cast(least(cast('01-01-01' as datetime), '01-01-02') as decimal
(20,2)
)
20010101000000.00
DROP PROCEDURE IF EXISTS test27759 ;
CREATE PROCEDURE test27759()
...
...
mysql-test/t/type_datetime.test
View file @
17265468
...
...
@@ -207,7 +207,7 @@ select least(cast('01-01-01' as date), '01-01-02') + 0;
select
greatest
(
cast
(
'01-01-01'
as
date
),
'01-01-02'
)
+
0
;
select
least
(
cast
(
'01-01-01'
as
datetime
),
'01-01-02'
)
+
0
;
select
cast
(
least
(
cast
(
'01-01-01'
as
datetime
),
'01-01-02'
)
as
signed
);
select
cast
(
least
(
cast
(
'01-01-01'
as
datetime
),
'01-01-02'
)
as
decimal
);
select
cast
(
least
(
cast
(
'01-01-01'
as
datetime
),
'01-01-02'
)
as
decimal
(
20
,
2
)
);
--
disable_warnings
DROP
PROCEDURE
IF
EXISTS
test27759
;
--
enable_warnings
...
...
sql/item_func.cc
View file @
17265468
...
...
@@ -1051,6 +1051,8 @@ my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
{
my_decimal
tmp_buf
,
*
tmp
=
args
[
0
]
->
val_decimal
(
&
tmp_buf
);
bool
sign
;
uint
precision
;
if
((
null_value
=
args
[
0
]
->
null_value
))
return
NULL
;
my_decimal_round
(
E_DEC_FATAL_ERROR
,
tmp
,
decimals
,
FALSE
,
dec
);
...
...
@@ -1063,9 +1065,11 @@ my_decimal *Item_decimal_typecast::val_decimal(my_decimal *dec)
goto
err
;
}
}
if
(
max_length
-
2
-
decimals
<
(
uint
)
my_decimal_intg
(
dec
))
precision
=
my_decimal_length_to_precision
(
max_length
,
decimals
,
unsigned_flag
);
if
(
precision
-
decimals
<
(
uint
)
my_decimal_intg
(
dec
))
{
max_my_decimal
(
dec
,
max_length
-
2
,
decimals
);
max_my_decimal
(
dec
,
precision
,
decimals
);
dec
->
sign
(
sign
);
goto
err
;
}
...
...
@@ -1084,7 +1088,6 @@ void Item_decimal_typecast::print(String *str)
{
char
len_buf
[
20
*
3
+
1
];
char
*
end
;
CHARSET_INFO
*
cs
=
str
->
charset
();
uint
precision
=
my_decimal_length_to_precision
(
max_length
,
decimals
,
unsigned_flag
);
...
...
sql/my_decimal.h
View file @
17265468
...
...
@@ -395,6 +395,7 @@ int my_decimal_intg(const my_decimal *a)
}
inline
void
my_decimal_trim
(
ulong
*
precision
,
uint
*
scale
)
{
if
(
!
(
*
precision
)
&&
!
(
*
scale
))
...
...
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