-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.3.1] Phalcon ORM consider tinyint as boolean #2236
Comments
We use the Introspection metadata system, here is a sample of : CREATE TABLE IF NOT EXISTS `member` (
`id_membre` int(10) unsigned NOT NULL AUTO_INCREMENT,
...
`flag_update` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 : update all, 1 : updated, 2 : update last connexion only',
...
PRIMARY KEY (`id_membre`),
...
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17314546 ; $metadata = $this->getDI()->get('modelsMetadata');
var_dump($metadata->getDataTypes($this));
die('die'); and here the result
as you can find, flag_update datatype is 8 which is boolean instead of being int (datatype 0). |
In fact the pb seems weirder, in 1.2.6 flag_update is already as an boolean type, but as it was'nt cast into false / true, the pb was unseen. |
The problem is here : tinyint(1) is put as a boolean whereas it can be between 0 to 127 |
it's an int between 0 and 127
Fixes #2236 - in mysql tinyint(1) is not boolean
Hello we've got a big pb with Phalcon 1.3.1 vs Phalcon 1.2.6
Our Model which contains tinyint values is now broken as values are now saved as 0 / 1 (true / false) even if they're set to 2 / 3 ....
0 => false (in the model) => 0 (in db)
1 .... 5 => true (in the model) => 1 (in db).
The text was updated successfully, but these errors were encountered: