Consider the following test case. It is unexpected that the third query returns an empty result since the second query shows that the expression should be evaluated to 1, and the third query should return the row in the table. Note that after removing the index, the result will be as expected. Thus I suppose the result is unexpected.
This could also reproduced in MySQL. Kindly let me know if it is regarded as expected.
DROP DATABASE IF EXISTS db0;
CREATE DATABASE IF NOT EXISTS db0;
USE db0;
CREATE TABLE t0(c1 BIT);
INSERT INTO t0(c1) VALUES ('');
CREATE INDEX t0i0 ON t0(c1); -- index is needed to trigger it
SELECT * FROM t0; -- 0x00
SELECT ((t0.c1='a')) FROM t0; -- 1
SELECT * FROM t0 WHERE ((t0.c1='a'));
-- Expected: 0x00 (if the second query is expected)
-- Actual: empty
Overview of the Issue
Consider the following test case. It is unexpected that the third query returns an empty result since the second query shows that the expression should be evaluated to 1, and the third query should return the row in the table. Note that after removing the index, the result will be as expected. Thus I suppose the result is unexpected.
This could also reproduced in MySQL. Kindly let me know if it is regarded as expected.
Reproduction Steps
Start the Vittestserver docker container according to https://vitess.io/docs/21.0/get-started/vttestserver-docker-image/#example
Execute the following SQL using a MySQL client
Binary Version
Operating System and Environment details
Log Fragments