[sqlite] sqlite compound keys

2012-06-21 Thread nn6eumtr


If I have a table:

create table tmp (
  x integer,
  y integer
)

And a an index with compound key:

create unique index idx on tmp (x, y);

And I did a query:

select * from tmp where x = 9

Would sqlite know how to use the index to find records where x = 9? Or 
would it opt for a scan instead?



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible bug when rebuilding amalgamation without triggers or altertable

2012-04-27 Thread nn6eumtr
In response to Stepheen Beal's previous comments I do understand that 
not all combinations of -DSQLITE_OMIT statements will work, and past 
experience has shown its usually because the dependencies between the 
various options are not clear in the documentation.


However someone has invested the effort to write the 
-DSQLITE_OMIT_ALTERTABLE and -DSQLITE_OMIT_FOREIGN_KEY functionality, 
and the person who did that may be concerned that these features do not 
work in current builds of SQLite, or they may have a fix which isn't 
part of the source distribution yet, or they may know other dependencies 
that need to be resolved.


Those are the people I am attempting to reach via this list. If that 
isn't you or your not interested in a solution, then I would ask that 
you please don't discourage others from responding.


On 4/25/2012 7:11 PM, nn6eumtr wrote:

To clarify, the below steps to reproduce include building the
amalgamation from scratch, and the errors I demonstrate occur after
building and compiling a new amalgamation with -DSQLITE_OMIT_ALTERTABLE
and -DSQLITE_OMIT_FOREIGN_KEY.

In Stepheen Beal's earlier comments he appears to have not realized that
I was rebuilding the amalgamation and not trying to use the
-DSQLITE_OMIT_* flags with the distributed amalgamation. I still need
some assistance.

On 4/25/2012 1:09 AM, nn6eumtr wrote:

Steps to recreate:

1) wget -nd -nH -c -t 0 -w 1
http://www.sqlite.org/src/tarball/SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b


2) mv -v
SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b

SQLite-9fb7da6904e479f4.tar.gz
3) tar -xzf SQLite-9fb7da6904e479f4.tar.gz
4) cd SQLite-9fb7da6904e479f4
5) OPT_FEATURE_FLAGS=-DSQLITE_ENABLE_FTS3_PARENTHESIS
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_ENABLE_MEMORY_MANAGEMENT \
-DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM
-DSQLITE_OMIT_BUILTIN_TEST \
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_EXPLAIN
-DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE
-DSQLITE_OMIT_TRACE \
-DSQLITE_OMIT_TRIGGER -DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
./configure --disable-tcl --disable-readline
6) make sqlite3.c
8) Compile - gcc -c -Wall -DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
-DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_MEMSYS5 \
-DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM \
-DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_COMPLETE \
-DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE \
-DSQLITE_OMIT_TRACE -DSQLITE_OMIT_TRIGGER \
-DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
-DSQLITE_ZERO_MALLOC sqlite3.c

This will produce the following errors:

