Skip to content

Commit 7f7ad56

Browse files
committed
address comment #3
1 parent bbb9596 commit 7f7ad56

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ddl/ddl_api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,9 +1219,6 @@ func buildTableInfoWithCheck(ctx sessionctx.Context, d *ddl, s *ast.CreateTableS
12191219
if err = handleTableOptions(s.Options, tbInfo); err != nil {
12201220
return nil, errors.Trace(err)
12211221
}
1222-
if tbInfo.ShardRowIDBits > 0 && tbInfo.PKIsHandle {
1223-
return nil, errUnsupportedShardRowIDBits
1224-
}
12251222

12261223
if err = resolveDefaultTableCharsetAndCollation(tbInfo, dbCharset); err != nil {
12271224
return nil, errors.Trace(err)
@@ -1650,6 +1647,9 @@ func handleTableOptions(options []*ast.TableOption, tbInfo *model.TableInfo) err
16501647
case ast.TableOptionCompression:
16511648
tbInfo.Compression = op.StrValue
16521649
case ast.TableOptionShardRowID:
1650+
if op.UintValue > 0 && tbInfo.PKIsHandle {
1651+
return errUnsupportedShardRowIDBits
1652+
}
16531653
tbInfo.ShardRowIDBits = op.UintValue
16541654
if tbInfo.ShardRowIDBits > shardRowIDBitsMax {
16551655
tbInfo.ShardRowIDBits = shardRowIDBitsMax

0 commit comments

Comments
 (0)