matrixorigin / matrixone

Hyperconverged cloud-edge native database
https://docs.matrixorigin.cn/en
Apache License 2.0
1.72k stars 271 forks source link

[Bug]: sql_mode no_auto_value_on_zero is not implemented #16227

Open fengttt opened 2 months ago

fengttt commented 2 months ago

Is there an existing issue for the same bug?

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 | +-----------------------------------------------------------------------------------------------------------------------+

dengn commented 2 months ago

For documentation side, it's already updated in the lastest version. https://docs.matrixorigin.cn/dev/MatrixOne/Reference/Variable/system-variables/sql-mode/

It will be default as 1.2.0 will be released.