When a ResultSet contains multiple columns which are equal when ignoring the case the Map returned by JdbcTemplate#queryForMap contains the value of the last column with the equal name. As an example think of the following query:
SELECT 1 as "X", 2 as "x"
from dual
However the specification of ResultSet states that
Column names used as input to getter methods are case insensitive. When a getter method is called with a column name and several columns have the same name, the value of the first matching column will be returned.
Affects: 5.0.4
Issue Links:
#21465 LinkedCaseInsensitiveMap should explicitly implement putIfAbsent and computeIfAbsent
Referenced from: pull request #1739, and commits 7bce750
The text was updated successfully, but these errors were encountered:
We have a similar case in TableMetaDataContext.matchInParameterValuesWithInsertColumns where we currenty use the last case-insensitive key match in the user-provided Map... where we should stop after the first match and proceed with it instead. I'll fix that one for 5.1 as well.
Philippe Marschall opened SPR-16578 and commented
When a ResultSet contains multiple columns which are equal when ignoring the case the Map returned by
JdbcTemplate#queryForMap
contains the value of the last column with the equal name. As an example think of the following query:However the specification of ResultSet states that
Affects: 5.0.4
Issue Links:
Referenced from: pull request #1739, and commits 7bce750
The text was updated successfully, but these errors were encountered: