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

Valid query is parsed and re-created as invalid query (SQL function arguments stripped) #351

Open
carlomanf opened this issue Feb 9, 2022 · 0 comments

Comments

@carlomanf
Copy link

carlomanf commented Feb 9, 2022

The below code example attempts to parse a valid SQL query and re-create it. $this->creator and $this->parser are instances of the creator and parser.

Upon the query being re-created, the arguments of the round function are stripped, causing an SQL error.

This is a similar issue to #348 but with a different query.

var_dump(
  $this->creator->create(
    $this->parser->parse(
      "SELECT table_name AS 'name', engine AS 'engine', round( ( data_length / 1024 / 1024 ), 2 ) 'data', round( ( index_length / 1024 / 1024 ), 2 ) 'index' FROM information_schema.TABLES WHERE table_schema = 'mydb' ORDER BY name ASC;"
    )
  )
);
exit;

Tested with v4.4.0

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

No branches or pull requests

1 participant