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

Support full SHOW TABLES syntax #563

Merged
merged 1 commit into from Aug 11, 2022

Conversation

MazterQyou
Copy link
Contributor

@MazterQyou MazterQyou commented Aug 9, 2022

This PR adds support for MySQL-specific SHOW TABLES statement with full syntax support, as well as a related test.

@coveralls
Copy link

coveralls commented Aug 9, 2022

Pull Request Test Coverage Report for Build 2839397720

  • 55 of 64 (85.94%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 89.994%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tests/sqlparser_mysql.rs 26 28 92.86%
src/parser.rs 17 20 85.0%
src/ast/mod.rs 12 16 75.0%
Totals Coverage Status
Change from base Build 2839268478: 0.01%
Covered Lines: 9255
Relevant Lines: 10284

💛 - Coveralls

@MazterQyou MazterQyou force-pushed the upstream-patch/show-tables branch 2 times, most recently from a6a1e74 to 59c37e9 Compare August 9, 2022 15:59
@alamb alamb changed the title Support SHOW TABLES Support full SHOW TABLES syntax Aug 11, 2022
self.expect_one_of_keywords(&[Keyword::COLUMNS, Keyword::FIELDS])?;
pub fn parse_show_columns(
&mut self,
extended: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 nice refactoring of this into the common parse_show

assert!(mysql_and_generic()
.parse_sql_statements("SHOW EXTENDED FULL COLUMNS FROM mytable")
.is_ok());
// SHOW EXTENDED/FULL can only be used with COLUMNS and TABLES
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great tests 🏅

@@ -1012,6 +1012,15 @@ pub enum Statement {
table_name: ObjectName,
filter: Option<ShowStatementFilter>,
},
/// SHOW TABLES
Copy link
Collaborator

Choose a reason for hiding this comment

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

I reviewed and this appears to match https://dev.mysql.com/doc/refman/8.0/en/show-tables.html

@alamb
Copy link
Collaborator

alamb commented Aug 11, 2022

@MazterQyou -- github says this PR has a conflict that needs to be resolved. Can you please merge up from master so I can then merge it in?

Thank you

@alamb alamb marked this pull request as draft August 11, 2022 11:01
@alamb alamb marked this pull request as ready for review August 11, 2022 11:01
@MazterQyou
Copy link
Contributor Author

@alamb rebased the PR branch to resolve the conflict 👌

@alamb
Copy link
Collaborator

alamb commented Aug 11, 2022

Thanks @MazterQyou !

@alamb alamb merged commit b6e36ad into sqlparser-rs:main Aug 11, 2022
@MazterQyou MazterQyou deleted the upstream-patch/show-tables branch August 11, 2022 13:50
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.

None yet

3 participants