use strict;
-use warnings;
+use warnings;
use Test::More;
use lib qw(t/lib);
use DBICTest;
use DBI::Const::GetInfoType;
-use DBICTest::Stats;
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
-plan tests => 7;
+plan tests => 5;
my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
my $dbh = $schema->storage->dbh;
-my $stats = new DBICTest::Stats();
-$schema->storage->debugobj($stats);
-$schema->storage->debug(1);
$dbh->do("DROP TABLE IF EXISTS artist;");
-$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10)) ENGINE=InnoDB;");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10));");
#'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', '');
},
};
-$schema->txn_begin;
-
-my $arty = $schema->resultset('Artist')->find(1);
-
-my $name = $arty->name;
-
-$schema->storage->_svp_begin ("mysavepoint");
-
-$arty->update({ name => 'Jheephizzy' });
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', 'Jheephizzy', 'Name changed');
-
-$schema->storage->_svp_rollback ("mysavepoint");
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', $name, 'Name rolled back');
-
-$schema->txn_commit;
-
SKIP: {
my $mysql_version = $dbh->get_info( $GetInfoType{SQL_DBMS_VER} );
skip "Cannot determine MySQL server version", 1 if !$mysql_version;
use Test::More;
use lib qw(t/lib);
use DBICTest;
-use DBICTest::Stats;
{
package DBICTest::Schema::Casecheck;
plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
. ' (note: creates and drops tables named artist and casecheck!)' unless ($dsn && $user);
-plan tests => 34;
+plan tests => 32;
DBICTest::Schema->load_classes( 'Casecheck' );
-my $schema = DBICTest::Schema->connect($dsn, $user, $pass, { auto_savepoint => 1});
+my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
# Check that datetime_parser returns correctly before we explicitly connect.
SKIP: {
}
my $dbh = $schema->storage->dbh;
-my $stats = new DBICTest::Stats();
-$schema->storage->debugobj($stats);
-$schema->storage->debug(1);
-
$schema->source("Artist")->name("testschema.artist");
$schema->source("SequenceTest")->name("testschema.sequence_test");
$dbh->do("CREATE SCHEMA testschema;");
SKIP: {
skip "Oracle Auto-PK tests are broken", 16;
+
# test auto increment using sequences WITHOUT triggers
-
for (1..5) {
my $st = $schema->resultset('SequenceTest')->create({ name => 'foo' });
is($st->pkid1, $_, "Oracle Auto-PK without trigger: First primary key");
is($st->pkid1, 55, "Oracle Auto-PK without trigger: First primary key set manually");
}
-$schema->txn_begin;
-
-my $arty = $schema->resultset('Artist')->find(1);
-
-my $name = $arty->name;
-
-$schema->storage->_svp_begin ("mysavepoint");
-
-$arty->update({ name => 'Jheephizzy' });
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', 'Jheephizzy', 'Name changed');
-
-$schema->storage->_svp_rollback ("mysavepoint");
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', $name, 'Name rolled back');
-
-$schema->txn_commit;
-
END {
if($dbh) {
$dbh->do("DROP TABLE testschema.artist;");