diff options
| author | Marcus Boerger <helly@php.net> | 2005-02-19 23:58:03 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2005-02-19 23:58:03 +0000 |
| commit | 96e8cca9bc3a8066aa50a9231e2a8918ec9267df (patch) | |
| tree | b083473b3422dd54e66c786f207845903e39f79f /ext/pdo_sqlite/tests | |
| parent | 6045a3a5e1ac4207b1f76471bc405ae791471a2e (diff) | |
| download | php-git-96e8cca9bc3a8066aa50a9231e2a8918ec9267df.tar.gz | |
- Add test
Diffstat (limited to 'ext/pdo_sqlite/tests')
| -rwxr-xr-x | ext/pdo_sqlite/tests/pdo_sqlite_008.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
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-- +<?php # vim:ft=php +if (!extension_loaded("pdo_sqlite")) print "skip"; ?> +--FILE-- +<?php + +$db =new pdo('sqlite::memory:'); + +$db->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=== +<?php exit(0); ?> +--EXPECTF-- +array(2) { + ["A"]=> + array(1) { + [0]=> + string(1) "B" + } + ["C"]=> + array(1) { + [0]=> + string(1) "C" + } +} +===DONE=== |
