-
Notifications
You must be signed in to change notification settings - Fork 189
Description
(closing issue #9016 in favor of this one which is going to be more descriptive)
Describe the bug
While trying to install Loris on an Ubuntu server at the BIC, I stumbled upon the following bug, which I had already encountered while I was installing Loris locally on my laptop (see #9016).
Basically, while creating a Loris MySQL user on the loris/installdb.php page, an error "Could not retrieve hostname for MySQL user" systemically appears, which originates from this line :
Loris/php/installer/Installer.class.inc
Line 434 in 9fbe7a6
| $this->_lastErr = "Could not retrieve hostname for MySQL user"; |
The cause of this error is that despite the previous field names being in lowercase in the query, they are returned in the original capitalization of the database, which begins with an uppercase letter. From what I have read, the SQL standard does not guarantee the capitalization of the field names of the returned table unless quotes are used, which explains this bug.
As mentionned in #9016, fixing this bug on this specific query allows the installation to continue but results in a buggy software, likely meaning that there are other places that are affected.
I see several potential solutions to resolve this bug:
- Check the capitalization of all Loris SQL queries to ensure they correspond to the real field names. Likely the cleanest but also the most laborious solution.
- Patch our database abstraction to ensure the field names are returned as they appear in the query.
- Configure the database from inside Loris to use the query capizalization in the returned field names (if possible).
- Configure the database from outside Loris to use the query capizalization in the returned field names (if possible), and add instructions to do so in the installation guide.
Server Environment:
- LORIS Version: v25.0.2
- Linux distribution and Version: Ubuntu 22.04.4 LTS
- MySQL/MariaDB Version: MariaDB 10.6.16