Bug in Sybase::BLK

Michael Peppler <[email protected]> Wed, 05 Dec 2007 20:11:32 +0100
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Organization Peppler Consulting SaRL
Message-ID <[email protected]>
There is a bug in Sybase::BLK that shows up in certain circumstances 
when it is used against a 15.0.2 or later ASE.

Because the system tables now use DOL locking, there is no implicit 
order of returned rows, so the query that fetches the columns and the 
data types of the target table can return data in the wrong order.

Here is a patch:

$ diff -c BLK.pm~ BLK.pm
*** BLK.pm~     Sun Mar 20 20:50:59 2005
--- BLK.pm      Wed Dec  5 10:05:12 2007
***************
*** 669,674 ****
--- 669,675 ----
   from $db.dbo.syscolumns c, $db.dbo.systypes t
   where c.id = object_id('$db.$user.$table')
   and   c.usertype *= t.usertype
+ order by c.colid
   ", "ARRAY");

       return [ @arr ];


Michael
-- 
Michael Peppler           -                 Peppler Consulting SaRL
[email protected]      -                  http://www.peppler.org
Sybase DBA/Developer      -   TeamSybase: http://www.teamsybase.com
Sybase on Linux FAQ       -   http://www.peppler.org/FAQ/linux.html