Code

Removed id handling.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 Apr 2008 07:38:24 +0000 (07:38 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 22 Apr 2008 07:38:24 +0000 (07:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10603 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/modules/DBsqlite.pm

index e845ef6d0ce1d743d3ac247cabbe3f2cda15f13d..075e6bbecf5dca06ebc0d837dfdcdda61ef4cbbe 100644 (file)
@@ -85,30 +85,6 @@ sub add_dbentry {
     if( 0 != @$primkeys ) {   # more than one primkey exist in list
         my @prim_list;
                foreach my $primkey (@$primkeys) {
-                       if($primkey eq 'id') {
-                               # if primkey is id, fetch max id from table and give new job id=  max(id)+1
-                               my $sql_statement = "SELECT MAX(CAST(id AS INTEGER)) FROM $table";
-                               my $max_id;
-                               eval {
-                                       $max_id = @{ @{ $self->{dbh}->selectall_arrayref($sql_statement) }[0] }[0];
-                               };
-                               if($@) {
-                                       $self->{dbh}->do("ANALYZE");
-                                       eval {
-                                               $max_id = @{ @{ $self->{dbh}->selectall_arrayref($sql_statement) }[0] }[0];
-                                       };
-                                       if($@) {
-                                               &main::daemon_log("ERROR: $sql_statement failed with $@", 1);
-                                       }
-                               }
-                               my $id;
-                               if( defined $max_id) {
-                                       $id = $max_id + 1;
-                               } else {
-                                       $id = 1;
-                               }
-                               $arg->{id} = $id;
-                       }
                        if( not exists $arg->{$primkey} ) {
                                return (3, "primkey '$primkey' has no value for add_dbentry");
                        }