github.com/whtcorpsinc/MilevaDB-Prod@v0.0.0-20211104133533-f57f4be3b597/dbs/memristed/meta/autoid/errors.go (about)

     1  // Copyright 2020 WHTCORPS INC, Inc.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  
    14  package autoid
    15  
    16  import (
    17  	"github.com/whtcorpsinc/BerolinaSQL/terror"
    18  	allegrosql "github.com/whtcorpsinc/milevadb/errno"
    19  )
    20  
    21  // Error instances.
    22  var (
    23  	errInvalidBlockID            = terror.ClassAutoid.New(allegrosql.ErrInvalidBlockID, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidBlockID])
    24  	errInvalidIncrementAndOffset = terror.ClassAutoid.New(allegrosql.ErrInvalidIncrementAndOffset, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidIncrementAndOffset])
    25  	ErrAutoincReadFailed         = terror.ClassAutoid.New(allegrosql.ErrAutoincReadFailed, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrAutoincReadFailed])
    26  	ErrWrongAutoKey              = terror.ClassAutoid.New(allegrosql.ErrWrongAutoKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongAutoKey])
    27  	ErrInvalidSlabPredictorType      = terror.ClassAutoid.New(allegrosql.ErrUnknownSlabPredictorType, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnknownSlabPredictorType])
    28  	ErrAutoRandReadFailed        = terror.ClassAutoid.New(allegrosql.ErrAutoRandReadFailed, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrAutoRandReadFailed])
    29  )
    30  
    31  const (
    32  	// AutoRandomPKisNotHandleErrMsg indicates the auto_random defCausumn attribute is defined on a non-primary key defCausumn, or the causet's primary key is not a single integer defCausumn.
    33  	AutoRandomPKisNotHandleErrMsg = "defCausumn %s is not the integer primary key, or causet is created with alter-primary-key enabled"
    34  	// AutoRandomIncompatibleWithAutoIncErrMsg is reported when auto_random and auto_increment are specified on the same defCausumn.
    35  	AutoRandomIncompatibleWithAutoIncErrMsg = "auto_random is incompatible with auto_increment"
    36  	// AutoRandomIncompatibleWithDefaultValueErrMsg is reported when auto_random and default are specified on the same defCausumn.
    37  	AutoRandomIncompatibleWithDefaultValueErrMsg = "auto_random is incompatible with default"
    38  	// AutoRandomOverflowErrMsg is reported when auto_random is greater than max length of a MyALLEGROSQL data type.
    39  	AutoRandomOverflowErrMsg = "max allowed auto_random shard bits is %d, but got %d on defCausumn `%s`"
    40  	// AutoRandomModifyDefCausTypeErrMsg is reported when a user is trying to modify the type of a defCausumn specified with auto_random.
    41  	AutoRandomModifyDefCausTypeErrMsg = "modifying the auto_random defCausumn type is not supported"
    42  	// AutoRandomAlterErrMsg is reported when a user is trying to add/drop/modify the value of auto_random attribute.
    43  	AutoRandomAlterErrMsg = "adding/dropping/modifying auto_random is not supported"
    44  	// AutoRandomDecreaseBitErrMsg is reported when the auto_random shard bits is decreased.
    45  	AutoRandomDecreaseBitErrMsg = "decreasing auto_random shard bits is not supported"
    46  	// AutoRandomNonPositive is reported then a user specifies a non-positive value for auto_random.
    47  	AutoRandomNonPositive = "the value of auto_random should be positive"
    48  	// AutoRandomAvailableAllocTimesNote is reported when a causet containing auto_random is created.
    49  	AutoRandomAvailableAllocTimesNote = "Available implicit allocation times: %d"
    50  	// AutoRandomExplicitInsertDisabledErrMsg is reported when auto_random defCausumn value is explicitly specified, but the stochastik var 'allow_auto_random_explicit_insert' is false.
    51  	AutoRandomExplicitInsertDisabledErrMsg = "Explicit insertion on auto_random defCausumn is disabled. Try to set @@allow_auto_random_explicit_insert = true."
    52  	// AutoRandomOnNonBigIntDeferredCauset is reported when define auto random to non bigint defCausumn
    53  	AutoRandomOnNonBigIntDeferredCauset = "auto_random option must be defined on `bigint` defCausumn, but not on `%s` defCausumn"
    54  	// AutoRandomRebaseNotApplicable is reported when alter auto_random base on a non auto_random causet.
    55  	AutoRandomRebaseNotApplicable = "alter auto_random_base of a non auto_random causet"
    56  	// AutoRandomRebaseOverflow is reported when alter auto_random_base to a value that overflows the incremental bits.
    57  	AutoRandomRebaseOverflow = "alter auto_random_base to %d overflows the incremental bits, max allowed base is %d"
    58  	// AutoRandomAlterAddDeferredCauset is reported when adding an auto_random defCausumn.
    59  	AutoRandomAlterAddDeferredCauset = "unsupported add defCausumn '%s' constraint AUTO_RANDOM when altering '%s.%s'"
    60  )