ID: 31968 Updated by: [EMAIL PROTECTED] Reported By: jlim at natsoft dot com -Status: Assigned +Status: Bogus Bug Type: *Database Functions Operating System: WinXP SP2 PHP Version: 5CVS-2005-02-14 (dev) Assigned To: wez New Comment:
Report to PECL. This is not PECL bug system.. Previous Comments: ------------------------------------------------------------------------ [2005-02-15 06:52:20] jlim at natsoft dot com Hi This is probably a problem with sqlite. I just tested with pdo's pgsql extension and getcolumnmeta worked fine under both cases. John ------------------------------------------------------------------------ [2005-02-14 16:34:22] [EMAIL PROTECTED] I'll look into it. PS: John, can you submit PDO bugs via PECL instead in the future. I'd love to find out more about the OCI problems you mentioned. http://pecl.php.net/bugs/report.php?package=PDO http://pecl.php.net/bugs/report.php?package=PDO_OCI etc. thanks! ------------------------------------------------------------------------ [2005-02-14 12:09:33] jlim at natsoft dot com Description: ------------ Hi, I think PDO should return the getColumnMeta info even if no data is returned, so long as SQL parses correctly and table exists. I believe that all of the non-PDO database extensions work like this. I don't know whether this is an SQLite issue or PDO issue. Thanks, John Lim Reproduce code: --------------- <?php function GetColumnMeta($db) { $st2 = $db->prepare("select * from hash "); $ok = $st2->execute(); echo "<h3>GetColumnMeta</h3>"; for ($i=0; $i<2; $i++) { $col = $st2->getColumnMeta($i); var_dump($col);echo "<br>"; } } $db = new PDO('sqlite:' . getenv('HOME') . "/.web-watch.sql3"); $db->query('create table hash(url primary key, hash)'); $db->query('delete from hash'); GetColumnMeta($db); $db->query("insert into hash (url, hash) values ('http://yahoo.com/','100')"); GetColumnMeta($db); ?> Expected result: ---------------- GetColumnMeta array(6) { ["native_type"]=> string(6) "string" ["flags"]=> array(0) { } ["name"]=> string(3) "url" ["len"]=> int(-1) ["precision"]=> int(0) ["pdo_type"]=> int(2) } array(6) { ["native_type"]=> string(6) "string" ["flags"]=> array(0) { } ["name"]=> string(4) "hash" ["len"]=> int(-1) ["precision"]=> int(0) ["pdo_type"]=> int(2) } GetColumnMeta array(6) { ["native_type"]=> string(6) "string" ["flags"]=> array(0) { } ["name"]=> string(3) "url" ["len"]=> int(-1) ["precision"]=> int(0) ["pdo_type"]=> int(2) } array(6) { ["native_type"]=> string(6) "string" ["flags"]=> array(0) { } ["name"]=> string(4) "hash" ["len"]=> int(-1) ["precision"]=> int(0) ["pdo_type"]=> int(2) } Actual result: -------------- GetColumnMeta bool(false) bool(false) GetColumnMeta array(6) { ["native_type"]=> string(6) "string" ["flags"]=> array(0) { } ["name"]=> string(3) "url" ["len"]=> int(-1) ["precision"]=> int(0) ["pdo_type"]=> int(2) } array(6) { ["native_type"]=> string(6) "string" ["flags"]=> array(0) { } ["name"]=> string(4) "hash" ["len"]=> int(-1) ["precision"]=> int(0) ["pdo_type"]=> int(2) } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31968&edit=1