PDO/MySQL column metadata native_type broken
| From: | Timm Friebe | Date: | Sat, 19 Feb 2005 17:52:47 +0000 |
| Subject: | PDO/MySQL column metadata native_type broken | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-15110@lists.php.net to get a copy of this message | ||
Hi,
native_type (returned from PDOStatement::getColumnMeta()) was showing
weird behaviour in PDO/MySQL, mostly not existing at all and showing
incorrect values (e.g. "DECIMAL" for varchars).
A small typo is why:
Index: ext/pdo_mysql/mysql_statement.c
===================================================================
RCS file: /repository/php-src/ext/pdo_mysql/mysql_statement.c,v
retrieving revision 1.14
diff -u -r1.14 mysql_statement.c
--- ext/pdo_mysql/mysql_statement.c 13 Feb 2005 00:48:00 -0000
1.14
+++ ext/pdo_mysql/mysql_statement.c 19 Feb 2005 17:48:00 -0000
@@ -228,7 +228,7 @@
if (IS_BLOB(F->flags)) {
add_next_index_string(flags, "blob", 1);
}
- str = type_to_name_native(F->flags);
+ str = type_to_name_native(F->type);
if (str) {
add_assoc_string(return_value, "native_type", str, 1);
}
--
Timm
If it ain't broken, it doesn't have enough features yet