#36449 [Bgs]: Procedure call + PDO::ATTR_PERSISTENT => true

2006-04-30 Thread brice dot joly at free dot fr
 ID:   36449
 User updated by:  brice dot joly at free dot fr
 Reported By:  brice dot joly at free dot fr
 Status:   Bogus
 Bug Type: PDO related
 Operating System: Windows XP
 PHP Version:  5.2.0-dev
 New Comment:

Some quick clarification: the problem occurs even with non-prepared
code:

$dbh = new PDO('mysql:host=localhost;dbname=test', 'user', 'password',
array(PDO::ATTR_PERSISTENT => true);

foreach ($dbh->query("CALL simpleTest()") as $row) {
print_r($row);
}
$arr = $dbh->errorInfo();
print_r($arr);

So I'm afraid the problem is not directly linked with the native
prepared statement API, though the people at that conference might know
better.


Previous Comments:


[2006-04-30 01:06:53] [EMAIL PROTECTED]

Not a PHP bug; you cannot use CALL with the native prepared statement
API in mySQL.

Use the latest snapshot or PHP 5.1.3 (being released any day now) and
follow the advice in:
http://netevil.org/node.php?nid=795



--------------------

[2006-04-27 10:38:38] brice dot joly at free dot fr

Not yet fixed in build of Apr 27 2006 08:15:12, above code still fails.



[2006-04-17 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2006-04-09 07:54:37] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

The next snapshot dated after this message likely fixes this.

--------------------

[2006-02-18 21:55:19] brice dot joly at free dot fr

Description:

When calling a procedure from PDO with PDO::ATTR_PERSISTENT = true, I
have a very strange behaviour when refreshing the page: on odd tries it
works as expected, on even ones PDO makes the call, then loses
connection while retrieving the result. Direct and prepared call both
produce the same behaviour. Note that the call is actually ran by MySQL
in both cases (appears in the query log).

When switching PDO::ATTR_PERSISTENT to false all works as expected.

Running the test with PHP CLI works fine. I run PHP (tested with
snapshot of 17 Feb 2006, 5.1.3-dev, had the same problem with 5.1.2) as
a module, Apache 2.0.52, MySQL 5.0.18.

Reproduce code:
---
// MySQL Procedure
CREATE PROCEDURE test.simpleTest()
BEGIN
  SELECT 'Procedure output';
END;

// PDO call
 true);

foreach ($dbh->query("CALL simpleTest()") as $row) {
print_r($row);
}
$arr = $dbh->errorInfo();
print_r($arr);

/* Same problem with
$stmt = $dbh->prepare("CALL simpleTest()");
$stmt->execute();
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
print_r($row);
}
$arr = $stmt->errorInfo();
print_r($arr);
*/
?>

Expected result:

Array
(
[Procedure output] => Procedure output
[0] => Procedure output
)
Array
(
[0] => 0
)

on odd and even tries/refresh

Actual result:
--
On odd tries (1st, 3rd, etc.):

Array
(
[Procedure output] => Procedure output
[0] => Procedure output
)
Array
(
[0] => 0
)

on even tries (refresh)
Array
(
[0] => HY000
[1] => 2013
[2] => Lost connection to MySQL server during query
)





-- 
Edit this bug report at http://bugs.php.net/?id=36449&edit=1


#36449 [NoF->Opn]: Procedure call + PDO::ATTR_PERSISTENT => true

2006-04-27 Thread brice dot joly at free dot fr
 ID:   36449
 User updated by:  brice dot joly at free dot fr
 Reported By:  brice dot joly at free dot fr
-Status:   No Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Windows XP
-PHP Version:  5.1.2
+PHP Version:  5.2.0-dev
 New Comment:

Not yet fixed in build of Apr 27 2006 08:15:12, above code still fails.


Previous Comments:


[2006-04-17 01:00:01] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2006-04-09 07:54:37] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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

The next snapshot dated after this message likely fixes this.



[2006-02-18 21:55:19] brice dot joly at free dot fr

Description:

