|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-06-18 19:27 UTC] david dot bergeron5 at usherbrooke dot ca
Description: ------------ MariaDB Version 10.3.15-MariaDB-1:10.3.15+maria~stretch PHP Version: PHP version: 7.0.33-0+deb9u3 With MariaDB 10.3 they remove the innoDB version reporting. I think this is due to this issue in MariaDB. https://jira.mariadb.org/browse/MDEV-16172 So when you do a $db->begin_transaction(MYSQLI_TRANS_START_READ_WRITE); You receive a "PHP Warning: mysqli::begin_transaction(): This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required in /var/www/html/..." Test script: --------------- $host="localhost"; $username="username"; $password="password"; $database="yourdatabase"; $db = new mysqli( $host, $username, $password, $database); $db->begin_transaction(MYSQLI_TRANS_START_READ_WRITE); Expected result: ---------------- Should not say that this doesn't support 'READ WRITE'. Actual result: -------------- PHP Warning: mysqli::begin_transaction(): This server version doesn't support 'READ WRITE' and 'READ ONLY'. Minimum 5.6.5 is required in /var/www/html/dbtest.php on line 8 PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 08:00:02 2025 UTC |
I don't know if this could help. If I do a HELP 'lock'; It return this. And we can see what is supported by the current version of the server. We should probably ask MySQL and MariaDB to have a more easy to parse definition of theirs statements. David --------------------------------------------------- Syntax: LOCK TABLES tbl_name [[AS] alias] lock_type [, tbl_name [[AS] alias] lock_type] ... lock_type: READ [LOCAL] | [LOW_PRIORITY] WRITE UNLOCK TABLES MySQL enables client sessions to acquire table locks explicitly for the purpose of cooperating with other sessions for access to tables, or to prevent other sessions from modifying tables during periods when a session requires exclusive access to them. A session can acquire or release locks only for itself. One session cannot acquire locks for another session or release locks held by another session. Locks may be used to emulate transactions or to get more speed when updating tables. This is explained in more detail later in this section. LOCK TABLES explicitly acquires table locks for the current client session. Table locks can be acquired for base tables or views. You must have the LOCK TABLES privilege, and the SELECT privilege for each object to be locked. For view locking, LOCK TABLES adds all base tables used in the view to the set of tables to be locked and locks them automatically. If you lock a table explicitly with LOCK TABLES, any tables used in triggers are also locked implicitly, as described in http://dev.mysql.com/doc/refman/5.5/en/lock-tables-and-triggers.html. UNLOCK TABLES explicitly releases any table locks held by the current session. LOCK TABLES implicitly releases any table locks held by the current session before acquiring new locks. Another use for UNLOCK TABLES is to release the global read lock acquired with the FLUSH TABLES WITH READ LOCK statement, which enables you to lock all tables in all databases. See [HELP FLUSH]. (This is a very convenient way to get backups if you have a file system such as Veritas that can take snapshots in time.) URL: http://dev.mysql.com/doc/refman/5.5/en/lock-tables.html