[php-src] Issue #14813: mysqli_get_charset incorrectly returns utf8mb4_general_ci
| From: | jabcreations | Date: | Thu, 04 Jul 2024 11:02:33 +0000 |
| Subject: | [php-src] Issue #14813: mysqli_get_charset incorrectly returns utf8mb4_general_ci | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247224@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14813
Author: jabcreations
### Description
I have a section in my custom Control Panel where many server settings (e.g. PHP, MariaDB) are
listed so I know if everything is as it should be or not. I did a server migration, _finally_ had
the option to update MariaDB to 10.10 or higher (10.11) (Unicode 5.2 is the best until MariaDB
10.10) and updated the
my.cnf collations to utf8mb4_uca1400_ai_ci.
However:
The following code:
```php
<?php
print_r(mysqli_get_charset($db));
?>
```
Resulted in this output:
``utf8mb4_general_ci``
But I expected this output instead:
``utf8mb4_uca1400_ai_ci``
- In MariaDB running the SHOW VARIABLES; there is nothing listed as
utf8mb4_general_ci (ORDER BY for both variable_name and
value); the my.cnf variables (collation_connection,
collation_database and collation_server) are all set to
utf8mb4_uca1400_ai_ci.
- In MariaDB running SELECT * FROM 'information_schema'.'SCHEMATA'
shows no exact matches for utf8mb4_general_ci.
- In phpinfo() there is no mention of collation or charset.
- Watching the all-queries log there does not seem to be a query run when executing
mysqli_get_charset().
- Using print_r($db) does not reveal any information about collation or charset.
- There is only one database service running and I'm only connecting to that service locally on
the same machine.
- On the live server I'm running MariaDB 10.11.8.
- With the server I have done several sacrilegious reboots for non-related issues so in my mind
there should be no "stuck-in-memory" issues.
- I haven't yet updated the databases and table columns so they're still set to
utf8mb4_unicode_520_ci.
- With the all-queries log I can clearly see that no instances of utf8mb4_general_ci in
any SQL queries.
- 100% of everything access the database is either my software or when I do manual work HeidiSQL
though HeidiSQL isn't relevant to this PHP issue.
I think that covers all if not most of where I went looking. I think it's possible I overlooked
something though there maybe is either a chance for either some kind of misinterpretation on my part
or an actual bug. Suggestions please?
### PHP Version
PHP 8.3.6
### Operating System
CloudLinux 8.10