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

[feature] complete explain statement #701

Closed
hustjieke opened this issue Nov 12, 2020 · 0 comments
Closed

[feature] complete explain statement #701

hustjieke opened this issue Nov 12, 2020 · 0 comments
Assignees
Labels
P0 High priority type: feature

Comments

@hustjieke
Copy link
Contributor

In MySQL 8.0 syntax:

{EXPLAIN | DESCRIBE | DESC}
    tbl_name [col_name | wild]

{EXPLAIN | DESCRIBE | DESC}
    [explain_type]
    {explainable_stmt | FOR CONNECTION connection_id}

{EXPLAIN | DESCRIBE | DESC} ANALYZE [FORMAT = TREE] select_statement

explain_type: {
    FORMAT = format_name
}

format_name: {
    TRADITIONAL
  | JSON
  | TREE
}

explainable_stmt: {
    SELECT statement
  | TABLE statement
  | DELETE statement
  | INSERT statement
  | REPLACE statement
  | UPDATE statement
}

Precautions:

  1. For explain_type in 8.0, extend and partitions are abandoned, for forward compatibility, we'll parse normally.
  2. 8.0 add new feature explain analyze
  3. TABLE statement and REPLACE statement will be supported in the future.

Differently with MySQL, the explain will output radon plan but not MySQL currently.

@hustjieke hustjieke added type: feature P0 High priority labels Nov 12, 2020
@hustjieke hustjieke self-assigned this Nov 12, 2020
hustjieke added a commit to hustjieke/radon that referenced this issue Nov 19, 2020
[summary]
complete explain stmt syntax, compatible with MySQL 8.0

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go
src/proxy/explain_test.go

[patch codecov]
src/proxy/explain.go  88.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.6%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/constants.go  100%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go  64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go  69.6%
hustjieke added a commit to hustjieke/radon that referenced this issue Nov 19, 2020
[summary]
complete explain stmt syntax, compatible with MySQL 8.0

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go
src/proxy/explain_test.go

[patch codecov]
src/proxy/explain.go  88.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.6%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/constants.go  100%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go  64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go  69.6%
hustjieke added a commit to hustjieke/radon that referenced this issue Nov 19, 2020
[summary]
complete explain stmt syntax, compatible with MySQL 8.0

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go
src/proxy/explain_test.go

[patch codecov]
src/proxy/explain.go  88.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.6%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/constants.go  100%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go  64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go  69.6%
hustjieke added a commit to hustjieke/radon that referenced this issue Dec 9, 2020
[summary]
complete explain stmt syntax, compatible with MySQL 8.0

[test case]
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/parse_test.go
src/proxy/explain_test.go

[patch codecov]
src/proxy/explain.go  88.0%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/ast.go 96.6%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/constants.go  100%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/rewriter.go  64.7%
src/vendor/github.com/xelabs/go-mysqlstack/sqlparser/sql.go  69.6%
hustjieke added a commit to hustjieke/radon that referenced this issue Dec 9, 2020
hustjieke added a commit to hustjieke/radon that referenced this issue Dec 9, 2020
hustjieke added a commit to hustjieke/radon that referenced this issue Dec 10, 2020
hustjieke added a commit to hustjieke/radon that referenced this issue Dec 10, 2020
…specific environment radondb#701

[summary]
To resolve test result sometimes depends on the specific environment
--- FAIL: TestCache (1.41s)
	Error Trace:	caching_sha2_cache_test.go:160
			asm_amd64.s:1333
	Error:		Should be true

	Error Trace:	caching_sha2_cache_test.go:160
			asm_amd64.s:1333
	Error:		Should be true

[test case]
go-mysql/server/caching_sha2_cache_test.go

[patch codecov]
N/A
BohuTANG added a commit that referenced this issue Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 High priority type: feature
Projects
None yet
Development

No branches or pull requests

1 participant