// MockTableInfo mocks a table info by create table stmt ast and a specified table id.
175557
func MockTableInfo(ctx sessionctx.Context, stmt *ast.CreateTableStmt, tableID int64) (*model.TableInfo, error) {
	cols, newConstraints, err := buildColumnsAndConstraints(ctx, stmt.Cols, stmt.Constraints, "", "")
	if err != nil {
		return nil, errors.Trace(err)
	}
	tbl, err := buildTableInfo(ctx, nil, stmt.Table.Name, cols, newConstraints)
	if err != nil {
		return nil, errors.Trace(err)
	}
	tbl.ID = tableID

	// The specified charset will be handled in handleTableOptions
	if err = handleTableOptions(stmt.Options, tbl); err != nil {
		return nil, errors.Trace(err)
	}

	if err = resolveDefaultTableCharsetAndCollation(tbl, ""); err != nil {
		return nil, errors.Trace(err)
	}

	return tbl, nil
}
430645
func (m *MockEventInterface) UpdateWithEventNamespace(arg0 *v1.Event) (*v1.Event, error) {
	ret := m.ctrl.Call(m, "UpdateWithEventNamespace", arg0)
	ret0, _ := ret[0].(*v1.Event)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
672253
func (m *MockInstanceMutaterState) ControllerTimestamp() (*time.Time, error) {
	ret := m.ctrl.Call(m, "ControllerTimestamp")
	ret0, _ := ret[0].(*time.Time)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1302367
func (m *MockServerInfoSource) Facts() json.RawMessage {
	ret := m.ctrl.Call(m, "Facts")
	ret0, _ := ret[0].(json.RawMessage)
	return ret0
}
1086521
func (m *MockLogger) Infof(arg0 string, arg1 ...interface{}) {
	varargs := []interface{}{arg0}
	for _, a := range arg1 {
		varargs = append(varargs, a)
	}
	m.ctrl.Call(m, "Infof", varargs...)
}
877074
func (m *MockConfig) MongoInfo() (*mongo.MongoInfo, bool) {
	ret := m.ctrl.Call(m, "MongoInfo")
	ret0, _ := ret[0].(*mongo.MongoInfo)
	ret1, _ := ret[1].(bool)
	return ret0, ret1
}
1360802
func (statement *Statement) TableName() string {
	if statement.AltTableName != "" {
		return statement.AltTableName
	}

	return statement.tableName
}
314125
func getColsInfo(tn *ast.TableName) (indicesInfo []*model.IndexInfo, colsInfo []*model.ColumnInfo, pkCol *model.ColumnInfo) {
	tbl := tn.TableInfo
	for _, col := range tbl.Columns {
		if tbl.PKIsHandle && mysql.HasPriKeyFlag(col.Flag) {
			pkCol = col
		} else {
			colsInfo = append(colsInfo, col)
		}
	}
	for _, idx := range tn.TableInfo.Indices {
		if idx.State == model.StatePublic {
			indicesInfo = append(indicesInfo, idx)
		}
	}
	return
}
193640
func (m *MockStateModel) ModelConfig() (*config.Config, error) {
	ret := m.ctrl.Call(m, "ModelConfig")
	ret0, _ := ret[0].(*config.Config)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1008737
func NewLoadDataInfo(ctx sessionctx.Context, row []types.Datum, tbl table.Table, cols []*table.Column) *LoadDataInfo {
	insertVal := &InsertValues{baseExecutor: newBaseExecutor(ctx, nil, insertValuesLabel), Table: tbl}
	return &LoadDataInfo{
		row:          row,
		InsertValues: insertVal,
		Table:        tbl,
		Ctx:          ctx,
	}
}
1031993
func TableInfo2Schema(ctx sessionctx.Context, tbl *model.TableInfo) *Schema {
	return TableInfo2SchemaWithDBName(ctx, model.CIStr{}, tbl)
}
52635
func (m *MockConfig) StateServingInfo() (params.StateServingInfo, bool) {
	ret := m.ctrl.Call(m, "StateServingInfo")
	ret0, _ := ret[0].(params.StateServingInfo)
	ret1, _ := ret[1].(bool)
	return ret0, ret1
}
392327
func TableCreate(name interface{}, optArgs ...TableCreateOpts) Term {
	opts := map[string]interface{}{}
	if len(optArgs) >= 1 {
		opts = optArgs[0].toMap()
	}
	return constructRootTerm("TableCreate", p.Term_TABLE_CREATE, []interface{}{name}, opts)
}
141186
func (m *MockMachineProvisioner) ProvisioningInfo() (*params.ProvisioningInfo, error) {
	ret := m.ctrl.Call(m, "ProvisioningInfo")
	ret0, _ := ret[0].(*params.ProvisioningInfo)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
960978
func (m *MockServerInfoSource) MachinesStatus() ([]aagent.MachineState, error) {
	ret := m.ctrl.Call(m, "MachinesStatus")
	ret0, _ := ret[0].([]aagent.MachineState)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
833286
func (*mockWalletController) FetchInputInfo(
	prevOut *wire.OutPoint) (*wire.TxOut, error) {
	txOut := &wire.TxOut{
		Value:    int64(10 * btcutil.SatoshiPerBitcoin),
		PkScript: []byte("dummy"),
	}
	return txOut, nil
}
507994
func (m *MockDatabase) Copy() (state.Database, state.SessionCloser) {
	ret := m.ctrl.Call(m, "Copy")
	ret0, _ := ret[0].(state.Database)
	ret1, _ := ret[1].(state.SessionCloser)
	return ret0, ret1
}