Re: [sqlite] SQLITE 3.8.3 beta: SQLITE_OMIT_CTE build doesn't work

2014-01-20 Thread Jan Nijtmans
2014/1/20 Richard Hipp :
> That single-macro fix allows it to compile and run.  But there are memory
> leaks associated with that fix that would need to be plugged before we
> could use it in a release.

Well, I didn't think about memory leaks Never mind. Since CTE doesn't
make much difference in library size (only 5Kb on x86_64), I don't know if
anyone would actually want CTE to be removed. I just tried it out of curiosity.

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


Re: [sqlite] SQLITE 3.8.3 beta: SQLITE_OMIT_CTE build doesn't work

2014-01-20 Thread Richard Hipp
On Mon, Jan 20, 2014 at 9:23 AM, Jan Nijtmans wrote:

> 2014/1/20 Dan Kennedy :
> > Looks like SQLITE_OMIT_CTE only works with full source builds, not
> > the amalgamation. As it causes code to be omitted from parse.y.
> >
> > There are a few others this is true of as well - OMIT_VIRTUALTABLE,
> > OMIT_TRIGGER etc.
>
> Sure, but since addition of a single macro fixes this, I
> would say: why not fixing it?
>

That single-macro fix allows it to compile and run.  But there are memory
leaks associated with that fix that would need to be plugged before we
could use it in a release.


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


Re: [sqlite] SQLITE 3.8.3 beta: SQLITE_OMIT_CTE build doesn't work

2014-01-20 Thread Jan Nijtmans
2014/1/20 Dan Kennedy :
> Looks like SQLITE_OMIT_CTE only works with full source builds, not
> the amalgamation. As it causes code to be omitted from parse.y.
>
> There are a few others this is true of as well - OMIT_VIRTUALTABLE,
> OMIT_TRIGGER etc.

Sure, but since addition of a single macro fixes this, I
would say: why not fixing it? But - of course- that's
up to you.

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


Re: [sqlite] SQLITE 3.8.3 beta: SQLITE_OMIT_CTE build doesn't work

2014-01-20 Thread Dan Kennedy

On 01/20/2014 08:36 PM, Jan Nijtmans wrote:

$ gcc -c -Wall -o sqlite3.o -DSQLITE_OMIT_CTE sqlite3.c
sqlite3.c: In function ‘yy_reduce’:
sqlite3.c:117782:3: warning: implicit declaration of function
‘sqlite3WithAdd’ [-Wimplicit-function-declaration]
yygotominor.yy59 = sqlite3WithAdd(pParse, 0, [-5].minor.yy0,
yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
^
sqlite3.c:117782:20: warning: assignment makes pointer from integer
without a cast [enabled by default]
yygotominor.yy59 = sqlite3WithAdd(pParse, 0, [-5].minor.yy0,
yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
 ^
sqlite3.c:117787:20: warning: assignment makes pointer from integer
without a cast [enabled by default]
yygotominor.yy59 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy59,
[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
 ^



Looks like SQLITE_OMIT_CTE only works with full source builds, not
the amalgamation. As it causes code to be omitted from parse.y.

There are a few others this is true of as well - OMIT_VIRTUALTABLE,
OMIT_TRIGGER etc.

Dan.


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


[sqlite] SQLITE 3.8.3 beta: SQLITE_OMIT_CTE build doesn't work

2014-01-20 Thread Jan Nijtmans
$ gcc -c -Wall -o sqlite3.o -DSQLITE_OMIT_CTE sqlite3.c
sqlite3.c: In function ‘yy_reduce’:
sqlite3.c:117782:3: warning: implicit declaration of function
‘sqlite3WithAdd’ [-Wimplicit-function-declaration]
   yygotominor.yy59 = sqlite3WithAdd(pParse, 0, [-5].minor.yy0,
yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
   ^
sqlite3.c:117782:20: warning: assignment makes pointer from integer
without a cast [enabled by default]
   yygotominor.yy59 = sqlite3WithAdd(pParse, 0, [-5].minor.yy0,
yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
^
sqlite3.c:117787:20: warning: assignment makes pointer from integer
without a cast [enabled by default]
   yygotominor.yy59 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy59,
[-5].minor.yy0, yymsp[-4].minor.yy14, yymsp[-1].minor.yy3);
^

Suggested fix:

$ fossil diff --from trunk sqliteInt.h
--- sqliteInt.h
+++ sqliteInt.h
@@ -3357,10 +3357,12 @@
   void sqlite3WithDelete(sqlite3*,With*);
   void sqlite3WithPush(Parse*, With*, u8);
 #else
 #define sqlite3WithPush(x,y,z)
 #define sqlite3WithDelete(x,y)
+#define sqlite3WithAdd(p,w,t,x,y) (sqlite3ErrorMsg((p), \
+"near \"%T\": syntax error", (t)),(With*)(w))
 #endif

 /* Declarations for functions in fkey.c. All of these are replaced by
 ** no-op macros if OMIT_FOREIGN_KEY is defined. In this case no foreign
 ** key functionality is available. If OMIT_TRIGGER is defined but
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users