Skip to content

Commit

Permalink
Don't require autoincrement column in test.
Browse files Browse the repository at this point in the history
It just makes it difficult for Firebird, and likely other databases, and is
just not necessary for the purposes of the test. Instead, use an explicit ID
value. This allows us to avoid all the generator stuff on Firebird, as I ran
into an issue where it would die on `DROP GENERATOR`, because the first time I
ran it there was no generator to drop!x
  • Loading branch information
theory committed Mar 16, 2016
1 parent 360432e commit 13cfdcb
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions t/svp_live.t
Expand Up @@ -27,16 +27,7 @@ if (exists $ENV{DBICTEST_DSN}) {
} elsif ($driver eq 'Firebird') {
@table_sql = (
q{RECREATE TABLE artist (id INTEGER, name VARCHAR(100))},
q{DROP GENERATOR g_artist_id},
q{CREATE GENERATOR g_artist_id},
q{CREATE TRIGGER t_artist_id FOR artist
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.id IS NULL OR NEW.id = 0) THEN
NEW.id = GEN_ID(g_artist_id, 1);
END
});
);
# } elsif ($driver eq 'mysql') {
# @table_sql = (q{
# DROP TABLE IF EXISTS artist;
Expand All @@ -57,12 +48,13 @@ ok my $conn = DBIx::Connector->new($dsn, $user, $pass, {
PrintError => 0,
RaiseError => 1,
}), 'Get a connection';
diag "Connecting to $dsn";
ok my $dbh = $conn->dbh, 'Get the database handle';
isa_ok $dbh, 'DBI::db', 'The handle';

$dbh->do($_) for (
@table_sql,
"INSERT INTO artist (name) VALUES('foo')",
"INSERT INTO artist (id, name) VALUES(1, 'foo')",
);

pass 'Table created';
Expand Down

0 comments on commit 13cfdcb

Please sign in to comment.