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
79f6e6f6
Commit
79f6e6f6
authored
Mar 18, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lp:737458 Casting dates and times into integers works differently in 5.1-micro
better default for Field::cast_to_int_type()
parent
ffdf98f2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
mysql-test/r/cast.result
mysql-test/r/cast.result
+6
-0
mysql-test/t/cast.test
mysql-test/t/cast.test
+9
-0
sql/field.h
sql/field.h
+1
-1
No files found.
mysql-test/r/cast.result
View file @
79f6e6f6
...
@@ -452,3 +452,9 @@ SELECT CONVERT(t2.a USING UTF8) FROM t1, t1 t2 LIMIT 1
...
@@ -452,3 +452,9 @@ SELECT CONVERT(t2.a USING UTF8) FROM t1, t1 t2 LIMIT 1
1
1
DROP TABLE t1;
DROP TABLE t1;
End of 5.1 tests
End of 5.1 tests
create table t1 (f1 time, f2 date, f3 datetime);
insert into t1 values ('11:22:33','2011-12-13','2011-12-13 11:22:33');
select cast(f1 as unsigned), cast(f2 as unsigned), cast(f3 as unsigned) from t1;
cast(f1 as unsigned) cast(f2 as unsigned) cast(f3 as unsigned)
112233 20111213 20111213112233
drop table t1;
mysql-test/t/cast.test
View file @
79f6e6f6
...
@@ -284,3 +284,12 @@ DROP TABLE t1;
...
@@ -284,3 +284,12 @@ DROP TABLE t1;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
#
# lp:737458 Casting dates and times into integers works differently in 5.1-micro
#
create
table
t1
(
f1
time
,
f2
date
,
f3
datetime
);
insert
into
t1
values
(
'11:22:33'
,
'2011-12-13'
,
'2011-12-13 11:22:33'
);
select
cast
(
f1
as
unsigned
),
cast
(
f2
as
unsigned
),
cast
(
f3
as
unsigned
)
from
t1
;
drop
table
t1
;
sql/field.h
View file @
79f6e6f6
...
@@ -149,7 +149,7 @@ class Field
...
@@ -149,7 +149,7 @@ class Field
virtual
bool
str_needs_quotes
()
{
return
FALSE
;
}
virtual
bool
str_needs_quotes
()
{
return
FALSE
;
}
virtual
Item_result
result_type
()
const
=
0
;
virtual
Item_result
result_type
()
const
=
0
;
virtual
Item_result
cmp_type
()
const
{
return
result_type
();
}
virtual
Item_result
cmp_type
()
const
{
return
result_type
();
}
virtual
Item_result
cast_to_int_type
()
const
{
return
result
_type
();
}
virtual
Item_result
cast_to_int_type
()
const
{
return
cmp
_type
();
}
static
bool
type_can_have_key_part
(
enum_field_types
);
static
bool
type_can_have_key_part
(
enum_field_types
);
static
enum_field_types
field_type_merge
(
enum_field_types
,
enum_field_types
);
static
enum_field_types
field_type_merge
(
enum_field_types
,
enum_field_types
);
static
Item_result
result_merge_type
(
enum_field_types
);
static
Item_result
result_merge_type
(
enum_field_types
);
...
...
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