[ic] Problem with 'aq' column op

Ron Phipps rphipps at reliant-solutions.com
Thu Jun 10 16:53:08 EDT 2004


> From: Ron Phipps
> Sent: Thursday, June 10, 2004 1:25 PM
> 
> Hello,
> 
> I'm on IC 5.0.0, Perl 5.6.1, MySQL.  I'm running a custom store.  I
have
> the following search profile:
> 
> __NAME__ keyword_search
> mv_search_page=search_results
> mv_searchtype=db
> mv_coordinate=yes
> mv_search_file=products
>
mv_return_fields=sku,title,image,short_description,long_description,msrp
>
_price,free_batteries,free_shipping,mfgr_id,import_type,option_type,hcpc
> s_code
> mv_sort_field=title
> mv_search_field=:long_description:short_description:title:sku
> mv_column_op=aq
> mv_search_field=user_inactive
> mv_searchspec=0
> mv_column_op===
> mv_search_field=import_inactive
> mv_searchspec=0
> mv_column_op===
> mv_matchlimit=10
> __END__
> 
> I enter the word 'canes' into the search box and hit enter.  14
products
> are returned as expected.  After the result is returned if I hit
refresh
> on my browser some times it works and other times I receive the
> following in the error log and no results are returned:
> 
> store /search.html search error: Limit subroutine creation: Bad code:
> syntax error at (eval 519) line 8, near "] aqcanes "
> 
> Some times I can hit refresh 5 times and the results are returned each
> time.  Other times it errors out the first time I hit refresh.  It's
> very unpredictable on the number of times I can hit refresh before it
> errors out.
> 
> I have tried removing the column op of 'aq' and just searching on the
> title field and I can refresh that search results as many times as I
> want so it appears to be a problem with the 'aq' code path.  I'm
> currently debugging the search code to see where the problem might lie
> and will post if I find anything of use.
> 
> Thanks,
> -Ron

Here is some more information.  The following is the debug log for
get_limit on a valid search:

----------------------------------------------------
Vend::DbSearch:debug: In DbSearch.pm
Vend::Search:debug: In Search::get_limit
Vend::Search:debug: join_field
:long_description:short_description:title:sku
Vend::Search:debug: join_field -1
Vend::Search:debug: join_field 14
Vend::Search:debug: join_field 15
Vend::Search:debug: Ops=[
  [
    sub { "DUMMY" },
    'aq'
  ]
]

