apache / apache/incubator-seata

BUG: `TINYINT(1)` fields in `MYSQL` are parsed as `BIT`, resulting in the value in `UNDO_LOG` is not equals the value in db.

Open
#6,064 0 comments 0 reactions 1 assignee Claimed by @wangliang181230 View on GitHub
type: bug
Dominant language
Java
Stars
26k
Forks
8.8k
Avg merge
1d 8h
Merged PRs (30d)
4

Description

- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.

### Ⅰ. Issue Description
`TINYINT(1)` fields in `MYSQL` are parsed as `BIT`, resulting in the value in `UNDO_LOG` is not equals the value in db.
在MYSQL中类型为 `TINYINT(1)` 的字段,被解析为 `BIT` 类型,导致保存进 `UNDO_LOG` 中的值为布尔型不等于数据库中的值,最终,导致回滚后的值,要么是0,要么是1。

**表结构截图:**
![8176bd1e3fe398df9b3c852475204122](https://github.com/seata/seata/assets/1527893/a2412041-da65-4ad6-8a0f-1c7d02fd9045)

**DEBUG字段类型截图:**
![b8b10718b22d37f5d723e6de07b60bd1](https://github.com/seata/seata/assets/1527893/49a0ce2d-e3bf-4029-80e4-73b77af5782e)

**DEBUG获取到的字段值截图:**
![图片](https://github.com/seata/seata/assets/1527893/1624b16a-757d-48e0-b3c8-cfc16c9ec0f0)

### Ⅱ. Describe what happened

If there is an exception, please attach the exception trace:

```
Just paste your stack trace here!
```

### Ⅲ. Describe what you expected to happen

### Ⅳ. How to reproduce it (as minimally and precisely as possible)

1. xxx
2. xxx
3. xxx

Minimal yet complete reproducer code (or URL to code):

### Ⅴ. Anything else we need to know?

### Ⅵ. Environment:

- JDK version(e.g. `java -version`):
- Seata client/server version: 1.8.0
- Database version: MYSQL
- OS(e.g. `uname -a`):
- Others:

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.