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
7efcc279
Commit
7efcc279
authored
Nov 20, 2021
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27072 Subquery using the ALL keyword on date columns produces a wrong result
parent
81d7adb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
mysql-test/r/type_date.result
mysql-test/r/type_date.result
+12
-0
mysql-test/t/type_date.test
mysql-test/t/type_date.test
+9
-0
sql/sql_class.cc
sql/sql_class.cc
+1
-1
No files found.
mysql-test/r/type_date.result
View file @
7efcc279
...
...
@@ -932,5 +932,17 @@ Warning 1292 Incorrect datetime value: '1995.0000000'
Note 1003 select `test`.`t1`.`f` AS `f` from `test`.`t1` where '0000-00-00' between `test`.`t1`.`f` and <cache>('2012-12-12')
DROP TABLE t1;
#
# MDEV-27072 Subquery using the ALL keyword on date columns produces a wrong result
#
CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('2021-11-17'), ('2021-10-17'),('2022-11-17'), ('2020-10-17');
SELECT * FROM t1 WHERE d >= ALL (SELECT * FROM t1);
d
2022-11-17
SELECT * FROM t1 WHERE d <= ALL (SELECT * FROM t1);
d
2020-10-17
DROP TABLE t1;
#
# End of 10.2 tests
#
mysql-test/t/type_date.test
View file @
7efcc279
...
...
@@ -647,6 +647,15 @@ INSERT INTO t1 VALUES ('2020-01-01'),('2020-01-02');
EXPLAIN
EXTENDED
SELECT
*
FROM
t1
WHERE
1995.0000000
BETWEEN
f
AND
'2012-12-12'
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-27072 Subquery using the ALL keyword on date columns produces a wrong result
--
echo
#
CREATE
TABLE
t1
(
d
DATE
);
INSERT
INTO
t1
VALUES
(
'2021-11-17'
),
(
'2021-10-17'
),(
'2022-11-17'
),
(
'2020-10-17'
);
SELECT
*
FROM
t1
WHERE
d
>=
ALL
(
SELECT
*
FROM
t1
);
SELECT
*
FROM
t1
WHERE
d
<=
ALL
(
SELECT
*
FROM
t1
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.2 tests
...
...
sql/sql_class.cc
View file @
7efcc279
...
...
@@ -3479,7 +3479,7 @@ bool select_max_min_finder_subselect::cmp_str()
but added for safety
*/
val1
=
cache
->
val_str
(
&
buf1
);
val2
=
maxmin
->
val_str
(
&
buf
1
);
val2
=
maxmin
->
val_str
(
&
buf
2
);
/* Ignore NULLs for ANY and keep them for ALL subqueries */
if
(
cache
->
null_value
)
...
...
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