Vend::Search:debug: Begin=
Vend::Search:debug: Group=
Vend::Search:debug: Ors=
Vend::Search:debug: Field count=3
Vend::Search:debug: Code fragment is q!
$s->{search_routines}[0]->($fields[0])!
Vend::Search:debug: Code fragment is q!$fields[1] =~ m{\b0\b}i!
Vend::Search:debug: triggered wild_card: 1
Vend::Search:debug: Code fragment is q!$fields[2] =~ m{\b0\b}i!
Vend::Search:debug: coderef=[["
\$s->{search_routines}[0]->(\$fields[0])"," and \$fields[1] =~
m{\\b0\\b}i"," and \$fields[2] =~ m{\\b0\\b}i",],]
Vend::Search:debug: {'mv_searchspec' => ["canes","0","0",],'mv_numeric'
=> [],'mv_search_file' => ["products",],'mv_matchlimit' =>
"10",'mv_return_delim' => "      ",'dbref' => 'something
else','mv_cache_key' => "d717fd6b25ae12229644ff4e3f79801e",'mv_case' =>
[],'search_routines' => ['something else',],'mv_min_string' =>
"1",'mv_return_fields' =>
["0","1","8","2","3","6","21","22","10","18","12","17",],'mv_search_rela
te' => "",'mv_session_id' => "JifM6voM",'mv_begin_string' =>
[],'mv_index_delim' => "  ",'mv_orsearch' => [],'mv_search_group' =>
[],'mv_field_hash' => {'21' => "21",'7' => "7",'size_type_c' =>
"26",'26' => "26",'17' => "17",'2' => "2",'long_description' =>
"3",'free_shipping' => "22",'1' => "1",'18' => "18",'hcpcs_code' =>
"17",'user_inactive' => "14",'import_type' => "18",'weight' =>
"11",'msrp_price' => "6",'16' => "16",'27' => "27",'25' =>
"25",'sale_price' => "7",'20' => "20",'14' => "14",'option_type' =>
"12",'size_type_a' => "24",'short_description' => "2",'24' => "24",'10'
=> "10",'title' => "1",'price' => "4",'warranty' => "20",'11' =>
"11",'sku' => "0",'common_adjust' => "27",'colors' => "19",'22' =>
"22",'import_inactive' => "15",'size_type_b' => "25",'0' =>
"0",'imported_price' => "5",'23' => "23",'mfgr_id' => "10",'13' =>
"13",'6' => "6",'3' => "3",'9' => "9",'12' => "12",'image' => "8",'15'
=> "15",'8' => "8",'subcat_id' => "9",'4' => "4",'free_batteries' =>
"21",'template_page' => "13",'19' => "19",'new_import' =>
"16",'update_on_import' => "23",'5' => "5",},'mv_search_field' =>
["-1","14","15",],'mv_sort_option' => [],'mv_substring_match' =>
[],'mv_base_directory' => "products",'mv_coordinate' =>
"1",'mv_column_op' => [["aq",],],'matches' => "0",'mv_head_skip' =>
"0",'field_hash' => {'sku' => "0",'common_adjust' => "27",'size_type_c'
=> "26",'colors' => "19",'long_description' => "3",'free_shipping' =>
"22",'import_inactive' => "15",'size_type_b' => "25",'hcpcs_code' =>
"17",'user_inactive' => "14",'imported_price' => "5",'import_type' =>
"18",'weight' => "11",'msrp_price' => "6",'mfgr_id' => "10",'sale_price'
=> "7",'image' => "8",'option_type' => "12",'size_type_a' =>
"24",'subcat_id' => "9",'short_description' => "2",'free_batteries' =>
"21",'template_page' => "13",'price' => "4",'title' => "1",'new_import'
=> "16",'update_on_import' => "23",'warranty' => "20",},'mv_all_chars'
=> ["1","1","1",],'mv_searchtype' => "db",'verbatim_columns' =>
"1",'mv_profile' => "0",'mv_negate' => [],'mv_field_names' =>
["sku","title","short_description","long_description","price","imported_
price","msrp_price","sale_price","image","subcat_id","mfgr_id","weight",
"option_type","template_page","user_inactive","import_inactive","new_imp
ort","hcpcs_code","import_type","colors","warranty","free_batteries","fr
ee_shipping","update_on_import","size_type_a","size_type_b","size_type_c
","common_adjust",],'mv_sort_field' => ["1",],'mv_search_page' =>
"search_results",}
Vend::Search:debug: do_limit.
Vend::Search:debug: do_limit past f.
Vend::Search:debug: regex_specs=undef

Vend::Search:debug: code is sub {
my $line = shift;
my @fields = @$line;
my $key = $line->[0];
my $addl = join " ", @fields[3,2,1,0];
push @fields, $addl;
        @fields = @fields[-1,14,15];
return (  $s->{search_routines}[0]->($fields[0]) and $fields[1] =~
m{\b0\b}i and $fields[2] =~ m{\b0\b}i );
}
----------------------------------------------------

And for an invalid search:

----------------------------------------------------
Vend::DbSearch:debug: In DbSearch.pm
Vend::Search:debug: In Search::get_limit
Vend::Search:debug: join_field
:long_description:short_description:title:sku
Vend::Search:debug: join_field -1
Vend::Search:debug: join_field 14
Vend::Search:debug: join_field 15
Vend::Search:debug: Ops=[
  [
    'aq'
  ]
]

Vend::Search:debug: Begin=
Vend::Search:debug: Group=
Vend::Search:debug: Ors=
Vend::Search:debug: Field count=3
Vend::Search:debug: Op now=[
  'aq'
]

Vend::Search:debug: Candidate now=
Vend::Search:debug: Code fragment is q!$fields[0] aqcanes!
Vend::Search:debug: Code fragment is q!$fields[1] =~ m{\b0\b}i!
Vend::Search:debug: triggered wild_card: 1
Vend::Search:debug: Code fragment is q!$fields[2] =~ m{\b0\b}i!
Vend::Search:debug: coderef=[["\$fields[0] aqcanes"," and \$fields[1] =~
m{\\b0\\b}i"," and \$fields[2] =~ m{\\b0\\b}i",],]
Vend::Search:debug: {'mv_searchspec' => ["canes","0","0",],'mv_numeric'
=> [],'mv_search_file' => ["products",],'mv_matchlimit' =>
"10",'mv_return_delim' => "      ",'dbref' => 'something
else','mv_cache_key' => "d717fd6b25ae12229644ff4e3f79801e",'mv_case' =>
[],'mv_min_string' => "1",'mv_return_fields' =>
["0","1","8","2","3","6","21","22","10","18","12","17",],'mv_search_rela
te' => "",'mv_session_id' => "JifM6voM",'mv_begin_string' =>
[],'mv_index_delim' => "",'mv_orsearch' => [],'mv_search_group' =>
[],'mv_field_hash' => {'21' => "21",'7' => "7",'size_type_c' =>
"26",'26' => "26",'17' => "17",'2' => "2",'long_description' =>
"3",'free_shipping' => "22",'1' => "1",'18' => "18",'hcpcs_code' =>
"17",'user_inactive' => "14",'import_type' => "18",'weight' =>
"11",'msrp_price' => "6",'16' => "16",'27' => "27",'25' =>
"25",'sale_price' => "7",'20' => "20",'14' => "14",'option_type' =>
"12",'size_type_a' => "24",'short_description' => "2",'24' => "24",'10'
=> "10",'title' => "1",'price' => "4",'warranty' => "20",'11' =>
"11",'sku' => "0",'common_adjust' => "27",'colors' => "19",'22' =>
"22",'import_inactive' => "15",'size_type_b' => "25",'0' =>
"0",'imported_price' => "5",'23' => "23",'mfgr_id' => "10",'13' =>
"13",'6' => "6",'3' => "3",'9' => "9",'12' => "12",'image' => "8",'15'
=> "15",'8' => "8",'subcat_id' => "9",'4' => "4",'free_batteries' =>
"21",'template_page' => "13",'19' => "19",'new_import' =>
"16",'update_on_import' => "23",'5' => "5",},'mv_search_field' =>
["-1","14","15",],'mv_sort_option' => [],'mv_substring_match' =>
[],'mv_base_directory' => "products",'mv_coordinate' =>
"1",'mv_column_op' => [["aq",],],'matches' => "0",'mv_head_skip' =>
"0",'field_hash' => {'sku' => "0",'common_adjust' => "27",'size_type_c'
=> "26",'colors' => "19",'long_description' => "3",'free_shipping' =>
"22",'import_inactive' => "15",'size_type_b' => "25",'hcpcs_code' =>
"17",'user_inactive' => "14",'imported_price' => "5",'import_type' =>
"18",'weight' => "11",'msrp_price' => "6",'mfgr_id' => "10",'sale_price'
=> "7",'image' => "8",'option_type' => "12",'size_type_a' =>
"24",'subcat_id' => "9",'short_description' => "2",'free_batteries' =>
"21",'template_page' => "13",'price' => "4",'title' => "1",'new_import'
=> "16",'update_on_import' => "23",'warranty' => "20",},'mv_all_chars'
=> ["1","1","1",],'mv_searchtype' => "db",'verbatim_columns' =>
"1",'mv_profile' => "0",'mv_negate' => [],'mv_field_names' =>
["sku","title","short_description","long_description","price","imported_
price","msrp_price","sale_price","image","subcat_id","mfgr_id","weight",
"option_type","template_page","user_inactive","import_inactive","new_imp
ort","hcpcs_code","import_type","colors","warranty","free_batteries","fr
ee_shipping","update_on_import","size_type_a","size_type_b","size_type_c
","common_adjust",],'mv_sort_field' => ["1",],'mv_search_page' =>
"search_results",}
Vend::Search:debug: do_limit.
Vend::Search:debug: do_limit past f.
Vend::Search:debug: regex_specs=undef

Vend::Search:debug: code is sub {
my $line = shift;
my @fields = @$line;
my $key = $line->[0];
my $addl = join " ", @fields[3,2,1,0];
push @fields, $addl;
        @fields = @fields[-1,14,15];
return ( $fields[0] aqcanes and $fields[1] =~ m{\b0\b}i and $fields[2]
=~ m{\b0\b}i );
}

Bareword found where operator expected at (eval 584) line 8, near "]
aqcanes"
        (Missing operator before aqcanes?)
search error: Limit subroutine creation: Bad code: syntax error at (eval
584) line 8, near "] aqcanes "

----------------------------------------------------

The first difference is the Ops= line.  I'm investigating that right now
to find out why it varies on a refresh.  It seems like a value is not
being deleted or initialized properly.  More to come...

-Ron



More information about the interchange-users mailing list