Commit e45199af authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: no hope for other DBD drivers to support detection of...

bugfix: no hope for other DBD drivers to support detection of auto-incrementing fields => use our inernal fixed rule
parent 95b1f35f
......@@ -124,8 +124,8 @@ sub CreateNewJob {
-prev_job_id => $prev_job_id,
-analysis_id => $analysis_id,
-input_id => $input_id,
-param_id_stack => $param_id_stack,
-accu_id_stack => $accu_id_stack,
-param_id_stack => $param_id_stack || '',
-accu_id_stack => $accu_id_stack || '',
-status => $job_status,
-semaphore_count => $semaphore_count,
-semaphored_job_id => $semaphored_job_id,
......
......@@ -175,21 +175,19 @@ sub _table_info_loader {
my $sth = $dbh->column_info(undef, undef, $table_name, '%');
$sth->execute();
while (my $row = $sth->fetchrow_hashref()) {
my ($position, $name, $type, $is_ai) = @$row{'ORDINAL_POSITION','COLUMN_NAME', 'TYPE_NAME', 'mysql_is_auto_increment'};
my ($position, $column_name, $column_type, $is_ai) = @$row{'ORDINAL_POSITION','COLUMN_NAME', 'TYPE_NAME', 'mysql_is_auto_increment'};
$column_set{$name} = 1;
$name2type{$name} = $type;
if($is_ai) {
$autoinc_id = $name;
$column_set{$column_name} = 1;
$name2type{$column_name} = $column_type;
if( $is_ai # careful! This is only supported by DBD::mysql and will not work with other drivers
or ($column_name eq $table_name.'_id')
or ($table_name eq 'analysis_base' and $column_name eq 'analysis_id') ) { # a special case (historical)
$autoinc_id = $column_name; # careful! This is only supported by DBD::mysql and will not work with other drivers
}
}
$sth->finish;
if( ($driver ne 'mysql')
and scalar(@primary_key)==1 and (uc($name2type{$primary_key[0]}) eq 'INTEGER') ) {
$autoinc_id = $primary_key[0];
}
$self->column_set( \%column_set );
$self->primary_key( \@primary_key );
$self->autoinc_id( $autoinc_id );
......
......@@ -595,6 +595,17 @@ sub run {
-batch_size => $batch_size,
-hive_capacity => $hive_capacity,
-status => $blocked ? 'BLOCKED' : 'EMPTY', # be careful, as this "soft" way of blocking may be accidentally unblocked by deep sync
-total_job_count => 0,
-semaphored_job_count => 0,
-ready_job_count => 0,
-done_job_count => 0,
-failed_job_count => 0,
-num_running_workers => 0,
-num_required_workers => 0,
-behaviour => 'STATIC',
-input_capacity => 4,
-output_capacity => 4,
-sync_lock => 0,
);
$analysis_stats_adaptor->store($stats);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment