Skip to content
Browse files

[SQLite] fix return value of .rows

  • Loading branch information...
1 parent fc92638 commit eac13ca8be4ba777cedaa978ff81b7abf1a227d8 @moritz moritz committed Apr 26, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/MiniDBD/SQLite.pm6
View
6 lib/MiniDBD/SQLite.pm6
@@ -117,7 +117,8 @@ class MiniDBD::SQLite::StatementHandle does MiniDBD::StatementHandle {
method rows() {
die 'Cannot determine rows of closed connection' unless $!conn.DEFINITE;
- sqlite3_changes($!conn);
+ my $rows = sqlite3_changes($!conn);
+ $rows == 0 ?? '0E0' !! $rows;
}
method fetchrow_array {
@@ -170,7 +171,8 @@ class MiniDBD::SQLite::Connection does MiniDBD::Connection {
method rows() {
die 'Cannot determine rows of closed connection' unless $!conn.DEFINITE;
- sqlite3_changes($!conn);
+ my $rows = sqlite3_changes($!conn);
+ $rows == 0 ?? '0E0' !! $rows;
}
method selectrow_arrayref(Str $statement, $attr?, *@bind is copy) {

0 comments on commit eac13ca

Please sign in to comment.
Something went wrong with that request. Please try again.