github.com/whtcorpsinc/milevadb-prod@v0.0.0-20211104133533-f57f4be3b597/dbs/error.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 dbs
    15  
    16  import (
    17  	"fmt"
    18  
    19  	"github.com/whtcorpsinc/BerolinaSQL/terror"
    20  	allegrosql "github.com/whtcorpsinc/milevadb/errno"
    21  )
    22  
    23  var (
    24  	// errWorkerClosed means we have already closed the DBS worker.
    25  	errInvalidWorker = terror.ClassDBS.New(allegrosql.ErrInvalidDBSWorker, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidDBSWorker])
    26  	// errNotTenant means we are not tenant and can't handle DBS jobs.
    27  	errNotTenant              = terror.ClassDBS.New(allegrosql.ErrNotTenant, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrNotTenant])
    28  	errCantDecodeRecord      = terror.ClassDBS.New(allegrosql.ErrCantDecodeRecord, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrCantDecodeRecord])
    29  	errInvalidDBSJob         = terror.ClassDBS.New(allegrosql.ErrInvalidDBSJob, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidDBSJob])
    30  	errCancelledDBSJob       = terror.ClassDBS.New(allegrosql.ErrCancelledDBSJob, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrCancelledDBSJob])
    31  	errFileNotFound          = terror.ClassDBS.New(allegrosql.ErrFileNotFound, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFileNotFound])
    32  	errRunMultiSchemaChanges = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "multi schemaReplicant change"))
    33  	errWaitReorgTimeout      = terror.ClassDBS.New(allegrosql.ErrLockWaitTimeout, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWaitReorgTimeout])
    34  	errInvalidStoreVer       = terror.ClassDBS.New(allegrosql.ErrInvalidStoreVersion, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidStoreVersion])
    35  	// ErrRepairBlockFail is used to repair blockInfo in repair mode.
    36  	ErrRepairBlockFail = terror.ClassDBS.New(allegrosql.ErrRepairBlock, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrRepairBlock])
    37  
    38  	// We don't support dropping column with index covered now.
    39  	errCantDropDefCausWithIndex                   = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "drop column with index"))
    40  	errUnsupportedAddDeferredCauset                   = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "add column"))
    41  	errUnsupportedModifyDeferredCauset                = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "modify column: %s"))
    42  	errUnsupportedModifyCharset               = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "modify %s"))
    43  	errUnsupportedModifyDefCauslation             = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "modifying collation from %s to %s"))
    44  	errUnsupportedPKHandle                    = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "drop integer primary key"))
    45  	errUnsupportedCharset                     = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "charset %s and collate %s"))
    46  	errUnsupportedShardRowIDBits              = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "shard_row_id_bits for causet with primary key as event id"))
    47  	errUnsupportedAlterBlockWithValidation    = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, "ALTER TABLE WITH VALIDATION is currently unsupported")
    48  	errUnsupportedAlterBlockWithoutValidation = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, "ALTER TABLE WITHOUT VALIDATION is currently unsupported")
    49  	errBlobKeyWithoutLength                   = terror.ClassDBS.New(allegrosql.ErrBlobKeyWithoutLength, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlobKeyWithoutLength])
    50  	errKeyPart0                               = terror.ClassDBS.New(allegrosql.ErrKeyPart0, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrKeyPart0])
    51  	errIncorrectPrefixKey                     = terror.ClassDBS.New(allegrosql.ErrWrongSubKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongSubKey])
    52  	errTooLongKey                             = terror.ClassDBS.New(allegrosql.ErrTooLongKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrTooLongKey])
    53  	errKeyDeferredCausetDoesNotExits                  = terror.ClassDBS.New(allegrosql.ErrKeyDeferredCausetDoesNotExits, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrKeyDeferredCausetDoesNotExits])
    54  	errUnknownTypeLength                      = terror.ClassDBS.New(allegrosql.ErrUnknownTypeLength, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnknownTypeLength])
    55  	errUnknownFractionLength                  = terror.ClassDBS.New(allegrosql.ErrUnknownFractionLength, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnknownFractionLength])
    56  	errInvalidDBSJobVersion                   = terror.ClassDBS.New(allegrosql.ErrInvalidDBSJobVersion, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidDBSJobVersion])
    57  	errInvalidUseOfNull                       = terror.ClassDBS.New(allegrosql.ErrInvalidUseOfNull, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidUseOfNull])
    58  	errTooManyFields                          = terror.ClassDBS.New(allegrosql.ErrTooManyFields, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrTooManyFields])
    59  	errInvalidSplitRegionRanges               = terror.ClassDBS.New(allegrosql.ErrInvalidSplitRegionRanges, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidSplitRegionRanges])
    60  	errReorgPanic                             = terror.ClassDBS.New(allegrosql.ErrReorgPanic, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrReorgPanic])
    61  	errFkDeferredCausetCannotDrop                     = terror.ClassDBS.New(allegrosql.ErrFkDeferredCausetCannotDrop, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFkDeferredCausetCannotDrop])
    62  	errFKIncompatibleDeferredCausets                  = terror.ClassDBS.New(allegrosql.ErrFKIncompatibleDeferredCausets, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFKIncompatibleDeferredCausets])
    63  
    64  	errOnlyOnRangeListPartition = terror.ClassDBS.New(allegrosql.ErrOnlyOnRangeListPartition, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrOnlyOnRangeListPartition])
    65  	// errWrongKeyDeferredCauset is for causet column cannot be indexed.
    66  	errWrongKeyDeferredCauset = terror.ClassDBS.New(allegrosql.ErrWrongKeyDeferredCauset, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongKeyDeferredCauset])
    67  	// errWrongFKOptionForGeneratedDeferredCauset is for wrong foreign key reference option on generated columns.
    68  	errWrongFKOptionForGeneratedDeferredCauset = terror.ClassDBS.New(allegrosql.ErrWrongFKOptionForGeneratedDeferredCauset, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongFKOptionForGeneratedDeferredCauset])
    69  	// ErrUnsupportedOnGeneratedDeferredCauset is for unsupported actions on generated columns.
    70  	ErrUnsupportedOnGeneratedDeferredCauset = terror.ClassDBS.New(allegrosql.ErrUnsupportedOnGeneratedDeferredCauset, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedOnGeneratedDeferredCauset])
    71  	// errGeneratedDeferredCausetNonPrior forbids to refer generated column non prior to it.
    72  	errGeneratedDeferredCausetNonPrior = terror.ClassDBS.New(allegrosql.ErrGeneratedDeferredCausetNonPrior, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrGeneratedDeferredCausetNonPrior])
    73  	// errDependentByGeneratedDeferredCauset forbids to delete columns which are dependent by generated columns.
    74  	errDependentByGeneratedDeferredCauset = terror.ClassDBS.New(allegrosql.ErrDependentByGeneratedDeferredCauset, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrDependentByGeneratedDeferredCauset])
    75  	// errJSONUsedAsKey forbids to use JSON as key or index.
    76  	errJSONUsedAsKey = terror.ClassDBS.New(allegrosql.ErrJSONUsedAsKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrJSONUsedAsKey])
    77  	// errBlobCantHaveDefault forbids to give not null default value to TEXT/BLOB/JSON.
    78  	errBlobCantHaveDefault = terror.ClassDBS.New(allegrosql.ErrBlobCantHaveDefault, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlobCantHaveDefault])
    79  	errTooLongIndexComment = terror.ClassDBS.New(allegrosql.ErrTooLongIndexComment, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrTooLongIndexComment])
    80  	// ErrInvalidDefaultValue returns for invalid default value for columns.
    81  	ErrInvalidDefaultValue = terror.ClassDBS.New(allegrosql.ErrInvalidDefault, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidDefault])
    82  	// ErrGeneratedDeferredCausetRefAutoInc forbids to refer generated columns to auto-increment columns .
    83  	ErrGeneratedDeferredCausetRefAutoInc = terror.ClassDBS.New(allegrosql.ErrGeneratedDeferredCausetRefAutoInc, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrGeneratedDeferredCausetRefAutoInc])
    84  	// ErrUnsupportedAddPartition returns for does not support add partitions.
    85  	ErrUnsupportedAddPartition = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "add partitions"))
    86  	// ErrUnsupportedCoalescePartition returns for does not support coalesce partitions.
    87  	ErrUnsupportedCoalescePartition   = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "coalesce partitions"))
    88  	errUnsupportedReorganizePartition = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "reorganize partition"))
    89  	errUnsupportedCheckPartition      = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "check partition"))
    90  	errUnsupportedOptimizePartition   = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "optimize partition"))
    91  	errUnsupportedRebuildPartition    = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "rebuild partition"))
    92  	errUnsupportedRemovePartition     = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "remove partitioning"))
    93  	errUnsupportedRepairPartition     = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "repair partition"))
    94  	errUnsupportedExchangePartition   = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "exchange partition"))
    95  	// ErrGeneratedDeferredCausetFunctionIsNotAllowed returns for unsupported functions for generated columns.
    96  	ErrGeneratedDeferredCausetFunctionIsNotAllowed = terror.ClassDBS.New(allegrosql.ErrGeneratedDeferredCausetFunctionIsNotAllowed, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrGeneratedDeferredCausetFunctionIsNotAllowed])
    97  	// ErrUnsupportedPartitionByRangeDeferredCausets returns for does unsupported partition by range columns.
    98  	ErrUnsupportedPartitionByRangeDeferredCausets = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "partition by range columns"))
    99  	errUnsupportedCreatePartition         = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "partition type, treat as normal causet"))
   100  	errBlockPartitionDisabled             = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, "Partitions are ignored because Block Partition is disabled, please set 'milevadb_enable_block_partition' if you need to need to enable it")
   101  	errUnsupportedIndexType               = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "index type"))
   102  
   103  	// ErrDupKeyName returns for duplicated key name
   104  	ErrDupKeyName = terror.ClassDBS.New(allegrosql.ErrDupKeyName, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrDupKeyName])
   105  	// ErrInvalidDBSState returns for invalid dbs perceptron object state.
   106  	ErrInvalidDBSState = terror.ClassDBS.New(allegrosql.ErrInvalidDBSState, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidDBSState]))
   107  	// ErrUnsupportedModifyPrimaryKey returns an error when add or drop the primary key.
   108  	// It's exported for testing.
   109  	ErrUnsupportedModifyPrimaryKey = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "%s primary key"))
   110  	// ErrPHoTTexCantBeInvisible return an error when primary key is invisible index
   111  	ErrPHoTTexCantBeInvisible = terror.ClassDBS.New(allegrosql.ErrPHoTTexCantBeInvisible, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPHoTTexCantBeInvisible])
   112  
   113  	// ErrDeferredCausetBadNull returns for a bad null value.
   114  	ErrDeferredCausetBadNull = terror.ClassDBS.New(allegrosql.ErrBadNull, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBadNull])
   115  	// ErrBadField forbids to refer to unknown column.
   116  	ErrBadField = terror.ClassDBS.New(allegrosql.ErrBadField, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBadField])
   117  	// ErrCantRemoveAllFields returns for deleting all columns.
   118  	ErrCantRemoveAllFields = terror.ClassDBS.New(allegrosql.ErrCantRemoveAllFields, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrCantRemoveAllFields])
   119  	// ErrCantDropFieldOrKey returns for dropping a non-existent field or key.
   120  	ErrCantDropFieldOrKey = terror.ClassDBS.New(allegrosql.ErrCantDropFieldOrKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrCantDropFieldOrKey])
   121  	// ErrInvalidOnUFIDelate returns for invalid ON UFIDelATE clause.
   122  	ErrInvalidOnUFIDelate = terror.ClassDBS.New(allegrosql.ErrInvalidOnUFIDelate, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidOnUFIDelate])
   123  	// ErrTooLongIdent returns for too long name of database/causet/column/index.
   124  	ErrTooLongIdent = terror.ClassDBS.New(allegrosql.ErrTooLongIdent, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrTooLongIdent])
   125  	// ErrWrongDBName returns for wrong database name.
   126  	ErrWrongDBName = terror.ClassDBS.New(allegrosql.ErrWrongDBName, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongDBName])
   127  	// ErrWrongBlockName returns for wrong causet name.
   128  	ErrWrongBlockName = terror.ClassDBS.New(allegrosql.ErrWrongBlockName, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongBlockName])
   129  	// ErrWrongDeferredCausetName returns for wrong column name.
   130  	ErrWrongDeferredCausetName = terror.ClassDBS.New(allegrosql.ErrWrongDeferredCausetName, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongDeferredCausetName])
   131  	// ErrInvalidGroupFuncUse returns for using invalid group functions.
   132  	ErrInvalidGroupFuncUse = terror.ClassDBS.New(allegrosql.ErrInvalidGroupFuncUse, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidGroupFuncUse])
   133  	// ErrBlockMustHaveDeferredCausets returns for missing column when creating a causet.
   134  	ErrBlockMustHaveDeferredCausets = terror.ClassDBS.New(allegrosql.ErrBlockMustHaveDeferredCausets, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlockMustHaveDeferredCausets])
   135  	// ErrWrongNameForIndex returns for wrong index name.
   136  	ErrWrongNameForIndex = terror.ClassDBS.New(allegrosql.ErrWrongNameForIndex, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongNameForIndex])
   137  	// ErrUnknownCharacterSet returns unknown character set.
   138  	ErrUnknownCharacterSet = terror.ClassDBS.New(allegrosql.ErrUnknownCharacterSet, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnknownCharacterSet])
   139  	// ErrUnknownDefCauslation returns unknown collation.
   140  	ErrUnknownDefCauslation = terror.ClassDBS.New(allegrosql.ErrUnknownDefCauslation, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnknownDefCauslation])
   141  	// ErrDefCauslationCharsetMismatch returns when collation not match the charset.
   142  	ErrDefCauslationCharsetMismatch = terror.ClassDBS.New(allegrosql.ErrDefCauslationCharsetMismatch, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrDefCauslationCharsetMismatch])
   143  	// ErrConflictingDeclarations return conflict declarations.
   144  	ErrConflictingDeclarations = terror.ClassDBS.New(allegrosql.ErrConflictingDeclarations, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrConflictingDeclarations], "CHARACTER SET ", "%s", "CHARACTER SET ", "%s"))
   145  	// ErrPrimaryCantHaveNull returns All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead
   146  	ErrPrimaryCantHaveNull = terror.ClassDBS.New(allegrosql.ErrPrimaryCantHaveNull, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPrimaryCantHaveNull])
   147  	// ErrErrorOnRename returns error for wrong database name in alter causet rename
   148  	ErrErrorOnRename = terror.ClassDBS.New(allegrosql.ErrErrorOnRename, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrErrorOnRename])
   149  	// ErrViewSelectClause returns error for create view with select into clause
   150  	ErrViewSelectClause = terror.ClassDBS.New(allegrosql.ErrViewSelectClause, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrViewSelectClause])
   151  
   152  	// ErrNotAllowedTypeInPartition returns not allowed type error when creating causet partition with unsupported memex type.
   153  	ErrNotAllowedTypeInPartition = terror.ClassDBS.New(allegrosql.ErrFieldTypeNotAllowedAsPartitionField, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFieldTypeNotAllowedAsPartitionField])
   154  	// ErrPartitionMgmtOnNonpartitioned returns it's not a partition causet.
   155  	ErrPartitionMgmtOnNonpartitioned = terror.ClassDBS.New(allegrosql.ErrPartitionMgmtOnNonpartitioned, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionMgmtOnNonpartitioned])
   156  	// ErrDropPartitionNonExistent returns error in list of partition.
   157  	ErrDropPartitionNonExistent = terror.ClassDBS.New(allegrosql.ErrDropPartitionNonExistent, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrDropPartitionNonExistent])
   158  	// ErrSameNamePartition returns duplicate partition name.
   159  	ErrSameNamePartition = terror.ClassDBS.New(allegrosql.ErrSameNamePartition, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrSameNamePartition])
   160  	// ErrRangeNotIncreasing returns values less than value must be strictly increasing for each partition.
   161  	ErrRangeNotIncreasing = terror.ClassDBS.New(allegrosql.ErrRangeNotIncreasing, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrRangeNotIncreasing])
   162  	// ErrPartitionMaxvalue returns maxvalue can only be used in last partition definition.
   163  	ErrPartitionMaxvalue = terror.ClassDBS.New(allegrosql.ErrPartitionMaxvalue, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionMaxvalue])
   164  	//ErrDropLastPartition returns cannot remove all partitions, use drop causet instead.
   165  	ErrDropLastPartition = terror.ClassDBS.New(allegrosql.ErrDropLastPartition, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrDropLastPartition])
   166  	//ErrTooManyPartitions returns too many partitions were defined.
   167  	ErrTooManyPartitions = terror.ClassDBS.New(allegrosql.ErrTooManyPartitions, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrTooManyPartitions])
   168  	//ErrPartitionFunctionIsNotAllowed returns this partition function is not allowed.
   169  	ErrPartitionFunctionIsNotAllowed = terror.ClassDBS.New(allegrosql.ErrPartitionFunctionIsNotAllowed, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionFunctionIsNotAllowed])
   170  	// ErrPartitionFuncNotAllowed returns partition function returns the wrong type.
   171  	ErrPartitionFuncNotAllowed = terror.ClassDBS.New(allegrosql.ErrPartitionFuncNotAllowed, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionFuncNotAllowed])
   172  	// ErrUniqueKeyNeedAllFieldsInPf returns must include all columns in the causet's partitioning function.
   173  	ErrUniqueKeyNeedAllFieldsInPf = terror.ClassDBS.New(allegrosql.ErrUniqueKeyNeedAllFieldsInPf, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUniqueKeyNeedAllFieldsInPf])
   174  	errWrongExprInPartitionFunc   = terror.ClassDBS.New(allegrosql.ErrWrongExprInPartitionFunc, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongExprInPartitionFunc])
   175  	// ErrWarnDataTruncated returns data truncated error.
   176  	ErrWarnDataTruncated = terror.ClassDBS.New(allegrosql.WarnDataTruncated, allegrosql.MyALLEGROSQLErrName[allegrosql.WarnDataTruncated])
   177  	// ErrCoalesceOnlyOnHashPartition returns coalesce partition can only be used on hash/key partitions.
   178  	ErrCoalesceOnlyOnHashPartition = terror.ClassDBS.New(allegrosql.ErrCoalesceOnlyOnHashPartition, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrCoalesceOnlyOnHashPartition])
   179  	// ErrViewWrongList returns create view must include all columns in the select clause
   180  	ErrViewWrongList = terror.ClassDBS.New(allegrosql.ErrViewWrongList, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrViewWrongList])
   181  	// ErrAlterOperationNotSupported returns when alter operations is not supported.
   182  	ErrAlterOperationNotSupported = terror.ClassDBS.New(allegrosql.ErrAlterOperationNotSupportedReason, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrAlterOperationNotSupportedReason])
   183  	// ErrWrongObject returns for wrong object.
   184  	ErrWrongObject = terror.ClassDBS.New(allegrosql.ErrWrongObject, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongObject])
   185  	// ErrBlockCantHandleFt returns FULLTEXT keys are not supported by causet type
   186  	ErrBlockCantHandleFt = terror.ClassDBS.New(allegrosql.ErrBlockCantHandleFt, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlockCantHandleFt])
   187  	// ErrFieldNotFoundPart returns an error when 'partition by columns' are not found in causet columns.
   188  	ErrFieldNotFoundPart = terror.ClassDBS.New(allegrosql.ErrFieldNotFoundPart, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFieldNotFoundPart])
   189  	// ErrWrongTypeDeferredCausetValue returns 'Partition column values of incorrect type'
   190  	ErrWrongTypeDeferredCausetValue = terror.ClassDBS.New(allegrosql.ErrWrongTypeDeferredCausetValue, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrWrongTypeDeferredCausetValue])
   191  	// ErrFunctionalIndexPrimaryKey returns 'The primary key cannot be a functional index'
   192  	ErrFunctionalIndexPrimaryKey = terror.ClassDBS.New(allegrosql.ErrFunctionalIndexPrimaryKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFunctionalIndexPrimaryKey])
   193  	// ErrFunctionalIndexOnField returns 'Functional index on a column is not supported. Consider using a regular index instead'
   194  	ErrFunctionalIndexOnField = terror.ClassDBS.New(allegrosql.ErrFunctionalIndexOnField, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrFunctionalIndexOnField])
   195  	// ErrInvalidAutoRandom returns when auto_random is used incorrectly.
   196  	ErrInvalidAutoRandom = terror.ClassDBS.New(allegrosql.ErrInvalidAutoRandom, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidAutoRandom])
   197  	// ErrUnsupportedConstraintCheck returns when use ADD CONSTRAINT CHECK
   198  	ErrUnsupportedConstraintCheck = terror.ClassDBS.New(allegrosql.ErrUnsupportedConstraintCheck, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedConstraintCheck])
   199  
   200  	// ErrSequenceRunOut returns when the sequence has been run out.
   201  	ErrSequenceRunOut = terror.ClassDBS.New(allegrosql.ErrSequenceRunOut, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrSequenceRunOut])
   202  	// ErrSequenceInvalidData returns when sequence values are conflicting.
   203  	ErrSequenceInvalidData = terror.ClassDBS.New(allegrosql.ErrSequenceInvalidData, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrSequenceInvalidData])
   204  	// ErrSequenceAccessFail returns when sequences are not able to access.
   205  	ErrSequenceAccessFail = terror.ClassDBS.New(allegrosql.ErrSequenceAccessFail, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrSequenceAccessFail])
   206  	// ErrNotSequence returns when object is not a sequence.
   207  	ErrNotSequence = terror.ClassDBS.New(allegrosql.ErrNotSequence, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrNotSequence])
   208  	// ErrUnknownSequence returns when drop / alter unknown sequence.
   209  	ErrUnknownSequence = terror.ClassDBS.New(allegrosql.ErrUnknownSequence, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnknownSequence])
   210  	// ErrSequenceUnsupportedBlockOption returns when unsupported causet option exists in sequence.
   211  	ErrSequenceUnsupportedBlockOption = terror.ClassDBS.New(allegrosql.ErrSequenceUnsupportedBlockOption, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrSequenceUnsupportedBlockOption])
   212  	// ErrDeferredCausetTypeUnsupportedNextValue is returned when sequence next value is assigned to unsupported column type.
   213  	ErrDeferredCausetTypeUnsupportedNextValue = terror.ClassDBS.New(allegrosql.ErrDeferredCausetTypeUnsupportedNextValue, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrDeferredCausetTypeUnsupportedNextValue])
   214  	// ErrAddDeferredCausetWithSequenceAsDefault is returned when the new added column with sequence's nextval as it's default value.
   215  	ErrAddDeferredCausetWithSequenceAsDefault = terror.ClassDBS.New(allegrosql.ErrAddDeferredCausetWithSequenceAsDefault, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrAddDeferredCausetWithSequenceAsDefault])
   216  	// ErrUnsupportedExpressionIndex is returned when create an memex index without allow-memex-index.
   217  	ErrUnsupportedExpressionIndex = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "creating memex index without allow-memex-index in config"))
   218  	// ErrPartitionExchangePartBlock is returned when exchange causet partition with another causet is partitioned.
   219  	ErrPartitionExchangePartBlock = terror.ClassDBS.New(allegrosql.ErrPartitionExchangePartBlock, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionExchangePartBlock])
   220  	// ErrBlocksDifferentMetadata is returned when exchanges blocks is not compatible.
   221  	ErrBlocksDifferentMetadata = terror.ClassDBS.New(allegrosql.ErrBlocksDifferentMetadata, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlocksDifferentMetadata])
   222  	// ErrRowDoesNotMatchPartition is returned when the event record of exchange causet does not match the partition rule.
   223  	ErrRowDoesNotMatchPartition = terror.ClassDBS.New(allegrosql.ErrRowDoesNotMatchPartition, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrRowDoesNotMatchPartition])
   224  	// ErrPartitionExchangeForeignKey is returned when exchanged normal causet has foreign keys.
   225  	ErrPartitionExchangeForeignKey = terror.ClassDBS.New(allegrosql.ErrPartitionExchangeForeignKey, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionExchangeForeignKey])
   226  	// ErrCheckNoSuchBlock is returned when exchanged normal causet is view or sequence.
   227  	ErrCheckNoSuchBlock         = terror.ClassDBS.New(allegrosql.ErrCheckNoSuchBlock, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrCheckNoSuchBlock])
   228  	errUnsupportedPartitionType = terror.ClassDBS.New(allegrosql.ErrUnsupportedDBSOperation, fmt.Sprintf(allegrosql.MyALLEGROSQLErrName[allegrosql.ErrUnsupportedDBSOperation], "partition type of causet %s when exchanging partition"))
   229  	// ErrPartitionExchangeDifferentOption is returned when attribute does not match between partition causet and normal causet.
   230  	ErrPartitionExchangeDifferentOption = terror.ClassDBS.New(allegrosql.ErrPartitionExchangeDifferentOption, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrPartitionExchangeDifferentOption])
   231  	// ErrBlockOptionUnionUnsupported is returned when create/alter causet with union option.
   232  	ErrBlockOptionUnionUnsupported = terror.ClassDBS.New(allegrosql.ErrBlockOptionUnionUnsupported, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlockOptionUnionUnsupported])
   233  	// ErrBlockOptionInsertMethodUnsupported is returned when create/alter causet with insert method option.
   234  	ErrBlockOptionInsertMethodUnsupported = terror.ClassDBS.New(allegrosql.ErrBlockOptionInsertMethodUnsupported, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrBlockOptionInsertMethodUnsupported])
   235  
   236  	// ErrInvalidPlacementSpec is returned when add/alter an invalid memristed rule
   237  	ErrInvalidPlacementSpec = terror.ClassDBS.New(allegrosql.ErrInvalidPlacementSpec, allegrosql.MyALLEGROSQLErrName[allegrosql.ErrInvalidPlacementSpec])
   238  )