ddl: add a guard UT to limit the DefMaxOfIndexLimit to 512 (#60050)
This commit is contained in:
@ -19,6 +19,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/pingcap/failpoint"
|
||||
"github.com/pingcap/tidb/pkg/config"
|
||||
"github.com/pingcap/tidb/pkg/errno"
|
||||
"github.com/pingcap/tidb/pkg/testkit"
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -146,3 +147,9 @@ func TestCreateDatabaseError(t *testing.T) {
|
||||
tk.MustExec("create database db1;")
|
||||
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/ddl/mockModifyJobSchemaId"))
|
||||
}
|
||||
|
||||
// This is a hard-coded test to make sure that the DefMaxOfIndexLimit is 512
|
||||
// This limitation can not be loosened to a larger number until tidb can handle more indexes on one table.
|
||||
func TestCreateIndexErrTooManyKeys(t *testing.T) {
|
||||
require.Equal(t, 512, config.DefMaxOfIndexLimit)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user