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
3ebd2e55
Commit
3ebd2e55
authored
May 04, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B27807-5.0-opt
parents
ad06c4c0
74c794d0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
mysql-test/r/cast.result
mysql-test/r/cast.result
+6
-0
mysql-test/t/cast.test
mysql-test/t/cast.test
+6
-0
sql/item_func.cc
sql/item_func.cc
+4
-2
No files found.
mysql-test/r/cast.result
View file @
3ebd2e55
...
@@ -351,6 +351,12 @@ DROP TABLE t1;
...
@@ -351,6 +351,12 @@ DROP TABLE t1;
select isnull(date(NULL)), isnull(cast(NULL as DATE));
select isnull(date(NULL)), isnull(cast(NULL as DATE));
isnull(date(NULL)) isnull(cast(NULL as DATE))
isnull(date(NULL)) isnull(cast(NULL as DATE))
1 1
1 1
SELECT CAST(cast('01-01-01' as date) AS UNSIGNED);
CAST(cast('01-01-01' as date) AS UNSIGNED)
20010101
SELECT CAST(cast('01-01-01' as date) AS SIGNED);
CAST(cast('01-01-01' as date) AS SIGNED)
20010101
End of 4.1 tests
End of 4.1 tests
select cast('1.2' as decimal(3,2));
select cast('1.2' as decimal(3,2));
cast('1.2' as decimal(3,2))
cast('1.2' as decimal(3,2))
...
...
mysql-test/t/cast.test
View file @
3ebd2e55
...
@@ -182,6 +182,12 @@ DROP TABLE t1;
...
@@ -182,6 +182,12 @@ DROP TABLE t1;
select
isnull
(
date
(
NULL
)),
isnull
(
cast
(
NULL
as
DATE
));
select
isnull
(
date
(
NULL
)),
isnull
(
cast
(
NULL
as
DATE
));
#
# Bug#23656: Wrong result of CAST from DATE to int
#
SELECT
CAST
(
cast
(
'01-01-01'
as
date
)
AS
UNSIGNED
);
SELECT
CAST
(
cast
(
'01-01-01'
as
date
)
AS
SIGNED
);
--
echo
End
of
4.1
tests
--
echo
End
of
4.1
tests
...
...
sql/item_func.cc
View file @
3ebd2e55
...
@@ -947,7 +947,8 @@ longlong Item_func_signed::val_int()
...
@@ -947,7 +947,8 @@ longlong Item_func_signed::val_int()
longlong
value
;
longlong
value
;
int
error
;
int
error
;
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
)
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
||
args
[
0
]
->
result_as_longlong
())
{
{
value
=
args
[
0
]
->
val_int
();
value
=
args
[
0
]
->
val_int
();
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
null_value
;
...
@@ -986,7 +987,8 @@ longlong Item_func_unsigned::val_int()
...
@@ -986,7 +987,8 @@ longlong Item_func_unsigned::val_int()
my_decimal2int
(
E_DEC_FATAL_ERROR
,
dec
,
1
,
&
value
);
my_decimal2int
(
E_DEC_FATAL_ERROR
,
dec
,
1
,
&
value
);
return
value
;
return
value
;
}
}
else
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
)
else
if
(
args
[
0
]
->
cast_to_int_type
()
!=
STRING_RESULT
||
args
[
0
]
->
result_as_longlong
())
{
{
value
=
args
[
0
]
->
val_int
();
value
=
args
[
0
]
->
val_int
();
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
null_value
;
...
...
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