Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: Merge master to feature/reorganize-partition #39164

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
22b85b9
statistics, planner: make the content in `HistColl.ColID2IdxIDs` stab…
time-and-fate Oct 18, 2022
d037637
*: don't use DSN to avoid some security problems (#38342)
lance6716 Oct 19, 2022
ff5fd4e
lightning: make default file router support compression (#38515)
lichunzhu Oct 19, 2022
9743a9a
txn: add table name in dup entry error message (#38243)
ekexium Oct 19, 2022
300d9e7
ddl: Support flashback schema (#37438)
erwadba Oct 19, 2022
7a9ed6f
planner: introduce some new hints for MPP plans (#38516)
qw4990 Oct 19, 2022
51e559c
bazel: update config and nogo (#38549)
hawkingrei Oct 19, 2022
298ce91
ddl: LINEAR HASH as HASH partitioned table (#38451)
mjonss Oct 19, 2022
e48f357
session: refactor non-transactional DML to make it ready for more DML…
ekexium Oct 19, 2022
93e0d36
extension: init tidb new extension framework (#38497)
lcwangchao Oct 19, 2022
5b0ae14
dump: fix dump large tables will timeout (#38540)
lance6716 Oct 20, 2022
17c7bcc
executor: fix the missing `Grantor` when querying `mysql`.`tables_pri…
CbcWestwolf Oct 20, 2022
c13a810
executor: fix TestIssue36903 which does not check result (#38565)
tiancaiamao Oct 20, 2022
4699c7d
*: support `ATTRIBUTE` and `COMMENT` in `CREATE USER` and `ALTER USER…
CbcWestwolf Oct 20, 2022
fb3c563
server, executor: allow showing session_states without TLS (#38529)
djshow832 Oct 20, 2022
7806b7c
planner: process over-optimization and skip plan-cache in some cases …
qw4990 Oct 20, 2022
4f5eafd
*: fix restore error typo (#38578)
xhebox Oct 20, 2022
431a9d8
planner: remove two useless hints `mpp_tidb_agg` and `mpp_scalar_agg`…
qw4990 Oct 20, 2022
c52b5a7
DDL: delete partition table tiflash replica progress from ETCD when t…
Oct 20, 2022
c1666d1
sessionctx: add tidb_gogc_tuner_threshold (#38432)
hawkingrei Oct 20, 2022
8d57ed9
bazel: remove useless config (#38581)
hawkingrei Oct 20, 2022
4346898
*: add foreign key cascade delete when execute delete statement (#38377)
crazycs520 Oct 21, 2022
873a3ea
json: add json_storage_free function (#38544)
YangKeao Oct 21, 2022
f65f4ba
planner: LRUPlanCache memory trace (#38069)
fzzf678 Oct 21, 2022
59886f5
sessionctx/variable: turn on range memory control by default (#38592)
xuyifangreeneyes Oct 21, 2022
9d606cd
parser, execution: support kill connection_id() (#37650)
hawkingrei Oct 21, 2022
85b53e1
*: fix docker script (#38602)
xhebox Oct 22, 2022
41518c9
executor: fix getting the more result when `select * from TIKV_REGION…
Defined2014 Oct 23, 2022
ad0f7d2
extension: allow extension to custom functions (#38567)
lcwangchao Oct 24, 2022
fe09770
extension: support bootstrap for extension (#38589)
lcwangchao Oct 24, 2022
b80a39f
parser: supports `flashback table` and `flashback database` (#38546)
Defined2014 Oct 24, 2022
7596b03
variables, config: change tidb_auth_signing_cert from variables to co…
djshow832 Oct 24, 2022
64051f9
planner: avoid double scan for index prefix col is (not) null (#38555)
xuyifangreeneyes Oct 24, 2022
00169d2
inforschema: check the user permission before loading TIKV_REGION_STA…
CbcWestwolf Oct 25, 2022
44cd0b0
ddl, session: let ddl related tables controlled by `split-table` (#38…
Defined2014 Oct 25, 2022
06ed0e6
gctuner: remove limit for global memory limit (#38629)
hawkingrei Oct 25, 2022
70f3348
executor: support save partition stats in concurrency (#38239)
Yisaer Oct 25, 2022
b5e99ec
br/restore: fixed restore sys tables (#38547)
YuJuncen Oct 25, 2022
2cdfdf2
executor: fix issue of foreign key cascade delete very slow (#38633)
crazycs520 Oct 25, 2022
0c68f91
*: support foreign key on delete set null when execute delete stateme…
crazycs520 Oct 25, 2022
9d56ee9
log-backup: add progress bar for truncate (#36454)
YuJuncen Oct 26, 2022
ac0d36b
log-backup: set checkpoint-ts - 1 as safe-point-ts (#38249)
joccau Oct 26, 2022
6c55faf
planner: update the cost model ver2 (#38643)
qw4990 Oct 26, 2022
4bdd20b
*: support 2-phases flashback cluster (#38164)
Defined2014 Oct 26, 2022
0f6baa3
lightning: support extracting source/schema/table name to specific co…
lichunzhu Oct 26, 2022
e843278
executor: fix HashJoinExec panic of closed channel (#38576)
Qiaolin-Yu Oct 26, 2022
d27c706
util: reduce STW from ReadMemStats (#38632)
hawkingrei Oct 26, 2022
753e3da
extension: support extension to listen connection events (#38624)
lcwangchao Oct 26, 2022
cd531a4
*: support auto_random on composite clustered primary key (#38617)
tangenta Oct 27, 2022
ec93697
server: update dispatch behavior on mysql command SLEEP (#38645)
igxlin Oct 27, 2022
c4316fb
log-backup: support restart task after stop a log-backup task (#38381)
joccau Oct 27, 2022
1cf6e77
DDL: fix update progress of available table (#38677)
Oct 27, 2022
fb6a131
session: tidb_server_memory_limit inherits the value of server-memory…
wshwsh12 Oct 27, 2022
756c7b3
planner: update seek-factor in cost model ver2 (#38682)
qw4990 Oct 27, 2022
c3ecb04
executor: support record analzye merge job (#38672)
Yisaer Oct 27, 2022
bba321c
*: skip log timeout on maxExecutiontime as slow query for DDL stateme…
Benjamin2037 Oct 27, 2022
3b10b3c
planner: update some cost formulas of model ver2 (#38690)
qw4990 Oct 27, 2022
18698d1
extension: add more informations to extension context (#38693)
lcwangchao Oct 27, 2022
86dd999
session: set tidb_opt_range_max_size to 0 when upgrading to v6.4.0+ (…
xuyifangreeneyes Oct 28, 2022
9331f51
dumpling: fix consistency lock table when tables to dump is empty (#3…
lichunzhu Oct 28, 2022
95d177a
planner: add more tests for pushing IsNull to prefix index (#38697)
xuyifangreeneyes Oct 28, 2022
7806839
planner: revise isnullRejected check for `And` and `OR` (#38702)
Yisaer Oct 28, 2022
d760405
*: upgrade pingcap/log and uber-go/zap (#38696)
hawkingrei Oct 28, 2022
636a363
server: support dumpPartitionStats param for statsHandler (#38190)
Yisaer Oct 28, 2022
b9029f1
log-backup: using streaming to load metadata for preventing OOM (#38386)
YuJuncen Oct 28, 2022
e8e37b3
ddl: make "add foreign key" step in multiple schema versions (#38679)
crazycs520 Oct 28, 2022
40f059a
executor: add some memory tables to observe memory usage (#38452)
wshwsh12 Oct 28, 2022
1614991
cgroup: get right value when cgroup set max value (#38661)
hawkingrei Oct 28, 2022
925bc26
*: close resultset (#38704)
hawkingrei Oct 28, 2022
37349e1
planner: disable query-feedback thoroughly
qw4990 Oct 28, 2022
582d18a
executor: fix revoke result view bug (#38552)
wxbty Oct 28, 2022
275896c
br: fix broken integration test with tiflash (#38692)
3pointer Oct 28, 2022
e415cfa
DDL: use new PD API to get TiFlash replica table regionCount (#38571)
Oct 28, 2022
ba2e2c9
executor: show create table should distinguish between old and new fo…
crazycs520 Oct 28, 2022
6d6e9c4
*: show backfill type in `admin show ddl jobs` (#38733)
tangenta Oct 28, 2022
bc0b419
lightning: support custom file listing policy (#38599)
dsdashun Oct 30, 2022
312155a
lightning: Compress Reader/Writer supports reading/writing Snappy/Zst…
lyzx2001 Oct 31, 2022
7571d55
executor: fix inl_hash join performance regression because of Iterato…
guo-shaoge Oct 31, 2022
0e23da6
*: create a user using `tidb_auth_token` authentication (#38585)
CbcWestwolf Oct 31, 2022
f9b0e01
extension: allow the dynamic argument length of the extension's custo…
lcwangchao Oct 31, 2022
8355181
DDL: Remove TiFlash replica progress etcd dependency (#38564)
Oct 31, 2022
cff890a
*: add server ip in connection info (#38723)
lcwangchao Oct 31, 2022
65a318f
executor: add memory track in handle cop request (#38755)
crazycs520 Oct 31, 2022
a151383
util: fix panic cause by nil plan in memeory usage alarm (#38727)
mengxin9014 Oct 31, 2022
b7aae15
txn: fix false assertion error caused by loss of pessimistic locks (#…
ekexium Oct 31, 2022
37ed0ab
tests: added v1 test for iterators (#38765)
YuJuncen Oct 31, 2022
5a8fd6d
*: fix goleak when to use CreateMockStoreAndDomain (#38734)
hawkingrei Nov 1, 2022
08aa32e
*: update bazel config (#38745)
hawkingrei Nov 1, 2022
38e9aa0
*: support foreign key on update cascade and set null when execute up…
crazycs520 Nov 1, 2022
ecdc0f7
extension: add error and active roles info to `extension.ConnEventInf…
lcwangchao Nov 1, 2022
7e4d759
bazel: use --remote_download_minimal in ci (#38780)
hawkingrei Nov 1, 2022
cc2a038
sessionctx: fix TiDBGOGCTunerThreshold failing to ParseFloat (#38774)
hawkingrei Nov 1, 2022
be75669
dumpling: add progress to dumpling's status (#38625)
okJiang Nov 1, 2022
ba6ae45
*: add variables and support external timestamp read (#38276)
YangKeao Nov 1, 2022
a1de01d
executor: refine `EXPLAIN ANALYZE` info for `INSERT IGNORE` statement…
crazycs520 Nov 1, 2022
97add26
json: support array range selection and from last selection (#38584)
YangKeao Nov 1, 2022
863d352
ddl: support add foreign key constraint with auto-create index (#38763)
crazycs520 Nov 1, 2022
5b0be9a
nogo: enable filepermission during building and lint (#38801)
hawkingrei Nov 1, 2022
e245b84
planner: Add HashJoin<-Receiver specific physicalPlan column pruner (…
yibin87 Nov 2, 2022
ef95612
*: extend the semantic of mem-quota-query to mem-quota-session (#38423)
XuHuaiyu Nov 2, 2022
30f3130
planner: judge nil pointer before call MemoryUsage (#38764)
fzzf678 Nov 2, 2022
60b2aa6
sessionctx: support bytes format and percentage format for tidb_serve…
wshwsh12 Nov 2, 2022
acf1dcf
planner: supply Task memory usage and correct some accumulation (#38638)
fzzf678 Nov 2, 2022
5fa9e25
executor: support foreign key on update cascade in insert on duplicat…
crazycs520 Nov 2, 2022
49e7c70
executor: support checking killed during merge stats (#38708)
Yisaer Nov 2, 2022
1c5b837
planner: fix the cost model version in explain-tests (#38728)
qw4990 Nov 2, 2022
ba175c4
util: fix panic cause by concurrent map iteration and write in memory…
mengxin9014 Nov 2, 2022
a3d7420
planner: add monitor for prepared plan cache memory usage (#38507)
fzzf678 Nov 2, 2022
26ba9b6
executor: fix some bug for global memory control (#38798)
wshwsh12 Nov 2, 2022
722aa68
docs: Support global memory control design (#38121)
wshwsh12 Nov 2, 2022
17bba4d
ddl: correct the next key during adding index (#38804)
tangenta Nov 2, 2022
5cdfea6
*: bring back the 'make ut' (#38806)
tiancaiamao Nov 2, 2022
caa26a4
session: make min start ts reporter aware of internal session from `g…
tangenta Nov 2, 2022
17c6c48
executor: add CPU padding for chunk.Iterator4Slice (#38800)
guo-shaoge Nov 2, 2022
0f62d1f
planner: projection should not push the expr that is not fully substi…
winoros Nov 2, 2022
e6f020a
executor: fix issue of insert ignore with foreign key check (#38832)
crazycs520 Nov 2, 2022
64ca5d4
planner: udpate cost model ver2 and some related UT (#38833)
qw4990 Nov 2, 2022
07a0ef2
executor: refactor plan replayer exec (#38786)
Yisaer Nov 2, 2022
e1b2f7c
*: downgrade the dependencies (#38821)
okJiang Nov 2, 2022
8db7c3b
ci, Makefile: add make rule to check bazel prepare (#38818)
YangKeao Nov 2, 2022
adf1adf
br: calculate the global checkpoint-ts of log-back task. (#38815)
joccau Nov 3, 2022
0f5bcd2
bazel: upgrade bazel version to 5.3.2 (#38843)
shenqidebaozi Nov 3, 2022
7e5086c
br: add GetTSWithRetry func (#38663)
MoCuishle28 Nov 3, 2022
3baebdb
table/tables: fix unstable test TestCacheTableBasicReadAndWrite (#38820)
tiancaiamao Nov 3, 2022
cacd3c8
expression: unset the flen for string type builtin control (#38845)
tangenta Nov 3, 2022
99a5728
*: support switch auth when change user (#38830)
xhebox Nov 3, 2022
033b9ce
domain: unify replayer folder with oom and log (#38816)
Yisaer Nov 3, 2022
a65468e
planner: treat null as a different type compare to other types (#38840)
Reminiscent Nov 3, 2022
aafdf0e
util, executor: remove OOMAction after a query finishing (#38834)
XuHuaiyu Nov 3, 2022
510003d
planner: add switch for plan cache memory trace (#38824)
fzzf678 Nov 3, 2022
59bed2f
sessionctx: enable tidb_stats_load_sync_wait by default (#38841)
chrysan Nov 3, 2022
bd081f1
br: ebs volume snapshot backup and restore with flashback solution (#…
fengou1 Nov 3, 2022
4c75850
ddl: make test case TestCacheTableSizeLimit stable (#38822)
tiancaiamao Nov 3, 2022
5ee578c
planner, session: use SessionExtendedInfoSchema if snapshot isn't set…
wjhuang2016 Nov 3, 2022
bc7d0aa
variable: add global scope for tidb_opt_agg_push_down (#38868)
winoros Nov 3, 2022
fce4fda
sessionctx: fix tidb_gogc_tuner_threshold (#38851)
hawkingrei Nov 3, 2022
dd3bcee
*: support mysql compatible auto_increment, the server side changes (…
tiancaiamao Nov 3, 2022
c799b0f
*: disable global memory control by default (#38859)
wshwsh12 Nov 3, 2022
09f6295
ddl: fix issue of foreign key name too long (#38855)
crazycs520 Nov 3, 2022
4df8d85
metrics: update active connection promeQL and add metric: miss plan c…
Yui-Song Nov 3, 2022
74ac033
server: fix deadlock when call `killNonFlashbackConn` (#38872)
Defined2014 Nov 3, 2022
d7bd49a
session: support non-transactional insert statements (#38799)
you06 Nov 3, 2022
f9c7bbc
*: authentication using `tidb_auth_token` plugin (#38773)
CbcWestwolf Nov 3, 2022
12d9644
*: support mysql compatible auto_increment, the client side changes (…
tiancaiamao Nov 4, 2022
c6e1982
sessionctx: enable clustered index by default (#38447)
tangenta Nov 4, 2022
72407d9
util: set checkpoint during Sort for SortedRowContainer (#38865)
XuHuaiyu Nov 4, 2022
0ab5231
docs: add a proposal for `flashback to timestamp` (#38367)
Defined2014 Nov 4, 2022
e5d3195
executor: generate AST instead of SQL for foreign key cascade (#38796)
crazycs520 Nov 4, 2022
0b3e1e9
*: Chunkreuse try reuse chunk in operator (#38607)
keeplearning20221 Nov 4, 2022
fb89796
planner: update some UTs to use cost model2 (#38875)
qw4990 Nov 4, 2022
de568be
server: fix cannot listen on ipv6 address (#38861)
nexustar Nov 4, 2022
55f4a63
fix(sec): upgrade org.apache.kafka:kafka_2.12 to 3.2.3 (#38878)
645775992 Nov 4, 2022
4f9de19
*: fix check auth support (#38884)
xhebox Nov 4, 2022
0e33fc2
ddl: restricting MODIFY COLUMN on partitioning columns. (#38670)
mjonss Nov 4, 2022
2f03a8d
*: GitHub Workflows security hardening (#38880)
sashashura Nov 4, 2022
6ab1707
telemetry: telemetry supports count `flashback cluster` (#38901)
Defined2014 Nov 4, 2022
fd18bb0
telemetry: add telemetry for global memory control (#38905)
wshwsh12 Nov 4, 2022
570f9a1
test: remove useless fixme in join test (#38864)
Qiaolin-Yu Nov 4, 2022
963c4ee
test: fix unstable test (#38906)
xiongjiwei Nov 4, 2022
114d8c1
*: enable global memory control by default (#38899)
wshwsh12 Nov 4, 2022
d323b8d
planner: update some UTs to cost model2 (#38893)
qw4990 Nov 5, 2022
490e4c4
session, sessionctx: enable metadata lock by default (#38866)
wjhuang2016 Nov 7, 2022
21d6190
txn: tidb_constraint_check_in_place_pessimistic should not be global …
ekexium Nov 7, 2022
30a76ce
telemetry: add telemetry for the new autoid implementation (#38915)
tiancaiamao Nov 7, 2022
dc9b691
extension: add extension API to listen stmt events (#38789)
lcwangchao Nov 7, 2022
54ff6e3
planner: update some UTs from cost model1 to model2 (#38925)
qw4990 Nov 7, 2022
f79e67f
executor: insert ignore return errAutoincReadFailed warning (#38486)
hawkingrei Nov 7, 2022
32248e2
*: fix panic when reusing `OptimisticTxnContextProvider` (#38952)
lcwangchao Nov 7, 2022
3ad6f93
planner: update some UTs from cost model1 to model2 (#38947)
qw4990 Nov 8, 2022
97b0151
metrics: add metrics for multi-statement (#38931)
jackysp Nov 8, 2022
2643550
*: upgrade golang 1.19.3 (#38805)
hawkingrei Nov 8, 2022
6eb9379
planner: sync load shouldn't load items which isn't intiailized befor…
Yisaer Nov 8, 2022
473a03c
gcworker: update gc time format (#38942)
Defined2014 Nov 8, 2022
3208719
planner: update some UTs from cost model1 to model2 (#38959)
qw4990 Nov 8, 2022
96708ad
log-backup: truncate metadata streamingly (#38870)
Leavrth Nov 8, 2022
1691161
extension: provide more complete info in StmtEventInfo when error (#3…
lcwangchao Nov 8, 2022
952a5b9
*: fix variable problem during initialization (#38971)
hawkingrei Nov 8, 2022
ad4d432
planner: support record table runtime stats during optimize (#38876)
Yisaer Nov 8, 2022
ea26284
*: avoid special cases DATA RACE (#38918)
keeplearning20221 Nov 8, 2022
18cb721
autoid_service,server: handle TLS config of the etcd client (#38975)
tiancaiamao Nov 8, 2022
c498090
server: set the keepalive MinTime for gRPC server (#38987)
tangenta Nov 9, 2022
10115e0
executor/analyzetest: Stabilise analyze table tests due to SyncWaitSt…
mjonss Nov 9, 2022
ce62915
planner: update the scan-row-size calculation formula in model2 (#38968)
qw4990 Nov 9, 2022
9efcb88
ddl: fix rename partition column panic (#38932) (#38989)
mjonss Nov 9, 2022
9303bfe
ddl: set tidb_super_read_only=ON when do flashback cluster (#38986)
Defined2014 Nov 9, 2022
8653b1e
statisticstest: fix goleak on the statisticstest (#39005)
hawkingrei Nov 9, 2022
2ec3e91
executor,bindinfo: set number of rows affected for drop global bindin…
dveeden Nov 9, 2022
4aa89a6
br: refine IsLogBackupEnabled (#38997)
tangenta Nov 9, 2022
5426727
util: support intermediate certs when use TLS (#39016)
lance6716 Nov 9, 2022
39f35c0
executor: fix unstable test TestShuffleMergeJoinInDisk (#39015)
wshwsh12 Nov 9, 2022
6399e6c
planner: update some UTs from cost model1 to model2 (#39013)
qw4990 Nov 9, 2022
9dc8bc9
dump: change cfg to use TLS first (#39030)
Daemonxiao Nov 9, 2022
9761e67
*: enable the CI test for concurrent ddl (#38926)
wjhuang2016 Nov 9, 2022
7f9219c
types: Make use of the new time.ZoneBounds function in go-1.19 (#39038)
mjonss Nov 10, 2022
d970c9b
util: add lock for MergeBasicStats (#38998)
mengxin9014 Nov 10, 2022
cfbe3c9
ddl: improve the reorg task scheduling (#38646)
tangenta Nov 10, 2022
066e9c8
domain: support plan_replayer_status system table (#38957)
Yisaer Nov 10, 2022
94aa804
auto_inc,constraint: Ignore check constraint for auto-increment check…
YangKeao Nov 10, 2022
208478b
executor: fix hashjoin goleak (#39023)
xhebox Nov 10, 2022
a20b70f
lightning: fix cluster index (#39010)
lichunzhu Nov 10, 2022
f51227c
extension: provide more informations in `extension.FunctionContext` (…
lcwangchao Nov 10, 2022
063d819
*: upgrade pingcap/log (#39064)
sleepymole Nov 10, 2022
f5171e3
executor: fix admin show job panic when upgrade from v4.0 to v6.4 (#3…
tangenta Nov 10, 2022
42ff5e6
executor: split hashjoin into workers(part1) (#39063)
XuHuaiyu Nov 11, 2022
a3fff42
ddl: refine logic of OwnerCheckAllVersions (#39070)
wjhuang2016 Nov 11, 2022
3bbffdf
planner: update some UTs from cost model1 to model2 (#39065)
qw4990 Nov 11, 2022
ddb4355
domain: support plan_replayer_task system table (#39019)
Yisaer Nov 11, 2022
f16209f
dumpling: process nan when chunk is zero (#39083)
okJiang Nov 11, 2022
481f5ab
lightning: support checkpoint read for compress files (#38946)
lichunzhu Nov 11, 2022
b5e1f7a
executor: split hashjoin into workers(part2) (#39079)
XuHuaiyu Nov 11, 2022
80c8fea
planner: update some UTs from cost model1 to model2 (#39085)
qw4990 Nov 11, 2022
483d2bc
stmtctx: remove the empty values in `StatementContext.Tables` (#39086)
lcwangchao Nov 11, 2022
b702ac7
ddl: delete `pkIsHandle` log in drop index (#39088)
Defined2014 Nov 11, 2022
4b08ccc
statistics, executor: merge Count and ModifyCount for global stats (#…
time-and-fate Nov 11, 2022
238caf6
*: add statistic lock/unlock function (#38387)
pingandb Nov 11, 2022
c919985
systable: Adapt with tiflash_tables changes (#39001)
JaySon-Huang Nov 12, 2022
86d3b46
util: change record analyze to explain in oom alarm (#39099)
mengxin9014 Nov 13, 2022
71e66b2
domain: refactor plan replayer implemention (#39084)
Yisaer Nov 14, 2022
192eae2
binlog: update binlog status from Skippping to On when recover binlog…
joccau Nov 14, 2022
a8f56ee
planner: support the view hint (#38653)
Reminiscent Nov 14, 2022
78d1905
dumpling: compress supports snappy/zstd (#38910)
lyzx2001 Nov 14, 2022
9f9d289
dumpling: revert 39030 (#39108)
okJiang Nov 14, 2022
e939c9b
ddl: fix return duplicate schema version during multi-schema change (…
Defined2014 Nov 14, 2022
61b02ec
gogctuner: fix unstable test in the TestTuner (#39101)
hawkingrei Nov 14, 2022
e8c640e
*: enable race test for more components (#39097)
hawkingrei Nov 14, 2022
678aa56
planner: update some UTs from cost model1 to model2 (#39124)
qw4990 Nov 14, 2022
b0c3381
parser: allow drop stats of multiple tables (#38042)
YangKeao Nov 14, 2022
efa7010
executor: fix issue of show create table with foreign key comment (#3…
crazycs520 Nov 14, 2022
4dd00bc
gogctuner: support Max/Min GOGC (#39109)
hawkingrei Nov 14, 2022
d734cc8
*: refactor some functions for better reusability (#39133)
tangenta Nov 14, 2022
bdcb850
schematracker: treat TableInfo as immutable (#39103)
lance6716 Nov 14, 2022
c69513d
planner: return the proper error for metadata lock so that it can be …
wjhuang2016 Nov 14, 2022
3765abb
infoschema: fix bit, year column metadata is not compatible with mysq…
hawkingrei Nov 15, 2022
b03690a
planner: update some UTs from cost model1 to model2 (#39138)
qw4990 Nov 15, 2022
c354b8b
extension: add support for extension to custom table and sysvar privi…
lcwangchao Nov 15, 2022
c395064
planner: add more test cases for view hint (#39126)
Reminiscent Nov 15, 2022
bb0e8a1
executor: split hashjoin part3 (#39089)
XuHuaiyu Nov 15, 2022
661a6b6
ddl: modify default unique index name (#39145)
wxbty Nov 15, 2022
6af4e4b
statistics: fix merge global stats panic if the partition hasn't been…
Yisaer Nov 15, 2022
27a7f43
Merge remote-tracking branch 'pingcap/master' into feature/reorganize…
mjonss Nov 15, 2022
3e8899e
infoschema: fix FormatTiDBVersion panic (#39172)
Defined2014 Nov 16, 2022
5aa66cb
domain: support dump plan replayer capture task during query (#39125)
Yisaer Nov 16, 2022
d00c588
dockerfile: use rockylinux (#39175)
hawkingrei Nov 16, 2022
ba35a37
util: use one logger (#39176)
xhebox Nov 16, 2022
154f027
ddl: make ddl scheduler prefers pick up already processing job (#38898)
xiongjiwei Nov 16, 2022
ce69f0b
expression: push down EXTRACT Duration to TiFlash (#39105)
birdstorm Nov 16, 2022
b117a2e
ddl,executor: enhance test for auto_increment with AUTO_ID_CACHE=1 (#…
tiancaiamao Nov 16, 2022
7f83ec4
DDL: Fix bug that TiFlash replica unavailable after add partition wit…
Nov 16, 2022
11ab7b4
parser: add ActionReorganizePartition (#39183)
mjonss Nov 16, 2022
444cd76
Merge remote-tracking branch 'pingcap/master' into reorg-part-merge-m…
mjonss Nov 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DEPS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2898,8 +2898,8 @@ def go_deps():
name = "com_github_pingcap_log",
build_file_proto_mode = "disable_global",
importpath = "github.com/pingcap/log",
sum = "h1:T7e5Low0BU2ZazI2dz2mh3W1qv+w8wtvq1YR8DneA0c=",
version = "v1.1.1-0.20221110065318-21a4942860b3",
sum = "h1:crhkw6DD+07Bg1wYhW5Piw+kYNKZqFQqfC2puUf6gMI=",
version = "v1.1.1-0.20221116035753-734d527bc87c",
)
go_repository(
name = "com_github_pingcap_sysutil",
Expand Down
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,24 @@
# limitations under the License.

# Builder image
FROM alpine:edge as builder
FROM rockylinux:9 as builder

ADD . https://raw.githubusercontent.com/njhallett/apk-fastest-mirror/c4ca44caef3385d830fea34df2dbc2ba4a17e021/apk-fastest-mirror.sh ./proxy
RUN sh ./proxy/apk-fastest-mirror.sh -t 50 && apk add --no-cache git build-base go
ENV GOLANG_VERSION 1.19.3
ENV ARCH amd64
ENV GOLANG_DOWNLOAD_URL https://dl.google.com/go/go$GOLANG_VERSION.linux-$ARCH.tar.gz
ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
RUN yum update -y && yum groupinstall 'Development Tools' -y \
&& curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz

COPY . /tidb
ARG GOPROXY
RUN export GOPROXY=${GOPROXY} && cd /tidb && make server

FROM alpine:latest
FROM rockylinux:9-minimal

COPY --from=builder /tidb/bin/tidb-server /tidb-server

Expand Down
28 changes: 23 additions & 5 deletions autoid_service/autoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,30 @@ func (s *Service) allocAutoID(ctx context.Context, req *autoid.AutoIDRequest) (*

val := s.getAlloc(req.DbID, req.TblID, req.IsUnsigned)

if req.N == 0 && val.base != 0 {
base := val.base
if req.N == 0 {
if val.base != 0 {
return &autoid.AutoIDResponse{
Min: val.base,
Max: val.base,
}, nil
}
// This item is not initialized, get the data from remote.
var currentEnd int64
ctx = kv.WithInternalSourceType(ctx, kv.InternalTxnMeta)
err := kv.RunInNewTxn(ctx, s.store, true, func(ctx context.Context, txn kv.Transaction) error {
idAcc := meta.NewMeta(txn).GetAutoIDAccessors(req.DbID, req.TblID).RowID()
var err1 error
currentEnd, err1 = idAcc.Get()
if err1 != nil {
return err1
}
val.end = currentEnd
return nil
})
return &autoid.AutoIDResponse{
Min: base,
Max: base,
}, nil
Min: currentEnd,
Max: currentEnd,
}, err
}

val.Lock()
Expand Down
26 changes: 26 additions & 0 deletions ddl/column_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,3 +959,29 @@ func TestGetDefaultValueOfColumn(t *testing.T) {
tk.MustQuery("select * from t1").Check(testkit.RowsWithSep("|", ""+
"1962-03-03 1962-03-03 00:00:00 12:23:23 2020-10-13 2020-03-27"))
}

func TestIssue39080(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("CREATE TABLE t1(id INTEGER PRIMARY KEY, authorId INTEGER AUTO_INCREMENT UNIQUE)")

tk.MustQuery("show create table t1").Check(testkit.RowsWithSep("|", ""+
"t1 CREATE TABLE `t1` (\n"+
" `id` int(11) NOT NULL,\n"+
" `authorId` int(11) NOT NULL AUTO_INCREMENT,\n"+
" PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+
" UNIQUE KEY `authorId` (`authorId`)\n"+
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin"))

//Do not affect the specified name
tk.MustExec("CREATE TABLE `t2`( `id` INTEGER PRIMARY KEY, `authorId` int(11) AUTO_INCREMENT, UNIQUE KEY `authorIdx` (`authorId`))")

tk.MustQuery("show create table t2").Check(testkit.RowsWithSep("|", ""+
"t2 CREATE TABLE `t2` (\n"+
" `id` int(11) NOT NULL,\n"+
" `authorId` int(11) NOT NULL AUTO_INCREMENT,\n"+
" PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,\n"+
" UNIQUE KEY `authorIdx` (`authorId`)\n"+
") ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin"))
}
186 changes: 102 additions & 84 deletions ddl/db_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2894,17 +2894,23 @@ func TestAutoIncrementTableOption(t *testing.T) {
tk.MustExec("create database test_auto_inc_table_opt;")
tk.MustExec("use test_auto_inc_table_opt;")

// Empty auto_inc allocator should not cause error.
tk.MustExec("create table t (a bigint primary key clustered) auto_increment = 10;")
tk.MustExec("alter table t auto_increment = 10;")
tk.MustExec("alter table t auto_increment = 12345678901234567890;")

// Rebase the auto_inc allocator to a large integer should work.
tk.MustExec("drop table t;")
tk.MustExec("create table t (a bigint unsigned auto_increment, unique key idx(a));")
tk.MustExec("alter table t auto_increment = 12345678901234567890;")
tk.MustExec("insert into t values ();")
tk.MustQuery("select * from t;").Check(testkit.Rows("12345678901234567890"))
for _, str := range []string{"", " AUTO_ID_CACHE 1"} {
// Empty auto_inc allocator should not cause error.
tk.MustExec("create table t (a bigint primary key clustered) auto_increment = 10" + str)
tk.MustExec("alter table t auto_increment = 10;")
tk.MustExec("alter table t auto_increment = 12345678901234567890;")
tk.MustExec("drop table t;")

// Rebase the auto_inc allocator to a large integer should work.
tk.MustExec("create table t (a bigint unsigned auto_increment, unique key idx(a))" + str)
// Set auto_inc to negative is not supported
err := tk.ExecToErr("alter table t auto_increment = -1;")
require.Error(t, err)
tk.MustExec("alter table t auto_increment = 12345678901234567890;")
tk.MustExec("insert into t values ();")
tk.MustQuery("select * from t;").Check(testkit.Rows("12345678901234567890"))
tk.MustExec("drop table t;")
}
}

func TestAutoIncrementForce(t *testing.T) {
Expand All @@ -2919,83 +2925,95 @@ func TestAutoIncrementForce(t *testing.T) {
require.NoError(t, err)
return gid
}
// Rebase _tidb_row_id.
tk.MustExec("create table t (a int);")
tk.MustExec("alter table t force auto_increment = 2;")
tk.MustExec("insert into t values (1),(2);")
tk.MustQuery("select a, _tidb_rowid from t;").Check(testkit.Rows("1 2", "2 3"))
// Cannot set next global ID to 0.
tk.MustGetErrCode("alter table t force auto_increment = 0;", errno.ErrAutoincReadFailed)
tk.MustExec("alter table t force auto_increment = 1;")
require.Equal(t, uint64(1), getNextGlobalID())
// inserting new rows can overwrite the existing data.
tk.MustExec("insert into t values (3);")
require.Equal(t, "[kv:1062]Duplicate entry '2' for key 't.PRIMARY'", tk.ExecToErr("insert into t values (3);").Error())
tk.MustQuery("select a, _tidb_rowid from t;").Check(testkit.Rows("3 1", "1 2", "2 3"))

// Rebase auto_increment.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a int primary key auto_increment, b int);")
tk.MustExec("insert into t values (1, 1);")
tk.MustExec("insert into t values (100000000, 1);")
tk.MustExec("delete from t where a = 100000000;")
require.Greater(t, getNextGlobalID(), uint64(100000000))
// Cannot set next global ID to 0.
tk.MustGetErrCode("alter table t /*T![force_inc] force */ auto_increment = 0;", errno.ErrAutoincReadFailed)
tk.MustExec("alter table t /*T![force_inc] force */ auto_increment = 2;")
require.Equal(t, uint64(2), getNextGlobalID())
tk.MustExec("insert into t(b) values (2);")
tk.MustQuery("select a, b from t;").Check(testkit.Rows("1 1", "2 2"))

// Rebase auto_random.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a bigint primary key auto_random(5));")
tk.MustExec("insert into t values ();")
tk.MustExec("set @@allow_auto_random_explicit_insert = true")
tk.MustExec("insert into t values (100000000);")
tk.MustExec("delete from t where a = 100000000;")
require.Greater(t, getNextGlobalID(), uint64(100000000))
// Cannot set next global ID to 0.
tk.MustGetErrCode("alter table t force auto_random_base = 0;", errno.ErrAutoincReadFailed)
tk.MustExec("alter table t force auto_random_base = 2;")
require.Equal(t, uint64(2), getNextGlobalID())
tk.MustExec("insert into t values ();")
tk.MustQuery("select (a & 3) from t order by 1;").Check(testkit.Rows("1", "2"))

// Change next global ID.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a bigint primary key auto_increment);")
tk.MustExec("insert into t values (1);")
bases := []uint64{1, 65535, 10, math.MaxUint64, math.MaxInt64 + 1, 1, math.MaxUint64, math.MaxInt64, 2}
lastBase := fmt.Sprintf("%d", bases[len(bases)-1])
for _, b := range bases {
tk.MustExec(fmt.Sprintf("alter table t force auto_increment = %d;", b))
require.Equal(t, b, getNextGlobalID())

for _, str := range []string{"", " AUTO_ID_CACHE 1"} {
// Rebase _tidb_row_id.
tk.MustExec("create table t (a int)" + str)
tk.MustExec("alter table t force auto_increment = 2;")
tk.MustExec("insert into t values (1),(2);")
tk.MustQuery("select a, _tidb_rowid from t;").Check(testkit.Rows("1 2", "2 3"))
// Cannot set next global ID to 0.
tk.MustGetErrCode("alter table t force auto_increment = 0;", errno.ErrAutoincReadFailed)
tk.MustExec("alter table t force auto_increment = 1;")
require.Equal(t, uint64(1), getNextGlobalID())
// inserting new rows can overwrite the existing data.
tk.MustExec("insert into t values (3);")
require.Equal(t, "[kv:1062]Duplicate entry '2' for key 't.PRIMARY'", tk.ExecToErr("insert into t values (3);").Error())
tk.MustQuery("select a, _tidb_rowid from t;").Check(testkit.Rows("3 1", "1 2", "2 3"))
tk.MustExec("drop table if exists t;")
}
tk.MustExec("insert into t values ();")
tk.MustQuery("select a from t;").Check(testkit.Rows("1", lastBase))
// Force alter unsigned int auto_increment column.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a bigint unsigned primary key auto_increment);")
for _, b := range bases {
tk.MustExec(fmt.Sprintf("alter table t force auto_increment = %d;", b))
require.Equal(t, b, getNextGlobalID())

for _, str := range []string{"", " AUTO_ID_CACHE 1"} {
// Rebase auto_increment.
tk.MustExec("create table t (a int primary key auto_increment, b int)" + str)
tk.MustExec("insert into t values (1, 1);")
tk.MustExec("insert into t values (100000000, 1);")
tk.MustExec("delete from t where a = 100000000;")
require.Greater(t, getNextGlobalID(), uint64(100000000))
// Cannot set next global ID to 0.
tk.MustGetErrCode("alter table t /*T![force_inc] force */ auto_increment = 0;", errno.ErrAutoincReadFailed)
tk.MustExec("alter table t /*T![force_inc] force */ auto_increment = 2;")
require.Equal(t, uint64(2), getNextGlobalID())
tk.MustExec("insert into t(b) values (2);")
tk.MustQuery("select a, b from t;").Check(testkit.Rows("1 1", "2 2"))
tk.MustExec("drop table if exists t;")
}

for _, str := range []string{"", " AUTO_ID_CACHE 1"} {
// Rebase auto_random.
tk.MustExec("create table t (a bigint primary key auto_random(5))" + str)
tk.MustExec("insert into t values ();")
tk.MustExec("set @@allow_auto_random_explicit_insert = true")
tk.MustExec("insert into t values (100000000);")
tk.MustExec("delete from t where a = 100000000;")
require.Greater(t, getNextGlobalID(), uint64(100000000))
// Cannot set next global ID to 0.
tk.MustGetErrCode("alter table t force auto_random_base = 0;", errno.ErrAutoincReadFailed)
tk.MustExec("alter table t force auto_random_base = 2;")
require.Equal(t, uint64(2), getNextGlobalID())
tk.MustExec("insert into t values ();")
tk.MustQuery("select a from t;").Check(testkit.Rows(fmt.Sprintf("%d", b)))
tk.MustExec("delete from t;")
tk.MustQuery("select (a & 3) from t order by 1;").Check(testkit.Rows("1", "2"))
tk.MustExec("drop table if exists t;")
}

// Force alter with @@auto_increment_increment and @@auto_increment_offset.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t(a int key auto_increment);")
tk.MustExec("set @@auto_increment_offset=2;")
tk.MustExec("set @@auto_increment_increment = 11;")
tk.MustExec("insert into t values (500);")
tk.MustExec("alter table t force auto_increment=100;")
tk.MustExec("insert into t values (), ();")
tk.MustQuery("select * from t;").Check(testkit.Rows("101", "112", "500"))
tk.MustQuery("select * from t order by a;").Check(testkit.Rows("101", "112", "500"))
tk.MustExec("drop table if exists t;")
for _, str := range []string{"", " AUTO_ID_CACHE 1"} {
// Change next global ID.
tk.MustExec("create table t (a bigint primary key auto_increment)" + str)
tk.MustExec("insert into t values (1);")
bases := []uint64{1, 65535, 10, math.MaxUint64, math.MaxInt64 + 1, 1, math.MaxUint64, math.MaxInt64, 2}
lastBase := fmt.Sprintf("%d", bases[len(bases)-1])
for _, b := range bases {
fmt.Println("execute alter table force increment to ==", b)
tk.MustExec(fmt.Sprintf("alter table t force auto_increment = %d;", b))
require.Equal(t, b, getNextGlobalID())
}
tk.MustExec("insert into t values ();")
tk.MustQuery("select a from t;").Check(testkit.Rows("1", lastBase))
// Force alter unsigned int auto_increment column.
tk.MustExec("drop table if exists t;")
tk.MustExec("create table t (a bigint unsigned primary key auto_increment)" + str)
for _, b := range bases {
tk.MustExec(fmt.Sprintf("alter table t force auto_increment = %d;", b))
require.Equal(t, b, getNextGlobalID())
tk.MustExec("insert into t values ();")
tk.MustQuery("select a from t;").Check(testkit.Rows(fmt.Sprintf("%d", b)))
tk.MustExec("delete from t;")
}
tk.MustExec("drop table if exists t;")
}

for _, str := range []string{"", " AUTO_ID_CACHE 1"} {
// Force alter with @@auto_increment_increment and @@auto_increment_offset.
tk.MustExec("create table t(a int key auto_increment)" + str)
tk.MustExec("set @@auto_increment_offset=2;")
tk.MustExec("set @@auto_increment_increment = 11;")
tk.MustExec("insert into t values (500);")
tk.MustExec("alter table t force auto_increment=100;")
tk.MustExec("insert into t values (), ();")
tk.MustQuery("select * from t;").Check(testkit.Rows("101", "112", "500"))
tk.MustQuery("select * from t order by a;").Check(testkit.Rows("101", "112", "500"))
tk.MustExec("drop table if exists t;")
}

// Check for warning in case we can't set the auto_increment to the desired value
tk.MustExec("create table t(a int primary key auto_increment)")
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ func setEmptyConstraintName(namesMap map[string]bool, constr *ast.Constraint) {
}
}
if colName == "" {
colName = constr.Keys[0].Column.Name.L
colName = constr.Keys[0].Column.Name.O
}
constrName := colName
i := 2
Expand Down
Loading