Project

General

Profile

Actions

Bug #4225

closed

Provenance - start auto-incremented IDs at 1 not 0

Added by ben leinfelder almost 15 years ago. Updated almost 15 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
provenance
Target version:
Start date:
07/06/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
4225

Description

I inadvertently noticed that when I queried for the last execution of a workflow that never ran I was still getting back a valid execution id (namely 0).
The method description for resultSet.getInt(int) says that if if receives a SQL null it will return 0. This is happening in provenance. I think the best solution would be to start the IDs at 1 so as to never have ambiguity about whether there is actually a result or not. The alternative is to add this to any code that might encounter ids with value=0:

Object obj = result.getObject(1);
if (obj == null) {
return -1;
}
return result.getInt(1);


Related issues

Blocked by Kepler - Bug #4227: Provenance - use Integer return type in Queryable interfaceResolvedDaniel Crawl07/07/2009

Actions
Actions #1

Updated by ben leinfelder almost 15 years ago

Dan changed the auto-increment start for HSQLDB to be 1. Works great.
Merged from trunk to our sanparks branch

There was talk of changing the Queryable interface to use Integer return types so that NULL could be encountered when no rows where found. This is a larger undertaking in terms of a refactor and should be in another bug (closing this one).

Actions #2

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 4225

Actions

Also available in: Atom PDF