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
ce6505f8
Commit
ce6505f8
authored
Feb 12, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18447 Assertion `!is_zero_datetime()' failed in Timestamp_or_zero_datetime::tv
parent
9f56dd73
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
mysql-test/main/type_timestamp.result
mysql-test/main/type_timestamp.result
+9
-0
mysql-test/main/type_timestamp.test
mysql-test/main/type_timestamp.test
+8
-0
sql/sql_type.h
sql/sql_type.h
+7
-1
No files found.
mysql-test/main/type_timestamp.result
View file @
ce6505f8
...
...
@@ -1164,5 +1164,14 @@ NULL
NULL
DROP TABLE t1, t2, t3;
#
# MDEV-18447 Assertion `!is_zero_datetime()' failed in Timestamp_or_zero_datetime::tv
#
CREATE TABLE t1 (a TIMESTAMP DEFAULT 0, b TIMESTAMP DEFAULT 0, c TIME DEFAULT 0);
INSERT INTO t1 VALUES (0,0,0);
SELECT c IN (GREATEST(a,b)) FROM t1;
c IN (GREATEST(a,b))
0
DROP TABLE t1;
#
# End of 10.4 tests
#
mysql-test/main/type_timestamp.test
View file @
ce6505f8
...
...
@@ -760,6 +760,14 @@ CREATE TABLE t3 (pk INT PRIMARY KEY, b TIMESTAMP) ENGINE=MyISAM;
SELECT
(
SELECT
b
FROM
t1
LIMIT
1
)
AS
sq
FROM
t2
LEFT
JOIN
t3
USING
(
pk
);
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
# MDEV-18447 Assertion `!is_zero_datetime()' failed in Timestamp_or_zero_datetime::tv
--
echo
#
CREATE
TABLE
t1
(
a
TIMESTAMP
DEFAULT
0
,
b
TIMESTAMP
DEFAULT
0
,
c
TIME
DEFAULT
0
);
INSERT
INTO
t1
VALUES
(
0
,
0
,
0
);
SELECT
c
IN
(
GREATEST
(
a
,
b
))
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.4 tests
...
...
sql/sql_type.h
View file @
ce6505f8
...
...
@@ -2435,6 +2435,12 @@ class Timestamp_or_zero_datetime_native:
length
(
0
);
// safety
}
int
save_in_field
(
Field
*
field
,
uint
decimals
)
const
;
Datetime
to_datetime
(
THD
*
thd
)
const
{
return
is_zero_datetime
()
?
Datetime
()
:
Datetime
(
thd
,
Timestamp_or_zero_datetime
(
*
this
).
tv
());
}
bool
is_zero_datetime
()
const
{
return
length
()
==
0
;
...
...
@@ -2459,7 +2465,7 @@ class Timestamp_or_zero_datetime_native_null: public Timestamp_or_zero_datetime_
Datetime
to_datetime
(
THD
*
thd
)
const
{
return
is_null
()
?
Datetime
()
:
Datetime
(
thd
,
Timestamp_or_zero_datetime
(
*
this
).
tv
()
);
Timestamp_or_zero_datetime_native
::
to_datetime
(
thd
);
}
void
to_TIME
(
THD
*
thd
,
MYSQL_TIME
*
to
)
{
...
...
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