@@ -82,7 +82,7 @@ func TestEncode(t *testing.T) {
82
82
c1 := & model.ColumnInfo {ID : 1 , Name : model .NewCIStr ("c1" ), State : model .StatePublic , Offset : 0 , FieldType : * types .NewFieldType (mysql .TypeTiny )}
83
83
cols := []* model.ColumnInfo {c1 }
84
84
tblInfo := & model.TableInfo {ID : 1 , Columns : cols , PKIsHandle : false , State : model .StatePublic }
85
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
85
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
86
86
require .NoError (t , err )
87
87
88
88
logger := log.Logger {Logger : zap .NewNop ()}
@@ -153,7 +153,7 @@ func TestDecode(t *testing.T) {
153
153
c1 := & model.ColumnInfo {ID : 1 , Name : model .NewCIStr ("c1" ), State : model .StatePublic , Offset : 0 , FieldType : * types .NewFieldType (mysql .TypeTiny )}
154
154
cols := []* model.ColumnInfo {c1 }
155
155
tblInfo := & model.TableInfo {ID : 1 , Columns : cols , PKIsHandle : false , State : model .StatePublic }
156
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
156
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
157
157
require .NoError (t , err )
158
158
decoder , err := lkv .NewTableKVDecoder (tbl , "`test`.`c1`" , & lkv.SessionOptions {
159
159
SQLMode : mysql .ModeStrictAllTables ,
@@ -208,7 +208,7 @@ func TestDecodeIndex(t *testing.T) {
208
208
State : model .StatePublic ,
209
209
PKIsHandle : false ,
210
210
}
211
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
211
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
212
212
if err != nil {
213
213
fmt .Printf ("error: %v" , err .Error ())
214
214
}
@@ -249,7 +249,7 @@ func TestEncodeRowFormatV2(t *testing.T) {
249
249
c1 := & model.ColumnInfo {ID : 1 , Name : model .NewCIStr ("c1" ), State : model .StatePublic , Offset : 0 , FieldType : * types .NewFieldType (mysql .TypeTiny )}
250
250
cols := []* model.ColumnInfo {c1 }
251
251
tblInfo := & model.TableInfo {ID : 1 , Columns : cols , PKIsHandle : false , State : model .StatePublic }
252
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
252
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
253
253
require .NoError (t , err )
254
254
255
255
logger := log.Logger {Logger : zap .NewNop ()}
@@ -297,7 +297,7 @@ func TestEncodeTimestamp(t *testing.T) {
297
297
}
298
298
cols := []* model.ColumnInfo {c1 }
299
299
tblInfo := & model.TableInfo {ID : 1 , Columns : cols , PKIsHandle : false , State : model .StatePublic }
300
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
300
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
301
301
require .NoError (t , err )
302
302
303
303
logger := log.Logger {Logger : zap .NewNop ()}
@@ -324,7 +324,7 @@ func TestEncodeTimestamp(t *testing.T) {
324
324
325
325
func TestEncodeDoubleAutoIncrement (t * testing.T ) {
326
326
tblInfo := mockTableInfo (t , "create table t (id double not null auto_increment, unique key `u_id` (`id`));" )
327
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
327
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
328
328
require .NoError (t , err )
329
329
330
330
logger := log.Logger {Logger : zap .NewNop ()}
@@ -388,7 +388,7 @@ func TestEncodeMissingAutoValue(t *testing.T) {
388
388
},
389
389
} {
390
390
tblInfo := mockTableInfo (t , testTblInfo .CreateStmt )
391
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
391
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
392
392
require .NoError (t , err )
393
393
394
394
encoder , err := lkv .NewTableKVEncoder (tbl , & lkv.SessionOptions {
@@ -436,7 +436,7 @@ func TestEncodeMissingAutoValue(t *testing.T) {
436
436
437
437
func TestEncodeExpressionColumn (t * testing.T ) {
438
438
tblInfo := mockTableInfo (t , "create table t (id varchar(40) not null DEFAULT uuid(), unique key `u_id` (`id`));" )
439
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
439
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
440
440
require .NoError (t , err )
441
441
442
442
encoder , err := lkv .NewTableKVEncoder (tbl , & lkv.SessionOptions {
@@ -477,7 +477,7 @@ func mockTableInfo(t *testing.T, createSQL string) *model.TableInfo {
477
477
478
478
func TestDefaultAutoRandoms (t * testing.T ) {
479
479
tblInfo := mockTableInfo (t , "create table t (id bigint unsigned NOT NULL auto_random primary key clustered, a varchar(100));" )
480
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
480
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
481
481
require .NoError (t , err )
482
482
encoder , err := lkv .NewTableKVEncoder (tbl , & lkv.SessionOptions {
483
483
SQLMode : mysql .ModeStrictAllTables ,
@@ -512,7 +512,7 @@ func TestDefaultAutoRandoms(t *testing.T) {
512
512
513
513
func TestShardRowId (t * testing.T ) {
514
514
tblInfo := mockTableInfo (t , "create table t (s varchar(16)) shard_row_id_bits = 3;" )
515
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
515
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
516
516
require .NoError (t , err )
517
517
encoder , err := lkv .NewTableKVEncoder (tbl , & lkv.SessionOptions {
518
518
SQLMode : mysql .ModeStrictAllTables ,
@@ -671,7 +671,7 @@ func SetUpTest(b *testing.B) *benchSQL2KVSuite {
671
671
tableInfo .State = model .StatePublic
672
672
673
673
// Construct the corresponding KV encoder.
674
- tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tableInfo )
674
+ tbl , err := tables .TableFromMeta (lkv .NewPanickingAllocators (tableInfo . SepAutoInc (), 0 ), tableInfo )
675
675
require .NoError (b , err )
676
676
encoder , err := lkv .NewTableKVEncoder (tbl , & lkv.SessionOptions {SysVars : map [string ]string {"tidb_row_format_version" : "2" }}, nil , log .L ())
677
677
require .NoError (b , err )
@@ -734,7 +734,7 @@ func TestLogKVConvertFailed(t *testing.T) {
734
734
c1 := & model.ColumnInfo {ID : 1 , Name : modelName , State : modelState , Offset : 0 , FieldType : modelFieldType }
735
735
cols := []* model.ColumnInfo {c1 }
736
736
tblInfo := & model.TableInfo {ID : 1 , Columns : cols , PKIsHandle : false , State : model .StatePublic }
737
- _ , err = tables .TableFromMeta (lkv .NewPanickingAllocators (0 ), tblInfo )
737
+ _ , err = tables .TableFromMeta (lkv .NewPanickingAllocators (tblInfo . SepAutoInc (), 0 ), tblInfo )
738
738
require .NoError (t , err )
739
739
740
740
var newString strings.Builder
0 commit comments