our $join_offset = 0;
our $sth_join;
-our $join_more = 0;
sub join_table {
$sth_join = $dbh->prepare(qq{
$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();