[Dbix-class] cdbi::sweet pager issue (OT?)

Wade.Stuart at fallon.com Wade.Stuart at fallon.com
Wed Aug 17 21:12:13 CEST 2005





Sorry this may be off topic -- last I heard this was the mailing list for
sweet issues too..

If you look below I am getting some unexpected results from the sweet page,
I thought at first I was getting the abstract structure wrong but after
tracing it looks like sweets pager may be horking the where clause..

Not that the where clause in the count query is correct (and between
me.filename like ? and me.filename not like ?,  where the actual limited
select shows an OR in the where clause.

Any ideas,  is this a known thing with a work around or should I dig in and
see if I can figure out where the fubar where clause is generated...

criteria is:
      {  'filename' => [
                          '-and',
                          {
                            '-like' => '%/var%'
                          },
                          {
                            '-not_like' => '%test2%'
                          }
                        ],
          'dvd.archive.id' => '1'
        }

my ($pager, $pagerit)  = $file->page(\%criteria,   {rows => 40, order_by =>
$order, page => $c->req->params->{page} || 1 });


The count select that page does looks right,

 T  <- prepare_cached('SELECT COUNT(*)
FROM   file me, archive archive, dvd dvd
WHERE  ( archive.id = ? AND ( ( me.filename LIKE ? ) AND ( me.filename NOT
LIKE ? ) ) ) AND dvd.archive = archive.id AND me.dvd = dvd.id
')= DBIx::ContextualFetch::st=HASH(0x1c9fd54) at DBI.pm line 391

The page select looks wrong like it is not using the same abstract...:

 T  <- prepare_cached('SELECT me.id
FROM   file me, archive archive, dvd dvd
WHERE  ( archive.id = ? AND ( ( me.filename LIKE ? ) OR ( me.filename NOT
LIKE ? ) ) ) AND dvd.archive = archive.id AND me.dvd = dvd.id ORDER BY
dvd.name LIMIT ?, ?
')= DBIx::ContextualFetch::st=HASH(0x32d6988) at DBI.pm line 391




More information about the Dbix-class mailing list