Error reporting issue in SimpleParameterList
| От | |
|---|---|
| Тема | Error reporting issue in SimpleParameterList |
| Дата | |
| Msg-id | B998A44C8986644EA8029CFE6396A9246F4C9D@exqld2-bne.nexus.csiro.au обсуждение исходный текст |
| Ответы |
Re: Error reporting issue in SimpleParameterList
|
| Список | pgsql-jdbc |
Hi,
In org.postgresql.core.v3.SimpleParameterList there is the following code:
void setResolvedType(int index, int oid) {
// only allow overwriting an unknown value
if (paramTypes[index-1] == Oid.UNSPECIFIED) {
paramTypes[index-1] = oid;
} else if (paramTypes[index-1] != oid) {
throw new IllegalArgumentException("Can't change resolved type for param: " + index + " from " + paramTypes[index] + " to " + oid);
}
}
// only allow overwriting an unknown value
if (paramTypes[index-1] == Oid.UNSPECIFIED) {
paramTypes[index-1] = oid;
} else if (paramTypes[index-1] != oid) {
throw new IllegalArgumentException("Can't change resolved type for param: " + index + " from " + paramTypes[index] + " to " + oid);
}
}
In the throw statement, paramTypes[index] should be paramTypes[index-1]. (This was a little confusing until we spotted it).
It's possible the message could be more explanatory as well, would something like "Param " + index + " type mismatch - expected " + getNameForOid(oid) + " but was bound to " + getNameForOid(paramTypes[index-1]) make sense?
Cheers,
Nathan
В списке pgsql-jdbc по дате отправления: