Hi Luuk,

Not sure if you realize this, but your email comes over as very aggressive,
and if there's one person on this mailing list that doesn't deserve that,
it's dr Hipp.

In particular, the quotes around forgot seem to imply that it was forgotten
on purpose.

Personally, I would have worded it as "I looked at the test and I wonder if
this test case is addressed". Email communication is easy to misconstrue…

Cheers,

Wout.


---------- Forwarded message ---------
From: Luuk <[email protected]>
Date: Sun, Dec 9, 2018 at 7:42 PM
Subject: Re: [sqlite] SQLITE gives incorrect results for 'NOT IN' query if
partial index exists
To: <[email protected]>



On 8-12-2018 23:47, Richard Hipp wrote:
> On 12/8/18, Deon Brewis <[email protected]> wrote:
>> I'm curious how that test that you added works?  i.e. What causes the
test
>> to fail if the results are wrong?
> The particular test case you are referring to is written in in the TCL
> language.  The TCL tests are the oldest set of tests for SQLite since
> SQLite is really a TCL-extension that escaped into the wild.
>
> Everything in TCL is a command followed by zero or more arguments.  In
> this sense, TCL is very much like Bourne shell.  COMMAND ARG1 ARG2
> ARG3 ....  Where TCL excels is in how it quotes the arguments.  Curly
> braces {...} are quoting characters that nest.   Take, for example,
> the "if" command in TCL:
>
>      if {$a<0} {
>        set a [expr {-$a}]
>      } else {
>        set a [expr {$a+10}]
>      }
>
> In this case, the "if" command has four arguments
>
>       if EXPR SCRIPT else SCRIPT
>
> When the "if" command runs, it evaluates its first argument EXPR.  If
> EXPR is true, then the if command runs the SCRIPT given in the second
> argument.  Otherwise it runs the SCRIPT in the fourth argument.  The
> magic, you see, is in the use of nested curly braces for quoting.
>
> The test command you refer to is this:
>
> do_execsql_test index6-12.1 {
>    DROP TABLE IF EXISTS t1;
>    DROP TABLE IF EXISTS t2;
>    CREATE TABLE t1(a,b);
>    INSERT INTO t1 VALUES(1,1);
>    INSERT INTO t1 VALUES(2,2);
>    CREATE TABLE t2(x);
>    INSERT INTO t2 VALUES(1);
>    INSERT INTO t2 VALUES(2);
>    SELECT 'one', * FROM t2 WHERE x NOT IN (SELECT a FROM t1);
>    CREATE INDEX t1a ON t1(a) WHERE b=1;
>    SELECT 'two', * FROM t2 WHERE x NOT IN (SELECT a FROM t1);
> } {}
>
> The name of the command is "do_execsql_test".  That command takes
> three arguments:
>
>      do_execsql_test   TESTNAME   SQL-SCRIPT   EXPECTED-RESULT
>
> This command simply runs the SQL found in its second argument and
> accumulates the results.  The accumulated result should exactly match
> the third argument.  If it does not match, then it prints an error
> message and increments the error counter.
>
> If you start with the canonical SQL source code, you can generate the
> appropriate TCL interpreter by typing
>
>      ./configure; make testfixture
>
> Or on windows:
>
>       nmake /f Makefile.msc testfixture.exe
>
> Then you say "./testfixture test/index6.test" to run that particular test
file.


You 'forgot' to add the example that Olivier Mascia gave?:

select * from bar WHERE x IN (SELECT y from foo); -- this will wrongly
return 1.





_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to