in reply to Nastyness between DBI and Test::More

Is this what you meant to test?
my $stmt = "SELECT ALL * FROM test";
update Actually it's valid SQL just doubly redundant - once because ALL is implied and twice because if ALL * is different from DISTINCT *, your table is hosed :-).
  • Comment on Re: Nastyness between DBI and Test::More

Replies are listed 'Best First'.
Re^2: Nastyness between DBI and Test::More
by GrandFather (Saint) on Apr 21, 2007 at 23:34 UTC

    What I mean to test is the bug that (as it turned out) was due to an older version of Perl. The test code is a much trimmed down version of some "real" code and as such may carry some baggage from the original context.

    Although I'm pretty new to SQL, my reading of the MySQL and SQLite documentation indicates that the ALL is implied and optional, but that the * or some other select expression is required. In the original code there was a WHERE clause so the ALL was a nod to improved understanding by a neophyte (me). The ALL didn't affect the test nor cause undue visual clutter or confusion so it didn't get taken out.


    DWIM is Perl's answer to Gödel
      Sure, there's nothing wrong with using ALL to make clearer what you are doing - selecting all rows (ALL) and all columns (*). It just struck me as funny.