Lines 289-295
subtest 'Ensure last_run is populated' => sub {
Link Here
|
289 |
}; |
289 |
}; |
290 |
|
290 |
|
291 |
subtest 'convert_sql' => sub { |
291 |
subtest 'convert_sql' => sub { |
292 |
plan tests => 3; |
292 |
plan tests => 4; |
293 |
|
293 |
|
294 |
my $sql = q| |
294 |
my $sql = q| |
295 |
SELECT biblionumber, ExtractValue(marcxml, |
295 |
SELECT biblionumber, ExtractValue(marcxml, |
Lines 341-346
count(h.reservedate) AS 'holds'
Link Here
|
341 |
GROUP BY b.biblionumber |
341 |
GROUP BY b.biblionumber |
342 |
HAVING count(h.reservedate) >= 42|; |
342 |
HAVING count(h.reservedate) >= 42|; |
343 |
is( C4::Reports::Guided::convert_sql( $sql ), $expected_converted_sql, "Query with 2 joins should have been correctly converted"); |
343 |
is( C4::Reports::Guided::convert_sql( $sql ), $expected_converted_sql, "Query with 2 joins should have been correctly converted"); |
|
|
344 |
|
345 |
$sql = q| |
346 |
SELECT t1.marcxml AS first, t2.marcxml AS second, |
347 |
FROM biblioitems t1 |
348 |
LEFT JOIN biblioitems t2 USING ( biblionumber )|; |
349 |
|
350 |
$expected_converted_sql = q| |
351 |
SELECT t1.metadata AS first, t2.metadata AS second, |
352 |
FROM biblio_metadata t1 |
353 |
LEFT JOIN biblio_metadata t2 USING ( biblionumber )|; |
354 |
is( C4::Reports::Guided::convert_sql( $sql ), $expected_converted_sql, "Query with multiple instances of marcxml and biblioitems should have them all replaced"); |
344 |
}; |
355 |
}; |
345 |
|
356 |
|
346 |
$schema->storage->txn_rollback; |
357 |
$schema->storage->txn_rollback; |
347 |
- |
|
|