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

Auto-generate sysvar documentation from TiDB server source #5720

Draft
wants to merge 56 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f29ab02
system-variables: ensure alphabetical order
morgo May 28, 2021
6ea73ee
fix broken anchors
morgo May 28, 2021
30a9be5
Add WIP script
morgo May 28, 2021
b82868d
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo May 28, 2021
984272a
Add generators and generated file
morgo May 28, 2021
24fc507
fix linter
morgo May 28, 2021
d7877ca
Update to master, manually fix default txn mode
morgo May 31, 2021
6944092
Fetch correctness changes from tidb-master
morgo Jun 1, 2021
0f08b9b
Update for new variables
morgo Jun 3, 2021
2297833
Remove system-variables.md from commit
morgo Jun 3, 2021
a8aa051
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jun 3, 2021
fdbd7a7
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jun 5, 2021
5ab0a89
update with units
morgo Jun 5, 2021
8dee833
WIP
morgo Jun 8, 2021
0b4d8b6
Add quotes on range
morgo Jun 8, 2021
5784d50
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jun 14, 2021
5a2d09b
WIP
morgo Jun 14, 2021
a536480
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jun 22, 2021
10ff188
update
morgo Jun 22, 2021
f2e6b0f
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jul 2, 2021
f0ebe10
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Aug 23, 2021
652939b
Update against master
morgo Aug 23, 2021
5ee8613
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Sep 10, 2021
806360d
WIP
morgo Sep 10, 2021
ccdd4bb
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Sep 22, 2021
9d28f5a
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Oct 1, 2021
bb41e30
updates for new sysvars
morgo Oct 1, 2021
d8ea211
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Oct 9, 2021
510d568
WIP
morgo Oct 12, 2021
a8a9311
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Oct 15, 2021
eda0317
WIP
morgo Oct 15, 2021
b33d349
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Oct 25, 2021
f5833c8
update changes
morgo Oct 25, 2021
c75d298
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Nov 1, 2021
8600643
WIP
morgo Nov 2, 2021
b06513f
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Nov 10, 2021
b95bdcd
Wip
morgo Nov 10, 2021
f05991e
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Nov 17, 2021
472d881
WIP
morgo Nov 17, 2021
395ef8e
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Dec 17, 2021
7d5107c
WIP
morgo Dec 17, 2021
16f024a
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jan 5, 2022
8ae2848
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Jan 18, 2022
c157e5b
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Feb 7, 2022
ba6f2f2
WIP
morgo Mar 2, 2022
136086b
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Mar 22, 2022
42f0d30
WIP
morgo Mar 22, 2022
e8d0aed
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Mar 22, 2022
495bb63
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Apr 14, 2022
fe86242
WIP
morgo Apr 14, 2022
fee3391
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Apr 27, 2022
f23d033
WIP
morgo Apr 27, 2022
76c0809
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo Apr 29, 2022
2c6556e
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo May 19, 2022
031e9fc
WIP
morgo May 19, 2022
12a3512
Merge remote-tracking branch 'upstream/master' into fix-sysvar-correc…
morgo May 30, 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
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
morgo committed Oct 12, 2021
commit 510d56805ad49523e10780431e9ca60c10cfd525
8 changes: 3 additions & 5 deletions scripts/generate-system-variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ func skipSv(sv *variable.SysVar) bool {
}
// These svs have no documentation yet.
switch sv.Name {
case variable.ErrorCount,
variable.LowerCaseTableNames, variable.MaxConnections,
variable.MaxPreparedStmtCount,
case variable.ErrorCount, variable.LowerCaseTableNames, variable.MaxPreparedStmtCount,
variable.TiDBBatchCommit, variable.TiDBBatchDelete, variable.TiDBBatchInsert, variable.TiDBEnableChangeMultiSchema,
variable.TiDBEnableExchangePartition, variable.TiDBEnableExtendedStats, variable.TiDBEnablePointGetCache,
variable.TiDBEnableStreaming, variable.TiDBGuaranteeLinearizability, variable.TiDBTxnScope, variable.TiDBTxnReadTS,
Expand Down Expand Up @@ -954,12 +952,12 @@ func main() {
fmt.Print(printWarning(sv))

if sv.Name == variable.TxnIsolation {
fmt.Println("This variable is an alias for _transaction_isolation_.")
fmt.Println("This variable is an alias for `transaction_isolation`.")
fmt.Println("")
continue
}
if sv.Name == variable.Identity {
fmt.Println("This variable is an alias for _last_insert_id_.")
fmt.Println("This variable is an alias for `last_insert_id`.")
fmt.Println("")
continue
}
Expand Down
15 changes: 8 additions & 7 deletions scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 // indirect
github.com/pingcap/kvproto v0.0.0-20210927053809-df38c15b57b3 // indirect
github.com/pingcap/tidb v1.1.0-beta.0.20210930110847-5f797c3f241c // indirect
github.com/pingcap/kvproto v0.0.0-20211009031853-d6dd964d6b8c // indirect
github.com/pingcap/tidb v1.1.0-beta.0.20211009135324-6e70be97c2e5 // indirect
github.com/pingcap/tidb-tools v5.2.1+incompatible // indirect
github.com/pingcap/tipb v0.0.0-20210917081614-311f2369c5f7 // indirect
github.com/pingcap/tipb v0.0.0-20211008080435-3fd327dfce0e // indirect
github.com/prometheus/common v0.31.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/shirou/gopsutil v3.21.8+incompatible // indirect
github.com/shirou/gopsutil v3.21.9+incompatible // indirect
github.com/twmb/murmur3 v1.1.6 // indirect
github.com/uber-go/atomic v1.4.0 // indirect
github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect
go.etcd.io/etcd v3.3.26+incompatible // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6 // indirect
golang.org/x/sys v0.0.0-20210930141918-969570ce7c6c // indirect
google.golang.org/genproto v0.0.0-20210930144712-2e2e1008e8a3 // indirect
golang.org/x/net v0.0.0-20211008194852-3b03d305991f // indirect
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
google.golang.org/genproto v0.0.0-20211008145708-270636b82663 // indirect
google.golang.org/grpc v1.41.0 // indirect
)

Expand Down
16 changes: 16 additions & 0 deletions scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ github.com/pingcap/kvproto v0.0.0-20210806074406-317f69fb54b4 h1:4EUpHzPFHwleKkV
github.com/pingcap/kvproto v0.0.0-20210806074406-317f69fb54b4/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20210927053809-df38c15b57b3 h1:jqTAy4AwG0h05wPUywAuLOu4qGfNH1ASlrzRgXW4rzw=
github.com/pingcap/kvproto v0.0.0-20210927053809-df38c15b57b3/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20211009031853-d6dd964d6b8c h1:4BOqAbGsXniTL3mIzX5jyKmbP5Q1j2TTr36DSAQHQs0=
github.com/pingcap/kvproto v0.0.0-20211009031853-d6dd964d6b8c/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
Expand All @@ -825,6 +827,8 @@ github.com/pingcap/parser v0.0.0-20210907051057-948434fa20e4 h1:v3paTSRJgM7E/2Cq
github.com/pingcap/parser v0.0.0-20210907051057-948434fa20e4/go.mod h1:Ek0mLKEqUGnQqBw1JnYrJQxsguU433DU68yUbsoeJ7s=
github.com/pingcap/parser v0.0.0-20210917114242-ac711116bdff h1:LiwvvutmyeSkFkdVM09mH6KK+OeDVJzX7WKy9Lf0ri0=
github.com/pingcap/parser v0.0.0-20210917114242-ac711116bdff/go.mod h1:+xcMiiZzdIktT/Nqdfm81dkECJ2EPuoAYywd57py4Pk=
github.com/pingcap/parser v0.0.0-20211004012448-687005894c4e h1:dPMDpj+7ng9qEWoT3n6qjpB1ohz79uTLVM6ILW+ZMT0=
github.com/pingcap/parser v0.0.0-20211004012448-687005894c4e/go.mod h1:+xcMiiZzdIktT/Nqdfm81dkECJ2EPuoAYywd57py4Pk=
github.com/pingcap/pd v2.1.5+incompatible/go.mod h1:nD3+EoYes4+aNNODO99ES59V83MZSI+dFbhyr667a0E=
github.com/pingcap/pd/v4 v4.0.0-rc.1.0.20200422143320-428acd53eba2/go.mod h1:s+utZtXDznOiL24VK0qGmtoHjjXNsscJx3m1n8cC56s=
github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI=
Expand All @@ -838,6 +842,8 @@ github.com/pingcap/tidb v1.1.0-beta.0.20210910144639-8e25f8eee42f h1:rR2M6lVZWVz
github.com/pingcap/tidb v1.1.0-beta.0.20210910144639-8e25f8eee42f/go.mod h1:3TLQ3gMhl5s2oYeJx9ROQSZz1q6qYLaps63O6hYv8uo=
github.com/pingcap/tidb v1.1.0-beta.0.20210930110847-5f797c3f241c h1:sDKKthrFlpy3uyjrea0l+xpJTyCw+eRNviwxrkeDAd4=
github.com/pingcap/tidb v1.1.0-beta.0.20210930110847-5f797c3f241c/go.mod h1:oay14Mbdgf+zIj5moA7hAaViIZadaAweV2NVe90rzf8=
github.com/pingcap/tidb v1.1.0-beta.0.20211009135324-6e70be97c2e5 h1:J8SqSMuoQI+EeuA/MuWXvvnLir+EtXd9M42RL3470ys=
github.com/pingcap/tidb v1.1.0-beta.0.20211009135324-6e70be97c2e5/go.mod h1:WQHMalPfxjTrWMSSsKsPaJsM4ErDr2/ZOF4Gpd70CGQ=
github.com/pingcap/tidb-dashboard v0.0.0-20210312062513-eef5d6404638/go.mod h1:OzFN8H0EDMMqeulPhPMw2i2JaiZWOKFQ7zdRPhENNgo=
github.com/pingcap/tidb-dashboard v0.0.0-20210716172320-2226872e3296/go.mod h1:OCXbZTBTIMRcIt0jFsuCakZP+goYRv6IjawKbwLS2TQ=
github.com/pingcap/tidb-insight v0.3.1/go.mod h1:HZ6cGBYxViftTKLbl/V4moRol79bifZzI9ImGavJms0=
Expand All @@ -856,6 +862,8 @@ github.com/pingcap/tipb v0.0.0-20210802080519-94b831c6db55 h1:oxOovwOzm7VD37XpDo
github.com/pingcap/tipb v0.0.0-20210802080519-94b831c6db55/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs=
github.com/pingcap/tipb v0.0.0-20210917081614-311f2369c5f7 h1:fYfF2cI9hbJqiEuqQaKCov3ybuUaYYGBe+ozG/pU+Ls=
github.com/pingcap/tipb v0.0.0-20210917081614-311f2369c5f7/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs=
github.com/pingcap/tipb v0.0.0-20211008080435-3fd327dfce0e h1:fZY5T65QWiPc9noQJ1UkdwejZyBZjNfxzSyTcBjKrEU=
github.com/pingcap/tipb v0.0.0-20211008080435-3fd327dfce0e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs=
github.com/pingcap/tiup v1.2.3/go.mod h1:q8WzflNHjE1U49k2qstTL0clx2pKh8pkOzUFV4RTvQo=
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -948,6 +956,8 @@ github.com/shirou/gopsutil v3.21.2+incompatible h1:U+YvJfjCh6MslYlIAXvPtzhW3YZEt
github.com/shirou/gopsutil v3.21.2+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.21.8+incompatible h1:sh0foI8tMRlCidUJR+KzqWYWxrkuuPIGiO6Vp+KXdCU=
github.com/shirou/gopsutil v3.21.8+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.21.9+incompatible h1:LTLpUnfX81MkHeCtSrwNKZwuW5Id6kCa7/P43NdcNn4=
github.com/shirou/gopsutil v3.21.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v0.0.0-20191125035519-b054a8dfd10d/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
Expand Down Expand Up @@ -1292,6 +1302,8 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6 h1:Z04ewVs7JhXaYkmDhBERPi41gnltfQpMWDnTnQbaCqk=
golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211008194852-3b03d305991f h1:1scJEYZBaF48BaG6tYbtxmLcXqwYGSfGcMoStTqkkIw=
golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -1407,6 +1419,8 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraC
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210930141918-969570ce7c6c h1:ayiZ33F3u3LIXB03Y5VKNdaFO79a18Fr+SB30o/KFyw=
golang.org/x/sys v0.0.0-20210930141918-969570ce7c6c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down Expand Up @@ -1614,6 +1628,8 @@ google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda h1:iT5uhT54PtbqUsW
google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210930144712-2e2e1008e8a3 h1:+F3FcO6LTrzNq5wp1Z6JtoBvnJzX6euyN70FoyMDXy4=
google.golang.org/genproto v0.0.0-20210930144712-2e2e1008e8a3/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211008145708-270636b82663 h1:33YYJanAOLxgS7pGjzC1IUrFLpwN//bbgtnKYikOmQU=
google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/grpc v0.0.0-20180607172857-7a6a684ca69e/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
Expand Down
7 changes: 1 addition & 6 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,6 @@ This variable is an alias for `last_insert_id`.
- Default value: ""
- This variable is used to specify a list of storage engines that might fall back to TiKV. If the execution of a SQL statement fails due to a failure of the specified storage engine in the list, TiDB retries executing this SQL statement with TiKV. This variable can be set to "" or "tiflash". When this variable is set to "tiflash", if the execution of a SQL statement fails due to a failure of TiFlash, TiDB retries executing this SQL statement with TiKV.

### tidb_allow_function_for_expression_index <span class="version-mark">New in v5.2.0</span>

- Scope: NONE
- This variable is used to show the functions that are allowed to be used for creating expression indexes.

### tidb_allow_mpp <span class="version-mark">New in v5.0</span>

- Scope: SESSION | GLOBAL
Expand Down Expand Up @@ -1536,7 +1531,7 @@ SET tidb_slow_log_threshold = 200;

### tx_isolation

This variable is an alias for _transaction_isolation_.
This variable is an alias for `transaction_isolation`.

### version

Expand Down