@@ -1391,6 +1391,7 @@ int SchemaFactory::get_region_by_key(int64_t main_table_id,
1391
1391
auto record_template = TableRecord::new_record (main_table_id);
1392
1392
int range_size = primary->ranges_size ();
1393
1393
for (const auto & range : primary->ranges ()) {
1394
+ bool like_prefix = range.like_prefix ();
1394
1395
SmartRecord left;
1395
1396
SmartRecord right;
1396
1397
if (range.left_pb_record () != " " ) {
@@ -1406,7 +1407,7 @@ int SchemaFactory::get_region_by_key(int64_t main_table_id,
1406
1407
MutTableKey _start;
1407
1408
MutTableKey _end;
1408
1409
if (left != nullptr ) {
1409
- if (0 != _start. append_index (index, left. get () , range.left_field_cnt (), false )) {
1410
+ if (0 != left-> encode_key (index, _start , range.left_field_cnt (), false , like_prefix )) {
1410
1411
DB_FATAL (" Fail to encode_key, table:%ld" , index.id );
1411
1412
return -1 ;
1412
1413
}
@@ -1415,7 +1416,7 @@ int SchemaFactory::get_region_by_key(int64_t main_table_id,
1415
1416
}
1416
1417
1417
1418
if (right != nullptr ) {
1418
- if (0 != _end. append_index (index, right. get () , range.right_field_cnt (), false )) {
1419
+ if (0 != right-> encode_key (index, _end , range.right_field_cnt (), false , like_prefix )) {
1419
1420
DB_FATAL (" Fail to encode_key, table:%ld" , index.id );
1420
1421
return -1 ;
1421
1422
}
0 commit comments