My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 40: column name alias error from cache
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  mnlagra...@gmail.com
Closed:  Nov 2009


 
Reported by mnlagra...@gmail.com, Oct 15, 2009
What steps will reproduce the problem?
1. create a where which uses fields from multiple tables
2. use next to get a record
3. update that record using a set of a single field from the original table

What is the expected output? What do you see instead?
Update fails.

Error message is:
DBD::mysql::db do failed: Unknown column 'a.date_closed' in 'field list' at
/usr/lib/perl5/vendor_perl/5.8.8/DBR/Misc/Connection.pm line 32.

It appears that the sql for the initial select does a select table_name AS
a. Then when the update sql is executed, it still uses the "a.field_name"
reference without adding the "table_name AS a".

Again, this only happens when pulling from the cache. If the line number of
the query is changed to break the cache, the code executes as expected.

Sample code:
my $ds_items = $dbh->dropship_item->where(
'item.order_id' =>      $order_id,
'dropship_product.vendor_id'    =>      $vendor_id,
'dropship_product.vendor_sku'   =>      $vendor_sku,
);
while (my $dsitem = $ds_items->next()) {
   $dsitem->date_closed('now');
}

Oct 15, 2009
#1 daniel.d...@gmail.com
(No comment was entered for this change.)
Labels: -Priority-Medium Priority-Critical
Oct 26, 2009
#2 daniel.d...@gmail.com
Thought I had this resolved. but The fix did not apply to ->set.
Nov 23, 2009
#3 daniel.d...@gmail.com
fixed in v301
Status: Fixed

Powered by Google Project Hosting