sqlite3.c:(.text+0x462d2): undefined reference to
`sqlite3AlterBeginAddColumn'
sqlite3.c:(.text+0x462fe): undefined reference to
`sqlite3AlterFinishAddColumn'
sqlite3.c:(.text+0x46331): undefined reference to
`sqlite3AlterRenameTable'
sqlite3.c:(.text+0x46482): undefined reference to `sqlite3DropTrigger'
sqlite3.c:(.text+0x4657b): undefined reference to
`sqlite3TriggerSelectStep'
sqlite3.c:(.text+0x465b9): undefined reference to
`sqlite3TriggerDeleteStep'
sqlite3.c:(.text+0x4660a): undefined reference to
`sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x46661): undefined reference to
`sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x466b0): undefined reference to
`sqlite3TriggerUpdateStep'
sqlite3.c:(.text+0x4688d): undefined reference to `sqlite3BeginTrigger'
sqlite3.c:(.text+0x468f8): undefined reference to `sqlite3FinishTrigger'


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] [solution] - Re: Possible bug when rebuilding amalgamation without triggers or altertable

2012-04-27 Thread nn6eumtr
I looked into the problem more tonight and found all of the references 
to the omitted functions were from the auto-generated parser. I looked 
at the parser source and it was checking for omits in all the right 
places so the functions should have have been referenced. I checked the 
Makefile and found that OPT_FEATURE_FLAGS still had the default 
settings. I manually changed OPT_FEATURE_FLAGS in the Makefile and 
rebuilt sqlite3.c - this time I was able to use all of the omit features 
and create a usable binary.


So root cause of my delima seems to be that OPT_FEATURE_FLAGS isn't 
populated by passing in to configure as my notes had indicated, but by 
manually editing the Makefile and adding the desired flags to 
OPT_FEATURE_FLAGS.


On 4/26/2012 7:31 PM, nn6eumtr wrote:

In response to Stepheen Beal's previous comments I do understand that
not all combinations of -DSQLITE_OMIT statements will work, and past
experience has shown its usually because the dependencies between the
various options are not clear in the documentation.

However someone has invested the effort to write the
-DSQLITE_OMIT_ALTERTABLE and -DSQLITE_OMIT_FOREIGN_KEY functionality,
and the person who did that may be concerned that these features do not
work in current builds of SQLite, or they may have a fix which isn't
part of the source distribution yet, or they may know other dependencies
that need to be resolved.

Those are the people I am attempting to reach via this list. If that
isn't you or your not interested in a solution, then I would ask that
you please don't discourage others from responding.

On 4/25/2012 7:11 PM, nn6eumtr wrote:

To clarify, the below steps to reproduce include building the
amalgamation from scratch, and the errors I demonstrate occur after
building and compiling a new amalgamation with -DSQLITE_OMIT_ALTERTABLE
and -DSQLITE_OMIT_FOREIGN_KEY.

In Stepheen Beal's earlier comments he appears to have not realized that
I was rebuilding the amalgamation and not trying to use the
-DSQLITE_OMIT_* flags with the distributed amalgamation. I still need
some assistance.

On 4/25/2012 1:09 AM, nn6eumtr wrote:

Steps to recreate:

1) wget -nd -nH -c -t 0 -w 1
http://www.sqlite.org/src/tarball/SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b



2) mv -v
SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b


SQLite-9fb7da6904e479f4.tar.gz
3) tar -xzf SQLite-9fb7da6904e479f4.tar.gz
4) cd SQLite-9fb7da6904e479f4
5) OPT_FEATURE_FLAGS=-DSQLITE_ENABLE_FTS3_PARENTHESIS
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_ENABLE_MEMORY_MANAGEMENT \
-DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM
-DSQLITE_OMIT_BUILTIN_TEST \
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_EXPLAIN
-DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE
-DSQLITE_OMIT_TRACE \
-DSQLITE_OMIT_TRIGGER -DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
./configure --disable-tcl --disable-readline
6) make sqlite3.c
8) Compile - gcc -c -Wall -DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
-DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_MEMSYS5 \
-DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM \
-DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_COMPLETE \
-DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE \
-DSQLITE_OMIT_TRACE -DSQLITE_OMIT_TRIGGER \
-DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
-DSQLITE_ZERO_MALLOC sqlite3.c

This will produce the following errors:

sqlite3.c:(.text+0x462d2): undefined reference to
`sqlite3AlterBeginAddColumn'
sqlite3.c:(.text+0x462fe): undefined reference to
`sqlite3AlterFinishAddColumn'
sqlite3.c:(.text+0x46331): undefined reference to
`sqlite3AlterRenameTable'
sqlite3.c:(.text+0x46482): undefined reference to `sqlite3DropTrigger'
sqlite3.c:(.text+0x4657b): undefined reference to
`sqlite3TriggerSelectStep'
sqlite3.c:(.text+0x465b9): undefined reference to
`sqlite3TriggerDeleteStep'
sqlite3.c:(.text+0x4660a): undefined reference to
`sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x46661): undefined reference to
`sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x466b0): undefined reference to
`sqlite3TriggerUpdateStep'
sqlite3.c:(.text+0x4688d): undefined reference to `sqlite3BeginTrigger'
sqlite3.c:(.text+0x468f8): undefined reference to `sqlite3FinishTrigger'


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible bug when rebuilding amalgamation without triggers or altertable

2012-04-26 Thread nn6eumtr
To clarify, the below steps to reproduce include building the 
amalgamation from scratch, and the errors I demonstrate occur after 
building and compiling a new amalgamation with -DSQLITE_OMIT_ALTERTABLE 
and -DSQLITE_OMIT_FOREIGN_KEY.


In Stepheen Beal's earlier comments he appears to have not realized that 
I was rebuilding the amalgamation and not trying to use the 
-DSQLITE_OMIT_* flags with the distributed amalgamation. I still need 
some assistance.


On 4/25/2012 1:09 AM, nn6eumtr wrote:

