xref: /PHP-7.2/ext/pdo_sqlite/tests/bug_42589.phpt (revision efaba65c)
1--TEST--
2PDO SQLite Feature Request #42589 (getColumnMeta() should also return table name)
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_sqlite')) die('skip not loaded');
6?>
7--FILE--
8<?php
9$db = new PDO("sqlite::memory:");
10
11$db->exec('CREATE TABLE test (field1 VARCHAR(10))');
12$db->exec('INSERT INTO test VALUES("test")');
13
14$result = $db->query('SELECT * FROM test t1 LEFT JOIN test t2 ON t1.field1 = t2.field1');
15$meta1 = $result->getColumnMeta(0);
16$meta2 = $result->getColumnMeta(1);
17
18var_dump(!empty($meta1['table']) && $meta1['table'] == 'test');
19var_dump(!empty($meta2['table']) && $meta2['table'] == 'test');
20?>
21--EXPECTF--
22bool(true)
23bool(true)
24