?>
--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 - -
--------
?>
--EXPECTF--
object(PDORow)#%d (2) {
- [u"queryString"]=>
- unicode(17) "SELECT 1 AS "one""
- [u"one"]=>
- string(1) "1"
+ [%u|b%"queryString"]=>
+ %unicode|string%(17) "SELECT 1 AS "one""
+ [%u|b%"one"]=>
+ %unicode|string%(1) "1"
}
-unicode(1) "1"
-unicode(1) "1"
-unicode(17) "SELECT 1 AS "one""
+%unicode|string%(1) "1"
+%unicode|string%(1) "1"
+%unicode|string%(17) "SELECT 1 AS "one""
----------------------------------
object(PDORow)#%d (2) {
- [u"queryString"]=>
- unicode(19) "SELECT id FROM test"
- [u"id"]=>
- unicode(1) "1"
+ [%u|b%"queryString"]=>
+ %unicode|string%(19) "SELECT id FROM test"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
-unicode(19) "SELECT id FROM test"
+%unicode|string%(19) "SELECT id FROM test"
----------------------------------
Notice: Trying to get property of non-object in %s on line %d
var_dump($stmt->fetch());
var_dump($stmt->fetch());
var_dump($stmt->fetchAll());
-
- $pdoDb->query('DROP TABLE IF EXISTS testz');
-
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS testz');
?>
--EXPECTF--
bool(true)
myclass::__construct()
object(myclass)#%d (1) {
- ["value"]=>
- string(1) "1"
+ [%u|b%"value"]=>
+ %unicode|string%(1) "1"
}
myclass::__construct()
object(myclass2)#%d (1) {
- ["value"]=>
- string(1) "2"
+ [%u|b%"value"]=>
+ %unicode|string%(1) "2"
}
myclass::__construct()
array(2) {
[0]=>
object(myclass)#%d (1) {
- ["value"]=>
+ [%u|b%"value"]=>
NULL
}
[1]=>
object(stdClass)#%d (1) {
- ["value"]=>
+ [%u|b%"value"]=>
NULL
}
}
print_r($tmp);
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
object(PDOStatement)#%d (1) {
- ["queryString"]=>
- string(18) "SELECT * from test"
+ [%u|b%"queryString"]=>
+ %unicode|string%(18) "SELECT * from test"
}
Array
(
$db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true);
$stmt = $db->prepare("SELECT 1");
$stmt->bindParam(':a', 'b');
-
?>
--EXPECTF--
Fatal error: Cannot pass parameter 2 by reference in %sbug_37445.php on line %d
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec("DROP PROCEDURE IF EXISTS p");
+?>
--EXPECTF--
Emulated Prepared Statements...
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
Native Prepared Statements...
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
array(1) {
[0]=>
array(1) {
- ["2 * 2"]=>
- string(1) "4"
+ [%u|b%"2 * 2"]=>
+ %unicode|string%(1) "4"
}
}
done!
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$db = MySQLPDOTest::factory();
+$db->exec("DROP TABLE IF EXISTS test");
// And now allow the evil to do his work
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec("DROP TABLE IF EXISTS test");
+?>
--EXPECTF--
Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in %s on line %d
array(0) {
$stmt->execute(array($value));
var_dump($db->query('SELECT * from test')->fetchAll(PDO::FETCH_ASSOC));
?>
---EXPECT--
+--EXPECTF--
array(2) {
[0]=>
array(1) {
- ["floatval"]=>
- string(8) "2.340000"
+ [%u|b%"floatval"]=>
+ %unicode|string%(8) "2.340000"
}
[1]=>
array(1) {
- ["floatval"]=>
- string(8) "4.560000"
+ [%u|b%"floatval"]=>
+ %unicode|string%(8) "4.560000"
}
}
\ No newline at end of file
var_dump($stmt->errorInfo());
print "done!";
?>
---EXPECT--
+--EXPECTF--
array(1) {
[0]=>
array(1) {
- ["one"]=>
- string(1) "1"
+ [%u|b%"one"]=>
+ %unicode|string%(1) "1"
}
}
-array(1) {
+array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
array(1) {
[0]=>
array(1) {
- ["two"]=>
- string(1) "2"
+ [%u|b%"two"]=>
+ %unicode|string%(1) "2"
}
}
-array(1) {
+array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
+ [1]=>
+ NULL
+ [2]=>
+ NULL
}
-done!
\ No newline at end of file
+done!
array(1) {
[0]=>
array(1) {
- ["_id"]=>
- string(1) "a"
+ [%u|b%"_id"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(1) {
- ["_id"]=>
- unicode(1) "a"
+ [%u|b%"_id"]=>
+ %unicode|string%(1) "a"
}
}
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--XFAIL--
For some reason the exception gets thrown at the wrong place
---EXPECT--
+--EXPECTF--
Native Prepared Statements
... SELECT has returned 1 row...
... INSERT should fail...
print "done!";
?>
---EXPECT--
+--EXPECTF--
Native Prepared Statements
bool(false)
bool(false)
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["mybool"]=>
- string(1) "0"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"mybool"]=>
+ %unicode|string%(1) "0"
}
}
done!
$db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
---EXPECT--
+--EXPECTF--
Emulated...
array(1) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "c"
}
}
Native...
array(1) {
[0]=>
array(1) {
- ["id"]=>
- unicode(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "c"
}
}
done!
\ No newline at end of file
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
bug_pecl_7976($db);
-$db->exec('DROP PROCEDURE IF EXISTS p');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP PROCEDURE IF EXISTS p');
+?>
--XFAIL--
Works with mysqlnd. It is not supported by libmysql. For libmysql is good enough to see no crash.
---EXPECT--
+--EXPECTF--
Emulated...
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- string(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- string(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
Native...
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- unicode(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
array(1) {
[0]=>
array(1) {
- ["_one"]=>
- unicode(1) "1"
+ [%u|b%"_one"]=>
+ %unicode|string%(1) "1"
}
}
done!
return (bool)preg_match('/Client API version.*mysqlnd/', $tmp);
}
+ static function dropTestTable($db = NULL) {
+ if (is_null($db))
+ $db = self::factory();
+
+ $db->exec('DROP TABLE IF EXISTS test');
+ }
+
}
-?>
+?>
\ No newline at end of file
}
print "done!";
+?>
--EXPECTF--
[002] invalid data source name, [n/a] n/a
[003] invalid data source name, [n/a] n/a
/* TODO - fix this limitation */
if (getenv('PDO_MYSQL_TEST_DSN') !== "mysql:dbname=phptest;unix_socket=/tmp/mysql.sock")
die("skip Fix test to run in other environments as well!");
-
?>
--INI--
pdo.dsn.mysql="mysql:dbname=phptest;socket=/tmp/mysql.sock"
}
print "done!";
+?>
--EXPECTF--
pdo.dsn.mysql cannot be accessed through ini_get_all()/ini_get()
done!
\ No newline at end of file
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY',
PDO::MYSQL_ATTR_LOCAL_INFILE => 'PDO::MYSQL_ATTR_LOCAL_INFILE',
PDO::MYSQL_ATTR_DIRECT_QUERY => 'PDO::MYSQL_ATTR_DIRECT_QUERY',
+
+ PDO::MYSQL_ATTR_INIT_COMMAND => 'PDO::MYSQL_ATTR_INIT_COMMAND',
);
$defaults = array(
PDO::MYSQL_ATTR_LOCAL_INFILE => false,
/* TODO getAttribute() does not handle it */
PDO::MYSQL_ATTR_DIRECT_QUERY => 1,
+ PDO::MYSQL_ATTR_INIT_COMMAND => '',
);
if (NULL !== ($db = @new PDO($dsn, $user, $pass, 'wrong type')))
set_option_and_check(21, PDO::MYSQL_ATTR_LOCAL_INFILE, true, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
set_option_and_check(22, PDO::MYSQL_ATTR_LOCAL_INFILE, false, 'PDO::MYSQL_ATTR_LOCAL_INFILE');
+ set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+ set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+ set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
+
set_option_and_check(33, PDO::MYSQL_ATTR_DIRECT_QUERY, 1, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
set_option_and_check(34, PDO::MYSQL_ATTR_DIRECT_QUERY, 0, 'PDO::MYSQL_ATTR_DIRECT_QUERY');
}
print "done!";
+?>
--EXPECTF--
[003] [TODO][CHANGEREQUEST] Please, lets not ignore invalid options and bail out!
[003a] Expecting default value for 'PDO::ATTR_EMULATE_PREPARES' of '1'/integer, getAttribute() reports setting ''/boolean
+[003a] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
Warning: PDO::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: driver does not support that attribute in %s on line %d
[010] [TODO][CHANGEREQUEST] ATTR_EMULATE_PREPARES should be on
$tmp, gettype($tmp));
}
- set_option_and_check(23, PDO::MYSQL_ATTR_INIT_COMMAND, 'SET @a=1', 'PDO::MYSQL_ATTR_INIT_COMMAND');
- set_option_and_check(24, PDO::MYSQL_ATTR_INIT_COMMAND, '', 'PDO::MYSQL_ATTR_INIT_COMMAND');
- set_option_and_check(25, PDO::MYSQL_ATTR_INIT_COMMAND, 'INSERT INTO nonexistent(invalid) VALUES (1)', 'PDO::MYSQL_ATTR_INIT_COMMAND');
-
set_option_and_check(26, PDO::MYSQL_ATTR_READ_DEFAULT_FILE, true, 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE');
set_option_and_check(27, PDO::MYSQL_ATTR_READ_DEFAULT_FILE, false, 'PDO::MYSQL_ATTR_READ_DEFAULT_FILE');
}
print "done!";
+?>
--EXPECTF--
[001] Expecting default value for 'PDO::MYSQL_ATTR_INIT_COMMAND' of ''/string, getAttribute() reports setting ''/boolean
[023] Execting 'SET @a=1'/string got ''/boolean' for options 'PDO::MYSQL_ATTR_INIT_COMMAND'
if ($fp = @fopen($file, 'w')) {
// ok, great we can create a file with a DSN in it
- @fwrite($fp, $dsn);
+ fwrite($fp, $dsn);
fclose($fp);
clearstatcache();
assert(file_exists($file));
}
if ($fp = @fopen($file, 'w')) {
- @fwrite($fp, sprintf('mysql:dbname=letshopeinvalid;%s%s',
+ fwrite($fp, sprintf('mysql:dbname=letshopeinvalid;%s%s',
chr(0), $dsn));
fclose($fp);
clearstatcache();
}
print "done!";
+?>
--EXPECTF--
Warning: PDO::__construct(%s
[002] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=%s'), invalid data source URI
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
\ No newline at end of file
var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
var_dump($stmt->fetchAll(PDO::FETCH_BOTH));
-
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
+
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
-unicode(15) "PDO::CASE_LOWER"
+%unicode|string%(15) "PDO::CASE_LOWER"
array(2) {
[0]=>
array(6) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["id_upper"]=>
- string(1) "1"
+ %unicode|string%(1) "1"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[2]=>
- string(1) "a"
+ %unicode|string%(1) "a"
}
[1]=>
array(6) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
[0]=>
- string(1) "2"
- ["id_upper"]=>
- string(1) "2"
+ %unicode|string%(1) "2"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "2"
[1]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
[2]=>
- string(1) "b"
+ %unicode|string%(1) "b"
}
}
array(2) {
[0]=>
array(10) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["id_upper"]=>
- string(1) "1"
+ %unicode|string%(1) "1"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[2]=>
- string(1) "a"
- ["mixed"]=>
+ %unicode|string%(1) "a"
+ [%u|b%"mixed"]=>
NULL
[3]=>
NULL
- ["myupper"]=>
+ [%u|b%"myupper"]=>
NULL
[4]=>
NULL
}
[1]=>
array(10) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
[0]=>
- string(1) "2"
- ["id_upper"]=>
- string(1) "2"
+ %unicode|string%(1) "2"
+ [%u|b%"id_upper"]=>
+ %unicode|string%(1) "2"
[1]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
[2]=>
- string(1) "b"
- ["mixed"]=>
+ %unicode|string%(1) "b"
+ [%u|b%"mixed"]=>
NULL
[3]=>
NULL
- ["myupper"]=>
+ [%u|b%"myupper"]=>
NULL
[4]=>
NULL
array(1) {
[0]=>
array(10) {
- ["ID"]=>
- string(1) "1"
+ [%u|b%"ID"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["LABEL"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"LABEL"]=>
+ %unicode|string%(1) "a"
[1]=>
- string(1) "a"
- ["MIXED"]=>
+ %unicode|string%(1) "a"
+ [%u|b%"MIXED"]=>
NULL
[2]=>
NULL
- ["MYUPPER"]=>
+ [%u|b%"MYUPPER"]=>
NULL
[3]=>
NULL
- ["LOWER"]=>
+ [%u|b%"LOWER"]=>
NULL
[4]=>
NULL
array(1) {
[0]=>
array(10) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[1]=>
- string(1) "a"
- ["MiXeD"]=>
+ %unicode|string%(1) "a"
+ [%u|b%"MiXeD"]=>
NULL
[2]=>
NULL
- ["MYUPPER"]=>
+ [%u|b%"MYUPPER"]=>
NULL
[3]=>
NULL
- ["ID"]=>
- string(1) "1"
+ [%u|b%"ID"]=>
+ %unicode|string%(1) "1"
[4]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
}
done!
\ No newline at end of file
printf("[003] Did we change it from '%s' to '%s'?\n", $version, $new_version);
print "done!";
+?>
--EXPECTF--
done!
\ No newline at end of file
printf("[005] Connection status should not have changed\n");
print "done!";
+?>
--EXPECTF--
done!
\ No newline at end of file
printf("[002] Did we change it from '%s' to '%s'?\n", $name, $new_name);
print "done!";
+?>
--EXPECTF--
-string(5) "mysql"
+%unicode|string%(5) "mysql"
done!
\ No newline at end of file
$stmt->closeCursor();
print "done!";
+?>
--EXPECTF--
array(1) {
[0]=>
array(1) {
- ["test.label"]=>
- string(1) "a"
+ [%u|b%"test.label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
done!
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
$db->exec(sprintf('DROP TABLE IF EXISTS %s', $table));
- print "done!\n";
+ print "done!";
+?>
--EXPECTF--
%unicode|string%(58) "CREATE TABLE test_%s(id INT)"
%unicode|string%(5) "00000"
try_buffer_size(4, 2000);
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
[001] id = 1, val = 0123456789... (length: %d)
[002] id = 1, val = 0123456789... (length: 1000)
@$db->exec('DROP PROCEDURE IF EXISTS p');
print "done!";
+?>
--EXPECTF--
[002] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...
[003] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...
array(1) {
[0]=>
array(6) {
- ["z"]=>
+ [%u|b%"z"]=>
NULL
- ["a"]=>
+ [%u|b%"a"]=>
NULL
- ["b"]=>
- string(1) " "
- ["c"]=>
+ [%u|b%"b"]=>
+ %unicode|string%(1) " "
+ [%u|b%"c"]=>
NULL
- ["d"]=>
- string(2) " d"
- ["e"]=>
- string(3) "%se"
+ [%u|b%"d"]=>
+ %unicode|string%(2) " d"
+ [%u|b%"e"]=>
+ %unicode|string%(3) "%se"
}
}
array(1) {
[0]=>
array(6) {
- ["z"]=>
+ [%u|b%"z"]=>
NULL
- ["a"]=>
- string(0) ""
- ["b"]=>
- string(1) " "
- ["c"]=>
- string(0) ""
- ["d"]=>
- string(2) " d"
- ["e"]=>
- string(3) "%se"
+ [%u|b%"a"]=>
+ %unicode|string%(0) ""
+ [%u|b%"b"]=>
+ %unicode|string%(1) " "
+ [%u|b%"c"]=>
+ %unicode|string%(0) ""
+ [%u|b%"d"]=>
+ %unicode|string%(2) " d"
+ [%u|b%"e"]=>
+ %unicode|string%(3) "%se"
}
}
done!
\ No newline at end of file
printf("[010] Did we change it from '%s' to '%s'?\n", $version, $new_version);
print "done!";
+?>
--EXPECTF--
done!
\ No newline at end of file
$stmt = $db->query('SELECT id, label FROM test ORDER BY id ASC LIMIT 1');
print "done!";
+?>
--EXPECTF--
array(1) {
[0]=>
- string(12) "PDOStatement"
+ %unicode|string%(12) "PDOStatement"
}
Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error: PDO::ATTR_STATEMENT_CLASS requires format array(classname, array(ctor_args)); the classname must be a string specifying an existing class in %s on line %d
Warning: PDO::setAttribute(): SQLSTATE[HY000]: General error in %s on line %d
array(2) {
[0]=>
- string(12) "mystatement4"
+ %unicode|string%(12) "mystatement4"
[1]=>
array(1) {
[0]=>
- string(6) "param1"
+ %unicode|string%(6) "param1"
}
}
mystatement4
-string(6) "param1"
+%unicode|string%(6) "param1"
mystatement5
-string(12) "mystatement5"
-string(10) "no data :)"
+%unicode|string%(12) "mystatement5"
+%unicode|string%(10) "no data :)"
array(1) {
[0]=>
array(4) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
[0]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
[1]=>
- string(1) "a"
+ %unicode|string%(1) "a"
}
}
$tmp = $stmt->fetch(PDO::FETCH_ASSOC);
if ($tmp['auto_commit'] != 0)
printf("[026] Autocommit mode of the MySQL Server should be off, got '%s', [%d] %s\n",
- $tmp['auto_commit'], $stmt->errorCode(), implode(' ', $stmt->errorInfo()));
+ $tmp['auto_commit'], $stmt->errorCode(), trim(implode(' ', $stmt->errorInfo())));
$db->commit();
// Now we should be back to autocommit - we've issues a commit
if (1 != $db->exec('DELETE FROM test'))
printf("[038] No rows deleted, can't be true.\n");
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
bool(false)
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "z"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "z"
}
[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
+%unicode|string%(5) "00000"
+done!
var_dump($row);
var_dump($value);
-
return true;
}
echo "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(2) {
- ["id"]=>
- string(2) "20"
- ["label"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(2) "20"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "1"
}
int(1)
done!
\ No newline at end of file
$db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test_commit'));
print "done!";
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test_commit');
+MySQLPDOTest::dropTestTable($db);
+?>
--EXPECT--
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
\ No newline at end of file
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);
printf("Native Prepared Statements...\n");
pdo_mysql_errorinfo($db, 20);
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--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!
}
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
- @$db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+@$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDO::exec(): 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 'THIS IS NOT VALID SQL, I HOPE' at line 1 in %s on line %d
[016] [42000] 42000 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 'THIS IS NOT VALID SQL, I HOPE' at line %d
11.1.17. DROP TABLESPACE Syntax
*/
- // clean up
- @$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl');
- @$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl2');
- @$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl');
- @$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl2');
-
-
} catch (PDOException $e) {
printf("[001] %s, [%s] %s\n",
$e->getMessage(),
}
print "done!";
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+MySQLPDOTest::dropTestTable($db);
+// clean up
+@$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl');
+@$db->exec('DROP TABLE IF EXISTS pdo_exec_ddl2');
+@$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl');
+@$db->exec('DROP DATABASE IF EXISTS pdo_exec_ddl2');
+?>
--EXPECTF--
done!
\ No newline at end of file
$db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done!
\ No newline at end of file
$e->getMessage(),
$db->errorCode(), implode(' ', $db->errorInfo()));
}
-
- @$db->exec(sprintf('DROP TABLE IF EXISTS test'));
+
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+@$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDO::exec(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in %s on line %d
[006] Expecting '1'/integer got ''/boolean when running 'INSERT INTO test(id, col1) VALUES (2, "b")', [HY000] HY000 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
--EXPECTF--
[002] Suspicious FETCH_BOTH result, dumping
array(2) {
[0]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
array(2) {
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[2]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
[002] Expected differes from returned data, dumping
array(2) {
[0]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
array(2) {
[1]=>
- string(1) "1"
+ %unicode|string%(1) "1"
[2]=>
- string(1) "1"
+ %unicode|string%(1) "1"
}
done!
\ No newline at end of file
PDO::ATTR_SERVER_INFO
*/
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
[001] Call to PDO::setAttribute(int attribute, mixed value) has changed the type of value from integer to boolean, test will not work properly
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
}
print "done!";
+?>
--EXPECTF--
done!
\ No newline at end of file
}
print "done!";
+?>
--EXPECT--
done!
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--XFAIL--
PDO's PS parser has some problems with invalid SQL and crashes from time to time
(check with valgrind...)
--EXPECTF--
array(1) {
- ["one"]=>
- string(1) "1"
+ [%u|b%"one"]=>
+ %unicode|string%(1) "1"
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(12) ":placeholder"
+ [%u|b%"label"]=>
+ %unicode|string%(12) ":placeholder"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(12) ":placeholder"
+ [%u|b%"label"]=>
+ %unicode|string%(12) ":placeholder"
}
}
array(2) {
[0]=>
array(1) {
- ["label"]=>
- string(9) "first row"
+ [%u|b%"label"]=>
+ %unicode|string%(9) "first row"
}
[1]=>
array(1) {
- ["label"]=>
- string(10) "second row"
+ [%u|b%"label"]=>
+ %unicode|string%(10) "second row"
}
}
array(2) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "?"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "?"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "?"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "?"
}
}
array(2) {
[0]=>
array(1) {
- ["label"]=>
- string(9) "first row"
+ [%u|b%"label"]=>
+ %unicode|string%(9) "first row"
}
[1]=>
array(1) {
- ["label"]=>
- string(10) "second row"
+ [%u|b%"label"]=>
+ %unicode|string%(10) "second row"
}
}
array(2) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(3) "row"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(3) "row"
}
}
done!
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "?"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "?"
}
}
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!
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec(sprintf('DROP TABLE IF EXISTS test'));
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
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) {
}
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!
implode(' ', $db->errorInfo()),
(isset($stmt)) ? implode(' ', $stmt->errorInfo()) : 'N/A');
}
-
- // $db->exec('DROP TABLE IF EXISTS test');
+
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: %s in %s on line %d
[004] [0] array (
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(0) {
}
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Warning: PDOStatement::execute(): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown_column' in 'field list' in %s on line %d
[003] Execute has failed, '42S22' array (
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Native...
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) {
}
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!
$stmt->execute(array(1, 1));
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Warning: PDO::prepare(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters in %s on line %d
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
[003] Execute has failed, 'HY093' array (
0 => 'HY093',
+ 1 => NULL,
+ 2 => NULL,
)
array(0) {
}
string(12) ":placeholder"
}
}
-done!
\ No newline at end of file
+done!
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
array(1) {
[0]=>
[0]=>
array(3) {
["?"]=>
- unicode(2) "id"
+ string(2) "id"
["id"]=>
int(1)
["label"]=>
- unicode(4) "row1"
+ string(4) "row1"
}
}
done!
\ No newline at end of file
$db->commit();
var_dump($db->getAttribute(PDO::ATTR_AUTOCOMMIT));
- $db->exec('DROP TABLE IF EXISTS test');
- $db->exec('DROP TABLE IF EXISTS test2');
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+$db->exec('DROP TABLE IF EXISTS test2');
+?>
--EXPECTF--
int(1)
int(0)
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
id = 1 (integer) / label = 'a' (string)
id = 2 (integer) / label = 'b' (string)
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated PS...
Buffered...
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Testing native PS...
Binding variable...
printf("[001] %s [%s] %s\n",
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
-
- @unlink($file);
- $db->exec('DROP TABLE IF EXISTS test');
+
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+@unlink(MySQLPDOTest::getTempDir() . DIRECTORY_SEPARATOR . 'pdoblob.tst');
+?>
--EXPECTF--
Emulated PS...
Native PS...
}
print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
-
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Testing emulated PS...
Buffered...
$db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
in = 0 -> id = 1 (integer) / label = 'a' (string)
in = 0 -> id = 2 (integer) / label = 'b' (string)
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Testing emulated PS...
int(3)
$stmt->execute();
var_dump($stmt->errorCode());
-
-
} catch (PDOException $e) {
printf("[003] %s [%s] %s\n",
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Testing emulated PS...
array(3) {
[0]=>
- string(0) ""
+ %unicode|string%(0) ""
[1]=>
NULL
[2]=>
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.ihopeitdoesnotexist' doesn't exist in %s on line %d
array(3) {
[0]=>
- string(5) "42S02"
+ %unicode|string%(5) "42S02"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
+ %unicode|string%(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
}
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.test' doesn't exist in %s on line %d
bool(false)
array(3) {
[0]=>
- string(5) "42S02"
+ %unicode|string%(5) "42S02"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.test' doesn't exist"
+ %unicode|string%(%d) "Table '%s.test' doesn't exist"
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
bool(false)
array(3) {
[0]=>
- string(0) ""
+ %unicode|string%(0) ""
[1]=>
NULL
[2]=>
Warning: PDOStatement::execute(): SQLSTATE[42S02]: Base table or view not found: 1146 Table '%s.test' doesn't exist in %s on line %d
array(3) {
[0]=>
- string(5) "42S02"
+ %unicode|string%(5) "42S02"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.test' doesn't exist"
+ %unicode|string%(%d) "Table '%s.test' doesn't exist"
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
int(1146)
[2]=>
- string(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
+ %unicode|string%(%d) "Table '%s.ihopeitdoesnotexist' doesn't exist"
}
-done!
\ No newline at end of file
+done!
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
Creating an object, serializing it and writing it to DB...
myclass::singleton(Creating object)
Unserializing the previously serialized object...
myclass::unserialize('Data from serialize')
object(myclass)#4 (1) {
- [u"myprotected":protected]=>
- unicode(19) "a protected propery"
+ [%u|b%"myprotected":protected]=>
+ %unicode|string%(19) "a protected propery"
}
Using PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE to fetch the object from DB and unserialize it...
myclass::unserialize('C:7:"myclass":19:{Data from serialize}')
-myclass::__construct(PDO shall not call __construct())
object(myclass)#%d (1) {
- [u"myprotected":protected]=>
- unicode(19) "a protected propery"
+ [%u|b%"myprotected":protected]=>
+ %unicode|string%(19) "a protected propery"
}
Using PDO::FETCH_CLASS to fetch the object from DB and unserialize it...
myclass::__set(myobj, 'C:7:"myclass":19:{Data from serialize}')
myclass::__construct(PDO shall call __construct())
object(myclass)#%d (2) {
- [u"myprotected":protected]=>
- unicode(19) "a protected propery"
- [u"myobj"]=>
- unicode(38) "C:7:"myclass":19:{Data from serialize}"
+ [%u|b%"myprotected":protected]=>
+ %unicode|string%(19) "a protected propery"
+ [%u|b%"myobj"]=>
+ %unicode|string%(38) "C:7:"myclass":19:{Data from serialize}"
}
done!
And now magic PDO using fetchAll(PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE)...
myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct('Called by PDO') - note that it must not be called when unserializing
object(myclass)#%d (0) {
}
myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct(NULL) - note that it must not be called when unserializing
object(myclass)#%d (0) {
}
And now PDO using setFetchMode(PDO::FETCH:CLASS|PDO::FETCH_SERIALIZE) + fetch()...
myclass::unserialize('Data fetched from DB to be given to unserialize()')
-myclass::__construct('Called by PDO') - note that it must not be called when unserializing
object(myclass)#%d (0) {
}
done!
$e->getMessage(), $db->errorInfo(), implode(' ', $db->errorInfo()));
}
-$db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
myclass::__set(id, -'1'-) 1
myclass::__set(, -''-) 2
myclass::__set(, -''-) 4
myclass::__construct(2, 3): 12 / 4
object(myclass)#%d (4) {
- [u"set_calls":u"myclass":private]=>
+ [%u|b%"set_calls":"myclass":private]=>
int(4)
- [u"grp":protected]=>
+ [%u|b%"grp":protected]=>
NULL
- [u"id"]=>
- string(1) "3"
- [u"null"]=>
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"null"]=>
NULL
}
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated Prepared Statements...
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(3) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
[1]=>
NULL
[2]=>
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(1) {
- ["label"]=>
- string(1) "a"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
Native Prepared Statements...
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 '%SSELECT 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
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Emulated PS...
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
array(1) {
[0]=>
array(1) {
- ["_version"]=>
- string(%d) "%s"
+ [%u|b%"_version"]=>
+ %unicode|string%(%d) "%s"
}
}
bool(false)
array(3) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
[2]=>
array(1) {
- ["id"]=>
- string(1) "3"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
}
}
array(3) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "3"
- ["label"]=>
- string(1) "c"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "3"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "c"
}
[1]=>
array(2) {
- ["id"]=>
- string(1) "2"
- ["label"]=>
- string(1) "b"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "b"
}
[2]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
bool(false)
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
done!
\ No newline at end of file
$e->getMessage(), $db->errorCode(), implode(' ', $db->errorInfo()));
}
- $db->exec('DROP TABLE IF EXISTS test');
print "done!";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECTF--
Native PS...
Buffered...
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
Unbuffered...
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
array(1) {
[0]=>
array(2) {
- ["id"]=>
- string(1) "1"
- ["label"]=>
- string(1) "a"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
+ [%u|b%"label"]=>
+ %unicode|string%(1) "a"
}
}
done!
\ No newline at end of file
}
print "done!";
+?>
--EXPECTF--
done!
\ No newline at end of file
$db->exec('DROP TABLE IF EXISTS test');
print "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
__construct('%S', '%S', '%S')
exec('DROP TABLE IF EXISTS test')
array(2) {
[0]=>
array(1) {
- ["id"]=>
- string(1) "1"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "1"
}
[1]=>
array(1) {
- ["id"]=>
- string(1) "2"
+ [%u|b%"id"]=>
+ %unicode|string%(1) "2"
}
}
bool(false)
echo "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done!
echo "done!\n";
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECTF--
done!
\ No newline at end of file
foreach ($db->query('DESCRIBE test phase')->fetchAll(PDO::FETCH_ASSOC) as $row) {
print_r($row);
}
-
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
--EXPECT--
Array
(
$info = $logstmt->errorInfo();
unset($info[2]);
var_dump($info);
---EXPECT--
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+$db->exec('DROP TABLE IF EXISTS test2');
+?>
+--EXPECTF--
array(2) {
[0]=>
- string(7) "testing"
+ %unicode|string%(7) "testing"
[1]=>
- string(7) "testing"
+ %unicode|string%(7) "testing"
}
bool(true)
-array(1) {
+array(2) {
[0]=>
- string(5) "00000"
+ %unicode|string%(5) "00000"
+ [1]=>
+ NULL
}
if($stmt) $stmt->execute();
if($stmt) var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
---EXPECT--
+print "done!";
+?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+$db = MySQLPDOTest::factory();
+$db->exec('DROP TABLE IF EXISTS test');
+?>
+--EXPECTF--
array(3) {
[0]=>
array(1) {
- ["bar"]=>
- string(3) "foo"
+ [%u|b%"bar"]=>
+ %unicode|string%(3) "foo"
}
[1]=>
array(1) {
- ["bar"]=>
+ [%u|b%"bar"]=>
NULL
}
[2]=>
array(1) {
- ["bar"]=>
- string(3) "qaz"
+ [%u|b%"bar"]=>
+ %unicode|string%(3) "qaz"
}
}
+done!
\ No newline at end of file