Author: uwendel
Date: 2008-04-04 14:56:24 +0200 (Fri, 04 Apr 2008)
New Revision: 1390
Added:
trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_369.phpt
Log:
See Mantis #369 - Stored Proc does not work with native PS in PDO_MYSQLND
Added: trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_369.phpt
===================================================================
--- trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_369.phpt (rev 0)
+++ trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_369.phpt 2008-04-04 12:56:24 UTC (rev 1390)
@@ -0,0 +1,67 @@
+--TEST--
+Mantis #369 (Native PS and Stored Procedures) - remove test after fix!
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('mysql_pdo_test.inc');
+MySQLPDOTest::skip();
+$db = MySQLPDOTest::factory();
+
+$stmt = $db->query('SELECT VERSION() as _version');
+$row = $stmt->fetch(PDO::FETCH_ASSOC);
+if ((int)substr($row['_version'], 0, 1) < 5)
+ die("skip Requires MySQL 5+");
+?>
+--FILE--
+<?php
+ require_once('mysql_pdo_test.inc');
+
+ printf("Emulated PS...\n");
+ $db = MySQLPDOTest::factory();
+ $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);
+
+ $db->exec('DROP PROCEDURE IF EXISTS p');
+ $db->exec('CREATE PROCEDURE p() BEGIN SELECT 1 AS a, 2 AS b; END;');
+ $stmt = $db->query('CALL p()');
+ var_dump($stmt->fetchAll());
+
+ printf("Native PS...\n");
+ $db = MySQLPDOTest::factory();
+ $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
+
+ $db->exec('DROP PROCEDURE IF EXISTS p');
+ $db->exec('CREATE PROCEDURE p() BEGIN SELECT 1 AS a, 2 AS b; END;');
+ $stmt = $db->query('CALL p()');
+ var_dump($stmt->fetchAll());
+
+ print "done!";
+--EXPECTF--
+Emulated PS...
+array(1) {
+ [0]=>
+ array(4) {
+ ["a"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ ["b"]=>
+ string(1) "2"
+ [1]=>
+ string(1) "2"
+ }
+}
+Native PS...
+array(1) {
+ [0]=>
+ array(4) {
+ ["a"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ ["b"]=>
+ string(1) "2"
+ [1]=>
+ string(1) "2"
+ }
+}
+done!
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r1390 - trunk/tests/ext/pdo_mysql | uwendel | 4 Apr |