Repository navigation
Description
Describe the bug
The Autosuggestion for the column name is wrong in phpmyadmin when the column name ends with a dot (.)
For example if the Column Name is called `Article Nr.` the phpmyadmin autosuggestion will turn it into `Article Nr`.`` which is faulty / wrong.
To Reproduce
Steps to reproduce the behavior:
- Create a new Table and create one or multiple columns with a Dot (.) at the end, in this example
Article Nr. - Write for example a simple select Query and while typing `Article Nr.` (note: the apostrophes ` are important) a popup with the suggested Column name will appear
- Click on the Suggestion
- Instead of the expected `Article Nr.` it will fill in `Article Nr`.`` which will result in an error.
Expected behavior
The Autosuggestion should handle the dot at the end properly and when clicking on the suggestion it should fill in `Article Nr.`
Screenshots
❌ Wrong (this happens right now):

✔ Expected (this should happen):

Server configuration
- Operating system: Windows 10 (XAMPP Version 8.1.6)
- Web server: Apache 2.4.53
- Database version: MariaDB 10.4.24
- PHP version: PHP 8.1.6 (VS16 X86 64bit thread safe) + PEAR
- phpMyAdmin version: 5.2.0
(I was as well able to reproduce this on a Linux Webserver with slightly different specs)
Edit: This was as well reproduced on the newest Version of phpmyadmin by now.
Client configuration
- Browser: Firefox 114.0.2 (64-Bit)
- Operating system: Windows 10
Additional Information:
As suggested further below by me, this as well affects other components like for example the "Sorting": #18521 (comment)

Activity
nicolasbachmaier commentedon Jul 4, 2023
This was initially tested on version 5.2.0, but I could as well reproduce this on the newest version (https://demo.phpmyadmin.net/)
nicolasbachmaier commentedon Jul 11, 2023
Another related Bug: Sorting not possible when Column ends with / contains a Dot.
Description:
In phpmyadmin you usually can sort a table by clicking on a column heading. This however, doesn't work when the Table heading contains / ends with a dot ".".
Expected Result:
Actual Result:
williamdes commentedon Jul 13, 2023
Thank you for this report!
harshitrajsinha commentedon Jul 30, 2023
Suppose there are two tables
product1andproduct2with columns asidp1andidp2.(where idp2 has DOT(.) at its end) respectively. If we try to join these two tables based on their IDs -A statement like: 'select * from
product1,product2whereproduct1.idp1=product2.idp2.;' will work. However, SQL allows to write statement without BACKTICK also and in such case 'select * from product1, product2 where product1.idp1 = product2.idp2.;' will break. Therefore, should we consider ending a column name or table name with DOT (.)?nicolasbachmaier commentedon Jul 31, 2023
For me this is most definitely a yes.
https://dev.mysql.com/doc/refman/8.0/en/identifiers.html
Backticks in general don't have to be used when these conditions apply [0-9,a-z,A-Z$_] (you can read more about it in the documentation up there)
For everything else, backticks must always be used, so yes, of course. Every column name (including one with an ending dot) that can't be used without backticks (like for example the SPACE character) must be used with backticks and should as well work accordingly in the autosuggestion and sorting etc..
If you disagree, then please let me know why but in my understanding this is a logical flaw and should be fixed.
(And yes, of course in theory it is best to name your columns like prefix_variable_name, but in this case easy variable names were required and i stumbled upon this bug. And according to mysql documentation this should be allowed and is allowed, so phpmyadmin should in theory be able to handle it as well)
harshitrajsinha commentedon Jul 31, 2023
That's also correct. I will try once again.