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
72c5a8d3
Commit
72c5a8d3
authored
Aug 26, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20417 Assertion `(m_ptr == __null) == item->null_value' failed in VDec::VDec(Item*)
parent
4a490d1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
mysql-test/main/type_timestamp.result
mysql-test/main/type_timestamp.result
+30
-0
mysql-test/main/type_timestamp.test
mysql-test/main/type_timestamp.test
+18
-0
sql/sql_type.h
sql/sql_type.h
+2
-2
No files found.
mysql-test/main/type_timestamp.result
View file @
72c5a8d3
...
...
@@ -1267,5 +1267,35 @@ f
DROP TABLE t1;
SET sql_mode=DEFAULT;
#
# MDEV-20417 Assertion `(m_ptr == __null) == item->null_value' failed in VDec::VDec(Item*)
#
CREATE TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
INSERT IGNORE INTO t1 VALUES ('2001-01-01','2002-01-01'),('2003-01-01','2004-01-01');
SELECT * FROM t1 WHERE DEFAULT(b) - a;
a b
Warnings:
Warning 1916 Got overflow when converting '-20010101000000' to UNSIGNED INT. Value truncated
Warning 1916 Got overflow when converting '-20030101000000' to UNSIGNED INT. Value truncated
SELECT LEFT('', DEFAULT(b)-a) FROM t1;
LEFT('', DEFAULT(b)-a)
Warnings:
Warning 1916 Got overflow when converting '-20010101000000' to UNSIGNED INT. Value truncated
Warning 1916 Got overflow when converting '-20030101000000' to UNSIGNED INT. Value truncated
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP(4), b TIMESTAMP DEFAULT 0) ENGINE=MyISAM;
INSERT IGNORE INTO t1 (a) VALUES ('2001-01-01'),('2003-01-01');
SELECT * FROM t1 WHERE (SELECT MIN(b) FROM t1) - a;
a b
Warnings:
Warning 1916 Got overflow when converting '-20010101000000' to UNSIGNED INT. Value truncated
Warning 1916 Got overflow when converting '-20030101000000' to UNSIGNED INT. Value truncated
SELECT (SELECT MIN(b) FROM t1) - a FROM t1;
(SELECT MIN(b) FROM t1) - a
-20010101000000.0000
-20030101000000.0000
DROP TABLE t1;
#
# End of 10.4 tests
#
mysql-test/main/type_timestamp.test
View file @
72c5a8d3
...
...
@@ -837,6 +837,24 @@ SELECT GREATEST(a,b) AS f FROM t1 ORDER BY 1 DESC;
DROP
TABLE
t1
;
SET
sql_mode
=
DEFAULT
;
--
echo
#
--
echo
# MDEV-20417 Assertion `(m_ptr == __null) == item->null_value' failed in VDec::VDec(Item*)
--
echo
#
CREATE
TABLE
t1
(
a
TIMESTAMP
(
4
),
b
TIMESTAMP
DEFAULT
0
)
ENGINE
=
MyISAM
;
INSERT
IGNORE
INTO
t1
VALUES
(
'2001-01-01'
,
'2002-01-01'
),(
'2003-01-01'
,
'2004-01-01'
);
SELECT
*
FROM
t1
WHERE
DEFAULT
(
b
)
-
a
;
SELECT
LEFT
(
''
,
DEFAULT
(
b
)
-
a
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
TIMESTAMP
(
4
),
b
TIMESTAMP
DEFAULT
0
)
ENGINE
=
MyISAM
;
INSERT
IGNORE
INTO
t1
(
a
)
VALUES
(
'2001-01-01'
),(
'2003-01-01'
);
SELECT
*
FROM
t1
WHERE
(
SELECT
MIN
(
b
)
FROM
t1
)
-
a
;
SELECT
(
SELECT
MIN
(
b
)
FROM
t1
)
-
a
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.4 tests
--
echo
#
sql/sql_type.h
View file @
72c5a8d3
...
...
@@ -2439,7 +2439,7 @@ class Timestamp_or_zero_datetime: protected Timestamp
Datetime
to_datetime
(
THD
*
thd
)
const
{
if
(
is_zero_datetime
())
return
Datetime
();
return
Datetime
::
zero
();
return
Timestamp
::
to_datetime
(
thd
);
}
bool
is_zero_datetime
()
const
{
return
m_is_zero_datetime
;
}
...
...
@@ -2487,7 +2487,7 @@ class Timestamp_or_zero_datetime_native:
Datetime
to_datetime
(
THD
*
thd
)
const
{
return
is_zero_datetime
()
?
Datetime
()
:
Datetime
::
zero
()
:
Datetime
(
thd
,
Timestamp
(
*
this
).
tv
());
}
bool
is_zero_datetime
()
const
...
...
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