summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e451bf4)
raw | patch | inline | side by side (parent: e451bf4)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 20 May 2011 12:49:36 +0000 (12:49 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 20 May 2011 12:49:36 +0000 (12:49 +0000) |
and abort recreate_fai_release_db and recreate_fai_server_db events if
create_table fails
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20891 594d385d-05f5-0310-b6e9-bd551577e9d8
create_table fails
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20891 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-si/modules/DBsqlite.pm | patch | blob | history | |
trunk/gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
index e6ec1048c289149ddeb576211a72b3b491c8b3a6..4b8f60a66762295dd3049c06bb570ccb4a20ee92 100644 (file)
my $col_names_string = join(", ", @col_names);
my $sql_statement = "CREATE TABLE IF NOT EXISTS $table_name ( $col_names_string )";
my $res = $self->exec_statement($sql_statement);
+ if ($@) {
+ &main::daemon_log("0 ERROR: CREATE TABLE IF NOT EXISTS $table_name failed", 1);
+ return 1;
+ }
# Add indices
if(defined($index_names_ref) and ref($index_names_ref) eq 'ARRAY') {
foreach my $index_name (@$index_names_ref) {
$self->exec_statement("CREATE ".(($index_name eq 'id')?'UNIQUE':'')." INDEX IF NOT EXISTS $index_name on $table_name ($index_name);");
+ if ($@) {
+ &main::daemon_log("0 ERROR: CREATE $index_name on $table_name failed", 1);
+ return 1;
+ }
}
}
diff --git a/trunk/gosa-si/server/events/gosaTriggered.pm b/trunk/gosa-si/server/events/gosaTriggered.pm
index 42f2189fcc24e71f71a13cd0cfcbe02c6e82c5da..d7ef85131a5be55d105bf993c19044a0a3b85ada 100644 (file)
my $res = $main::job_db->exec_statement($sql_statement);
}
- $main::fai_server_db->create_table("new_fai_server", \@main::fai_server_col_names);
+ my $res = $main::fai_server_db->create_table("new_fai_server", \@main::fai_server_col_names);
+ if ($res) {
+ return ( $out_msg );
+ }
&main::create_fai_server_db("new_fai_server",undef,"dont", $session_id);
$main::fai_server_db->move_table("new_fai_server", $main::fai_server_tn);
-
- my @out_msg_l = ( $out_msg );
- return @out_msg_l;
+
+ return ( $out_msg );
}
my $res = $main::job_db->exec_statement($sql_statement);
}
- $main::fai_release_db->create_table("new_fai_release", \@main::fai_release_col_names);
+ my $res = $main::fai_release_db->create_table("new_fai_release", \@main::fai_release_col_names);
+ if ($res) {
+ return ( $out_msg );
+ }
&main::create_fai_release_db("new_fai_release", $session_id);
$main::fai_release_db->move_table("new_fai_release", $main::fai_release_tn);
- my @out_msg_l = ( $out_msg );
- return @out_msg_l;
+ return ( $out_msg );
}