Hi Jan, Thanks for trying out my patch, and for your improvement. If I may suggest one thing: change the 'for alignment' comments to something more informative, e.g., 'please keep this line for SQLITE_ENABLE_UPDATE_DELETE_LIMIT debugging'.
I also toyed with the idea of running lemon with '-l' both times, so that we rid ourselves of the #line's altogether. I couldn't decide if this was a good idea, so I left the #line's in. However, looking at the the parse.c code JUST NOW, I realized that there is something more fundamentally wrong: The '#line ... parse.c' directives should really be '#line ... parse.y'! I was wondering why I was getting inconsistent line numbers for the 2 invocations of lemon, since we're using the same parse.y both times, but did not manage to put the pieces together until just now. :-) Here is what I would suggest, and please let me know what you think. We do the change it 3 steps: (1) commit my patch, together with your patch below; (2) fix lemon so that it correctly outputs '#line ... parse.y' instead 'parse.c' ; (3) remove your patch below, since at that point it might become confusing to developers. Another sequence might be: (1) commit my patch, together with -l options provided for the lemon invocations; (2) fix lemon so that it correctly outputs '#line ... parse.y' instead 'parse.c' ; (3) remove the '-l' options from the lemon invocations. I can definitely do all the work, unless you (Jan) would like to jump in. SQLite maintainers, please feel free to opine anytime. :-) I see that a new release of SQLite is being put together, so all the fixes we're discussing here should probably go in afterwards. --Zem -----Original Message----- From: Jan Nijtmans [mailto:jan.nijtm...@gmail.com] Sent: Wednesday, 8 February 2017 2:58 To: Ziemowit Laski Cc: sqlite-users@mailinglists.sqlite.org Subject: Re: SQLITE_ENABLE_UPDATE_DELETE_LIMIT (Was: [sqlite] Patch Etiquette) 2017-02-06 23:25 GMT+01:00 Ziemowit Laski: > Here is my approach to the SQLITE_ENABLE_UPDATE_DELETE_LIMIT problem. > [If the attachment does not arrive intact, please let me know.] Hi Ziemowit, I tried your patch, and it works fine! Below is an additional patch, which makes the resulting amalgamation much smaller (from 202734 to 202415 lines, while the original amalgamation was 201287 lines). The reason for this reduction is that your amalgamation contains 321 segments which look like: #ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT #line 3288 "parse.c" #else /* SQLITE_ENABLE_UPDATE_DELETE_LIMIT */ #line 3290 "parse.c" #endif /* SQLITE_ENABLE_UPDATE_DELETE_LIMIT */ This is not really useful, since the only difference is the line number. If both "parse.c" versions contain the same line numbering, that helps in the diff size. Thank you for your idea! Regards, Jan nijtmans Index: src/parse.y ================================================================== --- src/parse.y +++ src/parse.y @@ -748,10 +748,11 @@ %ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT cmd ::= with(C) DELETE FROM fullname(X) indexed_opt(I) where_opt(W). { sqlite3WithPush(pParse, C, 1); sqlite3SrcListIndexedBy(pParse, X, &I); sqlite3DeleteFrom(pParse,X,W); + /* for alignment */ } %endif %type where_opt {Expr*} %destructor where_opt {sqlite3ExprDelete(pParse->db, $$);} @@ -776,10 +777,11 @@ where_opt(W). { sqlite3WithPush(pParse, C, 1); sqlite3SrcListIndexedBy(pParse, X, &I); sqlite3ExprListCheckLength(pParse,Y,"set list"); sqlite3Update(pParse,X,Y,W,R); + /* for alignment */ } %endif %type setlist {ExprList*} %destructor setlist {sqlite3ExprListDelete(pParse->db, $$);} _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users