github.com/team-ide/go-dialect@v1.9.20/vitess/vterrors/state.go (about)

     1  /*
     2  Copyright 2021 The Vitess Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package vterrors
    18  
    19  // State is error state
    20  type State int
    21  
    22  // All the error states
    23  const (
    24  	Undefined State = iota
    25  
    26  	// invalid argument
    27  	BadFieldError
    28  	BadTableError
    29  	CantUseOptionHere
    30  	DataOutOfRange
    31  	EmptyQuery
    32  	ForbidSchemaChange
    33  	IncorrectGlobalLocalVar
    34  	NonUniqError
    35  	NonUniqTable
    36  	NonUpdateableTable
    37  	SyntaxError
    38  	WrongFieldWithGroup
    39  	WrongGroupField
    40  	WrongTypeForVar
    41  	WrongValueForVar
    42  	LockOrActiveTransaction
    43  	MixOfGroupFuncAndFields
    44  	DupFieldName
    45  
    46  	// failed precondition
    47  	NoDB
    48  	InnodbReadOnly
    49  	WrongNumberOfColumnsInSelect
    50  	CantDoThisInTransaction
    51  	RequiresPrimaryKey
    52  	OperandColumns
    53  
    54  	// not found
    55  	BadDb
    56  	DbDropExists
    57  	NoSuchTable
    58  	SPDoesNotExist
    59  	UnknownSystemVariable
    60  	UnknownTable
    61  	NoSuchSession
    62  
    63  	// already exists
    64  	DbCreateExists
    65  
    66  	// resource exhausted
    67  	NetPacketTooLarge
    68  
    69  	// cancelled
    70  	QueryInterrupted
    71  
    72  	// unimplemented
    73  	NotSupportedYet
    74  	UnsupportedPS
    75  
    76  	// permission denied
    77  	AccessDeniedError
    78  
    79  	// server not available
    80  	ServerNotAvailable
    81  
    82  	// No state should be added below NumOfStates
    83  	NumOfStates
    84  )