ZF-4361: BIT data type support in Zend_Db classes for MySQL
At the moment, in order to represent values to be stored in a BIT column of a MySQL database table, use of Zend_Db_Expr is required. It would be a nice improvement if support for this was added, for example in Zend_Db_Table so that binary values are properly escaped for columns designated as using the BIT data type in the table schema. More information on the data type and syntax to escape it is available in Section 10.2 Numeric Types of the MySQL manual. Specific relevant passages are cited below.
"As of MySQL 5.0.3, a BIT data type is available for storing bit-field values. (Before 5.0.3, MySQL interprets BIT as TINYINT(1).) In MySQL 5.0.3, BIT is supported only for MyISAM. MySQL 5.0.5 extends BIT support to MEMORY, InnoDB, BDB, and NDBCLUSTER."
"As of MySQL 5.0.3, the BIT data type is used to store bit-field values. A type of BIT(M) allows for storage of M-bit values. M can range from 1 to 64.
To specify bit values, b'value' notation can be used. value is a binary value written using zeros and ones. For example, b'111' and b'10000000' represent 7 and 128, respectively. See Section 8.1.5, "Bit-Field Values".
If you assign a value to a BIT(M) column that is less than M bits long, the value is padded on the left with zeros. For example, assigning a value of b'101' to a BIT(6) column is, in effect, the same as assigning b'000101'. "