php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39052 pdo::query with "show slave/master status"
Submitted: 2006-10-05 19:28 UTC Modified: 2006-10-06 12:21 UTC
From: xing at mac dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.6 OS: Linux
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: xing at mac dot com
New email:
PHP Version: OS:

 

 [2006-10-05 19:28 UTC] xing at mac dot com
Description:
------------
PHP 5.1.6
Mysql 5.0.24a

I have tested using PDO::query for both "show master status" and "show slave status" via tcp port and both bomb out with "SQLSTATE[HY000]: General error: 2030 This command is not supported in the prepared statement protocol yet" error.

Bug #36572 was suppoed to fix this but I just tested with php 5.1.6 and the issue is still unresolved. 


Reproduce code:
---------------
Execute 

"show slave status;"

or 

"show master status"

via pdo::query connected to server using tcp port.

Expected result:
----------------
Result set.

Actual result:
--------------
SQLSTATE[HY000]: General error: 2030 This command is not supported in the prepared statement protocol yet

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-05 19:36 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-10-05 20:09 UTC] xing at mac dot com
Just tried the 5.2cvs snapshot. Same result. No change.
 [2006-10-05 20:21 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2006-10-05 20:34 UTC] xing at mac dot com
<?php

$link = new PDO("mysql:host=127.0.0.1;port=11113;","user","password");
$link->setAttribute (PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$link->setAttribute (PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, TRUE);
$link->query("SET NAMES 'utf8'");

try {
  $link->query("show slave status");
  echo "good";
}
catch (PDOException $e) {
  echo "<pre>";
  print_r($e);
  echo "</pre>";
}

?>
 [2006-10-06 12:21 UTC] wez@php.net
$link->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 13:01:30 2024 UTC