cvsuser 03/06/13 09:20:49
Modified: App-Repository/lib/App/Repository MySQL2.pm
Log:
fix auto_id bug
Revision Changes Path
1.2 +5 -2 p5ee/App-Repository/lib/App/Repository/MySQL2.pm
Index: MySQL2.pm
===================================================================
RCS file: /cvs/public/p5ee/App-Repository/lib/App/Repository/MySQL2.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- MySQL2.pm 19 May 2003 17:41:15 -0000 1.1
+++ MySQL2.pm 13 Jun 2003 16:20:49 -0000 1.2
@@ -1,12 +1,12 @@
######################################################################
-## File: $Id: MySQL2.pm,v 1.1 2003/05/19 17:41:15 spadkins Exp $
+## File: $Id: MySQL2.pm,v 1.2 2003/06/13 16:20:49 spadkins Exp $
######################################################################
use App::Repository::MySQL;
package App::Repository::MySQL2;
-$VERSION = do { my @r=(q$Revision: 1.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
+$VERSION = do { my @r=(q$Revision: 1.2 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
@ISA = ( "App::Repository::MySQL" );
@@ -38,7 +38,10 @@
# TODO: make it work with PK bigger than one column
$pk_column = $tabledef->{primary_key};
- if (ref($pk_column) eq "ARRAY") {
+ if ($pk_column) {
+ if (!ref($pk_column)) {
+ $pk_column = [ $pk_column ];
+ }
if ($#$pk_column eq 0) {
$pk_column = $pk_column->[0];
$auto_id = $tabledef->{column}{$pk_column}{auto_id};