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

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
@kuba-- kuba-- requested review from a team and erizocosmico 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-- <[email protected]>
@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