Fix #283 - MariaDB window function with alias gives bad linting errors#487
Fix #283 - MariaDB window function with alias gives bad linting errors#487williamdes merged 2 commits intophpmyadmin:5.8.xfrom
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## 5.8.x #487 +/- ##
=========================================
Coverage 97.02% 97.02%
- Complexity 2234 2235 +1
=========================================
Files 69 69
Lines 5144 5145 +1
=========================================
+ Hits 4991 4992 +1
Misses 153 153
☔ View full report in Codecov by Sentry. |
|
The issue was that both "AS" and "OVER" are of type "NONE", so we were entering in the alias handling too early. The "OVER" was considered as the alias part, so when the "AS" comes out, the parser wrongly interpreted it as a second alias, and failed. With this quickfix, I force the parser to disallow "OVER" as an alias-setting keyword, so that the whole windowing process in included in the expression, and "AS" is correctly recognized as the first (and only) alias-setting keyword. Commits are showing the difference of the tokens management, by comparing before and after. @williamdes This time, I picked up the right branch when I created the PR, and the tests are passing 😉 |
Pull-request: #487 Signed-off-by: William Desportes <williamdes@wdes.fr>
Fixes #283