From: Marcus Boerger Date: Sat, 19 Feb 2005 23:58:03 +0000 (+0000) Subject: - Add test X-Git-Tag: RELEASE_0_3~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96e8cca9bc3a8066aa50a9231e2a8918ec9267df;p=php - Add test --- diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_008.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_008.phpt new file mode 100755 index 0000000000..03eb014d81 --- /dev/null +++ b/ext/pdo_sqlite/tests/pdo_sqlite_008.phpt @@ -0,0 +1,35 @@ +--TEST-- +PDO-SQLite: PDO_FETCH_UNIQUE conflict +--SKIPIF-- + +--FILE-- +exec('CREATE TABLE test(id CHAR(1) PRIMARY KEY, val VARCHAR(10))'); +$db->exec('INSERT INTO test VALUES("A", "A")'); +$db->exec('INSERT INTO test VALUES("B", "A")'); +$db->exec('INSERT INTO test VALUES("C", "C")'); + +var_dump($db->query('SELECT val, id FROM test')->fetchAll(PDO_FETCH_NUM|PDO_FETCH_UNIQUE)); +// check that repeated first columns overwrite existing array elements + +?> +===DONE=== + +--EXPECTF-- +array(2) { + ["A"]=> + array(1) { + [0]=> + string(1) "B" + } + ["C"]=> + array(1) { + [0]=> + string(1) "C" + } +} +===DONE===