Steps to recreate:

1) wget -nd -nH -c -t 0 -w 1
http://www.sqlite.org/src/tarball/SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b

2) mv -v
SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b
SQLite-9fb7da6904e479f4.tar.gz
3) tar -xzf SQLite-9fb7da6904e479f4.tar.gz
4) cd SQLite-9fb7da6904e479f4
5) OPT_FEATURE_FLAGS=-DSQLITE_ENABLE_FTS3_PARENTHESIS
-DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_ENABLE_MEMORY_MANAGEMENT \
-DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM
-DSQLITE_OMIT_BUILTIN_TEST \
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_TRACE \
-DSQLITE_OMIT_TRIGGER -DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
./configure --disable-tcl --disable-readline
6) make sqlite3.c
8) Compile - gcc -c -Wall -DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
-DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_MEMSYS5 \
-DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM \
-DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_COMPLETE \
-DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE \
-DSQLITE_OMIT_TRACE -DSQLITE_OMIT_TRIGGER \
-DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
-DSQLITE_ZERO_MALLOC sqlite3.c

This will produce the following errors:

sqlite3.c:(.text+0x462d2): undefined reference to
`sqlite3AlterBeginAddColumn'
sqlite3.c:(.text+0x462fe): undefined reference to
`sqlite3AlterFinishAddColumn'
sqlite3.c:(.text+0x46331): undefined reference to `sqlite3AlterRenameTable'
sqlite3.c:(.text+0x46482): undefined reference to `sqlite3DropTrigger'
sqlite3.c:(.text+0x4657b): undefined reference to
`sqlite3TriggerSelectStep'
sqlite3.c:(.text+0x465b9): undefined reference to
`sqlite3TriggerDeleteStep'
sqlite3.c:(.text+0x4660a): undefined reference to
`sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x46661): undefined reference to
`sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x466b0): undefined reference to
`sqlite3TriggerUpdateStep'
sqlite3.c:(.text+0x4688d): undefined reference to `sqlite3BeginTrigger'
sqlite3.c:(.text+0x468f8): undefined reference to `sqlite3FinishTrigger'


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Possible bug when rebuilding amalgamation without triggers or altertable

2012-04-25 Thread nn6eumtr

Steps to recreate:

1) wget -nd -nH -c -t 0 -w 1 
http://www.sqlite.org/src/tarball/SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b
2) mv -v 
SQLite-9fb7da6904e479f4.tar.gz?uuid=9fb7da6904e479f4671eeebf1a4b7e4e4e4f2b7b 
SQLite-9fb7da6904e479f4.tar.gz

3) tar -xzf SQLite-9fb7da6904e479f4.tar.gz
4) cd SQLite-9fb7da6904e479f4
5) OPT_FEATURE_FLAGS=-DSQLITE_ENABLE_FTS3_PARENTHESIS 
-DSQLITE_ENABLE_FTS4 \

-DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_ENABLE_MEMORY_MANAGEMENT \
-DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM -DSQLITE_OMIT_BUILTIN_TEST \
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_TRACE \
-DSQLITE_OMIT_TRIGGER -DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
./configure --disable-tcl --disable-readline
6) make sqlite3.c
8) Compile - gcc -c -Wall -DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
-DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_MEMSYS5 \
-DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM \
-DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_COMPLETE \
-DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE \
-DSQLITE_OMIT_TRACE -DSQLITE_OMIT_TRIGGER \
-DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
-DSQLITE_ZERO_MALLOC sqlite3.c

This will produce the following errors:

sqlite3.c:(.text+0x462d2): undefined reference to 
`sqlite3AlterBeginAddColumn'
sqlite3.c:(.text+0x462fe): undefined reference to 
`sqlite3AlterFinishAddColumn'

sqlite3.c:(.text+0x46331): undefined reference to `sqlite3AlterRenameTable'
sqlite3.c:(.text+0x46482): undefined reference to `sqlite3DropTrigger'
sqlite3.c:(.text+0x4657b): undefined reference to `sqlite3TriggerSelectStep'
sqlite3.c:(.text+0x465b9): undefined reference to `sqlite3TriggerDeleteStep'
sqlite3.c:(.text+0x4660a): undefined reference to `sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x46661): undefined reference to `sqlite3TriggerInsertStep'
sqlite3.c:(.text+0x466b0): undefined reference to `sqlite3TriggerUpdateStep'
sqlite3.c:(.text+0x4688d): undefined reference to `sqlite3BeginTrigger'
sqlite3.c:(.text+0x468f8): undefined reference to `sqlite3FinishTrigger'

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Possible bug when rebuilding amalgamation with -DSQLITE_ZERO_MALLOC

