Hi!

Until recently we have used DBI-1.15 in our product. After trying to 
upgrade to DBI-1.20 (or anything after 1.15) our SQL select statements 
broke in a curious way:

In a lot of places we have to rely (for performance reasons) for 
something like this to succeed:

select *, trim(leading '*' from plz) as plz from ....

As you can see the alias overwrites the original field of the select (in 
some of our cases it is way more complicated...:-().
Beginning with 1.16 (the XS-rewrite of fetchrow_hashref) this doesn't 
work anymore. The field 'plz' (or the like) is not overwritten with the 
result of the SQL-function call.
The reason for this is that the XS-implementation copies the fetched AV 
into the HV in reverse order. (while (--num_field) ... etc.)
This patch changes that to honor the original field order of the SQL 
result set (as was the case in 1.15).

The patch applies cleanly to DBI-1.20.

Regards,

Kay Roepke


Attachment: dbi-patch1.20
Description: Binary data

Reply via email to