The bool type not null allows inserting null values

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: bool 类型 not null允许插入 null 值。

| username: 梦想是个厨子

Under sql_mode set to NO_ENGINE_SUBSTITUTION;
Differences in behavior between TIDB and MySQL

| username: Miracle | Original post link

Is TiDB’s sql_mode inconsistent with MySQL’s?

| username: 梦想是个厨子 | Original post link

I set sql_mode to NO_ENGINE_SUBSTITUTION, but TiDB and MySQL behave inconsistently. I’ve updated the issue with a screenshot.

| username: xingzhenxiang | Original post link

I didn’t change the sql_mode and it can still be inserted.

| username: forever | Original post link

show warning to check

| username: 有猫万事足 | Original post link

Version 7.3 did not change sql_mode and did not reproduce the issue.

| username: xingzhenxiang | Original post link

The image you provided is not accessible. Please provide the text content that needs to be translated.

| username: 大飞哥online | Original post link

A warning prompt and a direct error.

| username: xingzhenxiang | Original post link

It’s still more practical to report errors.

| username: 大飞哥online | Original post link

That’s true.

| username: 梦想是个厨子 | Original post link

Here’s the problem: after the program migration, it became incompatible.

| username: ajin0514 | Original post link

How did you solve it?