// LoadDDLVars loads ddl variable from mysql.global_variables.
336562
func LoadDDLVars(ctx sessionctx.Context) error {
	return LoadGlobalVars(ctx, []string{variable.TiDBDDLErrorCountLimit})
}
398313
func (a *ACLs) load(ctx *validation.Context, cfg []*config.Settings_SourceAcls) {
	a.hosts = map[string]*hostACLs{}
	for i, group := range cfg {
		ctx.Enter("source_acls #%d", i)

		if len(group.Readers) == 0 {
			ctx.Errorf("at least 1 reader required")
		}
		if len(group.Hosts)+len(group.Projects) == 0 {
			ctx.Errorf("at least 1 host or project required")
		}

		gReaders := a.loadReaders(ctx, group.Readers)
		for _, hostURL := range group.Hosts {
			ctx.Enter("host %q", hostURL)
			a.loadHost(ctx, i, hostURL, gReaders)
			ctx.Exit()
		}
		for _, projectURL := range group.Projects {
			ctx.Enter("project %q", projectURL)
			a.loadProject(ctx, i, projectURL, gReaders)
			ctx.Exit()
		}
		ctx.Exit()
	}
}
174285
func load(config *tableaclpb.Config, newACL func([]string) (acl.ACL, error)) (entries aclEntries, err error) {
	if err := ValidateProto(config); err != nil {
		return nil, err
	}
	entries = aclEntries{}
	for _, group := range config.TableGroups {
		readers, err := newACL(group.Readers)
		if err != nil {
			return nil, err
		}
		writers, err := newACL(group.Writers)
		if err != nil {
			return nil, err
		}
		admins, err := newACL(group.Admins)
		if err != nil {
			return nil, err
		}
		for _, tableNameOrPrefix := range group.TableNamesOrPrefixes {
			entries = append(entries, aclEntry{
				tableNameOrPrefix: tableNameOrPrefix,
				groupName:         group.Name,
				acl: map[Role]acl.ACL{
					READER: readers,
					WRITER: writers,
					ADMIN:  admins,
				},
			})
		}
	}
	sort.Sort(entries)
	return entries, nil
}
838603
func (m *GormAreaRepository) LoadMultiple(ctx context.Context, ids []uuid.UUID) ([]Area, error) {
	defer goa.MeasureSince([]string{"goa", "db", "Area", "getmultiple"}, time.Now())
	var objs []Area
	if len(ids) == 0 {
		return objs, nil
	}
	for i := 0; i < len(ids); i++ {
		m.db = m.db.Or("id = ?", ids[i])
	}
	tx := m.db.Find(&objs)
	if tx.Error != nil {
		return nil, errors.NewInternalError(ctx, tx.Error)
	}
	return objs, nil
}
536298
func Load(db DB, table string, dst interface{}, pk int64) error {
	return Default.Load(db, table, dst, pk)
}
365503
func Load() {
	_ = commands.API{}
	_ = application.ListApps{}
	_ = buildpack.ListBuildpacks{}
	_ = domain.CreateDomain{}
	_ = environmentvariablegroup.RunningEnvironmentVariableGroup{}
	_ = featureflag.ShowFeatureFlag{}
	_ = organization.ListOrgs{}
	_ = plugin.Plugins{}
	_ = pluginrepo.RepoPlugins{}
	_ = quota.CreateQuota{}
	_ = route.CreateRoute{}
	_ = routergroups.RouterGroups{}
	_ = securitygroup.ShowSecurityGroup{}
	_ = service.ShowService{}
	_ = serviceauthtoken.ListServiceAuthTokens{}
	_ = serviceaccess.ServiceAccess{}
	_ = servicebroker.ListServiceBrokers{}
	_ = servicekey.ServiceKey{}
	_ = space.CreateSpace{}
	_ = spacequota.SpaceQuota{}
	_ = user.CreateUser{}
}
30869
func LoadJSON(jsonContent []byte) (*Dataset, error) {
	var input []map[string]interface{}
	if err := json.Unmarshal(jsonContent, &input); err != nil {
		return nil, err
	}

	return internalLoadFromDict(input)
}
896588
func (db *PGStore) load(session *sessions.Session) error {
	var s PGSession

	err := db.selectOne(&s, session.ID)
	if err != nil {
		return err
	}

	return securecookie.DecodeMulti(session.Name(), string(s.Data), &session.Values, db.Codecs...)
}
1363915
func (nz *normalizer) convertSQLVal(node *SQLVal) {
	bval := nz.sqlToBindvar(node)
	if bval == nil {
		return
	}

	bvname := nz.newName()
	nz.bindVars[bvname] = bval

	node.Type = ValArg
	node.Val = append([]byte(":"), bvname...)
}
615497
func loadDomKeyData() (map[string][]string, error) {
	buf, err := grab(domKeyDataInc)
	if err != nil {
		return nil, err
	}
	buf = fixRE.ReplaceAllLiteral(buf, []byte(", "))

	keyMap := make(map[string][]string)
	matches := domKeyRE.FindAllStringSubmatch(string(buf), -1)
	for _, m := range matches {
		keyMap[m[2]] = m[1:]
	}

	return keyMap, nil
}
924610
func (m *AggregateStore) Load(ctx context.Context, aggregateType eh.AggregateType, id uuid.UUID) (eh.Aggregate, error) {
	if m.Err != nil {
		return nil, m.Err
	}
	m.Context = ctx
	return m.Aggregates[id], nil
}
1237087
func LoadTable(schemaName, name, csvRaw string) {
	CsvGlobal.CreateTable(name, csvRaw)
	schema.DefaultRegistry().SchemaRefresh(SchemaName)
}
229608
func (p *MySQLPrivilege) LoadAll(ctx sessionctx.Context) error {
	err := p.LoadUserTable(ctx)
	if err != nil {
		return errors.Trace(err)
	}

	err = p.LoadDBTable(ctx)
	if err != nil {
		if !noSuchTable(err) {
			return errors.Trace(err)
		}
		log.Warn("mysql.db maybe missing")
	}

	err = p.LoadTablesPrivTable(ctx)
	if err != nil {
		if !noSuchTable(err) {
			return errors.Trace(err)
		}
		log.Warn("mysql.tables_priv missing")
	}

	err = p.LoadDefaultRoles(ctx)
	if err != nil {
		if !noSuchTable(err) {
			return errors.Trace(err)
		}
		log.Warn("mysql.default_roles missing")
	}

	err = p.LoadColumnsPrivTable(ctx)
	if err != nil {
		if !noSuchTable(err) {
			return errors.Trace(err)
		}
		log.Warn("mysql.columns_priv missing")
	}

	err = p.LoadRoleGraph(ctx)
	if err != nil {
		if !noSuchTable(err) {
			return errors.Trace(err)
		}
		log.Warn("mysql.role_edges missing")
	}
	return nil
}
1071701
func (s *TableStatistics) SetDdls(v int64) *TableStatistics {
	s.Ddls = &v
	return s
}
1335142
func (do *Domain) LoadBindInfoLoop(ctx sessionctx.Context) error {
	ctx.GetSessionVars().InRestrictedSQL = true
	do.bindHandle = bindinfo.NewBindHandle(ctx)
	err := do.bindHandle.Update(true)
	if err != nil {
		return err
	}

	do.loadBindInfoLoop()
	do.handleInvalidBindTaskLoop()
	return nil
}
1300601
func LoadGlobalVars(ctx sessionctx.Context, varNames []string) error {
	if sctx, ok := ctx.(sqlexec.RestrictedSQLExecutor); ok {
		nameList := ""
		for i, name := range varNames {
			if i > 0 {
				nameList += ", "
			}
			nameList += fmt.Sprintf("'%s'", name)
		}
		sql := fmt.Sprintf(loadGlobalVarsSQL, nameList)
		rows, _, err := sctx.ExecRestrictedSQL(ctx, sql)
		if err != nil {
			return errors.Trace(err)
		}
		for _, row := range rows {
			varName := row.GetString(0)
			varValue := row.GetString(1)
			variable.SetLocalSystemVar(varName, varValue)
		}
	}
	return nil
}
1116217
func (formats *Formats) Load(urls ...string) error {
	for _, url := range urls {
		err := formats.load(url)
		if err != nil {
			return err
		}
	}
	return nil
}