return the actual value for TINY fields - let the caller coerce into bool

This commit is contained in:
Brian Lopez 2010-04-02 16:32:18 -07:00
parent 9482ca36d6
commit 6c76cbbda0

View File

@ -142,12 +142,6 @@ static VALUE rb_mysql_result_fetch_row(int argc, VALUE * argv, VALUE self) {
val = Qnil; val = Qnil;
break; break;
case MYSQL_TYPE_TINY: // TINYINT field case MYSQL_TYPE_TINY: // TINYINT field
if (row[i] == 0 || 0 == memcmp("0", row[i], fieldLengths[i])) {
val = Qfalse;
} else {
val = Qtrue;
}
break;
case MYSQL_TYPE_BIT: // BIT field (MySQL 5.0.3 and up) case MYSQL_TYPE_BIT: // BIT field (MySQL 5.0.3 and up)
case MYSQL_TYPE_SHORT: // SMALLINT field case MYSQL_TYPE_SHORT: // SMALLINT field
case MYSQL_TYPE_LONG: // INTEGER field case MYSQL_TYPE_LONG: // INTEGER field