]> granicus.if.org Git - php/commitdiff
Fixed Bug #63149 Feature missing with system SQLite
authorRemi Collet <remi@php.net>
Sat, 24 Nov 2012 16:47:51 +0000 (17:47 +0100)
committerRemi Collet <remi@php.net>
Sat, 24 Nov 2012 16:47:51 +0000 (17:47 +0100)
In pdo_sqlite, getColumnMeta should return the table name.
With bundled SQLite library, -DSQLITE_ENABLE_COLUMN_METADATA=1 (other_flags)
enable the feature in SQLite (function sqlite3_column_table_name).
With system SQLite library, this fix detects if sqlite3_column_table_name is
available and add SQLITE_ENABLE_COLUMN_METADATA macro to get the same behavior.

Test already exists: ext/pdo_sqlite/tests/bug_42589.phpt

ext/sqlite3/config0.m4

index ac58b35cf01b9458bf892f695c50afe33f8fde6e..1365def033160599a7e0583d0609d83d783573f9 100644 (file)
@@ -50,6 +50,9 @@ if test $PHP_SQLITE3 != "no"; then
     PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[
       AC_DEFINE(HAVE_SQLITE3_KEY, 1, [have commercial sqlite3 with crypto support])
     ])
+    PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[
+      AC_DEFINE(SQLITE_ENABLE_COLUMN_METADATA, 1, [have sqlite3 with column metadata enabled])
+    ])
 
     PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension,
     [],