一个测试表结构如下,指定了sequence_col为flag:
MySQL [testdb]> show create table seqtable_test\G
*************************** 1. row ***************************
Table: seqtable_test
Create Table: CREATE TABLE `seqtable_test` (
`id` int NULL,
`name` varchar(30) NULL,
`flag` int NULL
) ENGINE=OLAP
UNIQUE KEY(`id`)
DISTRIBUTED BY HASH(`id`) BUCKETS 3
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V1",
"enable_unique_key_merge_on_write" = "true",
"light_schema_change" = "true",
"function_column.sequence_col" = "flag",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728",
"enable_mow_light_delete" = "false"
);
1 row in set (0.00 sec)
当前表数据如下:
MySQL [testdb]> select * from seqtable_test;
+------+------+------+
| id | name | flag |
+------+------+------+
| 2 | bb | 1 |
| 1 | aa | 10 |
+------+------+------+
2 rows in set (0.01 sec)
手工设置了参数:
MySQL [testdb]> set require_sequence_in_insert = false;
Query OK, 0 rows affected (0.01 sec)
重新再插入一条数据,按理不会对sequence_col进行检测,所以应该覆盖上面的id为1的数据:
MySQL [testdb]> insert into seqtable_test values(1,'cc',3);
Query OK, 1 row affected (0.04 sec)
{'label':'label_331ed576fb354370_b23540296333792c', 'status':'VISIBLE', 'txnId':'1032'}
但是实际查询到的数据还是未更新:
MySQL [testdb]> select * from seqtable_test;
+------+------+------+
| id | name | flag |
+------+------+------+
| 2 | bb | 1 |
| 1 | aa | 10 |
+------+------+------+
2 rows in set (0.01 sec)
MySQL [testdb]>