sql-parser
sql-parser copied to clipboard
Syntax error with row_number alias
When using ROW_NUMBER and an alias such as :
SELECT ROW_NUMBER() OVER (ORDER BY `start`)
Phpmyadmin is showing an error but the query works.
It says "An alias was previously found" near the index.
Server configuration
- Operating system: Ubuntu
- Web server: Nginx + Apache
- Database version: 10.6.7-MariaDB-2ubuntu1.1 - Ubuntu 22.04
- PHP version: 8.1.2-1ubuntu2.8
- phpMyAdmin version: 5.1.1deb5ubuntu1
Client configuration
- Browser: Firefox 107.0
- Operating system: Windows 10 64 bits
Bonjour ! Thank you for reporting this issue, I moved it here so we can investigate about it. @iifawzi I am not sure if any of your recent PRs fix this one ?
I bet that we've seen this bug before, I will take a deeper look
The issue is already fixed by https://github.com/phpmyadmin/sql-parser/pull/360#issuecomment-954721943. Kindly @DorianCoding, can you test with the latest version? (5.2.0)
(phpMyAdmin 5.2+snapshot) also available as a non official docker image
The issue is already fixed by #360 (comment). Kindly @DorianCoding, can you test with the latest version? (5.2.0)
It seems indeed that the problem is solved using phpmyadmin 5.2 with XAMPP on Windows (with same browser). I guess I just have to wait the update of ubuntu packages then.
The issue is already fixed by #360 (comment). Kindly @DorianCoding, can you test with the latest version? (5.2.0)
It seems indeed that the problem is solved using phpmyadmin 5.2 with XAMPP on Windows (with same browser). I guess I just have to wait the update of ubuntu packages then.
I am the one responsible for the packaging on Ubuntu and Debian, I am quite behind schedule and sorry about that. I will keep you updated
I am the one responsible for the packaging on Ubuntu and Debian, I am quite behind schedule and sorry about that. I will keep you updated
It's been a while, the PPA is updated for Jammy. Can you please check our Wiki for install methods on Ubuntu/Debian
Error is still there in phpMyAdmin 5.2.1
Query :
SELECT *, ROW_NUMBER() OVER(PARTITION BY SUBSTR(`created_at`, 1, 10), SUBSTR(`date`, 1, 10), `customer_id` ORDER BY `id` DESC) AS _row_number_ FROM `wp_8_ava_appointments` WHERE `deleted_at` IS NULL
Thank you for confirming this