[MDEV-23141] PHP mysqli reports 'READ WRITE' and 'READ ONLY' in transaction is not supported. Created: 2020-07-10  Updated: 2020-09-18  Resolved: 2020-09-18

Status: Closed
Project: MariaDB Server
Component/s: N/A
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Maarten Manders Assignee: Daniel Black
Resolution: Not a Bug Votes: 0
Labels: innodb
Environment:

PHP 7.4, Debian 10


Issue Links:
Problem/Incident
is caused by MDEV-16172 Remove InnoDB 5.7 version number from... Closed

 Description   

The mysqli extension of PHP reports the following warning when using the begin_transaction function with either the MYSQLI_TRANS_START_READ_ONLY or MYSQLI_TRANS_START_READ_WRITE flag.

This bug was reported to PHP development before, but won't be fixed there:
https://bugs.php.net/bug.php?id=78179



 Comments   
Comment by Daniel Black [ 2020-07-21 ]

PHP upstream attempt at bypassing version based tests and relying on syntax errors to identify transaction features not supported by very old MySQL/MariaDB versions:

https://github.com/php/php-src/pull/5877

A wider look at how MariaDB does versioning in light of the 5.5 EOL is still needed. I seem to remember/assume that the versioning was around cross MySQL replica / MariaDB master replication giving a id that MySQL identifies. How this requirement exists currently is probably open to re-evaluation.

So this MDEV-4088 related rather than the innodb versioning of MDEV-16172 that was incorrectly assumed in the php bug,

Comment by Daniel Black [ 2020-08-22 ]

mac89 are you actually experiencing this problem?

The mariadb on docker hub is ubuntu based and very similarly packaged to debian and I don't have a problem.

$ php --version
PHP 7.4.9 (cli) (built: Aug  4 2020 08:28:13) ( NTS )
 
$  podman run -e MYSQL_USER=dan -e MYSQL_PASSWORD=bob  -e MYSQL_ROOT_PASSWORD=bob -e MYSQL_DATABASE=test  --name mariadb10.3 -p 3306  mariadb:10.3
 
 
$ cat /tmp/t.php 
<?php
 
$db = new mysqli("127.0.0.1", "dan", "bob", "test");
$db->begin_transaction(MYSQLI_TRANS_START_READ_WRITE);
 
$v = $db->server_version;
print "server version $v\n";
 
$db->commit();
 
$db->begin_transaction(MYSQLI_TRANS_START_READ_WRITE);
 
$v = $db->server_version;
print "server version $v\n";
 
/tmp 
$ php /tmp/t.php 
server version 100324
server version 100324

So no errors here.

Despite a revert being threatened in https://bugs.php.net/bug.php?id=78179 it didn't happen
https://github.com/php/php-src/blob/master/ext/mysqlnd/mysqlnd_connection.c#L1440

Comment by Daniel Black [ 2020-08-29 ]

I managed to reproduce this bug report by getting php's mysqli against a mysql's (not mariadb) version of the connector-c library (and mysqlnd was unable to reproduce this too),

I needed to do modifications to the MySQL-8.0.21 build. Maybe mac89 older library actually worked easier.

Either way, still working with php upstream to complete this fix. Using the mysqlnd from php will work around this in the mean time.

Comment by Daniel Black [ 2020-09-18 ]

Not so much "not a bug" but not our bug.

Fixed in upstream PHP -https://github.com/php/php-src/commit/740f0f616521c5e257f2e9923dadfde3a8352f48

Generated at Thu Feb 08 09:20:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.