davidc Mon Nov 10 18:44:04 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/pdo_mysql/tests bug41125.phpt bug_41997.phpt
pdo_mysql_begintransaction.phpt
pdo_mysql_errorinfo.phpt
pdo_mysql_prepare_emulated_anonymous.phpt
pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
pdo_mysql_prepare_native_dup_named_placeholder.phpt
pdo_mysql_prepare_native_named_placeholder.phpt
pdo_mysql_stmt_errorinfo.phpt
pdo_mysql_stmt_multiquery.phpt
pecl_bug_5780.phpt
Log:
- Make test conform to the error reporting that always returns
three elements. Adjusted all bugs and tests that were using
errorInfo() and errorCode() (dbh & stmt)
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/bug41125.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/bug41125.phpt
diff -u php-src/ext/pdo_mysql/tests/bug41125.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/bug41125.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/bug41125.phpt:1.1.2.2 Fri Oct 10 12:10:41 2008
+++ php-src/ext/pdo_mysql/tests/bug41125.phpt Mon Nov 10 18:44:04 2008
@@ -85,78 +85,78 @@
?>
--EXPECT--
1
-00000
+00000 - -
-------------------------------------------------------
[1] Query: [[SELECT 1 FROM DUAL WHERE 1 = '?\'\'']]
-00000
+00000 - -
--------
[2] Query: [[SELECT 'a\'0' FROM DUAL WHERE 1 = ?]]
a'0
-00000
+00000 - -
--------
[3] Query: [[SELECT 'a', 'b\'' FROM DUAL WHERE '''' LIKE '\'' AND ?]]
a - b'
-00000
+00000 - -
--------
[4] Query: [[SELECT 'foo?bar', '', '''' FROM DUAL WHERE ?]]
foo?bar - - '
-00000
+00000 - -
--------
Query: [[SELECT upper(:id) FROM DUAL WHERE '1']]
O'\0
-00000
+00000 - -
-------------------------------------------------------
[1] Query: [[SELECT 1, 'foo' FROM DUAL WHERE 1 = :id AND '\0' IS NULL AND 2
<> :id]]
-00000
+00000 - -
--------
[2] Query: [[SELECT 1 FROM DUAL WHERE 1 = :id AND '' AND 2 <> :id]]
-00000
+00000 - -
--------
[3] Query: [[SELECT 1 FROM DUAL WHERE 1 = :id AND '\'\'' = '''' AND 2 <> :id]]
-00000
+00000 - -
--------
[4] Query: [[SELECT 1 FROM DUAL WHERE 1 = :id AND '\'' = '''' AND 2 <> :id]]
1
-00000
+00000 - -
--------
[5] Query: [[SELECT 'a', 'b\'' FROM DUAL WHERE '''' LIKE '\'' AND 1]]
a - b'
-00000
+00000 - -
--------
[6] Query: [[SELECT 'a''', '\'b\'' FROM DUAL WHERE '''' LIKE '\'' AND 1]]
a' - 'b'
-00000
+00000 - -
--------
[7] Query: [[SELECT UPPER(:id) FROM DUAL WHERE '1']]
1
-00000
+00000 - -
--------
[8] Query: [[SELECT 1 FROM DUAL WHERE '\'']]
-00000
+00000 - -
--------
[9] Query: [[SELECT 1 FROM DUAL WHERE :id AND '\0' OR :id]]
1
-00000
+00000 - -
--------
[10] Query: [[SELECT 1 FROM DUAL WHERE 'a\f\n\0' AND 1 >= :id]]
-00000
+00000 - -
--------
[11] Query: [[SELECT 1 FROM DUAL WHERE '\'' = '''']]
1
-00000
+00000 - -
--------
[12] Query: [[SELECT '\n' '1 FROM DUAL WHERE '''' and :id']]
1 FROM DUAL WHERE '' and :id
-00000
+00000 - -
--------
[13] Query: [[SELECT 1 'FROM DUAL WHERE :id AND '''' = '''' OR 1 = 1 AND ':id]]
1
-00000
+00000 - -
--------
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/bug_41997.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/bug_41997.phpt
diff -u php-src/ext/pdo_mysql/tests/bug_41997.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/bug_41997.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/bug_41997.phpt:1.1.2.2 Mon Jul 21 13:09:27 2008
+++ php-src/ext/pdo_mysql/tests/bug_41997.phpt Mon Nov 10 18:44:04 2008
@@ -46,9 +46,13 @@
string(1) "1"
}
}
-array(1) {
+array(3) {
[0]=>
string(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
array(1) {
[0]=>
@@ -57,8 +61,12 @@
string(1) "2"
}
}
-array(1) {
+array(3) {
[0]=>
string(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
diff -u php-src/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt:1.1.2.2 Mon Jul
21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt Mon Nov 10
18:44:04 2008
@@ -195,7 +195,7 @@
["label"]=>
string(1) "z"
}
-[026] Autocommit mode of the MySQL Server should be off, got '1', [0] 00000
+[026] Autocommit mode of the MySQL Server should be off, got '1', [0] 00000
[028] I'm confused, how can autocommit be on? Didn't I say I want to manually
control transactions?
string(5) "00000"
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt
diff -u php-src/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt:1.1.2.2 Mon Jul
21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_errorinfo.phpt Mon Nov 10
18:44:04 2008
@@ -14,13 +14,9 @@
MySQLPDOTest::createTestTable($db);
function check_error($offset, &$obj, $expected = '00000') {
-
$info = $obj->errorInfo();
- if (count($info) != 3)
- printf("[%03d] Info should have three fields, got %s\n",
- $offset, var_export($info, true));
-
$code = $info[0];
+
if (($code != $expected) && (($expected != '00000') && ($code
!= ''))) {
printf("[%03d] Expecting error code '%s' got code
'%s'\n",
$offset, $expected, $code);
@@ -33,6 +29,8 @@
printf("[%03d] Driver-specific error
message.not set\n", $offset);
}
+
+
}
function pdo_mysql_errorinfo($db, $offset) {
@@ -100,74 +98,12 @@
$db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
--EXPECTF--
Emulated Prepared Statements...
-[002] Info should have three fields, got array (
- 0 => '00000',
-)
-[003] Info should have three fields, got array (
- 0 => '00000',
-)
-[004] Info should have three fields, got array (
- 0 => '00000',
-)
-[005] Info should have three fields, got array (
- 0 => '00000',
-)
-[009] Info should have three fields, got array (
- 0 => '00000',
-)
-[010] Info should have three fields, got array (
- 0 => '00000',
-)
-[013] Info should have three fields, got array (
- 0 => '00000',
-)
-[014] Info should have three fields, got array (
- 0 => '00000',
-)
-[015] Info should have three fields, got array (
- 0 => 'IM001',
-)
[015] Driver-specific error code not set
[015] Driver-specific error message.not set
-[016] Info should have three fields, got array (
- 0 => 'IM001',
-)
[016] Driver-specific error code not set
[016] Driver-specific error message.not set
-[017] Info should have three fields, got array (
- 0 => '00000',
-)
-[018] Info should have three fields, got array (
- 0 => '00000',
-)
Native Prepared Statements...
-[022] Info should have three fields, got array (
- 0 => '00000',
-)
-[023] Info should have three fields, got array (
- 0 => '00000',
-)
-[024] Info should have three fields, got array (
- 0 => '00000',
-)
-[025] Info should have three fields, got array (
- 0 => '00000',
-)
-[030] Info should have three fields, got array (
- 0 => '00000',
-)
-[033] Info should have three fields, got array (
- 0 => '00000',
-)
-[034] Info should have three fields, got array (
- 0 => '00000',
-)
-[037] Info should have three fields, got array (
- 0 => '00000',
-)
-[038] Info should have three fields, got array (
- 0 => '00000',
-)
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
diff -u
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt:1.1.2.3
---
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt:1.1.2.2
Mon Jul 21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
Mon Nov 10 18:44:04 2008
@@ -72,7 +72,9 @@
now the same with native PS
[005] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index:
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
diff -u
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt:1.1.2.3
---
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt:1.1.2.2
Mon Jul 21 13:09:28 2008
+++
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
Mon Nov 10 18:44:04 2008
@@ -59,6 +59,8 @@
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in
%s on line %d
[003] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
@@ -69,7 +71,9 @@
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in
%s on line 33
[005] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index:
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
diff -u
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt:1.1.2.3
---
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt:1.1.2.2
Mon Jul 21 13:09:28 2008
+++
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
Mon Nov 10 18:44:04 2008
@@ -101,6 +101,8 @@
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in
%s on line %d
[003] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
@@ -130,7 +132,9 @@
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in
%s on line %d
[008] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index:
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
diff -u
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt:1.1.2.3
---
php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt:1.1.2.2
Mon Jul 21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
Mon Nov 10 18:44:04 2008
@@ -70,6 +70,8 @@
--EXPECTF--
[003] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
@@ -82,4 +84,4 @@
string(12) ":placeholder"
}
}
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt
diff -u php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt:1.1.2.2 Mon Jul
21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_errorinfo.phpt Mon Nov 10
18:44:04 2008
@@ -61,9 +61,13 @@
?>
--EXPECTF--
Testing emulated PS...
-array(1) {
+array(3) {
[0]=>
string(0) ""
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not
found: 1146 Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d
@@ -86,17 +90,25 @@
[2]=>
string(%d) "Table '%s.test' doesn't exist"
}
-array(1) {
+array(3) {
[0]=>
string(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
Testing native PS...
Warning: PDO::prepare(): SQLSTATE[42S02]: Base table or view not found: 1146
Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d
bool(false)
-array(1) {
+array(3) {
[0]=>
string(0) ""
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not
found: 1146 Table '%s.test' doesn't exist in %s on line %d
@@ -116,4 +128,4 @@
[2]=>
string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
}
-done!
\ No newline at end of file
+done!
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt
diff -u php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt:1.1.2.2
php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt:1.1.2.3
--- php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt:1.1.2.2 Mon Jul
21 13:09:28 2008
+++ php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_multiquery.phpt Mon Nov 10
18:44:04 2008
@@ -54,9 +54,13 @@
?>
--EXPECTF--
Emulated Prepared Statements...
-array(1) {
+array(3) {
[0]=>
string(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
array(1) {
[0]=>
@@ -65,9 +69,13 @@
string(1) "a"
}
}
-array(1) {
+array(3) {
[0]=>
string(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
array(1) {
[0]=>
@@ -87,4 +95,4 @@
Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 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 '; SELECT label FROM test
ORDER BY id ASC LIMIT 1' at line %d in %s on line %d
-Fatal error: Call to a member function errorInfo() on a non-object in %s on
line %d
\ No newline at end of file
+Fatal error: Call to a member function errorInfo() on a non-object in %s on
line %d
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/tests/pecl_bug_5780.phpt?r1=1.1.2.1.2.4&r2=1.1.2.1.2.4.2.1&diff_format=u
Index: php-src/ext/pdo_mysql/tests/pecl_bug_5780.phpt
diff -u php-src/ext/pdo_mysql/tests/pecl_bug_5780.phpt:1.1.2.1.2.4
php-src/ext/pdo_mysql/tests/pecl_bug_5780.phpt:1.1.2.1.2.4.2.1
--- php-src/ext/pdo_mysql/tests/pecl_bug_5780.phpt:1.1.2.1.2.4 Mon May 7
18:03:01 2007
+++ php-src/ext/pdo_mysql/tests/pecl_bug_5780.phpt Mon Nov 10 18:44:04 2008
@@ -25,6 +25,7 @@
$info = $logstmt->errorInfo();
unset($info[2]);
var_dump($info);
+?>
--EXPECT--
array(2) {
[0]=>
@@ -33,7 +34,9 @@
string(7) "testing"
}
bool(true)
-array(1) {
+array(2) {
[0]=>
string(5) "00000"
+ [1]=>
+ NULL
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php