-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.impact/wrong-resultseverity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
The following test case has two equivalent queries, one in normal format, and another one in prepared statement, but they return different result.
CREATE TABLE t0(c2 BOOL);
INSERT INTO t0(c2) VALUES (false), (true);
SELECT t0.c2 FROM t0 GROUP BY t0.c2 HAVING BIT_AND(BINARY (- (-1))); -- 0, 1
SET @a = -1;
PREPARE prepare_query FROM 'SELECT t0.c2 FROM t0 GROUP BY t0.c2 HAVING BIT_AND(BINARY (- (?)))';
EXECUTE prepare_query USING @a; -- empty result
2. What did you expect to see? (Required)
The prepared statement should also return 0 and 1, which is the result of this test case in MySQL
3. What did you see instead (Required)
The prepared statement returns empty result.
4. What is your TiDB version? (Required)
tidb_version()
Release Version: v7.5.1\nEdition: Community\nGit Commit Hash: 7d16cc79e81bbf573124df3fd9351c26963f3e70\nGit Branch: heads/refs/tags/v7.5.1\nUTC Build Time: 2024-02-27 14:28:32\nGoVersion: go1.21.6\nRace Enabled: false\nCheck Table Before Drop: false\nStore: unistore
Metadata
Metadata
Assignees
Labels
affects-7.5This bug affects the 7.5.x(LTS) versions.This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.This bug affects the 8.5.x(LTS) versions.impact/wrong-resultseverity/moderatesig/plannerSIG: PlannerSIG: Plannertype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.