From 1591f375b9ede4b6a9581bab5ea2d9c35e33837d Mon Sep 17 00:00:00 2001 From: Max Maischein Date: Fri, 3 Apr 2009 19:30:50 +0000 Subject: [PATCH] re-enable and fix t/70schemachange.t as per RT #43448 --- Changes | 3 +++ t/70schemachange.t | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 49b8f77..90f6c0f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension DBD-SQLite. +1.19_07 not released yet + - re-enable and fix t/70schemachange.t, as per RT #43448 (CORION) + 1.19_06 Sat 4 Apr 2009 - Fixed a segv with an error function under x86 linux (and hopefully Mac OSX). (TOKUHIROM) diff --git a/t/70schemachange.t b/t/70schemachange.t index 74bc24e..d599635 100644 --- a/t/70schemachange.t +++ b/t/70schemachange.t @@ -8,10 +8,10 @@ BEGIN { use t::lib::Test; -if ($^O eq 'MSWin32') { - print "1..0 # Skip changing active database's schema doesn't work under Windows\n"; - exit 0; -} +#if ($^O eq 'MSWin32') { +# print "1..0 # Skip changing active database's schema doesn't work under Windows\n"; +# exit 0; +#} do 't/lib.pl'; if ($@) { @@ -64,6 +64,10 @@ while (Testing()) { die("fork: $!"); } elsif ($pid == 0) { # Child: drop the second table + if ($^O =~ /win32/i) { + # sqlite prohibits thread sharing parent connection + $dbh = DBI->connect("DBI:SQLite:dbname=foo", '', ''); + } if (!$state) { $dbh->do("DROP TABLE $table2") or DbiError($dbh->err, $dbh->errstr); @@ -74,7 +78,12 @@ while (Testing()) { } # Parent: wait for the child to finish, then attempt to use the database - Test(waitpid($pid, 0) >= 0) or print("waitpid: $!\n"); + Test(waitpid($pid, 0) != -1) or print("waitpid: $!\n"); + + if ($^O =~ /win32/i) { + # schema changed, need to reconnect + $dbh = DBI->connect("DBI:SQLite:dbname=foo", '', ''); + } Test($state or $dbh->do("DROP TABLE $table1")) or DbiError($dbh->err, $dbh->errstr);