Commit Graph

61 Commits

Author SHA1 Message Date
a1dc0477a5 types: add error code for package types (#13300) 2019-11-26 19:45:14 +08:00
380216ed20 planner: Fixup error when assign DEFAULT in `INSERT/UPDATE/R… (#13211) 2019-11-19 18:23:02 +08:00
26174f11b5 *: disable batch DMLs by default (#13081) 2019-11-07 19:59:15 +08:00
36f0f37b40 expression, planner: remove some fields from `expression.Colum… (#12573) 2019-10-29 15:48:26 +08:00
01cddf63d9 dml : Multiple rows insert in a statement should have consecutive autoID if needed. (#11876)
* 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
2019-10-10 10:34:44 +08:00
41ac571d7b *: remove the LightningMode from TiDB (#12466) 2019-09-29 15:12:01 +08:00
20dc99995a executor: clean up the batch checker code (#12338) 2019-09-24 19:02:45 +08:00
213b783dc6 executor: do not use batchChecker in 'insert ignore into ...' (#12122) 2019-09-10 19:42:00 +08:00
1ef81a8620 *: replace word error in warning, info, debug logs (#12050) 2019-09-09 18:51:12 +08:00
dbdb2f4331 dml : fix last insert id when autoid specified by user in first row. (#11973) 2019-09-02 21:44:35 +08:00
bb84d1bdba planner: allow insert default into generated columns (#11901) 2019-08-30 17:45:40 +08:00
4cd5d15d97 *: improve plan cache param eval and insert const (#10746) 2019-08-27 11:11:01 +08:00
d210889a6c *: trace the execution of the insert operation (#11667) 2019-08-09 14:22:03 +08:00
036e7e207d *: support new 'log' format for trace (#11681) 2019-08-09 12:43:33 +08:00
28c0b1d226 executor: tiny refactor the insertRows function (#11643) 2019-08-07 21:28:44 +08:00
7715341cb7 server: tiny refactor, more go style (#11478) 2019-08-01 17:36:05 +08:00
119d532979 executor: load data/batch insert improvement reducing memory a… (#11284) 2019-07-23 18:41:52 +08:00
b3f71868c1 executor: fix autoid doesn't handle float, double type and tin… (#11110) 2019-07-22 19:19:54 +08:00
66f5754c68 *: add trace support for the AllocAutoIncrementValue function (#11158) 2019-07-10 15:07:42 +08:00
ray
862a2beba5 - make generated column ref in insert set available (#11042)
- change generated column calculation later in fillValue, resolve related compatible problems
2019-07-04 17:43:58 +08:00
d244723a5e executor: remove unused structure RecordBatch (#10891) 2019-06-26 15:26:16 +08:00
c8d1ff7ca6 *: replace 'logutil.Logger(context.Background())' with 'logutil.BgLogger()' (#10866) 2019-06-21 19:13:31 +08:00
f6be085bc6 executor: tiny refactor the Executor interface (#10846)
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
}
```
2019-06-19 15:55:28 +08:00
7d27fa63d3 ddl, table: allow using SHARD_ROW_ID_BITS with auto_incremental columns (#10759) 2019-06-12 20:43:29 +08:00
f3ab907dcc types: rename CopyRow and CopyDatum to Clone* (#10333) 2019-05-09 19:26:01 +08:00
70c37188ac executor: fix bad null error handling for insert statement when disabling the strict SQL mode (#10161) 2019-04-21 15:53:47 +08:00
e9653675dd *: remove errors.Trace in main handle path (#10033) 2019-04-04 14:27:15 +08:00
76a01da313 remove unnecessary expensive trace call and log from hot path (#10025) 2019-04-03 23:09:51 +08:00
f738ba24ad executor: replace logger with zap logger (#9521) 2019-03-14 15:14:38 +08:00
f8d90202c0 use single batch for insert (#9406) 2019-03-07 11:52:10 +08:00
00c4ff4fa9 *: refactor Executor.Next() to receive RecordBatch (#8994) 2019-01-14 15:04:36 +08:00
e06c87d3c1 add an option for AddRecord and Create (#8884) 2019-01-02 11:30:53 +08:00
3040788655 *: make errcheck work again (#8795) 2018-12-25 17:16:52 +08:00
a7907ede7a *: remove fail field from TxnState (#8712)
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.
2018-12-20 16:36:12 +08:00
7528a059cf executor/server/session: add extra info message sent to mysql client (#8285) 2018-12-19 15:32:49 +08:00
7056bb0d32 executor, session: refine insert unsigned bigint autoIncreID (#8181) 2018-12-18 23:01:10 +08:00
ce622ec6d8 session: move more session vars to stmt context for retrying (#8034) 2018-12-10 16:39:43 +08:00
93acd10f53 *: add context.Context to NewTxn(), tiny refactor (#8530) 2018-12-06 17:45:16 +08:00
c137cada68 *: change golang.org/x/net/context to standard context (#8579) 2018-12-05 13:54:00 +08:00
cb4d5bd988 executor: support batch insert for insert values statement (#8420) 2018-12-04 17:44:50 +08:00
3742a0d602 *: Txn() function signature refactor and remove ActivePendingTxn() (#8327)
* 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)
2018-11-16 11:10:39 +08:00
693ff90193 [cherry-pick]*: add a variable to control whether we can write _tidb_rowid (#8187) 2018-11-05 22:45:32 +08:00
32b1dbd8d5 *: rename "github.com/pkg/errors" to "github.com/pingcap/errors" (#8136)
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.
2018-11-01 16:09:07 +08:00
89dda9d9a8 *: move parser to a separate repository (#8036) 2018-10-25 11:12:10 +08:00
d8b52b82a8 executor: improve wide table insert & update performance (#7935) 2018-10-23 18:07:54 +08:00
f3148da27f executor: add an variable to compatible with MySQL insert for OGG (#7863) 2018-10-17 10:19:04 +08:00
d7a59ec5a3 executor: remove some useless code and avoid some redundancy check (#7639) 2018-10-12 12:56:02 +08:00
05b37de16e *: use chunk grow for simple executor (#7540) 2018-09-27 09:07:51 +08:00
cb03f2bec1 move from juju/errors to pkg/errors (#7151) 2018-09-12 15:42:20 +08:00
9070bb6b86 executer: fix the last_insert_id in insert on duplicate key update (#7534) 2018-08-30 14:16:30 +08:00