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
da5769fe
Commit
da5769fe
authored
Mar 22, 2007
by
holyfoot/hf@mysql.com/hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/hf/work/mrg/mysql-4.1-opt
into mysql.com:/home/hf/work/mrg/mysql-5.0-opt
parents
1f9fd51c
e0f0507f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
mysql-test/r/type_datetime.result
mysql-test/r/type_datetime.result
+3
-0
mysql-test/t/type_datetime.test
mysql-test/t/type_datetime.test
+6
-0
sql/item_timefunc.h
sql/item_timefunc.h
+7
-0
No files found.
mysql-test/r/type_datetime.result
View file @
da5769fe
...
@@ -168,6 +168,9 @@ dt
...
@@ -168,6 +168,9 @@ dt
0000-00-00 00:00:00
0000-00-00 00:00:00
0000-00-00 00:00:00
0000-00-00 00:00:00
drop table t1;
drop table t1;
select cast('2006-12-05 22:10:10' as datetime) + 0;
cast('2006-12-05 22:10:10' as datetime) + 0
20061205221010.000000
CREATE TABLE t1(a DATETIME NOT NULL);
CREATE TABLE t1(a DATETIME NOT NULL);
INSERT INTO t1 VALUES ('20060606155555');
INSERT INTO t1 VALUES ('20060606155555');
SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555");
SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555");
...
...
mysql-test/t/type_datetime.test
View file @
da5769fe
...
@@ -113,6 +113,12 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
...
@@ -113,6 +113,12 @@ insert into t1 values ("00-00-00"), ("00-00-00 00:00:00");
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #16546 DATETIME+0 not always coerced the same way
#
select
cast
(
'2006-12-05 22:10:10'
as
datetime
)
+
0
;
# End of 4.1 tests
# End of 4.1 tests
#
#
...
...
sql/item_timefunc.h
View file @
da5769fe
...
@@ -847,12 +847,19 @@ public:
...
@@ -847,12 +847,19 @@ public:
String
*
val_str
(
String
*
str
);
String
*
val_str
(
String
*
str
);
const
char
*
cast_type
()
const
{
return
"datetime"
;
}
const
char
*
cast_type
()
const
{
return
"datetime"
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_DATETIME
;
}
enum_field_types
field_type
()
const
{
return
MYSQL_TYPE_DATETIME
;
}
void
fix_length_and_dec
()
{
Item_typecast_maybe_null
::
fix_length_and_dec
();
decimals
=
DATETIME_DEC
;
}
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
Field
*
tmp_table_field
(
TABLE
*
t_arg
)
{
{
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
&
my_charset_bin
));
return
(
new
Field_datetime
(
maybe_null
,
name
,
t_arg
,
&
my_charset_bin
));
}
}
bool
result_as_longlong
()
{
return
TRUE
;
}
bool
result_as_longlong
()
{
return
TRUE
;
}
longlong
val_int
();
longlong
val_int
();
double
val
()
{
return
(
double
)
val_int
();
}
my_decimal
*
val_decimal
(
my_decimal
*
decimal_value
)
my_decimal
*
val_decimal
(
my_decimal
*
decimal_value
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
...
...
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