Skip to content

Commit 422c377

Browse files
committed
Fix test t/50commit.t to use both InnoDB and MyISAM engines when available
1 parent a17189f commit 422c377

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

t/50commit.t

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ sub num_rows($$$) {
3939

4040
my $engines = $dbh->selectall_hashref('SHOW ENGINES', 'Engine');
4141
my $have_innodb = exists $engines->{InnoDB} && $engines->{InnoDB}->{Support} ne 'NO';
42+
my $have_myisam = exists $engines->{MyISAM} && $engines->{MyISAM}->{Support} ne 'NO';
43+
44+
plan tests => 1 + ($have_myisam ? 12 : 0) + ($have_innodb ? 22 : 0);
4245

4346
if ($have_innodb) {
44-
plan tests => 22;
4547

4648
ok $dbh->do("DROP TABLE IF EXISTS dbd_mysql_t50commit"), "drop table if exists dbd_mysql_t50commit";
4749
my $create =<<EOT;
@@ -100,15 +102,15 @@ EOT
100102
ok $dbh->do("DROP TABLE dbd_mysql_t50commit");
101103

102104
}
103-
else {
104-
plan tests => 13;
105+
106+
if ($have_myisam) {
105107

106108
ok $dbh->do("DROP TABLE IF EXISTS dbd_mysql_t50commit"), "drop table if exists dbd_mysql_t50commit";
107109
my $create =<<EOT;
108110
CREATE TABLE dbd_mysql_t50commit (
109111
id INT(4) NOT NULL default 0,
110112
name VARCHAR(64) NOT NULL default ''
111-
)
113+
) ENGINE=MyISAM
112114
EOT
113115

114116
ok $dbh->do($create), 'create dbd_mysql_t50commit';
@@ -154,5 +156,7 @@ EOT
154156
ok $got_warning, "Should be warning defined upon rollback of non-trx table";
155157

156158
ok $dbh->do("DROP TABLE dbd_mysql_t50commit");
157-
ok $dbh->disconnect();
159+
158160
}
161+
162+
ok $dbh->disconnect();

0 commit comments

Comments
 (0)