[Bio] / FigKernelPackages / DBrtns.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/DBrtns.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20, Fri Jun 24 21:40:16 2005 UTC revision 1.25, Tue Jan 3 20:52:38 2006 UTC
# Line 1  Line 1 
1    #
2    # Copyright (c) 2003-2006 University of Chicago and Fellowship
3    # for Interpretations of Genomes. All Rights Reserved.
4    #
5    # This file is part of the SEED Toolkit.
6    #
7    # The SEED Toolkit is free software. You can redistribute
8    # it and/or modify it under the terms of the SEED Toolkit
9    # Public License.
10    #
11    # You should have received a copy of the SEED Toolkit Public License
12    # along with this program; if not write to the University of Chicago
13    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14    # Genomes at veronika@thefig.info or download a copy from
15    # http://www.theseed.org/LICENSE.TXT.
16    #
17    
18  package DBrtns;  package DBrtns;
19    
20      # Inherit the DBKernel methods. We must do this BEFORE the "use strict".      # Inherit the DBKernel methods. We must do this BEFORE the "use strict".
# Line 32  Line 49 
49  =cut  =cut
50    
51  sub get_inserted_id {  sub get_inserted_id {
52      my($self, $table, $sth) = @_;      my($self, $table, $sth, $id_column) = @_;
53    
54        $id_column = 'id' unless defined($id_column);
55      if ($self->{_dbms} eq "Pg") {      if ($self->{_dbms} eq "Pg") {
56          my $oid = $sth->{pg_oid_status};          my $oid = $sth->{pg_oid_status};
57          my $ret = $self->SQL("select id from $table where oid = ?", undef, $oid);          my $ret = $self->SQL("select $id_column from $table where oid = ?", undef, $oid);
58          return $ret->[0]->[0];          return $ret->[0]->[0];
59      } elsif ($self->{_dbms} eq "mysql") {      } elsif ($self->{_dbms} eq "mysql") {
60          my $id = $self->{_dbh}->{mysql_insertid};          my $id = $self->{_dbh}->{mysql_insertid};
61          # print "mysql got $id\n";          # print "mysql got $id\n";
62          return $id;          return $id;
63      }      }
64        else
65        {
66            confess "Attempting get_inserted_id on unsupported database $self->{_dbms}\n";
67        }
68  }  }
69    
70  #  #
# Line 170  Line 193 
193      push(@opts, "--old-password");      push(@opts, "--old-password");
194      push(@opts, "--max-allowed-packet=128M");      push(@opts, "--max-allowed-packet=128M");
195      #      #
196        # Use InnoDB for large-table support and allegedly better performance.
197        #
198    
199        #push(@opts, "--default-table-type=innodb");
200    
201        #
202      # Oddly, this doesn't seem to work. need to set the environment variable.      # Oddly, this doesn't seem to work. need to set the environment variable.
203      #      #
204      #push(@opts, "--port=$FIG_Config::dbport");      #push(@opts, "--port=$FIG_Config::dbport");
# Line 185  Line 214 
214      #      #
215    
216      my $exe = "$FIG_Config::ext_bin/mysqld_safe";      my $exe = "$FIG_Config::ext_bin/mysqld_safe";
217    
218        print "Start $exe @opts\n";
219      if (! -x $exe)      if (! -x $exe)
220      {      {
221          $exe = "mysqld_safe";          $exe = "mysqld_safe";

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.25

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3