9 use DBIC::SqlMakerTest;
14 my $schema = DBICTest->init_schema();
16 $schema->storage->sql_maker->quote_char('`');
17 $schema->storage->sql_maker->name_sep('.');
20 $schema->storage->debugobj(DBIC::DebugObj->new(\$sql, \@bind)),
21 $schema->storage->debug(1);
25 # ->table(\'cd') should NOT be quoted
26 $rs = $schema->resultset('CDTableRef')->search(
27 { 'me.year' => 2001, 'artist.name' => 'Caterwauler McCrae' },
28 { join => 'artist' });
32 "SELECT COUNT( * ) FROM cd `me` JOIN `artist` `artist` ON ( `artist`.`artistid` = `me`.`artist` ) WHERE ( `artist`.`name` = ? AND `me`.`year` = ? )", ["'Caterwauler McCrae'", "'2001'"],
33 'got correct SQL for count query with quoting'
36 # check that the table works
38 $rs = $schema->resultset('CDTableRef');
39 $rs->create({ cdid => 6, artist => 3, title => 'mtfnpy', year => 2009 });
40 my $row = $rs->find(6);
41 $row->update({ title => 'bleh' });
44 ok !$@, 'operations on scalarref table name work';