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
f4b27400
Commit
f4b27400
authored
Apr 19, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17299 Assertion `maybe_null' failed in make_sortkey
parent
056b6fe1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+25
-0
mysql-test/t/type_date.test
mysql-test/t/type_date.test
+14
-0
sql/item_func.cc
sql/item_func.cc
+2
-0
No files found.
mysql-test/r/type_date.result
View file @
f4b27400
...
...
@@ -854,5 +854,30 @@ d COUNT(*)
NULL 2
DROP TABLE t1;
#
# MDEV-17299 Assertion `maybe_null' failed in make_sortkey
#
CREATE TABLE t1 (pk int NOT NULL, d1 date, d2 date NOT NULL);
INSERT INTO t1 values (1,'2018-06-22','2018-06-22'),(2,'2018-07-11','2018-07-11');
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
FROM v1 GROUP BY greatest(pk, 0, d2);
group_concat(d1/(CASE 'b' WHEN 'j' THEN 'c' END))
NULL
Warnings:
Warning 1292 Incorrect datetime value: '1' for column 'pk' at row 1
Warning 1292 Incorrect datetime value: '2' for column 'pk' at row 1
Warning 1292 Incorrect datetime value: '1' for column 'pk' at row 1
Warning 1292 Incorrect datetime value: '1' for column 'pk' at row 1
Warning 1292 Incorrect datetime value: '2' for column 'pk' at row 2
CREATE TABLE t2 AS SELECT greatest(pk, 0, d2) AS c1 FROM t1 LIMIT 0;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`c1` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.1 tests
#
mysql-test/t/type_date.test
View file @
f4b27400
...
...
@@ -585,6 +585,20 @@ INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
SELECT
d
,
COUNT
(
*
)
FROM
t1
GROUP
BY
d
WITH
ROLLUP
HAVING
CASE
d
WHEN
'2017-05-25'
THEN
0
ELSE
1
END
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-17299 Assertion `maybe_null' failed in make_sortkey
--
echo
#
CREATE
TABLE
t1
(
pk
int
NOT
NULL
,
d1
date
,
d2
date
NOT
NULL
);
INSERT
INTO
t1
values
(
1
,
'2018-06-22'
,
'2018-06-22'
),(
2
,
'2018-07-11'
,
'2018-07-11'
);
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
SELECT
group_concat
(
d1
/
(
CASE
'b'
WHEN
'j'
THEN
'c'
END
))
FROM
v1
GROUP
BY
greatest
(
pk
,
0
,
d2
);
CREATE
TABLE
t2
AS
SELECT
greatest
(
pk
,
0
,
d2
)
AS
c1
FROM
t1
LIMIT
0
;
SHOW
CREATE
TABLE
t2
;
DROP
TABLE
t2
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.1 tests
...
...
sql/item_func.cc
View file @
f4b27400
...
...
@@ -2794,6 +2794,8 @@ void Item_func_min_max::fix_length_and_dec()
switch
(
tmp_cmp_type
)
{
case
TIME_RESULT
:
// At least one temporal argument was found.
if
(
temporal_type_count
<
arg_count
)
maybe_null
=
true
;
// Non-temporal-to-temporal conversion can return NULL
collation
.
set_numeric
();
set_handler_by_field_type
(
temporal_field_type
);
if
(
is_temporal_type_with_time
(
temporal_field_type
))
...
...
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