* support 'recover index' in clustered index table
* ddl: add truncate to buildCommonHandleFromChunkRow
* executor: truncate the updated handle
* executor: set core.HandleCols in the initialization of RecoverIndexExec
* refine code
* remove unused code
* fix integration test
* fix integration test
* address comment
* early return when recovering clustered pk
* remove panic
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
The assertion proto was introduced to verify the data consistency, but I find
it's complex and hard to achieve that goal. Adding additional assertions just
makes more memory occupation, especially in the large transaction.
So it's better to remove it.
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.
Thank you for working on TiDB! Please read TiDB's [CONTRIBUTING](https://github.com/pingcap/tidb/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
## What have you changed? (mandatory)
During coprocessor dag task, it first uses timezone `name`, if non-empty, to get legitimate timezone variable. To achieve this, we need to push down such data into tikv which leads to change the logic of building pushdown request. The logic I mentioned mainly resides in `executor` package.
I change `timeZoneOffset` to `zone` and add second return parameter `name string`. The intentioned of doing this to adopt the convention of `time` package.
For the same purpose, I change `GetTimeZone` to `Location`. As you can see, in `time` package, timezone was bind to `Location`.
## What are the type of the changes (mandatory)?
- Bug fix (non-breaking change which fixes an issue)
## How has this PR been tested (mandatory)?
unit-test
integration-test will be added shortly