From: rettenbe Date: Wed, 16 Jan 2008 14:49:08 +0000 (+0000) Subject: bugfix: DBsqlite select_dbentry: correct sorting of the DB output X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c3b8fa14e5492bddd24fa766e3e82cddca7dd4ff;p=gosa.git bugfix: DBsqlite select_dbentry: correct sorting of the DB output git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8399 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index c103cda34..42a9703a7 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1061,12 +1061,12 @@ while(1) { # TODO exchange ROWID with jobid, insert column jobid in table jobs befor if ($error == 0) { - my $sql = "UPDATE '$job_queue_table_name' SET status='processing', targettag='$target' WHERE ROWID='$jobdb_id'"; + my $sql = "UPDATE '$job_queue_table_name' SET status='processing', targettag='$target' WHERE id='$jobdb_id'"; my $res = $job_db->exec_statement($sql); } else { my $update_hash = { table=>$job_queue_table_name, update=> [ { status=>'error' } ], - where=> [ { ROWID=>$jobdb_id } ], + where=> [ { id=>$jobdb_id } ], }; my $res = $job_db->update_dbentry($update_hash); } diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index 05946095c..20463d782 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -310,9 +310,9 @@ sub select_dbentry { } if (@select_list == 0) { - $sql_statement = "SELECT ROWID, * FROM '$table'"; + $sql_statement = "SELECT * FROM '$table'"; } else { - $sql_statement = "SELECT ROWID, * FROM '$table' WHERE ".join(' AND ', @select_list); + $sql_statement = "SELECT * FROM '$table' WHERE ".join(' AND ', @select_list); } # query db @@ -326,10 +326,8 @@ sub select_dbentry { my $answer = {}; my $hit_counter = 0; - foreach my $hit ( @{ $query_answer }) { $hit_counter++; - $answer->{ $hit_counter }->{ 'ROWID' } = shift @{ $hit }; for ( my $i = 0; $i < $list_len; $i++) { $answer->{ $hit_counter }->{ @{ $column_list }[$i] } = @{ $hit }[$i]; } diff --git a/gosa-si/modules/GosaPackages.pm b/gosa-si/modules/GosaPackages.pm index ffc99840c..31bd729a5 100644 --- a/gosa-si/modules/GosaPackages.pm +++ b/gosa-si/modules/GosaPackages.pm @@ -427,6 +427,7 @@ sub process_job_msg { sub db_res_2_xml { my ($db_res) = @_ ; + my $xml = ""; while ( my ($hit, $hash) = each %{ $db_res } ) {