2003-04-19 12:54:17 +00:00
|
|
|
--TEST--
|
|
|
|
sqlite: binary encoding
|
2003-05-01 13:29:11 +00:00
|
|
|
--INI--
|
|
|
|
sqlite.assoc_case=0
|
2003-04-19 12:54:17 +00:00
|
|
|
--SKIPIF--
|
|
|
|
<?php # vim:ft=php
|
|
|
|
if (!extension_loaded("sqlite")) print "skip"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
include "blankdb.inc";
|
|
|
|
|
|
|
|
$strings = array(
|
|
|
|
"hello",
|
|
|
|
"hello\x01o",
|
|
|
|
"\x01hello there",
|
|
|
|
"hello\x00there",
|
|
|
|
""
|
|
|
|
);
|
|
|
|
|
|
|
|
sqlite_query("CREATE TABLE strings(a)", $db);
|
|
|
|
|
|
|
|
foreach ($strings as $str) {
|
|
|
|
sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($str) . "')", $db);
|
|
|
|
}
|
|
|
|
|
|
|
|
$i = 0;
|
|
|
|
$r = sqlite_query("SELECT * from strings", $db);
|
|
|
|
while ($row = sqlite_fetch_array($r, SQLITE_NUM)) {
|
|
|
|
if ($row[0] !== $strings[$i]) {
|
|
|
|
echo "FAIL!\n";
|
|
|
|
var_dump($row[0]);
|
|
|
|
var_dump($strings[$i]);
|
|
|
|
} else {
|
|
|
|
echo "OK!\n";
|
|
|
|
}
|
|
|
|
$i++;
|
|
|
|
}
|
2003-12-05 02:12:21 +00:00
|
|
|
|
|
|
|
sqlite_close($db);
|
|
|
|
|
2003-04-19 12:54:17 +00:00
|
|
|
echo "DONE!\n";
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
OK!
|
|
|
|
OK!
|
|
|
|
OK!
|
|
|
|
OK!
|
|
|
|
OK!
|
|
|
|
DONE!
|