Lines 413-419
$schema->storage->txn_rollback;
Link Here
|
413 |
|
413 |
|
414 |
subtest 'nb_rows() tests' => sub { |
414 |
subtest 'nb_rows() tests' => sub { |
415 |
|
415 |
|
416 |
plan tests => 1; |
416 |
plan tests => 3; |
417 |
|
417 |
|
418 |
$schema->storage->txn_begin; |
418 |
$schema->storage->txn_begin; |
419 |
|
419 |
|
Lines 430-435
subtest 'nb_rows() tests' => sub {
Link Here
|
430 |
|
430 |
|
431 |
is( $nb_rows, $items_count, 'nb_rows returns the right value' ); |
431 |
is( $nb_rows, $items_count, 'nb_rows returns the right value' ); |
432 |
|
432 |
|
|
|
433 |
my $bad_query = q{ |
434 |
SELECT * items xxx |
435 |
}; |
436 |
|
437 |
warning_like |
438 |
{ $nb_rows = nb_rows( $bad_query ) } |
439 |
qr/^DBD::mysql::st execute failed:/, |
440 |
'Bad queries raise a warning'; |
441 |
|
442 |
is( $nb_rows, 0, 'nb_rows returns 0 on bad queries' ); |
443 |
|
433 |
$schema->storage->txn_rollback; |
444 |
$schema->storage->txn_rollback; |
434 |
}; |
445 |
}; |
435 |
|
446 |
|
436 |
- |
|
|