You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MariaDB version prefix 5.5.5- is not stripped #7972
The version from SQL (from select version()) should match the version reported by php mysqli/pdo_mysql drivers.
The following code:
var_dump(...->expr('select version()')->getOne()); // raw version from SQL
var_dump(...->getWrappedConnection()->getServerVersion()); // version from DBAL/mysqli
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.
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 mysqli_get_server_info() needs to be stripped of any characters, it can be done in userland. I don't see any mention in any documentation that the value returned by mysql_get_server_info should match the one returned by SQL select version().
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.
mysqli_get_server_version() is fixed (in php-src) - is there any support to get the numerical version also from PDO?
We follow what the C API does in this case, which is to return the string verbatim.
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.
Activity
cmb69 commentedon Jan 11, 2022
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.
mvorisek commentedon Jan 11, 2022
in
php-src/ext/mysqlnd/mysqlnd_connection.c
Line 1281 in 72cdb0a
mysqli::get_server_infomethod still returns the unfixed/prefixed version because of https://jira.mariadb.org/browse/MDEV-4088 protocol fix for replicationthe version returned by
mysqli::get_server_infoshould be fixed and should match version returned byselect version()kamil-tekiela commentedon Jan 11, 2022
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
mysqli_get_server_info()needs to be stripped of any characters, it can be done in userland. I don't see any mention in any documentation that the value returned bymysql_get_server_infoshould match the one returned by SQLselect version().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.
mvorisek commentedon Jan 11, 2022
mysqli_get_server_version()is fixed (in php-src) - is there any support to get the numerical version also from PDO?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.
cmb69 commentedon Jan 18, 2022
outputs for me
This inconsistency is certainly a bug.
kamil-tekiela commentedon Jan 18, 2022
Do you mean a bug in mysqlnd? How so? This is exactly the information that mysqlnd receives from MariaDB.
cmb69 commentedon Jan 18, 2022
No. We already strip the version prefix for
::$server_infoand::$server_version, but not when setting theconn->server_versioninMYSQLND_METHOD(mysqlnd_command, handshake). Either we strip it everywhere, or never.Fix GH-7932: MariaDB version prefix not always stripped
cmb69 commentedon Jan 18, 2022
After some further discussion on #7963, we decided to keep the behavior as is, but to document it.
Strip MariaDB 10 prefix
Tests: Correct MariaDB version check in database charset tests.
Tests: Correct MariaDB version check in database charset tests.
Tests: Correct MariaDB version check in database charset tests.
Tests: Correct MariaDB version check in database charset tests.
Tests: Correct MariaDB version check in database charset tests.
Database: Correct MariaDB version check in `wpdb::has_cap()`.
Database: Correct MariaDB version check in `wpdb::has_cap()`.
Tests: Correct MariaDB version check in database charset tests.
Database: Correct MariaDB version check in `wpdb::has_cap()`.