matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: sql_mode no_auto_value_on_zero is not implemented

Open fengttt opened this issue 9 months ago • 0 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Branch Name

main

Commit ID

62bc77f5f

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

Even though this is documented, but we did not implement it.

So we will need to decide if we should implement this feature. This feature itself is more like a misfeature. So I am not sure.

But in the mean time, we need to update document.

Expected Behavior

No response

Steps to Reproduce

create table tt(i int not null auto_increment primary key, j int);

insert into tt values (1, 2);
insert into tt values (null, 3); -- correct

mysql> select * from tt;
+------+------+
| i    | j    |
+------+------+
|    1 |    2 |
|    2 |    3 |
+------+------+
2 rows in set (0.00 sec)


mysql> insert into tt values (0, 4); -- bug
Query OK, 1 row affected (0.01 sec)

mysql> select * from tt;
+------+------+
| i    | j    |
+------+------+
|    1 |    2 |
|    2 |    3 |
|    0 |    4 |
+------+------+
3 rows in set (0.00 sec)

Additional information

mysql> select @@sql_mode; +-----------------------------------------------------------------------------------------------------------------------+ | @@sql_mode | +-----------------------------------------------------------------------------------------------------------------------+ | ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES | +-----------------------------------------------------------------------------------------------------------------------+

fengttt avatar May 17 '24 20:05 fengttt