9 my $schema = DBICTest->init_schema();
13 my $rs = $schema->resultset('CD')->search({},
15 '+select' => \ 'COUNT(*)',
19 lives_ok(sub { $rs->first->get_column('count') }, 'additional count rscolumn present');
20 dies_ok(sub { $rs->first->get_column('nonexistent_column') }, 'nonexistant column requests still throw exceptions');
22 $rs = $schema->resultset('CD')->search({},
24 '+select' => [ \ 'COUNT(*)', 'title' ],
25 '+as' => [ 'count', 'addedtitle' ]
28 lives_ok(sub { $rs->first->get_column('count') }, 'multiple +select/+as columns, 1st rscolumn present');
29 lives_ok(sub { $rs->first->get_column('addedtitle') }, 'multiple +select/+as columns, 2nd rscolumn present');
31 $rs = $schema->resultset('CD')->search({},
33 '+select' => [ \ 'COUNT(*)', 'title' ],
34 '+as' => [ 'count', 'addedtitle' ]
39 '+as' => 'addedtitle2'
42 lives_ok(sub { $rs->first->get_column('count') }, '+select/+as chained search 1st rscolumn present');
43 lives_ok(sub { $rs->first->get_column('addedtitle') }, '+select/+as chained search 1st rscolumn present');
44 lives_ok(sub { $rs->first->get_column('addedtitle2') }, '+select/+as chained search 3rd rscolumn present');