Skip to content

Commit

Permalink
reworked bit-prepare test to not insert in reverse
Browse files Browse the repository at this point in the history
this is the 'sane' fix as recommended in
https://rt.cpan.org/Ticket/Display.html?id=102657

also added diagnostic output in t/10connect.t to show the default
storage engine for easier debugging.
  • Loading branch information
mbeijen committed Mar 12, 2015
1 parent f714a6c commit 6fe0a1d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2015-??-?? Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.032_01)
* Fixed test rt88006-bit-prepare on MyISAM storage
(Reported both in RT102657 and by Scimon on github)

2015-03-05 Patrick Galbraith, Michiel Beijen, DBI/DBD community (4.031)
* Added LICENSE
* Reworked installation documentation in POD.
Expand Down
4 changes: 4 additions & 0 deletions t/10connect.t
Expand Up @@ -47,6 +47,10 @@ like(

like($driver_ver, qr/^04\./, 'SQL_DRIVER_VER starts with "04." (update for 5.x)');

my $result = $dbh->selectall_arrayref('select @@storage_engine');
my $storage_engine = $result->[0]->[0] || 'unknown';
diag "Default storage engine is: $storage_engine";

my $info_hashref = $dbh->{mysql_dbd_stats};

ok($dbh->disconnect(), 'Disconnected');
Expand Down
6 changes: 3 additions & 3 deletions t/rt88006-bit-prepare.t
Expand Up @@ -31,9 +31,9 @@ EOT

ok $dbh->do($create),"create table for $scenario";

ok $dbh->do("INSERT INTO `dbd_mysql_rt88006_bit_prep` (`id_binary_test`, `flags`) VALUES (2, b'10'), (1, b'1')");
ok $dbh->do("INSERT INTO `dbd_mysql_rt88006_bit_prep` (`flags`) VALUES (b'10'), (b'1')");

my $sth = $dbh->prepare("SELECT id_binary_test,flags FROM dbd_mysql_rt88006_bit_prep ORDER BY id_binary_test ASC");
my $sth = $dbh->prepare("SELECT id_binary_test,flags FROM dbd_mysql_rt88006_bit_prep");
ok $sth->execute() or die("Execute failed: ".$DBI::errstr);
ok (my $r = $sth->fetchrow_hashref(), "fetchrow_hashref for $scenario");
is ($r->{id_binary_test}, 1, 'id_binary test contents');
Expand All @@ -43,7 +43,7 @@ TODO: {
}
ok $sth->finish;

ok $sth = $dbh->prepare("SELECT id_binary_test,BIN(flags) FROM dbd_mysql_rt88006_bit_prep ORDER BY id_binary_test ASC");
ok $sth = $dbh->prepare("SELECT id_binary_test,BIN(flags) FROM dbd_mysql_rt88006_bit_prep");
ok $sth->execute() or die("Execute failed: ".$DBI::errstr);
ok ($r = $sth->fetchrow_hashref(), "fetchrow_hashref for $scenario with BIN()");
is ($r->{id_binary_test}, 1, 'id_binary test contents');
Expand Down

0 comments on commit 6fe0a1d

Please sign in to comment.