Skip to content

Commit 2029163

Browse files
author
Alexander Barkov
committed
MDEV-8742 Wrong result for SELECT..WHERE view_latin1_swedish_ci_field='a' COLLATE latin1_bin
The fix for MDEV-8749 also fixed MDEV-8742. Just adding the test case from the bug report.
1 parent bf7a2bb commit 2029163

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

mysql-test/r/view.result

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5643,5 +5643,16 @@ a
56435643
DROP VIEW v1;
56445644
DROP TABLE t1;
56455645
#
5646+
# MDEV-8742 Wrong result for SELECT..WHERE view_latin1_swedish_ci_field='a' COLLATE latin1_bin
5647+
#
5648+
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
5649+
INSERT INTO t1 VALUES ('a'),('A');
5650+
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a='a';
5651+
SELECT * FROM v1 WHERE a=_latin1'a' COLLATE latin1_bin;
5652+
a
5653+
a
5654+
DROP VIEW v1;
5655+
DROP TABLE t1;
5656+
#
56465657
# End of 10.1 tests
56475658
#

mysql-test/t/view.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5503,6 +5503,17 @@ SELECT * FROM v1 WHERE a='5' AND a<2;
55035503
DROP VIEW v1;
55045504
DROP TABLE t1;
55055505

5506+
--echo #
5507+
--echo # MDEV-8742 Wrong result for SELECT..WHERE view_latin1_swedish_ci_field='a' COLLATE latin1_bin
5508+
--echo #
5509+
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
5510+
INSERT INTO t1 VALUES ('a'),('A');
5511+
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a='a';
5512+
SELECT * FROM v1 WHERE a=_latin1'a' COLLATE latin1_bin;
5513+
DROP VIEW v1;
5514+
DROP TABLE t1;
5515+
5516+
55065517
--echo #
55075518
--echo # End of 10.1 tests
55085519
--echo #

0 commit comments

Comments
 (0)