Bit field default value
In previous version of Heidisql(8.3) Create statement of table containing bit value
`Active` BIT(1) NOT NULL DEFAULT b'0', or `Active` BIT(1) NOT NULL DEFAULT b'1',
Now the default value of BIT(1) filed is '' that is
`Active` BIT(1) NOT NULL DEFAULT b'',
with this statement if I execute the create statement it shows an sql error Invalid default value for 'Active'
please do the rest
Thank you in advance
To reproduce, create this table:
CREATE TABLE `test` (
`test_bit` BIT(1) NULL DEFAULT b'1'
Then go look at the Default column for test_bit in the main editor.
Bit fields are still buggy in general. They still cannot display more than 8 bits, and if a 16 bit value is set to '1 000 000 00' (9th bit set), it is displayed as '11.111.101', which is obviously not the same/actual value.
When editing the BIT field, the following is logged by HeidiSQL:
`ALTER TABLE `ordersystem_order`
CHANGE COLUMN `enabled` `enabled` BIT(1) NOT NULL DEFAULT b'1' COMMENT 'Test Comment' AFTER `id`;`
But when I look at the table fields or the create code, no default value or comment:
`CREATE TABLE `ordersystem_order` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`enabled` BIT(1) NOT NULL DEFAULT b'',`
P.S. I'm using the latest build, 4949.
I encouter the BIT problem still in this build. It's not possible to save a BIT field if default is other than NULL. It first looks like it's saving 0 or 1 (true or false). After save, default does not display the set value and the comment is erased. Try to reenter comment shows error message Invalide default value.
Storing data 0 or 1 (true or false) however works as expected.
Please login to leave a reply, or register at first.