Patch for #42589
| From: | Martin Jansen | Date: | Sat, 13 Oct 2007 09:46:25 +0000 |
| Subject: | Patch for #42589 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-32742@lists.php.net to get a copy of this message | ||
Attached is a patch for the MySQL and SQLite drivers of PDO that
implements the feature request from #42589 by adding the name of the
table where the column is from to the output of getColumnMeta().
The change for MySQL seems to be pretty straightforward, but for SQLite
I had to add the SQLITE_ENABLE_COLUMN_METADATA preprocessor symbol to
the build chain of the bundled SQLite in order to make it work [1].
This means that people who are using their own SQLite build for PDO will
not be able to get the table name when their build didn't use the
symbol. In this case the corresponding unit test will fail as well. (I
haven't found a way to figure out from userland if PDO uses the bundled
lib.)
This is my first not-totally-trivial patch for PHP and the first time I
wrote .phpt unit tests, so please bear with me.
- Martin
[1] http://www.sqlite.org/capi3ref.html#sqlite3_column_table_name
Attachment: [text/x-diff] 42589-pdo-meta.patch
Attachment: [text/x-diff] 42589-pdo-meta.patch