Skip to content

Support full SHOW TABLES syntax - #563

Merged
alamb merged 1 commit into
apache:mainfrom
cube-js:upstream-patch/show-tables
Aug 11, 2022
Merged

Support full SHOW TABLES syntax#563
alamb merged 1 commit into
apache:mainfrom
cube-js:upstream-patch/show-tables

Conversation

@MazterQyou

@MazterQyouMazterQyou commented Aug 9, 2022

Copy link
Copy Markdown
Contributor

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

@coveralls

coveralls commented Aug 9, 2022

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 2839397720

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 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 CoverageCovered LinesChanged/Added Lines%
tests/sqlparser_mysql.rs262892.86%
src/parser.rs172085.0%
src/ast/mod.rs121675.0%
TotalsCoverage Status
Change from base Build 2839268478:0.01%
Covered Lines:9255
Relevant Lines:10284

💛 - Coveralls

@MazterQyou
MazterQyouforce-pushed the upstream-patch/show-tables branch 2 times, most recently from a6a1e74 to 59c37e9CompareAugust 9, 2022 15:59
@alambalamb changed the title Support SHOW TABLESSupport full SHOW TABLES syntaxAug 11, 2022
Comment threadsrc/parser.rs
self.expect_one_of_keywords(&[Keyword::COLUMNS, Keyword::FIELDS])?;
pub fn parse_show_columns(
&mut self,
extended: bool,

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great tests 🏅

Comment threadsrc/ast/mod.rs
table_name: ObjectName,
filter: Option<ShowStatementFilter>,
},
/// SHOW TABLES

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@alamb

Copy link
Copy Markdown
Contributor

@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
MazterQyouforce-pushed the upstream-patch/show-tables branch from 59c37e9 to 11d68abCompareAugust 11, 2022 11:19
@MazterQyou
MazterQyou requested a review from alambAugust 11, 2022 11:24
@MazterQyou

Copy link
Copy Markdown
ContributorAuthor

@alamb rebased the PR branch to resolve the conflict 👌

@MazterQyouMazterQyou mentioned this pull request Aug 11, 2022
@alamb

Copy link
Copy Markdown
Contributor

Thanks @MazterQyou !

@alamb
alamb merged commit b6e36ad into apache:mainAug 11, 2022
@MazterQyou
MazterQyou deleted the upstream-patch/show-tables branch August 11, 2022 13:50
mcheshkov pushed a commit to cube-js/sqlparser-rs that referenced this pull request Sep 2, 2024
Can drop this after rebase on commit b6e36ad "Support SHOW TABLES (apache#563)", first released in 0.21.0
Sign up for freeto 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.

3 participants

@MazterQyou@coveralls@alamb