Use only the
- Code: Select all Expand view RUN
function MYSQL_TinyIntAsLogical( .t. / .f. ) --> lPrevStatus
to set or reset the status.
Rowset remembers the status applicable for that table in its DATA lTinyIntAsLogical. We should not change it.
Global default is .F. and we recommend keeping it as .F.
Behavior when MYSQL_TinyIntAsLogical() is set to .F. :
(Default and Recommended)1) When a table is created, logical fields are created as fields of BIT type.
2) When a table is read (i.e., when a rowset is read) BIT type fields are read as Boolean and TinyInteger fields are read as integers. Rowset object remembers the setting when it reads the table from the server and uses the same setting throughout the life of that recordset.
Behavior when MYSQL_TinyIntAsLogical() is set to .T. :
1) When a table is created, logical fields are created as fields of TINYINTEGER type.
2) When a table is read (i.e., when a rowset is read) BIT type fields and also TINYINTEGER fields are read as Boolean. Rowset object remembers the setting when it reads the table from the server and uses the same setting throughout the life of that recordset.
So, set MYSQL_TinyIntAsLogical( .t. / .f. ) once globally at the beginning of the program, depending on your personal choice and leave it.