From d4f708ee38b48d15c4a1a2f34e703ae37239d529 Mon Sep 17 00:00:00 2001 From: janw Date: Thu, 26 Feb 2009 15:26:46 +0000 Subject: [PATCH] Suite runs perfect. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13470 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/tests/sqlite-check-concurrency.pl | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gosa-si/tests/sqlite-check-concurrency.pl b/gosa-si/tests/sqlite-check-concurrency.pl index dfd258340..9f03c66c7 100755 --- a/gosa-si/tests/sqlite-check-concurrency.pl +++ b/gosa-si/tests/sqlite-check-concurrency.pl @@ -15,13 +15,14 @@ my %threads; my $count= 10; my $db_name= "./test.sqlite"; my $lock = $db_name.".si.lock"; -if(stat($lock)) { - unlink($lock); -} -if(stat($db_name)) { - unlink($db_name) -} +#if(stat($lock)) { +# unlink($lock); +#} +# +#if(stat($db_name)) { +# unlink($db_name) +#} for(my $i=0;$i<$count;$i++) { $threads{$i}= threads->create(\&check_database); @@ -68,7 +69,7 @@ sub unlock { sub run_test { my $self= shift; my $table_name= shift; - my $sql= "CREATE TABLE IF NOT EXISTS $table_name (id INTEGER, value VARCHAR(255))"; + my $sql= "CREATE TABLE IF NOT EXISTS $table_name (id INTEGER PRIMARY KEY, status VARCHAR(255) DEFAULT 'none')"; $self->lock(); eval { $self->{dbh}->do($sql); @@ -79,7 +80,7 @@ sub run_test { $self->unlock(); for(my $i=0;$i<100;$i++) { - $sql= "INSERT INTO $table_name VALUES ($i, 'test $i')"; + $sql= "INSERT INTO $table_name (id, status) VALUES (null, 'test $i')"; $self->lock(); eval { $self->{dbh}->do($sql); -- 2.30.2