From: francesco de biasio on
Hello all,
I'm writing a matlab program to insert data into a mysql5.0 table.
The table has a tinyint(1) field.
when inserting data into this field with fastinsert

code:
fastinsert(conn, 'test', {'test'}, {6; 7; 8});

I get this warning:
Warning: Value other than 0 or 1 converted to Java true:

>> fastinsert(conn, 'test', {'test'}, {6; 7; 8});
Warning: Value other than 0 or 1 converted to Java true
> In database.fastinsert at 147
??? Java exception occurred: ...

going to debug fastinsert.m, I found at line 144 a switch on the variable a(j).typeValue:
case -7
StatementObject.setBoolean(j,tmp) %BIT
case -6
StatementObject.setByte(j,tmp) %TINYINT
....

but looking at a(j) I get this answer:
K>> a(j)

ans =

fieldName: 'test'
typeName: 'TINYINT UNSIGNED'
typeValue: -7
....



I'm not deeply involved in matlab, java and sql, but as I understand, the typeValue of the data I'm inserting is -7, representing 'TINYINT UNSIGNED', while in the fastinsert switch statement the typeValue -7 is associated to boolean values (0/1), while tinyint are associated to typeValue -6.

Does anyone have any idea if it is a bug or I did something wrong?
workarounds?

Thank you
Francesco