# PDO/MySQL column metadata native_type broken

- Thread: https://externals.io/message/15110
- Original archive: https://news-web.php.net/php.internals/15110
- Started by Timm Friebe on 2005-02-19T17:52:47+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #15110 — Timm Friebe — 2005-02-19T17:52:47+00:00

URL: https://externals.io/message/15110#15110

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

---

## #15115 — Wez Furlong — 2005-02-20T09:32:39+00:00

URL: https://externals.io/message/15110#15115 · In reply to: #15110

Please open a pecl bug for this too, 

Thanks

--Wez.



> 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

---

## #15117 — Timm Friebe — 2005-02-20T11:17:55+00:00

URL: https://externals.io/message/15110#15117 · In reply to: #15115

> Please open a pecl bug for this too, 

Done so:
  http://pecl.php.net/bugs/bug.php?id=3530

-- 
Timm
If it ain't broken, it doesn't have enough features yet
