Annotation of embedaddon/php/ext/pdo_sqlite/tests/bug_42589.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: PDO SQLite Feature Request #42589 (getColumnMeta() should also return table name)
                      3: --SKIPIF--
                      4: <?php
                      5: if (!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: 
                     18: var_dump(!empty($meta1['table']) && $meta1['table'] == 'test');
                     19: var_dump(!empty($meta2['table']) && $meta2['table'] == 'test');
                     20: ?>
                     21: --EXPECTF--
                     22: bool(true)
                     23: bool(true)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>