BIT data type not supported
When using BIT(1) as storage type for boolean value, all values retrieved from node-mariasql are empty string ("") no matter what the real value is (1 or 0).
The fix is at binding.cc, we should check the field type ( field.type == MYSQL_TYPE_BIT ) and then:
if(fields[f].type == MYSQL_TYPE_BIT){
field_value = Nan::New( *(const unsigned char*)(dbrow[f]) );
}
Of course the above fix only works for BIT length <=8, the maximum BIT length can be 64 ( up to 8 bytes ).
It works fine after the fix is applied, the value returned is 1 for true and 0 for false, otherwise to fetch the BIT(1) value, I have to cast it to integer at SQL level:
SELECT CAST( BitField AS unsigned integer) AS BitFieldV FROM DEMO;
I have faced the same issue with the column which I defined as bool. When I checked the column type it looks bit and mariasql says that the result is
""
(an empty string) even though the value is true