pingcap / pingcap/tidb

Session variable assignment does not work with bit(32)

Open
#47,101 2 comments 0 reactions 0 assignees View on GitHub
severity/moderate sig/planner type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
my:root@127.0.0.1:37481=> create table table5 (id bit(32));
CREATE TABLE
my:root@127.0.0.1:37481=> insert into table5 values (2);
INSERT 1
my:root@127.0.0.1:37481=> select * from table5;
id
------------------
\x00\x00\x00\x02
(1 row)

my:root@127.0.0.1:37481=> set @id=(select id from table5);
SET
my:root@127.0.0.1:37481=> select @id;
@id

0
(1 row)

### 2. What did you expect to see? (Required)
I expect the see the original value of "2" is returned from "select @id".

### 3. What did you see instead (Required)
I saw "0" was returned.
### 4. What is your TiDB version? (Required)

my:root@127.0.0.1:37481=> select tidb_version();
tidb_version()
-----------------------------------------------------------
Release Version: v7.3.0 +
Edition: Community +
Git Commit Hash: 40b72e7a9a4fc9670d4c5d974dd503a3c6097471+
Git Branch: heads/refs/tags/v7.3.0 +
UTC Build Time: 2023-08-08 10:08:14 +
GoVersion: go1.20.7 +
Race Enabled: false +
Check Table Before Drop: false +
Store: tikv

Note: I am using TiDB playground.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.