summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/tests
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2009-01-13 02:50:54 +0000
committerScott MacVicar <scottmac@php.net>2009-01-13 02:50:54 +0000
commitefaba65cf5aa5e6469bd6c53637b950934dccd44 (patch)
tree223661e3bcfdcca120e58d72d0c2daf724108816 /ext/pdo_sqlite/tests
parentfc044adb9fac7675fec420fb74a4de3d7c6521d1 (diff)
downloadphp-git-efaba65cf5aa5e6469bd6c53637b950934dccd44.tar.gz
MFH Add table key to getColumnMeta() with SQLite
Diffstat (limited to 'ext/pdo_sqlite/tests')
-rw-r--r--ext/pdo_sqlite/tests/bug_42589.phpt23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/tests/bug_42589.phpt b/ext/pdo_sqlite/tests/bug_42589.phpt
new file mode 100644
index 0000000000..abd5e8cea7
--- /dev/null
+++ b/ext/pdo_sqlite/tests/bug_42589.phpt
@@ -0,0 +1,23 @@
+--TEST--
+PDO SQLite Feature Request #42589 (getColumnMeta() should also return table name)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_sqlite')) die('skip not loaded');
+?>
+--FILE--
+<?php
+$db = new PDO("sqlite::memory:");
+
+$db->exec('CREATE TABLE test (field1 VARCHAR(10))');
+$db->exec('INSERT INTO test VALUES("test")');
+
+$result = $db->query('SELECT * FROM test t1 LEFT JOIN test t2 ON t1.field1 = t2.field1');
+$meta1 = $result->getColumnMeta(0);
+$meta2 = $result->getColumnMeta(1);
+
+var_dump(!empty($meta1['table']) && $meta1['table'] == 'test');
+var_dump(!empty($meta2['table']) && $meta2['table'] == 'test');
+?>
+--EXPECTF--
+bool(true)
+bool(true)