From: janw Date: Tue, 22 Jan 2008 09:42:54 +0000 (+0000) Subject: id was ordered as string - cast it to int X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b8a17e241dc21e3565ad6d180a567c9932355d12;p=gosa.git id was ordered as string - cast it to int now more than 10 jobs are possible... git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8532 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/DBsqlite.pm b/gosa-si/modules/DBsqlite.pm index 20463d782..5eede46f6 100644 --- a/gosa-si/modules/DBsqlite.pm +++ b/gosa-si/modules/DBsqlite.pm @@ -7,6 +7,7 @@ use DBI; use Data::Dumper; use threads; use Time::HiRes qw(usleep); +use POE qw(Component::EasyDBI); my $col_names = {}; @@ -96,7 +97,7 @@ sub add_dbentry { # if primkey is id, fetch max id from table and give new job id= max(id)+1 if ($primkey eq 'id') { my $id; - my $sql_statement = "SELECT MAX(id) FROM $table"; + my $sql_statement = "SELECT MAX(CAST(id AS INTEGER)) FROM $table"; &create_lock($self,'add_dbentry'); my $max_id = @{ @{ $self->{dbh}->selectall_arrayref($sql_statement) }[0] }[0]; &remove_lock($self,'add_dbentry');