tidb-incubator / TiBigData

TiDB connectors for Flink/Hive/Presto
Apache License 2.0
211 stars 57 forks source link

[BUG] TiBigData's AutoRandom ID assignment implementation is inconsistent with the TiDB implementation #244

Closed qidi1 closed 1 year ago

qidi1 commented 1 year ago

Describe the bug

TiBigData's AutoRandom ID assignment implementation is inconsistent with the TiDB implementation. IDs assigned in TiBigData will be reassigned in TiDB. What did you do

CREATE TABLE `tiflink_test`.`4015fe27517944ec8cfc3822221b2aa9`(
        id bigint unsigned PRIMARY KEY clustered AUTO_RANDOM(1), 
       number bigint
)

First , insert some row by TiBigData to table like above. Then, use mysql client to insert a row to table.

What do you expect

Successfully inserted

What happens instead

image

The bug is cause by the autorandom id's meta prefix use in TiBigData is different from TiDB. In TiDB, autorandom id's meta prefix is "TARID" , but in TiBigData, autorandom id's meta prefix is "TID". TiDB 5H1Yvbdii3 TiBigData image

Flink/Presto/MapReduce/Trino/Hive and TiBigData version info master