6 eval "use DBD::SQLite";
8 ? ( skip_all => 'needs DBD::SQLite for testing' )
16 use_ok('DBICTest::HelperRels');
18 DBICTest->schema->storage->sql_maker->quote_char("'");
19 DBICTest->schema->storage->sql_maker->name_sep('.');
21 my $rs = DBICTest::CD->search(
22 { 'me.year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
23 { join => 'artist' });
25 cmp_ok( $rs->count, '==', 1, "join with fields quoted");
27 $rs = DBICTest::CD->search({},
28 { 'order_by' => 'year DESC'});
31 local $SIG{__WARN__} = sub { $warnings .= $_[0] };
32 my $first = eval{ $rs->first() };
33 ok( $warnings =~ /ORDER BY terms/, "Problem with ORDER BY quotes" );
36 my $order = 'year DESC';
37 $rs = DBICTest::CD->search({},
38 { 'order_by' => \$order });
41 local $SIG{__WARN__} = sub { $warnings .= $_[0] };
42 my $first = $rs->first();
43 ok( $warnings !~ /ORDER BY terms/,
44 "No problem handling ORDER by scalaref" );
47 DBICTest->schema->storage->sql_maker->quote_char([qw/[ ]/]);
48 DBICTest->schema->storage->sql_maker->name_sep('.');
50 $rs = DBICTest::CD->search(
51 { 'me.year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
52 { join => 'artist' });
53 cmp_ok($rs->count,'==', 1,"join quoted with brackets.");
60 DBICTest->schema->storage->sql_maker->quote_char('`');
61 DBICTest->schema->storage->sql_maker->name_sep('.');
63 cmp_ok(DBICTest->schema->storage->sql_maker->update('group', \%data), 'eq', 'UPDATE `group` SET `name` = ?, `order` = ?', "quoted table names for UPDATE");