NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/46322: SQLite from base does not include useful functions



>Number:         46322
>Category:       lib
>Synopsis:       SQLite from base is compiled without 
>SQLITE_ENABLE_COLUMN_METADATA
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 11 00:15:00 +0000 2012
>Originator:     Pierre Pronchery <khorben%defora.org@localhost>
>Release:        NetBSD 6.0_BETA
>Organization:
>Environment:
System: NetBSD syn.defora.rom 6.0_BETA NetBSD 6.0_BETA (GENERIC) #7: Tue Apr 10 
02:09:40 CEST 2012 
khorben%syn.defora.rom@localhost:/home/amd64/obj/sys/arch/amd64/compile/GENERIC 
amd64
Architecture: x86_64
Machine: amd64
>Description:
A number of functions from SQLite 3 are only available when the
libsqlite3 library is built with particular values defined. One such
setting is SQLITE_ENABLE_COLUMN_METADATA, which includes the following
functions when enabled:

- sqlite3_column_database_name()
- sqlite3_column_database_name16()
- sqlite3_column_table_name()
- sqlite3_column_table_name16()
- sqlite3_column_origin_name()
- sqlite3_column_origin_name16()
- sqlite3_table_column_metadata()

These functions may be essential for completeness (including matching
the documentation), as well as for programmers relying on SQLite 3 as
available from base to be fully functional. At least to me :)

FWIW, I am currently relying on the sqlite3_column_origin_name()
function while analyzing results from prepared statements, passing the
column names along with the resulting rows of data to my respective
callbacks. The other functions are returning the respective databases
and tables associated to each column.

If this change is accepted, a pull-up to the netbsd-6 branch would also
be much appreciated.

>How-To-Repeat:
Use any of the functions listed above in a C/C++ program linked with
libsqlite3 from base.
>Fix:
As follows:

Index: external/public-domain/sqlite/Makefile.inc
===================================================================
RCS file: /cvsroot/src/external/public-domain/sqlite/Makefile.inc,v
retrieving revision 1.3
diff -p -u -r1.3 Makefile.inc
--- external/public-domain/sqlite/Makefile.inc  11 Nov 2011 01:34:18 -0000      
1.3
+++ external/public-domain/sqlite/Makefile.inc  10 Apr 2012 22:16:11 -0000
@@ -10,6 +10,7 @@ CPPFLAGS+=    -DHAVE_READLINE=1 -DHAVE_LOCA
                -DSQLITE_HAVE_ISNAN -DSQLITE_ENABLE_FTS4 \
                -DSQLITE_ENABLE_FTS3_PARENTHESIS \
                -DSQLITE_ENABLE_UNLOCK_NOTIFY \
-               -DSQLITE_ENABLE_LOAD_EXTENSION
+               -DSQLITE_ENABLE_LOAD_EXTENSION \
+               -DSQLITE_ENABLE_COLUMN_METADATA
 
 CWARNFLAGS+=   -Wno-shadow -Wno-unused

>Unformatted:
 Wed Apr 11 00:14:47 CEST 2012


Home | Main Index | Thread Index | Old Index