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

Sensitive to case and doesn't ignore irrelevant backticks #1

Open
skaramicke opened this issue Sep 5, 2021 · 0 comments
Open

Sensitive to case and doesn't ignore irrelevant backticks #1

skaramicke opened this issue Sep 5, 2021 · 0 comments

Comments

@skaramicke
Copy link

These two SQL statements are equal, as far as tokenization can be expected to work.

Lowercase without backticks:

select 1 + 1 as two

Uppercase with backticks:

SELECT 1 + 1 as `two`

Sample output from phpunit run:

Summary of non-successful tests:

Database Migrator
 ✘ Executes migration to version 1 when version is 0
   ┐
   ├ Failed asserting that two SQL query sequences are equal (whitespace ignored).
   ├ Failed asserting that two arrays are equal.                                  
   ┊ ---·Expected
   ┊ +++·Actual
   ┊ @@ @@
   ┊  Array &0 (
   ┊ -····0·=>·'select·1·+·1·as·two'
   ┊ +····0·=>·'SELECT·1·+·1·as·`two`'
   ┊  )
   │
   ╵ /project/vendor/czukowski/phpunit-sql/classes/EqualsSQLQueriesConstraint.php:65
   ╵ /project/vendor/czukowski/phpunit-sql/classes/AssertTrait.php:51
   ╵ /project/tests/TestDatabaseMigrations.php:10
   ┴
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