When calling a procedure from PDO with PDO::ATTR_PERSISTENT = true, I
have a very strange behaviour when refreshing the page: on odd tries it
works as expected, on even ones PDO makes the call, then loses
connection while retrieving the result. Direct and prepared call both
produce the same behaviour. Note that the call is actually ran by MySQL
in both cases (appears in the query log).

When switching PDO::ATTR_PERSISTENT to false all works as expected.

Running the test with PHP CLI works fine. I run PHP (tested with
snapshot of 17 Feb 2006, 5.1.3-dev, had the same problem with 5.1.2) as
a module, Apache 2.0.52, MySQL 5.0.18.

Reproduce code:
---
// MySQL Procedure
CREATE PROCEDURE test.simpleTest()
BEGIN
  SELECT 'Procedure output';
END;

// PDO call
 true);

foreach ($dbh->query("CALL simpleTest()") as $row) {
print_r($row);
}
$arr = $dbh->errorInfo();
print_r($arr);

/* Same problem with
$stmt = $dbh->prepare("CALL simpleTest()");
$stmt->execute();
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
print_r($row);
}
$arr = $stmt->errorInfo();
print_r($arr);
*/
?>

Expected result:

Array
(
[Procedure output] => Procedure output
[0] => Procedure output
)
Array
(
[0] => 0
)

on odd and even tries/refresh

Actual result:
--
On odd tries (1st, 3rd, etc.):

Array
(
[Procedure output] => Procedure output
[0] => Procedure output
)
Array
(
[0] => 0
)

on even tries (refresh)
Array
(
[0] => HY000
[1] => 2013
[2] => Lost connection to MySQL server during query
)





-- 
Edit this bug report at http://bugs.php.net/?id=36449&edit=1


#36449 [NEW]: Procedure call + PDO::ATTR_PERSISTENT => true

2006-02-18 Thread brice dot joly at free dot fr
From: brice dot joly at free dot fr
Operating system: Windows XP
PHP version:  5.1.2
PHP Bug Type: PDO related
Bug description:  Procedure call + PDO::ATTR_PERSISTENT => true

Description:

When calling a procedure from PDO with PDO::ATTR_PERSISTENT = true, I have
a very strange behaviour when refreshing the page: on odd tries it works as
expected, on even ones PDO makes the call, then loses connection while
retrieving the result. Direct and prepared call both produce the same
behaviour. Note that the call is actually ran by MySQL in both cases
(appears in the query log).

When switching PDO::ATTR_PERSISTENT to false all works as expected.

Running the test with PHP CLI works fine. I run PHP (tested with snapshot
of 17 Feb 2006, 5.1.3-dev, had the same problem with 5.1.2) as a module,
Apache 2.0.52, MySQL 5.0.18.

Reproduce code:
---
// MySQL Procedure
CREATE PROCEDURE test.simpleTest()
BEGIN
  SELECT 'Procedure output';
END;

// PDO call
 true);

foreach ($dbh->query("CALL simpleTest()") as $row) {
print_r($row);
}
$arr = $dbh->errorInfo();
print_r($arr);

/* Same problem with
$stmt = $dbh->prepare("CALL simpleTest()");
$stmt->execute();
foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
print_r($row);
}
$arr = $stmt->errorInfo();
print_r($arr);
*/
?>

Expected result:

Array
(
[Procedure output] => Procedure output
[0] => Procedure output
)
Array
(
[0] => 0
)

on odd and even tries/refresh

Actual result:
--
On odd tries (1st, 3rd, etc.):

Array
(
[Procedure output] => Procedure output
[0] => Procedure output
)
Array
(
[0] => 0
)

on even tries (refresh)
Array
(
[0] => HY000
[1] => 2013
[2] => Lost connection to MySQL server during query
)

-- 
Edit bug report at http://bugs.php.net/?id=36449&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36449&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36449&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36449&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36449&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=36449&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=36449&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=36449&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=36449&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=36449&r=support
Expected behavior:http://bugs.php.net/fix.php?id=36449&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=36449&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=36449&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36449&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36449&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36449&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=36449&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=36449&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36449&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=36449&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=36449&r=mysqlcfg


#35801 [Fbk->Opn]: Prepared statement with "LIMIT :limit"

