Sorry I don't have a lot of time right this moment to investigate 
further, taking a quick glance at the code, 

if (in_literal) {
   /* check if literal ends but keep quotes in literal */
   if (*src == in_literal && *(src-1) != '\\') {
         in_literal = 0;
   }
   *dest++ = *src++;
   continue;
}

..I think this is where the problem is, the \\ escapes the '.

On 14-Aug-01 Scott T. Hildreth wrote:
> 
> Actually the preparsing is done by the DBD's.  Look at the 
> dbd_preparse() function in dbdimp.c file under DBD::PG dist.
> 
> On 15-Aug-01 Anar R Guliev wrote:
>> Dear Sir,
>> 
>> I've found your email in the DBI's perldoc.
>> 
>> So, what i found seems to be a bug of sql-parsing
>> Here is a fragment of tracing:
>> 
>> dbd_st_preparse: statement = >select * from dirs_items1 where dirid like 
>> ?||'\\_\%' escape '\\'  and lang=?<
>>   dbd_preparse scanned 1 distinct placeholders
>> 
>> Of cause, there are 2 placeholders there, not 1.
>> If i write it this way:
>> 
>> select * from dirs_items1 where lang=? and dirid like  ?||'\\_\%' escape
>> '\\'
>> 
>> it is ok. so, something is wrong when parsing this:   ?||'\\_\%' escape '\\'
>>  is not it?
>> (btw, i'm using postgres, but i think it is of DBI, not of DBD )
>>  
>>  I don't know really  who deals with it, if you know - please forward
>>  the mail to him.
>>    I just wanted to notify developers of a possible problem in a code.
>> 
>> -- 
>> Best regards,
>>  Anar R Guliev                          mailto:[EMAIL PROTECTED]
>> 
>> 
>> PS: May be it will be usefull - here is a fragment of my program code
>> where i found a problem:
>> 
>>#For Postgres:
>> $argument_undescore_something=' ?||\'\\\\_\%\' escape \'\\\\\' ';
>> 
>> sub print_dirsbelow_n_return_number {#pass dirID,lang
>>  my($passed_dirid,$passed_lang)=@_;
>>  my $items_num=0;
>>  my $row;
>>  my $listingof_dirs='';
>>  my $processed_subdirs='';
>>  my $current_subdir_id='';
>>  my $sth=$dbh->prepare("select * from $configs{'tablename'} where dirid like
>> $argument_undescore_something and lang=?");
>>  $sth->execute($passed_lang,$passed_dirid);
>>  while($row=$sth->fetchrow_arrayref)
>>      ........
>> 
>> }
>> 
>> i've included $dbh->trace(7)   -  here is what it writes:
>> 
>> 
>> dbd_st_preparse: statement = >select * from dirs_items1 where dirid like 
>> ?||'\\_\%' escape '\\'  and lang=?<
>>   dbd_preparse scanned 1 distinct placeholders
>> 
> 
> ----------------------------------
> E-Mail: Scott T. Hildreth <[EMAIL PROTECTED]>
> Date: 14-Aug-01
> Time: 12:36:12
> ----------------------------------

----------------------------------
E-Mail: Scott T. Hildreth <[EMAIL PROTECTED]>
Date: 14-Aug-01
Time: 12:48:46
----------------------------------

Reply via email to