|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34624 mysqli_rpl_query_type always returns MYSQLI_RPL_MASTER for CALL statements
Submitted: 2005-09-24 06:32 UTC Modified: 2005-09-27 10:47 UTC
From: jasper at bryant-greene dot name Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.0.5 OS: Gentoo Linux x86
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jasper at bryant-greene dot name
New email:
PHP Version: OS:


 [2005-09-24 06:32 UTC] jasper at bryant-greene dot name
Calling mysqli_rpl_query_type() for a CALL statement should return MYSQLI_RPL_SLAVE for CALL statements where the stored procedure is defined as READS SQL DATA, and MYSQLI_RPL_MASTER for other SPs.

The way it is now (always returning MYSQLI_RPL_MASTER) makes replication useless when stored procedures are being used.

Reproduce code:
Where getUser is a stored procedure taking one INT argument and defined as READS SQL DATA:


$query_type = $myDatabaseConnection->rpl_query_type('CALL getUser(7)');

if($query_type == MYSQLI_RPL_SLAVE) {
print('Execute on slave');
} else {
print('Execute on master');


Expected result:
"Execute on slave"

Actual result:
"Execute on master"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-24 13:37 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-09-27 07:32 UTC] jasper at bryant-greene dot name
Same behaviour
 [2005-09-27 10:47 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The client isn't able to detect the type of call statement. Cause a call of a stored procedure can both retrieve and modify data, it will send statement always to the server.

As a workaround in your case , you should use the call mysqli_slave_query instead of using mysql_send_query.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 09:01:28 2024 UTC