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

Add support for VIEWs in SHOW TABLES statements #862

Draft
wants to merge 9 commits into
base: feature/views
Choose a base branch
from

Conversation

agarciamontoro
Copy link
Contributor

To merge after #860

This PR:

  • Adds the VIEWs in the specified database to the rows returned by SHOW TABLES.
  • Removes the sorting of tables in the ShowTables node.
  • Adapt the test in ShowTables (that relied on the expected order) to sort the rows after they are received.

Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
return err
}

if len(newItem) < 1 || len(newItem) > 2 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Personally I think if len(newItem) != 1 || len(newItem) != 2 would be clearer (also maybe a few nanoseconds faster, or not, depending on how Go optimizes).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, why do you think it is clearer? I see the interval (1,2) in the other case much more clear. But I guess that it only comes down to personal opinions. Although it would be cool to actually measure which one is faster!

sql/plan/drop_view.go Outdated Show resolved Hide resolved
Signed-off-by: Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants