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

executor, infoschema: return a pseudo profiling table when system var profiling is set to 1 #5960

Merged
merged 6 commits into from Mar 6, 2018

Conversation

XuHuaiyu
Copy link
Contributor

@XuHuaiyu XuHuaiyu commented Mar 6, 2018

fix #5666
Navicat autorun sql

set @@profiling = 1;
SELECT QUERY_ID, SUM(DURATION) AS SUM_DURATION FROM INFORMATION_SCHEMA.PROFILING GROUP BY QUERY_ID;

to get the QUERY_ID.

This commit returns a pseudo profiling table when profiling is set to 1.

PTAL @coocood

@@ -1033,6 +1060,9 @@ func (it *infoschemaTable) getRows(ctx sessionctx.Context, cols []*table.Column)
fullRows = dataForTableConstraints(dbs)
case tableFiles:
case tableProfiling:
if v, ok := ctx.GetSessionVars().GetSystemVar("profiling"); ok && v == "1" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use tidbOptOn.

@XuHuaiyu
Copy link
Contributor Author

XuHuaiyu commented Mar 6, 2018

PTAL @coocood

@@ -123,8 +123,8 @@ func SetSessionSystemVar(vars *SessionVars, name string, value types.Datum) erro
return vars.SetSystemVar(name, sVal)
}

// tidbOptOn could be used for all tidb session variable options, we use "ON"/1 to turn on those options.
func tidbOptOn(opt string) bool {
// TIDBOptOn could be used for all tidb session variable options, we use "ON"/1 to turn on those options.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/TIDBOptOn/TiDBOptOn ?

@XuHuaiyu
Copy link
Contributor Author

XuHuaiyu commented Mar 6, 2018

PTAL @coocood @zimulala

@coocood
Copy link
Member

coocood commented Mar 6, 2018

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala
Copy link
Contributor

zimulala commented Mar 6, 2018

/run-all-tests

@zimulala zimulala added the status/LGT2 Indicates that a PR has LGTM 2. label Mar 6, 2018
@shenli shenli merged commit 3e1a8ed into pingcap:master Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better Compatibility With Using Navicat for MySQL As TiDB Client
4 participants