github.com/vedadiyan/sqlparser@v1.0.0/pkg/vterrors/constants.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  import "regexp"
    20  
    21  // Operation not allowed error
    22  const (
    23  	NotServing   = "operation not allowed in state NOT_SERVING"
    24  	ShuttingDown = "operation not allowed in state SHUTTING_DOWN"
    25  )
    26  
    27  // RxOp regex for operation not allowed error
    28  var RxOp = regexp.MustCompile("operation not allowed in state (NOT_SERVING|SHUTTING_DOWN)")
    29  
    30  // TxEngineClosed for transaction engine closed error
    31  const TxEngineClosed = "tx engine can't accept new connections in state %v"
    32  
    33  // WrongTablet for invalid tablet type error
    34  const WrongTablet = "wrong tablet type"
    35  
    36  // RxWrongTablet regex for invalid tablet type error
    37  var RxWrongTablet = regexp.MustCompile("(wrong|invalid) tablet type")
    38  
    39  // Constants for error messages
    40  const (
    41  	// PrimaryVindexNotSet is the error message to be used when there is no primary vindex found on a table
    42  	PrimaryVindexNotSet = "table '%s' does not have a primary vindex"
    43  )
    44  
    45  // TxKillerRollback purpose when acquire lock on connection for rolling back transaction.
    46  const TxKillerRollback = "in use: for tx killer rollback"
    47  
    48  // TxClosed regex for connection closed
    49  var TxClosed = regexp.MustCompile("transaction ([a-z0-9:]+) (?:ended|not found|in use: for tx killer rollback)")