Subject: | DBIx::Class::Storage::DBI::Sybase::ASE::update/_update_blobs bug |
On updating a Sybase ASE blob column, I get error message like below,
DBIx::Class::Row::update(): Can't update XXX=HASH(0x50912a8): row not found at xxx
I did some investigation and I think it's a bug in DBIx::Class::Storage::DBI::Sybase::ASE.
The "row not found" error message comes from https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/lib/DBIx/Class/Row.pm#L558. There it checks the return value of storage class's update() method, that is called several lines above, at https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/lib/DBIx/Class/Row.pm#L552
And for DBIx::Class::Storage::DBI::Sybase::ASE, its update() method processes the blob columns in a different way from the non-blob columns. In my case where I update just a single blob column, it would get out of update() from https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm#L490, where $rv is obtained from _update_blobs() at https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm#L472
And if we look at _update_blobs() https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082840/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm#L747, we see it does not have an explicit return. This would cause $rv in DBIx::Class::Storage::DBI::Sybase::ASE::update() and $rows in DBIx::Class::Row::update() to be a false value.
IMHO the fix can be return @pks_to_update from DBIx::Class::Storage::DBI::Sybase::ASE::_update_blobs()