From: rettenbe Date: Fri, 18 Apr 2008 12:48:53 +0000 (+0000) Subject: bugfix: recreate fai_release_db X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d153401dbb614f0838e7a4e0c3d8c8f2a0870dc8;p=gosa.git bugfix: recreate fai_release_db git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10558 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index fce69ae0b..e900c5b38 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1090,7 +1090,10 @@ sub process_task { if ( 0 < @{$answer_l} ) { my $answer_str = join("\n", @{$answer_l}); daemon_log("$session_id DEBUG: $module: Got answer from module: \n".$answer_str,8); + } else { + daemon_log("$session_id DEBUG: $module: Got no answer from module!" ,8); } + } if( !$answer_l ) { $error++ }; @@ -1359,6 +1362,7 @@ sub watch_for_new_messages { my $message_to = @{$hit}[3]; # translate message_to to plain login name +# TODO implement reciever translation my @reciever_l = ($message_to); my $message_id = @{$hit}[0]; @@ -1724,7 +1728,7 @@ sub create_fai_release_db { daemon_log("$session_id DEBUG: Inserting ".scalar @sql_list." entries to DB",8); if(@sql_list) { - unshift @sql_list, "DELETE FROM $table_name"; + unshift @sql_list, "DELETE FROM $table_name"; # at first, clear db $fai_release_db->exec_statementlist(\@sql_list); } daemon_log("$session_id DEBUG: Done with inserting",6); diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index 2b260dac1..10472f00b 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -38,8 +38,7 @@ sub create_table { my $col_names_ref = shift; my $col_names_string = join(", ", @{$col_names_ref}); my $sql_statement = "CREATE TABLE IF NOT EXISTS $table_name ($col_names_string )"; - - $self->{dbh}->do($sql_statement); + my $res = $self->{dbh}->do($sql_statement); return 0; } @@ -219,6 +218,7 @@ sub exec_statementlist { my $sql_list = shift; my @db_answer; + $self->{dbh}->do("ANALYZE"); foreach my $sql (@$sql_list) { @db_answer = @{$self->{dbh}->selectall_arrayref($sql)}; } diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 8e521749b..bb4828eea 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -234,9 +234,9 @@ sub recreate_fai_release_db { my $res = $main::job_db->exec_statement($sql_statement); } - $main::fai_server_db->create_table("new_fai_release", \@main::fai_release_col_names); + $main::fai_release_db->create_table("new_fai_release", \@main::fai_release_col_names); &main::create_fai_release_db("new_fai_release", $session_id); - $main::fai_server_db->move_table("new_fai_release", $main::fai_release_tn); + $main::fai_release_db->move_table("new_fai_release", $main::fai_release_tn); my @out_msg_l = ( $out_msg ); return @out_msg_l; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index cc9e1b31e..1c40df4f6 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -77,12 +77,12 @@ if($sock->connected()){ ################## # recreate fai dbs #$data = "
gosa_recreate_fai_server_db
GOSA GOSA
"; -#$data = "
gosa_recreate_fai_release_db
GOSA GOSA
"; +$data = "
gosa_recreate_fai_release_db
GOSA GOSA
"; #$data = "
gosa_recreate_packages_list_db
GOSA GOSA
"; ########### # messaging -$data = "
gosa_send_user_msg
GOSA GOSA eine wichtige nachricht me you 20130101235959 kaffeepause
"; +#$data = "
gosa_send_user_msg
GOSA GOSA eine wichtige nachricht admin rettenbe 20130101235959 kaffeepause
"; ################