Skip to content

Commit

Permalink
config: add an option to disable chunk (pingcap#5268)
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood authored and XuHuaiyu committed Nov 30, 2017
1 parent 2cbeb54 commit 09e5e7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
16 changes: 9 additions & 7 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Config struct {
RunDDL bool `toml:"run-ddl" json:"run-ddl"`
SplitTable bool `toml:"split-table" json:"split-table"`
TokenLimit int `toml:"token-limit" json:"token-limit"`
EnableChunk bool `toml:"enable-chunk" json:"enable-chunk"`

Log Log `toml:"log" json:"log"`
Security Security `toml:"security" json:"security"`
Expand Down Expand Up @@ -147,13 +148,14 @@ type ProxyProtocol struct {
}

var defaultConf = Config{
Host: "0.0.0.0",
Port: 4000,
Store: "mocktikv",
Path: "/tmp/tidb",
RunDDL: true,
Lease: "10s",
TokenLimit: 1000,
Host: "0.0.0.0",
Port: 4000,
Store: "mocktikv",
Path: "/tmp/tidb",
RunDDL: true,
Lease: "10s",
TokenLimit: 1000,
EnableChunk: true,
Log: Log{
Level: "info",
Format: "text",
Expand Down
3 changes: 3 additions & 0 deletions config/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ lease = "10s"
# The limit of concurrent executed sessions.
# token-limit = 1000

# Enable chunk executors.
enable-chunk = true

[log]
# Log level: info, debug, warn, error, fatal.
level = "info"
Expand Down
2 changes: 1 addition & 1 deletion server/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ func (cc *clientConn) handleFieldList(sql string) (err error) {
// resultsets, it's used to support the MULTI_RESULTS capability in mysql protocol.
func (cc *clientConn) writeResultset(goCtx goctx.Context, rs ResultSet, binary bool, more bool) error {
defer terror.Call(rs.Close)
if rs.SupportChunk() {
if cc.server.cfg.EnableChunk && rs.SupportChunk() {
columns := rs.Columns()
err := cc.writeColumnInfo(columns)
if err != nil {
Expand Down

0 comments on commit 09e5e7b

Please sign in to comment.