-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
MariaDB version prefix 5.5.5-
is not stripped
#7972
Comments
This "most unfortunate" MariaDB version prefix broke compatibility with transactions (and likely more); therefore we fixed https://bugs.php.net/78179 by stripping that prefix. Anyway, I'm not sure what you're requesting here. Can you please clarify whether you want the prefix stripped, or retained? In the former case, that doesn't look like a php-src issue at all. |
in php-src/ext/mysqlnd/mysqlnd_connection.c Line 1281 in 72cdb0a
the version returned by |
We can't do any stripping. We follow what the C API does in this case, which is to return the string verbatim. Any stripping would be against the specification. If the value returned by If the issue is that MariaDB is prefixing this value in the first place, then this should be reported to MariaDB. I believe the current behaviour of PHP/mysqlnd is correct and I don't see any buggy behaviour. |
The stripping is actually official for MariaDB client, see one related MariaDB issue https://jira.mariadb.org/browse/MDEV-4575 . As the prefixing is known and introduced only as a fix for replication protocol, it is safe to be removed also for mysqlnd. |
$mysql = new mysqli($host, $user, $password, $db);
$res = $mysql->query("select version()");
var_dump(
$mysql->server_info,
$res->fetch_array()[0],
$mysql->server_version,
mysqli_get_server_version($mysql),
); outputs for me
This inconsistency is certainly a bug. |
Do you mean a bug in mysqlnd? How so? This is exactly the information that mysqlnd receives from MariaDB. |
No. We already strip the version prefix for |
For consistency with `mysqlnd_conn_data#get_server_version`, we strip the MariaDB version prefix also in `mysqlnd_command#handshake`.
After some further discussion on #7963, we decided to keep the behavior as is, but to document it. |
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. git-svn-id: https://develop.svn.wordpress.org/trunk@53919 602fd350-edb4-49c9-b593-d223f7449a82
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. Built from https://develop.svn.wordpress.org/trunk@53919 git-svn-id: http://core.svn.wordpress.org/trunk@53478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. Built from https://develop.svn.wordpress.org/trunk@53919 git-svn-id: https://core.svn.wordpress.org/trunk@53478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. git-svn-id: https://develop.svn.wordpress.org/trunk@53919 602fd350-edb4-49c9-b593-d223f7449a82
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. Built from https://develop.svn.wordpress.org/trunk@53919
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to `wpdb::has_cap()` to check for the correct MariaDB version. This resolves an issue where the `utf8mb4_unicode_520_ci` collation, which is available in MariaDB since version 10.2, was previously not detected correctly. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] * [https://mariadb.com/docs/reference/mdb/collations/utf8mb4_unicode_520_ci/ MariaDB Documentation: utf8mb4_unicode_520_ci] Follow-up to [37523], [53919]. Props jamieburchell, SergeyBiryukov. Fixes #54841. Built from https://develop.svn.wordpress.org/trunk@54384 git-svn-id: http://core.svn.wordpress.org/trunk@53943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to `wpdb::has_cap()` to check for the correct MariaDB version. This resolves an issue where the `utf8mb4_unicode_520_ci` collation, which is available in MariaDB since version 10.2, was previously not detected correctly. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] * [https://mariadb.com/docs/reference/mdb/collations/utf8mb4_unicode_520_ci/ MariaDB Documentation: utf8mb4_unicode_520_ci] Follow-up to [37523], [53919]. Props jamieburchell, SergeyBiryukov. Fixes #54841. Built from https://develop.svn.wordpress.org/trunk@54384 git-svn-id: https://core.svn.wordpress.org/trunk@53943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to the `Tests_DB_Charset` class to check for the correct version. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] Follow-up to [53918]. Fixes #53623. git-svn-id: https://develop.svn.wordpress.org/trunk@53919 602fd350-edb4-49c9-b593-d223f7449a82
MariaDB version is reported differently between PHP versions: * PHP 8.0.16 or later: `10.6.8-MariaDB` * PHP 8.0.15 or earlier: `5.5.5-10.6.8-MariaDB` The latter includes PHP 7.4.x and PHP 5.6.x as well, where the version is also reported with the `5.5.5-` prefix. This commit makes an adjustment to `wpdb::has_cap()` to check for the correct MariaDB version. This resolves an issue where the `utf8mb4_unicode_520_ci` collation, which is available in MariaDB since version 10.2, was previously not detected correctly. References: * [php/php-src#7972 php-src: #7972: MariaDB version prefix 5.5.5- is not stripped] * [php/php-src#7963 php-src: PR #7963 Fix GH-7932: MariaDB version prefix not always stripped] * [https://mariadb.com/docs/reference/mdb/collations/utf8mb4_unicode_520_ci/ MariaDB Documentation: utf8mb4_unicode_520_ci] Follow-up to [37523], [53919]. Props jamieburchell, SergeyBiryukov. Fixes #54841. git-svn-id: https://develop.svn.wordpress.org/trunk@54384 602fd350-edb4-49c9-b593-d223f7449a82
Description
The version from SQL (from
select version()
) should match the version reported by php mysqli/pdo_mysql drivers.The following code:
Resulted in this output:
But I expected this output instead:
PHP Version
8.0
Operating System
any
The text was updated successfully, but these errors were encountered: