set_sql weird cache issues?

[prev] [thread] [next] [Date index for 2005/06/28]

From: marshyon
Subject: set_sql weird cache issues?
Date: 19:54 on 28 Jun 2005

in a parent class 'DBI.pm', I am setting sql:

__PACKAGE__->set_sql("big_join", "select c.name 'customer', p.name 'product', p.notes 'notes' from purchase_order po, product p, customer c where po.product = p.id and po.customer = c.id order by customer");

in my script I am accessing values of the above

my @things = MyApp::M::DBI::list->search_big_join();

the values are accessed (and it all seems to work):

foreach my $t (@things) {
  print ">>".$t->customer."\n";
  print ">>".$t->notes."\n";
  print ">>".$t->product."\n";
}

>>b
>>notes
>>Test product
>>-------------
>>b
>>notes
>>Test product
>>-------------
>>b
>>notes
>>Test product
>>-------------

if run from mysql prompt, the results are totally different

| jon      | ad1    | folding helicopter                           | little nellie |
| jon      | ad1    | folding helicopter                           | little nellie |
| jon      | ad1    | folding helicopter                           | little 

However, the amount of rows are correct.

could this be caching working against me? I'm pretty new to this, can I clear down the cache prior to running the query?
o

set_sql weird cache issues?
marshyon 19:54 on 28 Jun 2005

Re: set_sql weird cache issues?
Perrin Harkins 03:56 on 01 Jul 2005

Re: set_sql weird cache issues?
J Brookes 15:46 on 01 Jul 2005

Re: set_sql weird cache issues?
Perrin Harkins 18:19 on 01 Jul 2005

Re: set_sql weird cache issues?
Matt S Trout 00:34 on 02 Jul 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52