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
27f11688
Commit
27f11688
authored
Jul 21, 2007
by
gshchepa/uchum@gleb.loc
Browse files
Options
Browse Files
Download
Plain Diff
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.1-opt
parents
d53374a0
e50e8c94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
mysql-test/r/cast.result
mysql-test/r/cast.result
+11
-0
mysql-test/t/cast.test
mysql-test/t/cast.test
+9
-0
sql/item_timefunc.cc
sql/item_timefunc.cc
+1
-4
No files found.
mysql-test/r/cast.result
View file @
27f11688
...
...
@@ -403,4 +403,15 @@ hex(cast('a' as binary(2)))
select hex(cast('a' as char(2) binary));
hex(cast('a' as char(2) binary))
61
CREATE TABLE t1 (d1 datetime);
INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL),
('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00');
SELECT cast(date(d1) as signed) FROM t1;
cast(date(d1) as signed)
20070719
NULL
20070719
NULL
20070719
drop table t1;
End of 5.0 tests
mysql-test/t/cast.test
View file @
27f11688
...
...
@@ -237,4 +237,13 @@ select hex(cast('a' as char(2) binary));
select
hex
(
cast
(
'a'
as
binary
(
2
)));
select
hex
(
cast
(
'a'
as
char
(
2
)
binary
));
#
# Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
#
CREATE
TABLE
t1
(
d1
datetime
);
INSERT
INTO
t1
(
d1
)
VALUES
(
'2007-07-19 08:30:00'
),
(
NULL
),
(
'2007-07-19 08:34:00'
),
(
NULL
),
(
'2007-07-19 08:36:00'
);
SELECT
cast
(
date
(
d1
)
as
signed
)
FROM
t1
;
drop
table
t1
;
--
echo
End
of
5.0
tests
sql/item_timefunc.cc
View file @
27f11688
...
...
@@ -2534,11 +2534,8 @@ longlong Item_date_typecast::val_int()
{
DBUG_ASSERT
(
fixed
==
1
);
MYSQL_TIME
ltime
;
if
(
args
[
0
]
->
get_date
(
&
ltime
,
TIME_FUZZY_DATE
))
{
null_value
=
1
;
if
((
null_value
=
args
[
0
]
->
get_date
(
&
ltime
,
TIME_FUZZY_DATE
)))
return
0
;
}
return
(
longlong
)
(
ltime
.
year
*
10000L
+
ltime
.
month
*
100
+
ltime
.
day
);
}
...
...
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