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

unrecognised keyword 'CASE' #262

Open
aschuch247 opened this issue Oct 16, 2019 · 1 comment
Open

unrecognised keyword 'CASE' #262

aschuch247 opened this issue Oct 16, 2019 · 1 comment

Comments

@aschuch247
Copy link
Contributor

$ ./lint-query --query 'SELECT * FROM `Caracteristiques` WHERE CASE `an` WHEN 86400 THEN 4 WHEN 604800 THEN 5 WHEN 2419200 THEN 6 WHEN 31536000 THEN 7 ELSE -1 END < 0;'
#1: Unrecognised keyword. (near "CASE" at position 39)
#2: Unexpected token. (near "`an`" at position 44)
#3: Unrecognised keyword. (near "WHEN" at position 49)
#4: Unexpected token. (near "86400" at position 54)
#5: Unrecognised keyword. (near "THEN" at position 60)
#6: Unexpected token. (near "4" at position 65)
#7: Unrecognised keyword. (near "WHEN" at position 67)
#8: Unexpected token. (near "604800" at position 72)
#9: Unrecognised keyword. (near "THEN" at position 79)
#10: Unexpected token. (near "5" at position 84)
#11: Unrecognised keyword. (near "WHEN" at position 86)
#12: Unexpected token. (near "2419200" at position 91)
#13: Unrecognised keyword. (near "THEN" at position 99)
#14: Unexpected token. (near "6" at position 104)
#15: Unrecognised keyword. (near "WHEN" at position 106)
#16: Unexpected token. (near "31536000" at position 111)
#17: Unrecognised keyword. (near "THEN" at position 120)
#18: Unexpected token. (near "7" at position 125)
#19: Unrecognised keyword. (near "ELSE" at position 127)
#20: Unexpected token. (near "-1" at position 132)
#21: Unrecognised keyword. (near "END" at position 135)
#22: Unexpected token. (near "&lt;" at position 139)
#23: Unexpected token. (near "0" at position 141)

I am using the version shipped with phpMyAdmin 4.9.1. The query works.

SELECT VERSION();
5.7.27-30-57-log
@phpmyadmin phpmyadmin deleted a comment from zeenayouhan Oct 25, 2019
@muglug
Copy link

muglug commented Dec 22, 2020

One workaround is to enclose the CASE ... END expression with brackets

@williamdes williamdes added this to the 4.7.2 milestone Dec 22, 2020
@williamdes williamdes modified the milestones: 4.7.2, 4.7.3 Feb 5, 2021
@williamdes williamdes modified the milestones: 4.7.3, 4.7.4 Dec 11, 2021
@williamdes williamdes modified the milestones: 4.7.4, 5.7.0 Nov 21, 2022
@williamdes williamdes modified the milestones: 5.7.0, 5.8.0 Jan 25, 2023
@williamdes williamdes modified the milestones: 5.8.0, 5.9.0 Jun 5, 2023
@MauricioFauth MauricioFauth removed this from the 5.8.1 milestone Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants