Thanks a lot Stefan for checking this. I did try to run a query from insider Pentaho Data Integration (Kettle) and this is returning the correct figures. I don't have any other 3rd party query clients installed other than Squirrel and DBeaver which both show the same problem. Is there a parameter that I could pass on with the connection string for the encoding?


On Fri, May 10, 2013 at 2:38 PM, Stefan Manegold <Stefan.Manegold@cwi.nl> wrote:
MonetDB's JdbcClient seems to handle tinyint correctly:


$ java -jar jdbcclient.jar
Welcome to the MonetDB interactive JDBC terminal!
Database: MonetDB v11.15.7, 'demo'
Driver: MonetDB Native Driver v2.8 (Liberica 20130426 based on MCL v1.9)
Type \q to quit, \h for a list of available commands
auto commit mode: on
monetdb-> create table t (a tinyint);
Operation successful

monetdb-> \d t
CREATE TABLE "sys"."t" (
        "a" tinyint
);
monetdb-> insert into t values (1);
1 affected row

monetdb-> select * from t;
+--------+
| a      |
+========+
|      1 |
+--------+
1 row

monetdb->


Stefan

----- Original Message -----
> Thanks a lot Stefan and Fabian for your reply! I checked this in two
> clients so far: Squirrel and DBeaver, and in both I can see exactly
> the
> same behaviour. Later on I will try to test in a 3rd one.
> Best regards,
> Diethard
>
>
> On Fri, May 10, 2013 at 10:34 AM, Fabian Groffen <fabian@monetdb.org>
> wrote:
>
> > On 10-05-2013 11:13:48 +0200, Stefan Manegold wrote:
> > > Hi Diethard,
> > >
> > > too me, this looks as if the server (correctly) serializes the
> > > TINYINT
> > > (MonetDB internal type bte) into a string to ship it via MAPI,
> > > but then
> > the
> > > client (JDBC driver or Squirrel??) (incorrectly) does not parse
> > > the
> > receives
> > > string as TINYINY (single-byte integer), but rather simply
> > > interprets the
> > > first character of the received string as single-byte integer,
> > > thus '1'
> > > becomes 49, i.e., the ASCII code of '1'.
> > >
> > > Could you please file a bug report to keep us reminded that we
> > > need to
> > > investigate and (if it's indeed the JDBC driver) fix it.
> >
> > I recall having seen this before, then we couldn't find anything
> > and
> > assumed a SquirrelSQL bug.  I think it's easy to check the driver
> > (JDBC) does the right thing by using JdbcClient and verifying that
> > it
> > prints a number.  Maybe the mapping is incorrect at some place, but
> > I
> > can hardly imagine, unless our sources do type mapping at Char or
> > something.
> >
> > If someone wants to look, check MonetConnection, there should be a
> > giant
> > switch where the monet types (see MonetDriver, getJavaType or
> > something)
> > are mapped onto JDBC types according to the specs.  It should
> > return a
> > java.sql.TINYINT for this case.  If not, we need to figure out if
> > there's a clash somehow, or just a prehistoric bug.
> >
> > Thanks,
> > Fabian
> >
> > --
> > Fabian Groffen                              fabian@monetdb.org
> > column-store pioneer               http://www.monetdb.org/Home
> >
> > _______________________________________________
> > users-list mailing list
> > users-list@monetdb.org
> > http://mail.monetdb.org/mailman/listinfo/users-list
> >
> >
>
> _______________________________________________
> users-list mailing list
> users-list@monetdb.org
> http://mail.monetdb.org/mailman/listinfo/users-list
>

--
| Stefan.Manegold@CWI.nl | DB Architectures   (DA) |
| www.CWI.nl/~manegold/  | Science Park 123 (L321) |
| +31 (0)20 592-4212     | 1098 XG Amsterdam  (NL) |

_______________________________________________
users-list mailing list
users-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/users-list