Commit Graph

78 Commits

Author SHA1 Message Date
d901863643 executor: insert negative primary key into auto_random table won't trigger rebase (#15397) 2020-04-15 20:56:37 +08:00
c81e903804 *: use the revertable sandbox to buffer mutations (#15931) 2020-04-03 14:54:27 +08:00
3ced6bc9ac dml: support default expression cache when insert (#15216) 2020-03-19 10:51:22 +08:00
1ff32ace27 executor: use MySQL compatible truncate error code (#15422) 2020-03-18 12:28:43 +08:00
4adff06b99 executor: reduce task queue size to reduce memory consume for load statement (#15369) 2020-03-14 20:23:53 +08:00
88dd552a6d *: fix autoid allocation to avoid quickly exhaustion (#15261) 2020-03-13 10:50:03 +08:00
b504d37924 *: refine the table.Table interface (#15227)
remove unnecessary methods.
"The bigger the interface, the weaker the abstraction -- Rob Pike"
2020-03-10 13:40:56 +08:00
55b3e1110c *: reduce the allocation caused by Datum.Copy (#15219) 2020-03-09 17:38:46 +08:00
dcb8b3d5dd executor: fix last_insert_id in auto_random mode (#15145) 2020-03-05 15:59:18 +08:00
a528e60e3b *: add auto_random id cache for statement retrying and table recover (#14711) 2020-02-19 18:53:03 +08:00
007c0e6656 *: support default expression value for sequence (#14589) 2020-02-13 18:50:33 +08:00
870d4b19c8 *: support auto_increment_increment & auto_increment_offset. (#14301) 2020-01-08 10:18:39 +08:00
ebc4fa9dee executor: resort fields for reducing the memory allocated (#14208) 2019-12-31 17:19:59 +08:00
c1bc9ffe5b *: add memory tracker for InsertExec and ReplaceExec (#14179) 2019-12-30 11:43:01 +08:00
86ae838d5a planner/core: disallow using hidden column in insert statement (#14150) 2019-12-26 16:08:55 +08:00
fce9870208 ddl,executor: add auto_random column option (#13127) 2019-12-23 14:51:51 +08:00
d587c63062 *: some tiny improvements for the large transaction (#13815)
1. Set the default txn size limit to 1G
2. Reduce memory footprint during insert for the large txn
3. Recycle the session buffer memory to avoid leak
4. Set rate limit to avoid 2PC prewrite overloads the TiKV
5. Start ttlManager for the large txn
2019-12-03 00:40:40 +08:00
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