2012-02-24 Thread nn6eumtr

Steps to recreate:

1) wget -nd -nH -c -t 0 -w 1 
http://www.sqlite.org/src/tarball/SQLite-bf1dc7907cf1a5c7.tar.gz?uuid=bf1dc7907cf1a5c7e19b04fa1278b2089316c30a
2) mv -v 
SQLite-bf1dc7907cf1a5c7.tar.gz?uuid=bf1dc7907cf1a5c7e19b04fa1278b2089316c30a 
SQLite-bf1dc7907cf1a5c7.tar.gz

3) tar -xzf SQLite-bf1dc7907cf1a5c7.tar.gz
4) cd SQLite-bf1dc7907cf1a5c7
5) ./configure --disable-tcl --disable-readline
6) Edit Makefile and set OPT_FEATURE_FLAGS:
OPT_FEATURE_FLAGS = -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 \
-DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_ENABLE_MEMORY_MANAGEMENT \
-DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM -DSQLITE_OMIT_BUILTIN_TEST \
-DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_DATETIME_FUNCS \
-DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_TRACE \
-DSQLITE_OMIT_TRIGGER -DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
-DSQLITE_ZERO_MALLOC
7) make sqlite3.c
8) Compile - gcc -c -Wall -DSQLITE_ENABLE_FTS3_PARENTHESIS \
-DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_LOCKING_STYLE=0 \
-DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_MEMSYS5 \
-DSQLITE_ENABLE_STAT3 -DSQLITE_OMIT_ALTERTABLE \
-DSQLITE_OMIT_AUTOINIT -DSQLITE_OMIT_AUTOVACUUM \
-DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_COMPLETE \
-DSQLITE_OMIT_DATETIME_FUNCS -DSQLITE_OMIT_DEPRECATED \
-DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_FOREIGN_KEY \
-DSQLITE_OMIT_GET_TABLE -DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_TCL_VARIABLE \
-DSQLITE_OMIT_TRACE -DSQLITE_OMIT_TRIGGER \
-DSQLITE_OMIT_UTF16 -DSQLITE_THREADSAFE=0 \
-DSQLITE_ZERO_MALLOC sqlite3.c

This will produce the following errors:

sqlite3.c:15236: error: redefinition of ‘sqlite3MemMalloc’
sqlite3.c:15096: note: previous definition of ‘sqlite3MemMalloc’ was here
sqlite3.c:15268: error: redefinition of ‘sqlite3MemFree’
sqlite3.c:15097: note: previous definition of ‘sqlite3MemFree’ was here
sqlite3.c:15283: error: redefinition of ‘sqlite3MemSize’
sqlite3.c:15099: note: previous definition of ‘sqlite3MemSize’ was here
sqlite3.c:15305: error: redefinition of ‘sqlite3MemRealloc’
sqlite3.c:15098: note: previous definition of ‘sqlite3MemRealloc’ was here
sqlite3.c:15337: error: redefinition of ‘sqlite3MemRoundup’
sqlite3.c:15100: note: previous definition of ‘sqlite3MemRoundup’ was here
sqlite3.c:15344: error: redefinition of ‘sqlite3MemInit’
sqlite3.c:15101: note: previous definition of ‘sqlite3MemInit’ was here
sqlite3.c:15380: error: redefinition of ‘sqlite3MemShutdown’
sqlite3.c:15102: note: previous definition of ‘sqlite3MemShutdown’ was here
sqlite3.c:15391: error: redefinition of ‘sqlite3MemSetDefault’
sqlite3.c:15110: note: previous definition of ‘sqlite3MemSetDefault’ was 
here


These errors prevent linking, however when -DSQLITE_ZERO_MALLOC is 
removed from the gcc command line the compile is successful. From the 
documentation I believe the combination of -DSQLITE_ZERO_MALLOC and 
-DSQLITE_ENABLE_MEMSYS5 should be valid.


I also tired compiling without -DSQLITE_ENABLE_MEMSYS5 and with 
-DSQLITE_ZERO_MALLOC and this produced the same errors. I believe this 
is incorrect and the file should compile and link, allowing me to 
specify a malloc routine at run time with 
sqlite3_config(SQLITE_CONFIG_MALLOC,...).


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users