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
651a142a
Commit
651a142a
authored
Mar 25, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND)
parent
bd2ae787
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
11 deletions
+45
-11
mysql-test/r/partition_datatype.result
mysql-test/r/partition_datatype.result
+8
-8
mysql-test/r/type_timestamp.result
mysql-test/r/type_timestamp.result
+17
-0
mysql-test/suite/vcol/r/vcol_misc.result
mysql-test/suite/vcol/r/vcol_misc.result
+2
-2
mysql-test/t/type_timestamp.test
mysql-test/t/type_timestamp.test
+17
-0
sql/field.cc
sql/field.cc
+1
-1
No files found.
mysql-test/r/partition_datatype.result
View file @
651a142a
...
...
@@ -699,7 +699,7 @@ a tz
2038-01-19 03:14:06 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1264 Out of range value for column 'a' at row 34
Warning 1264 Out of range value for column 'a' at row 35
SELECT MIN(a), MAX(a) FROM t2;
...
...
@@ -782,9 +782,9 @@ a tz
2011-10-30 00:00:02 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
SELECT MIN(a), MAX(a) FROM t2;
MIN(a) MAX(a)
1970-01-01 00:00:01 2038-01-19 03:14:06
...
...
@@ -1179,7 +1179,7 @@ a tz
2038-01-19 06:14:06 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, 1, a);
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 8
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 9
Warning 1264 Out of range value for column 'a' at row 34
...
...
@@ -1264,9 +1264,9 @@ a tz
2011-10-30 03:00:02 Moscow
UPDATE t2 SET a = TIMESTAMPADD(SECOND, -1, a);
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 18
Warning 1299 Invalid TIMESTAMP value in column 'a' at row 19
SELECT MIN(a), MAX(a) FROM t2;
...
...
mysql-test/r/type_timestamp.result
View file @
651a142a
...
...
@@ -691,3 +691,20 @@ drop function f1;
set timestamp=0;
SET time_zone=DEFAULT;
End of 10.0 tests
#
# Start of 10.1 tests
#
#
# MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND)
#
CREATE TABLE t1 (a TIMESTAMP);
INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
SELECT DATE_ADD(a, INTERVAL 10 SECOND) FROM t1;
DATE_ADD(a, INTERVAL 10 SECOND)
NULL
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 00:00:00'
DROP TABLE t1;
#
# End of 10.1 tests
#
mysql-test/suite/vcol/r/vcol_misc.result
View file @
651a142a
...
...
@@ -188,10 +188,10 @@ tsv TIMESTAMP AS (ADDDATE(ts, INTERVAL 1 DAY)) VIRTUAL
) ENGINE=MyISAM;
INSERT INTO t1 (tsv) VALUES (DEFAULT);
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
INSERT DELAYED INTO t1 (tsv) VALUES (DEFAULT);
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00'
Warning 1292 Incorrect datetime value: '0000-00-00
00:00:00
'
FLUSH TABLES;
SELECT COUNT(*) FROM t1;
COUNT(*)
...
...
mysql-test/t/type_timestamp.test
View file @
651a142a
...
...
@@ -493,3 +493,20 @@ set timestamp=0;
SET
time_zone
=
DEFAULT
;
--
echo
End
of
10.0
tests
--
echo
#
--
echo
# Start of 10.1 tests
--
echo
#
--
echo
#
--
echo
# MDEV-7831 Bad warning for DATE_ADD(timestamp_column, INTERVAL 10 SECOND)
--
echo
#
CREATE
TABLE
t1
(
a
TIMESTAMP
);
INSERT
INTO
t1
VALUES
(
'0000-00-00 00:00:00'
);
SELECT
DATE_ADD
(
a
,
INTERVAL
10
SECOND
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.1 tests
--
echo
#
sql/field.cc
View file @
651a142a
...
...
@@ -4842,7 +4842,7 @@ bool Field_timestamp::get_date(MYSQL_TIME *ltime, ulonglong fuzzydate)
{
/* Zero time is "000000" */
if
(
fuzzydate
&
TIME_NO_ZERO_DATE
)
return
1
;
bzero
((
char
*
)
ltime
,
sizeof
(
*
ltime
)
);
set_zero_time
(
ltime
,
MYSQL_TIMESTAMP_DATETIME
);
}
else
{
...
...
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