You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Date: 2016-06-27 11:24:33 +0200
From: Erik Berglund <<erik.berglund>>
To: clients devs <>
Version: 11.23.3 (Jun2016)
Last updated: 2016-07-22 09:56:10 +0200
Comment 22211
Date: 2016-06-27 11:24:33 +0200
From: Erik Berglund <<erik.berglund>>
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
Build Identifier:
When requesting the result of a query as an object, the JDBC driver returns TINYINT fields as String objects instead of, for example Short or Integer objects.
Reproducible: Always
Steps to Reproduce:
Java code to replicate:
Connection c = ...
PreparedStatement ps = c.prepareStatement("create table foo (bar tinyint)");
ps.execute();
ps.close();
ps = c.prepareStatement("insert into foo (bar) values(99)");
ps.execute();
ps.close();
ps = c.prepareStatement("select bar from foo");
ResultSet rs = ps.executeQuery();
if(rs.next())
{
//causes exception:
Short value = (Short) rs.getObject(1);
}
ps.close();
ps = c.prepareStatement("drop table foo ");
ps.execute();
ps.close();
Actual Results:
Instead of returning an object of an integer class (Integer, Short, or Long) the driver returns a String object with the result encoded as text.
Expected Results:
The driver should return a type that as closely matches the type of the database column as possible.
This happens every time on 32 bit windows 7, but only intermittently on 64-bit Ubuntu 16.04 with the MonetDB version included in that distribution's repository (Jun2016).
Added missing case for type == Short.class which is needed for SQL smallint and tinyint columns.
Added Java test program Test_PSgetObject.
This fixes bug #4026.
Also improved handling of getObject(int colnr, Map<String,Class<?>> map) input arguments.
When colnr is invalid it now throws a proper SQLException.
When map is null it falls back to internal default mapping as defined in getClassForType().
Date: 2016-06-27 11:24:33 +0200
From: Erik Berglund <<erik.berglund>>
To: clients devs <>
Version: 11.23.3 (Jun2016)
Last updated: 2016-07-22 09:56:10 +0200
Comment 22211
Date: 2016-06-27 11:24:33 +0200
From: Erik Berglund <<erik.berglund>>
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
Build Identifier:
When requesting the result of a query as an object, the JDBC driver returns TINYINT fields as String objects instead of, for example Short or Integer objects.
Reproducible: Always
Steps to Reproduce:
Java code to replicate:
Connection c = ...
PreparedStatement ps = c.prepareStatement("create table foo (bar tinyint)");
ps.execute();
ps.close();
ps = c.prepareStatement("insert into foo (bar) values(99)");
ps.execute();
ps.close();
ps = c.prepareStatement("select bar from foo");
ResultSet rs = ps.executeQuery();
if(rs.next())
{
//causes exception:
Short value = (Short) rs.getObject(1);
}
ps.close();
ps = c.prepareStatement("drop table foo ");
ps.execute();
ps.close();
Actual Results:
Instead of returning an object of an integer class (Integer, Short, or Long) the driver returns a String object with the result encoded as text.
Expected Results:
The driver should return a type that as closely matches the type of the database column as possible.
This happens every time on 32 bit windows 7, but only intermittently on 64-bit Ubuntu 16.04 with the MonetDB version included in that distribution's repository (Jun2016).
Comment 22219
Date: 2016-06-30 16:03:33 +0200
From: MonetDB Mercurial Repository <>
Changeset ac8dddcdeaf5 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.
For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=ac8dddcdeaf5
Changeset description:
Comment 22233
Date: 2016-07-05 16:38:06 +0200
From: @sjoerdmullender
I understand the commit fixed the problem.
The text was updated successfully, but these errors were encountered: