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

Incorrect SQL like SELECT 100ss or select 100s can be run #1208

Closed
tobegit3hub opened this issue Feb 12, 2022 · 5 comments · Fixed by 4paradigm/zetasql#35 or #1276
Closed

Incorrect SQL like SELECT 100ss or select 100s can be run #1208

tobegit3hub opened this issue Feb 12, 2022 · 5 comments · Fixed by 4paradigm/zetasql#35 or #1276
Assignees
Labels
bug Something isn't working

Comments

@tobegit3hub
Copy link
Collaborator

Now we can run SQL like SELECT 100ss in CLI which may output unexcepted result. Here is the execution and result.

Screen Shot 2022-02-12 at 7 56 42 PM

@tobegit3hub tobegit3hub added the bug Something isn't working label Feb 12, 2022
@tobegit3hub tobegit3hub added this to the v0.5 milestone Feb 12, 2022
@tobegit3hub tobegit3hub removed this from the v0.5 milestone Feb 12, 2022
@aceforeverd
Copy link
Collaborator

confirmed.

ConstNode* ConstNode::ShadowCopy(NodeManager* nm) const {
there are many data type not handled in the function

@aceforeverd
Copy link
Collaborator

aceforeverd commented Feb 16, 2022

  1. in zetasql select 100ss compiles:
select 100ss;
--
QueryStatement [0-12]
  Query [0-12]
    Select [0-12]
      SelectList [7-12]
        SelectColumn [7-12]
          IntervalLiteral(100s) [7-11]
          Alias [11-12]
            Identifier(s) [11-12]
--
SELECT
  100s AS s
==

@tobegit3hub
Copy link
Collaborator Author

This is the log of mysql client.

image

@aceforeverd aceforeverd reopened this Feb 17, 2022
@aceforeverd aceforeverd changed the title Incorrect SQL like “SELECT 100ss” can be run Incorrect SQL like SELECT 100ss or select 100s can be run Feb 17, 2022
@aceforeverd
Copy link
Collaborator

Left TODO:

  • select 100s is invalid

@aceforeverd
Copy link
Collaborator

bugfix-P1

aceforeverd added a commit to aceforeverd/fedb that referenced this issue Feb 21, 2022
also improve code cov for `ConstNode::ShadowCopy`
aceforeverd added a commit that referenced this issue Feb 23, 2022
close #1208

reason: ConstNode 's ShadowCopy not cover for time interval. The patch fix ShadowCopy method for time interval.
After patch the original infer attr flow for select 10s or select 10s + 1 work as expected.

Other changes:

- rm default parameter for PhysicalOpNode::SchemaToString, not recommended for virtual method
aceforeverd added a commit to aceforeverd/fedb that referenced this issue Feb 28, 2022
aceforeverd added a commit that referenced this issue Mar 3, 2022
it fixed #1208 for `select 100ss`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants