Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Implement SHOW VARIABLES #452

Merged
merged 4 commits into from
Oct 16, 2018
Merged

Implement SHOW VARIABLES #452

merged 4 commits into from
Oct 16, 2018

Conversation

kuba--
Copy link
Contributor

@kuba-- kuba-- commented Oct 15, 2018

Closes: #409

The PR implements:
SHOW [global | session] VARIABLES [LIKE pattern]

where global, session are ignored (we copy config from BaseSession).
So far it supports LIKE condition. In the future we can also add WHERE

kuba-- added 3 commits October 12, 2018 20:28
Signed-off-by: kuba-- <kuba@sourced.tech>
Signed-off-by: kuba-- <kuba@sourced.tech>
Signed-off-by: kuba-- <kuba@sourced.tech>
@kuba-- kuba-- requested review from erizocosmico and a team October 15, 2018 08:58
@kuba-- kuba-- added the enhancement New feature or request label Oct 15, 2018
}

func (it *showVariablesIter) Next() (sql.Row, error) {
i := atomic.LoadUint32(&it.offset)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is necessary manage offset and total as atomic variables?

On the other hand, if names and values are already in memory maybe we can build directly a slice of rows and return as iterator in the RowIter method sql.RowsToRowIter(rows)

Copy link
Contributor

@erizocosmico erizocosmico left a comment

Choose a reason for hiding this comment

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

Also, what Manu said

func parseShowVariables(ctx *sql.Context, s string) (sql.Node, error) {
var (
pattern string
)
Copy link
Contributor

Choose a reason for hiding this comment

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

can just be var pattern string

Signed-off-by: kuba-- <kuba@sourced.tech>
@kuba--
Copy link
Contributor Author

kuba-- commented Oct 16, 2018

@erizocosmico, @mcarmonaa - ok, done.

@ajnavarro ajnavarro merged commit 564e501 into src-d:master Oct 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy