remove $join_more
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 29 Jan 2010 18:30:01 +0000 (19:30 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 29 Jan 2010 18:30:01 +0000 (19:30 +0100)
dbi2mongo.pl

index faf4da7..369e930 100755 (executable)
@@ -58,7 +58,6 @@ print "import ",$sth->rows," from $table\n";
 
 our $join_offset = 0;
 our $sth_join;
-our $join_more = 0;
 
 sub join_table {
        $sth_join = $dbh->prepare(qq{
@@ -74,14 +73,13 @@ sub join_table {
        $sth_join->execute( $last_id );
        warn "# $table2 columns ",dump( $sth_join->{NAME} );
        print "join ",$sth_join->rows," from $table2 offset $join_offset limit $join_limit\n";
-       $join_more = $sth_join->rows == $join_limit ? 1 : 0;
 }
 
 our $row_join;
 
 sub fetch_row_join {
        $row_join = $sth_join->fetchrow_hashref();
-       if ( ! $row_join && $join_more ) {
+       if ( ! $row_join && $sth_join->rows == $join_limit ) {
                $join_offset += $join_limit;
                join_table;
                $row_join = $sth_join->fetchrow_hashref();