* consecutive id
* add AllocN interface func for util/kvencoder/allocator.go
* fix allocN test
* fix allocN tests
* fix allocN test 1
* fix allocN test 2
* fix allocN test 3
* fix allocN test 4
* fix cache
* add auto consecutive increment id in insert executor
* add auto consecutive increment id comment in insert executor
* try fix test case
* fix session_test.TestAutoIncrementID autoid overflow
* fix session_test.TestAutoIncrementID unsighed autoid overflow
* fix autoid usigned computing overflow
* fix conflict with suli's PR
* fix index out of range
* merge similar function
* delete fillRowLazy
* fix commment
* fix bug of rebase
* fix auto.go maxUint64 will be allocated
* fix maxInt64 autoid allocated
* fix batch rowIdx update
* add maxUint64 and maxInt64 limit in allocN
* reconstruct the autoid lazy alloc
* fix format
* remove commnet
* use new kind of logutil.logger(ctx) instead of logutil.BgLogger()
* combine alloc() and allocN together
* remove cache of hasValue
* remove cache of hasValue
* remove cache of hasValue
* remove cache of hasValue
* add test : autoID can find in retryInfo
* add test : autoID can find in retryInfo
* extract retry logic
* extract retry logic
* Update executor/insert_common.go
Co-Authored-By: bb7133 <bb7133@gmail.com>
* Update executor/insert_common.go
Co-Authored-By: bb7133 <bb7133@gmail.com>
* fix comment
* fix comment
* fix comment
* fix comment
* fix comment
* return min and max instead of slice in alloc autoid
* return min and max instead of slice in alloc autoid
* return min and max instead of slice in alloc autoid
* add comment for alloc N
Introduce a base() method to get the baseExecutor, so we don't need to add
method from baseExecutor to the Executor interface any more
Before:
```
type Executor interface {
Open(context.Context) error
Next(ctx context.Context, req *chunk.RecordBatch) error
Close() error
Schema() *expression.Schema
retTypes() []*types.FieldType
newFirstChunk() *chunk.Chunk
}
```
After:
```
type Executor interface {
base() *baseExecutor
Open(context.Context) error
Next(ctx context.Context, req *chunk.RecordBatch) error
Close() error
Schema() *expression.Schema
}
```
Originally, `fail` is added to simplify error handling, avoiding large changes on
the Txn() interface API. But it turns out that `fail` becomes the root of many bugs.
So this commit remove the `fail` and make an API refactory.
* change Txn() function signature to Txn(active bool)
* ActivePendingTxn() is not used any more because Txn() does the work
* change executor builder getStartTS() uint64 to getStartTS() (uint64, error)
We import "github.com/pkg/errors" in the code, and actually put
the "github.com/pingcap/errors" there in the vendor path.
That's a dirty hack, and prevent the introduce of Go module.