Author: uwendel
Date: 2008-04-11 11:50:43 +0200 (Fri, 11 Apr 2008)
New Revision: 1421
Added:
trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362_blob.phpt
Modified:
trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362.phpt
Log:
Updating tests. They should pass after a tiny change in mysqlnd which is currently in the
works by Andrey
Modified: trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362.phpt
===================================================================
--- trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362.phpt 2008-04-10 19:36:45 UTC (rev 1420)
+++ trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362.phpt 2008-04-11 09:50:43 UTC (rev 1421)
@@ -25,12 +25,16 @@
printf("[003] Second execution with unmodified bound parameter\n");
var_dump($stmt->execute());
- var_dump($stmt->fetchAll());
+ var_dump($tmp1 = $stmt->fetchAll());
- printf("[004] Third execution with new value for bound parameter\n");
- $param = 2;
+ $param2 = 1;
+ if (!($stmt = $db->prepare('SELECT 1 AS col1 FROM DUAL WHERE 1 = :param'))
+ || !$stmt->bindParam(':param', $param2))
+ printf("[004] prepare() or bindParam() has failed\n");
+
+ printf("[005] First execution with new statement\n");
var_dump($stmt->execute());
- var_dump($stmt->fetchAll());
+ var_dump($tmp2 = $stmt->fetchAll());
print "done!";
--EXPECTF--
@@ -56,8 +60,15 @@
string(1) "1"
}
}
-[004] Third execution with new value for bound parameter
+[005] First execution with new statement
bool(true)
-array(0) {
+array(1) {
+ [0]=>
+ array(2) {
+ ["col1"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ }
}
done!
\ No newline at end of file
Added: trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362_blob.phpt
===================================================================
--- trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362_blob.phpt (rev
0)
+++ trunk/tests/ext/pdo_mysql/pdo_mysql_mantis_362_blob.phpt 2008-04-11 09:50:43 UTC (rev
1421)
@@ -0,0 +1,74 @@
+--TEST--
+Mantis #362 (bindParam() @ BLOB) - remove test after fix!
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('mysql_pdo_test.inc');
+MySQLPDOTest::skip();
+$db = MySQLPDOTest::factory();
+?>
+--FILE--
+<?php
+ require_once('mysql_pdo_test.inc');
+
+ $db = MySQLPDOTest::factory();
+ $db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, 0);
+
+ $db->exec("DROP TABLE IF EXISTS test");
+ $db->exec('CREATE TABLE test(id INT, label LONGBLOB)');
+
+ $param = str_repeat('I am a mighty BLOB! ', 10);
+ if (!($stmt = $db->prepare('INSERT INTO test(id, label) VALUES (1, :param)'))
+ || !$stmt->bindParam(':param', $param))
+ printf("[001] prepare() or bindParam() has failed: %s/%s\n",
+ var_export($db->errorInfo(), true),
+ var_export($stmt->errorInfo(), true));
+
+ printf("[002] First execution with bound parameter\n");
+ var_dump($stmt->execute());
+
+ printf("[003] Second execution with unmodified bound parameter\n");
+ var_dump($stmt->execute());
+
+ $param = 1;
+ if (!($stmt = $db->prepare('SELECT id, label FROM test WHERE id = :param'))
+ || !$stmt->bindParam(':param', $param))
+ printf("[004] prepare() or bindParam() has failed\n");
+
+ printf("[004] First execution of new SELECT statement\n");
+ var_dump($stmt->execute());
+ var_dump($tmp2 = $stmt->fetchAll());
+
+ print "done!";
+--EXPECTF--
+[002] First execution with bound parameter
+bool(true)
+[003] Second execution with unmodified bound parameter
+bool(true)
+[004] First execution of new SELECT statement
+bool(true)
+array(2) {
+ [0]=>
+ array(4) {
+ ["id"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ ["label"]=>
+ string(200) "I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a
mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty
BLOB! I am a mighty BLOB! I am a mighty BLOB! "
+ [1]=>
+ string(200) "I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a
mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty
BLOB! I am a mighty BLOB! I am a mighty BLOB! "
+ }
+ [1]=>
+ array(4) {
+ ["id"]=>
+ string(1) "1"
+ [0]=>
+ string(1) "1"
+ ["label"]=>
+ string(200) "I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a
mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty
BLOB! I am a mighty BLOB! I am a mighty BLOB! "
+ [1]=>
+ string(200) "I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a
mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty BLOB! I am a mighty
BLOB! I am a mighty BLOB! I am a mighty BLOB! "
+ }
+}
+done!
\ No newline at end of file
| Thread |
|---|
| • PHP mysqlnd svn commit: r1421 - trunk/tests/ext/pdo_mysql | uwendel | 11 Apr |