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: alias SHOW STATEMENTS to SHOW QUERIES #56240

Closed
awoods187 opened this issue Nov 3, 2020 · 4 comments · Fixed by #58072
Closed

sql: alias SHOW STATEMENTS to SHOW QUERIES #56240

awoods187 opened this issue Nov 3, 2020 · 4 comments · Fixed by #58072
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-easy Easy issue to tackle, requires little or no CockroachDB experience good first issue

Comments

@awoods187
Copy link
Contributor

As we seek to make replicate functionality between the db console and the SQL shell we should seek consistency in terminology as well.

In the db console we offer Sessions, Transactions, and Statements pages.
We mirror this in the SQL shell with SHOW SESSIONS, SHOW TRANSACTIONS, and SHOW QUERIES. (although these only show active sessions, transactions, and queries as opposed to the db consoles historical information).

SHOW QUERIES and Statements are not consistent. Let's alias SHOW STATEMENTS to be the same as SHOW QUERIES so that we can demonstrate consistency. We don't need to retire SHOW QUERIES since its already in use but we should gradually emphasize it in the docs in favor of the new SHOW STATEMENTS for consistency.

root@127.0.0.1:57627/movr> show statements;
ERROR: unrecognized configuration parameter "statements"
SQLSTATE: 42704
@awoods187 awoods187 added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Nov 3, 2020
@rafiss rafiss added E-easy Easy issue to tackle, requires little or no CockroachDB experience good first issue labels Dec 10, 2020
@ivern
Copy link
Contributor

ivern commented Dec 17, 2020

I can do this. A question: should CANCEL QUERIES also be aliased to CANCEL STATEMENTS?

ivern added a commit to ivern/cockroach that referenced this issue Dec 18, 2020
Fixes cockroachdb#56240

This commit makes SHOW STATEMENTS a (preferred) alias of SHOW QUERIES.

Release note: None
@rafiss
Copy link
Collaborator

rafiss commented Dec 20, 2020

Thanks @ivern ! Good question. I'll find out and get an answer when I can, but may take longer than normal since we are in a holiday period.

craig bot pushed a commit that referenced this issue Jan 4, 2021
58072: sql: alias SHOW STATEMENTS to SHOW QUERIES r=rafiss a=ivern

Fixes #56240

This commit makes SHOW STATEMENTS a (preferred) alias of SHOW QUERIES.

Release note (sql change): SHOW STATEMENTS is now an alias of SHOW QUERIES.
The new syntax is preferred by the SQL parser.

58431: opt: assign placeholders for cascade queries r=rytaft a=rytaft

Prior to this commit, it was possible that placeholders could
appear in cascade queries without getting replaced, causing an error
at execution time. This commit fixes the problem by ensuring that
placeholders are replaced before the cascade query is executed.

Fixes #58028

Release note (bug fix): Fixed an internal error that could occur when
executing prepared statements with placeholders that delete data from
columns referenced by a foreign key with ON DELETE CASCADE.

Co-authored-by: Javier Fernandez-Ivern <[email protected]>
Co-authored-by: Rebecca Taft <[email protected]>
@craig craig bot closed this as completed in 26f763f Jan 4, 2021
@rafiss
Copy link
Collaborator

rafiss commented Jan 4, 2021

@ivern I checked in and an alias for CANCEL QUERY/QUERIES to use STATEMENT/STATEMENTS would also be nice to have. If you do work on that, feel free to refer to this issue number still.

@ivern
Copy link
Contributor

ivern commented Jan 5, 2021

@rafiss Thanks, I can make that change as well. I'll submit a PR later this week when I have some time.

andy-kimball pushed a commit to andy-kimball/cockroach that referenced this issue Jan 5, 2021
Fixes cockroachdb#56240

This commit makes SHOW STATEMENTS a (preferred) alias of SHOW QUERIES.

Release note (sql change): SHOW STATEMENTS is now an alias of SHOW QUERIES.
The new syntax is preferred by the SQL parser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) E-easy Easy issue to tackle, requires little or no CockroachDB experience good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants