From 13cfdcb6f079726494bfe3b58c02dd9c96837d07 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Wed, 16 Mar 2016 09:48:02 -0700 Subject: [PATCH] Don't require autoincrement column in test. 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 --- t/svp_live.t | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/t/svp_live.t b/t/svp_live.t index 4ae32ce..5baf78c 100644 --- a/t/svp_live.t +++ b/t/svp_live.t @@ -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; @@ -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';