// VerifyMode is a helper method to verify mysql is running with
// sql_mode = STRICT_TRANS_TABLES or STRICT_ALL_TABLES and autocommit=ON.
// It also returns the current binlog format.
977601
func (dbc *DBConn) VerifyMode(strictTransTables bool) (BinlogFormat, error) {
	if strictTransTables {
		qr, err := dbc.conn.ExecuteFetch(getModeSQL, 2, false)
		if err != nil {
			return 0, vterrors.Wrap(err, "could not verify mode")
		}
		if len(qr.Rows) != 1 {
			return 0, fmt.Errorf("incorrect rowcount received for %s: %d", getModeSQL, len(qr.Rows))
		}
		sqlMode := qr.Rows[0][0].ToString()
		if !(strings.Contains(sqlMode, "STRICT_TRANS_TABLES") || strings.Contains(sqlMode, "STRICT_ALL_TABLES")) {
			return 0, fmt.Errorf("require sql_mode to be STRICT_TRANS_TABLES or STRICT_ALL_TABLES: got '%s'", qr.Rows[0][0].ToString())
		}
	}
	qr, err := dbc.conn.ExecuteFetch(getAutocommit, 2, false)
	if err != nil {
		return 0, vterrors.Wrap(err, "could not verify mode")
	}
	if len(qr.Rows) != 1 {
		return 0, fmt.Errorf("incorrect rowcount received for %s: %d", getAutocommit, len(qr.Rows))
	}
	if !strings.Contains(qr.Rows[0][0].ToString(), "1") {
		return 0, fmt.Errorf("require autocommit to be 1: got %s", qr.Rows[0][0].ToString())
	}
	qr, err = dbc.conn.ExecuteFetch(getAutoIsNull, 2, false)
	if err != nil {
		return 0, vterrors.Wrap(err, "could not verify mode")
	}
	if len(qr.Rows) != 1 {
		return 0, fmt.Errorf("incorrect rowcount received for %s: %d", getAutoIsNull, len(qr.Rows))
	}
	if !strings.Contains(qr.Rows[0][0].ToString(), "0") {
		return 0, fmt.Errorf("require sql_auto_is_null to be 0: got %s", qr.Rows[0][0].ToString())
	}
	qr, err = dbc.conn.ExecuteFetch(showBinlog, 10, false)
	if err != nil {
		return 0, vterrors.Wrap(err, "could not fetch binlog format")
	}
	if len(qr.Rows) != 1 {
		return 0, fmt.Errorf("incorrect rowcount received for %s: %d", showBinlog, len(qr.Rows))
	}
	if len(qr.Rows[0]) != 2 {
		return 0, fmt.Errorf("incorrect column count received for %s: %d", showBinlog, len(qr.Rows[0]))
	}
	switch qr.Rows[0][1].ToString() {
	case "STATEMENT":
		return BinlogFormatStatement, nil
	case "ROW":
		return BinlogFormatRow, nil
	case "MIXED":
		return BinlogFormatMixed, nil
	}
	return 0, fmt.Errorf("unexpected binlog format for %s: %s", showBinlog, qr.Rows[0][1].ToString())
}
158412
func GetEditMode(w http.ResponseWriter, req *http.Request) bool {
	return admin.ActionBar.EditMode(w, req)
}
732843
func (s *HlsGroupSettings) SetMode(v string) *HlsGroupSettings {
	s.Mode = &v
	return s
}
695852
func (s *ImportDocumentationPartsInput) SetMode(v string) *ImportDocumentationPartsInput {
	s.Mode = &v
	return s
}
705090
func Verify(mac *[Size]byte, m []byte, key nacl.Key) bool {
	return poly1305.Verify(mac, m, key)
}
647257
func syscallMode(p PermissionBits) (o uint32) {
	o |= uint32(p)

	if p.Setuid() {
		o |= syscall.S_ISUID
	}
	if p.Setgid() {
		o |= syscall.S_ISGID
	}
	if p.Sticky() {
		o |= syscall.S_ISVTX
	}
	return
}
987999
func (s *PutRestApiInput) SetMode(v string) *PutRestApiInput {
	s.Mode = &v
	return s
}
370754
func (s *TracingConfig) SetMode(v string) *TracingConfig {
	s.Mode = &v
	return s
}
946699
func (s *CampaignHook) SetMode(v string) *CampaignHook {
	s.Mode = &v
	return s
}
253859
func (m *Module) Verify(req *http.Request) (string, error) {
	session, err := m.getSessionFromRequest(req)
	if err != nil {
		return "", err
	} else if session == nil {
		return "", nil
	}
	return session.ID, nil
}
989750
func Verify(ctx *Context, hash, password, salt []byte) (bool, error) {
	if ctx == nil {
		return false, ErrContext
	}
	if len(hash) == 0 {
		return false, ErrHash
	}

	hash2, err := ctx.hash(password, salt)
	if err != nil {
		return false, err
	}

	return subtle.ConstantTimeCompare(hash, hash2) == 1, nil
}
1187391
func (s *AutomationExecution) SetMode(v string) *AutomationExecution {
	s.Mode = &v
	return s
}
1152659
func (o *Config) getMode() (os.FileMode, bool, error) {
	modeOverride := o.OutMode != ""
	m, err := strconv.ParseUint("0"+o.OutMode, 8, 32)
	if err != nil {
		return 0, false, err
	}
	mode := os.FileMode(m)
	if mode == 0 && o.Input != "" {
		mode = 0644
	}
	return mode, modeOverride, nil
}
554065
func (s *Encryption) SetMode(v string) *Encryption {
	s.Mode = &v
	return s
}
1275271
func (s *StartAutomationExecutionInput) SetMode(v string) *StartAutomationExecutionInput {
	s.Mode = &v
	return s
}
478021
func (vind *BinaryMD5) Verify(_ VCursor, ids []sqltypes.Value, ksids [][]byte) ([]bool, error) {
	out := make([]bool, len(ids))
	for i := range ids {
		out[i] = bytes.Equal(binHash(ids[i].ToBytes()), ksids[i])
	}
	return out, nil
}
257088
func (_ *SigningMethodNone) Verify(_ []byte, _ Signature, _ interface{}) error {
	return nil
}