Bug #4225
closedProvenance - start auto-incremented IDs at 1 not 0
0%
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
Updated by ben leinfelder over 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).