From: Daniel Westermann-Clark Date: Thu, 14 Sep 2006 14:29:02 +0000 (+0000) Subject: Fix for recent SQLite versions interpreting single quotes as string literals X-Git-Tag: v0.07002~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=02af104d10b856ef439aea5aeefdd452bcabe3ae;p=dbsrgits%2FDBIx-Class.git Fix for recent SQLite versions interpreting single quotes as string literals --- diff --git a/t/19quotes.t b/t/19quotes.t index ad44bcb..2ce7a26 100644 --- a/t/19quotes.t +++ b/t/19quotes.t @@ -16,7 +16,7 @@ use lib qw(t/lib); use_ok('DBICTest'); DBICTest->init_schema(); -DBICTest->schema->storage->sql_maker->quote_char("'"); +DBICTest->schema->storage->sql_maker->quote_char('`'); DBICTest->schema->storage->sql_maker->name_sep('.'); my $rs = DBICTest::CD->search( @@ -31,7 +31,7 @@ $rs = DBICTest::CD->search({}, my $warnings = ''; local $SIG{__WARN__} = sub { $warnings .= $_[0] }; my $first = eval{ $rs->first() }; - like( $warnings, qr/ORDER BY terms/, "Problem with ORDER BY quotes" ); + like( $warnings, qr/no such column: year DESC/, "Problem with ORDER BY quotes" ); } my $order = 'year DESC'; diff --git a/t/19quotes_newstyle.t b/t/19quotes_newstyle.t index 65cd3aa..de32393 100644 --- a/t/19quotes_newstyle.t +++ b/t/19quotes_newstyle.t @@ -18,7 +18,7 @@ DBICTest->init_schema(); my $dsn = DBICTest->schema->storage->connect_info->[0]; -DBICTest->schema->connection($dsn, { quote_char => "'", name_sep => '.' }); +DBICTest->schema->connection($dsn, { quote_char => '`', name_sep => '.' }); my $rs = DBICTest::CD->search( { 'me.year' => 2001, 'artist.name' => 'Caterwauler McCrae' }, @@ -32,7 +32,7 @@ $rs = DBICTest::CD->search({}, my $warnings = ''; local $SIG{__WARN__} = sub { $warnings .= $_[0] }; my $first = eval{ $rs->first() }; - like( $warnings, qr/ORDER BY terms/, "Problem with ORDER BY quotes" ); + like( $warnings, qr/no such column: year DESC/, "Problem with ORDER BY quotes" ); } my $order = 'year DESC';