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

sql: CANCEL QUERY error tweaks, SHOW SESSIONS semicolon removal #17739

Merged
merged 2 commits into from
Aug 21, 2017

Conversation

itsbilal
Copy link
Member

  • Lowercase CANCEL QUERY errors to follow convention.
  • Add pgcode to query cancelled error.
  • Remove the semicolon at the end of active_queries in SHOW SESSIONS, to make the output match that of the query field in SHOW QUERIES.

@itsbilal itsbilal self-assigned this Aug 17, 2017
@itsbilal itsbilal requested review from knz and a team August 17, 2017 19:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@itsbilal itsbilal force-pushed the cancel-query-error-tweaks branch from ee4adad to 8c470c2 Compare August 17, 2017 19:56
@itsbilal itsbilal requested a review from a team August 17, 2017 19:56
@@ -697,9 +697,12 @@ func populateSessionsTable(
var oldestStart time.Time
var oldestStartDatum parser.Datum

for _, query := range session.ActiveQueries {
numQueries := len(session.ActiveQueries)
for idx, query := range session.ActiveQueries {
Copy link
Contributor

Choose a reason for hiding this comment

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

for i, query := range ...{
   if i > 0 {
      WriteString("; ")
  }
   WriteString(sql)
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@itsbilal itsbilal force-pushed the cancel-query-error-tweaks branch from 8c470c2 to 924a00b Compare August 18, 2017 14:19
@itsbilal itsbilal force-pushed the cancel-query-error-tweaks branch from 924a00b to 5b113bf Compare August 21, 2017 13:32
@CLAassistant
Copy link

CLAassistant commented Aug 21, 2017

CLA assistant check
All committers have signed the CLA.

@knz
Copy link
Contributor

knz commented Aug 21, 2017

LGTM modulo clean up in test.


Reviewed 4 of 4 files at r1, 2 of 2 files at r4.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


pkg/sql/logictest/testdata/logic_test/show_source, line 158 at r4 (raw file):

SELECT node_id,username,application_name,active_queries FROM [SHOW SESSIONS] WHERE active_queries != ''
----
node_id  username  application_name  active_queries                                   

Remove the trailing whitespaces.


Comments from Reviewable

@itsbilal itsbilal force-pushed the cancel-query-error-tweaks branch from 5b113bf to c8b8611 Compare August 21, 2017 14:37
@itsbilal
Copy link
Member Author

Review status: all files reviewed at latest revision, 1 unresolved discussion.


pkg/sql/logictest/testdata/logic_test/show_source, line 158 at r4 (raw file):

Previously, knz (kena) wrote…

Remove the trailing whitespaces.

Done.


Comments from Reviewable

@itsbilal itsbilal force-pushed the cancel-query-error-tweaks branch from c8b8611 to 6441300 Compare August 21, 2017 14:43
@itsbilal itsbilal merged commit 214f4b6 into cockroachdb:master Aug 21, 2017
@itsbilal itsbilal deleted the cancel-query-error-tweaks branch August 21, 2017 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants