Actions
Bug #4225
closedProvenance - start auto-incremented IDs at 1 not 0
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
Actions