2005-12-25 Thread brice dot joly at free dot fr
 ID:   35801
 User updated by:  brice dot joly at free dot fr
 Reported By:  brice dot joly at free dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Windows XP
 PHP Version:  5.1.1
 New Comment:

Tried with snapshot: no more Apache crash.

Yet LIMIT placeholder is still not supported, could someone possibly
forward the feature request to Wez/anyone working on PDO? I think that
would be a welcome addition. Thanks.


Previous Comments:


[2005-12-25 17:34:15] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2005-12-25 13:21:11] brice dot joly at free dot fr

Description:

As of MySQL 5.0.7, placeholders can be used in the LIMIT clause when
using prepared statements
(http://dev.mysql.com/doc/refman/5.0/en/select.html). Will this feature
make it to PDO? 

Friendly input: array(':limit' => 10) as well as "pager" input
array(':limit' => array(10, 10)) would make sense for the MySQL driver
since it understands both syntaxes.

Reproduce code:
---
Prepared SQL query:

SELECT * FROM table LIMIT :limit

with bindParam(':limit', 10), prepared statement sent to DB will be:

SELECT * FROM table LIMIT "10"

Expected result:

Double quotes on LIMIT value will raise a MySQL Error 1064: You have an
error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near '"10"' at line 1.
Of course MySQL expects 

SELECT * FROM table LIMIT 10

Actual result:
--
Apache crashes, log reads:

Parent: child process exited with status 3221225477 -- Restarting.

No Exception/PHP Error, tested on WinXP, Apache/2.0.52, PHP 5.1.1,
MySQL 5.0.17





-- 
Edit this bug report at http://bugs.php.net/?id=35801&edit=1


#35801 [NEW]: Prepared statement with "LIMIT :limit"

2005-12-25 Thread brice dot joly at free dot fr
From: brice dot joly at free dot fr
Operating system: Windows XP
PHP version:  5.1.1
PHP Bug Type: PDO related
Bug description:  Prepared statement with "LIMIT :limit"

Description:

As of MySQL 5.0.7, placeholders can be used in the LIMIT clause when using
prepared statements (http://dev.mysql.com/doc/refman/5.0/en/select.html).
Will this feature make it to PDO? 

Friendly input: array(':limit' => 10) as well as "pager" input
array(':limit' => array(10, 10)) would make sense for the MySQL driver
since it understands both syntaxes.

Reproduce code:
---
Prepared SQL query:

SELECT * FROM table LIMIT :limit

with bindParam(':limit', 10), prepared statement sent to DB will be:

SELECT * FROM table LIMIT "10"

Expected result:

Double quotes on LIMIT value will raise a MySQL Error 1064: You have an
error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '"10"' at line 1. Of
course MySQL expects 

SELECT * FROM table LIMIT 10

Actual result:
--
Apache crashes, log reads:

Parent: child process exited with status 3221225477 -- Restarting.

No Exception/PHP Error, tested on WinXP, Apache/2.0.52, PHP 5.1.1, MySQL
5.0.17

-- 
Edit bug report at http://bugs.php.net/?id=35801&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=35801&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=35801&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=35801&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35801&r=fixedcvs
Fixed in release: 
http://bugs.php.net/fix.php?id=35801&r=alreadyfixed
Need backtrace:   http://bugs.php.net/fix.php?id=35801&r=needtrace
Need Reproduce Script:http://bugs.php.net/fix.php?id=35801&r=needscript
Try newer version:http://bugs.php.net/fix.php?id=35801&r=oldversion
Not developer issue:  http://bugs.php.net/fix.php?id=35801&r=support
Expected behavior:http://bugs.php.net/fix.php?id=35801&r=notwrong
Not enough info:  
http://bugs.php.net/fix.php?id=35801&r=notenoughinfo
Submitted twice:  
http://bugs.php.net/fix.php?id=35801&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35801&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=35801&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35801&r=dst
IIS Stability:http://bugs.php.net/fix.php?id=35801&r=isapi
Install GNU Sed:  http://bugs.php.net/fix.php?id=35801&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=35801&r=float
No Zend Extensions:   http://bugs.php.net/fix.php?id=35801&r=nozend
MySQL Configuration Error:http://bugs.php.net/fix.php?id=35801&r=mysqlcfg