[Interchange-bugs] [Bug 208] New - [sql-param N] does not work

bugzilla-daemon@developer.akopia.com bugzilla-daemon@developer.akopia.com
Fri Jun 1 11:15:00 2001


http://developer.akopia.com/bugs/show_bug.cgi?id=208

*** shadow/208	Fri Jun  1 11:14:38 2001
--- shadow/208.tmp.13379	Fri Jun  1 11:14:38 2001
***************
*** 0 ****
--- 1,37 ----
+ Bug#: 208
+ Product: Interchange
+ Version: 4.6.3
+ Platform: All
+ OS/Version: All
+ Status: NEW   
+ Resolution: 
+ Severity: critical
+ Priority: P2
+ Component: Core
+ AssignedTo: mike@minivend.com                            
+ ReportedBy: nferrari@ccsc.com               
+ URL: http://http://
+ Cc: 
+ Summary: [sql-param N] does not work
+ 
+ In Interpolate.pm, line 3481, inside function iterate_array_list(), we have:
+ 
+ $run =~ s#$B$QR{_param}#defined $fh->{$1} ? $row->[$fh->{$1}] : ''#ige;
+ 
+ what is the code for a hash, not an array. Five lines below, we have:
+ 
+ $run =~ s#$B$QR{_pos}#$row->[$1]#ig;
+ 
+ that work just fine. Maybe the documentation should change to reflect the fact
+ that [sql-pos N] does the same as [sql-param N]...
+ 
+ If we change the incorrect code to:
+ 
+ $run =~ s#$B$QR{_param}#$row->[$1]#ige;
+ 
+ we have another kind of error: [sql-param name] always returns the same as
+ [sql-param 0] (int(name) == 0!!!), so this is not enough. I tried to change to:
+ 
+ $run =~ s#($B$QR{_param})#is_number($2)?$row->[$2]:$1#ige;
+ 
+ but now [sql-param name] returns '[sql-param name]' (the string!).