DBAL-565: MySQL 5.6, Doctrine\DBAL\DBALException: Unknown database type bit requested. #1775

Closed
doctrinebot opened this Issue Jul 22, 2013 · 3 comments

2 participants

@doctrinebot

Jira issue originally created by user thinkscape:

Given the following db table connected with an ORM entity:

CREATE TABLE `foo` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `bitField` bit(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Running something like orm:validate-schema will result in the following exception.

{quote}
[Doctrine\DBAL\DBALException]

Unknown database type bit requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.

{quote}

BIT datatype is available since mysql 5.0.3 but D2 Mysql platform doesn't seem to understand it

@doctrinebot

Comment created by @ocramius:

[~thinkscape] the platforms only support base types (common to all platforms) out of the box. If you want additional types, you need to register them.

@doctrinebot

Comment created by thinkscape:

It seems that BIT(M) column represents packed bits and is not directly transferable to "boolean", nor to (unpacked) "binary" d2 types. This leaves this column type in an awkward position, where no d2 built-in type matches it perfectly. Mapping it to "boolean" limits its scope and could result in data loss. Mapping it to "binary" could result in unexpected behavior.

Right now, the only 2 valid solutions I see are:

@doctrinebot

Issue was closed with resolution "Won't Fix"

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment