--source include/have_falcon.inc
--source include/have_utf8.inc

#
# Bug #23689: Falcon: searches fail if exotic collation and index exists
#
--echo *** Bug #23689 ***
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
SET NAMES utf8;

SET STORAGE_ENGINE = MyISAM;

CREATE TABLE t1 (a char(5) character set latin1 collate latin1_german2_ci);
INSERT INTO t1 VALUES ('UE'), ('ü'), (0xDC);
SELECT hex(a) FROM t1 WHERE a = 'UE';
SELECT hex(a) FROM t1 WHERE a = 'ü';
SELECT hex(a) FROM t1 WHERE a = 0xDC;
CREATE INDEX i1 on t1 (a);
SELECT hex(a) FROM t1 WHERE a = 'UE';
SELECT hex(a) FROM t1 WHERE a = 'ü';
SELECT hex(a) FROM t1 WHERE a = 0xDC;
DROP TABLE t1;

SET STORAGE_ENGINE = Falcon;

CREATE TABLE t1 (a char(5) character set latin1 collate latin1_german2_ci);
INSERT INTO t1 VALUES ('UE'), ('ü'), (0xDC);
SELECT hex(a) FROM t1 WHERE a = 'UE';
SELECT hex(a) FROM t1 WHERE a = 'ü';
SELECT hex(a) FROM t1 WHERE a = 0xDC;
CREATE INDEX i1 on t1 (a);
SELECT hex(a) FROM t1 WHERE a = 'UE';
SELECT hex(a) FROM t1 WHERE a = 'ü';
SELECT hex(a) FROM t1 WHERE a = 0xDC;

# Final cleanup.
DROP TABLE t1;
SET NAMES default;
