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

Syntax error with row_number alias #387

Open
DorianCoding opened this issue Nov 20, 2022 · 10 comments
Open

Syntax error with row_number alias #387

DorianCoding opened this issue Nov 20, 2022 · 10 comments
Labels

Comments

@DorianCoding
Copy link

DorianCoding commented Nov 20, 2022

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.

image

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
@DorianCoding DorianCoding changed the title Syntax error shown while there is none Syntax error with row_number alias Nov 20, 2022
@williamdes williamdes transferred this issue from phpmyadmin/phpmyadmin Nov 20, 2022
@williamdes
Copy link
Member

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 ?

@williamdes williamdes added the bug label Nov 20, 2022
@iifawzi
Copy link
Contributor

iifawzi commented Nov 21, 2022

I bet that we've seen this bug before, I will take a deeper look

@iifawzi
Copy link
Contributor

iifawzi commented Nov 21, 2022

The issue is already fixed by #360 (comment).
Kindly @DorianCoding, can you test with the latest version? (5.2.0)

@williamdes
Copy link
Member

williamdes commented Nov 21, 2022

(phpMyAdmin 5.2+snapshot) also available as a non official docker image

@DorianCoding
Copy link
Author

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.

@williamdes
Copy link
Member

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

@williamdes williamdes self-assigned this Nov 21, 2022
@williamdes williamdes removed their assignment Apr 21, 2023
@williamdes
Copy link
Member

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

@tcharbonnier-gp-aviva
Copy link

tcharbonnier-gp-aviva commented Apr 20, 2024

Error is still there in phpMyAdmin 5.2.1
image
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

@williamdes
Copy link
Member

Thank you for confirming this

@niconoe-
Copy link
Contributor

I can't reproduce the error using the parser on 5.10.x.

This might be fixed by the fact ROW_NUMBER is now included in the dictionnaries of functions, which wasn't the case before #572.

@williamdes I let you give it a try to double-check and confirm this is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants