-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
MariaDB 10.2.7 BC break #6565
Comments
Needs a test case though... |
Hi @bilhackmac and @Ocramius I also faced the same issue when I updated with MariaDB 10.2.7 |
Same issue too. |
I have the same problem. |
@sabzeta @belgattitude @baumannsven as @Ocramius said, please send us a PR with tests. That helps A LOT 😉 |
I haven't realy ran into this problem, but it's good to be aware. I'll try to look into it. |
just published a P/R on doctrine/dbal#2825 with the third approach... Feel free to comment. |
Same problem here, narrowed it down to it being a NULL problem of some sort as removing all nullable relations and fields solved it. That combined with me recently pulling the newest mariadb image for Docker explains it all. There went another 3/4 hours of my day trying to find an error in my code even though the mapping files validated fine 😭 Using the mysql:5 image now which should fix things, fingers crossed 🤞 . Hopefully a fix will be merged soon! |
doctrine/dbal#2825 has just been merged and it will be released on DBAL |
Attribute default models are broken otherwise, see: doctrine/orm#6565
Attribute default models are broken otherwise, see: doctrine/orm#6565
With "doctrine/dbal": "2.7.x-dev@dev" issue steel exist |
Can you confirm, I don't have it anymore: My composer:
|
Tested with mariadb 10.2.11 and 10.3.1 official docker image. in composer "symfony/orm-pack": "^1.0",
"doctrine/dbal": "2.7.x-dev as 2.6.4", Always get diff with null on every field. |
Weird, in my case, testing on $ ./vendor/bin/doctrine orm:schema-tool:create
ATTENTION: This operation should not be executed in a production environment.
Creating database schema...
Database schema created successfully! Followed by an update: $ ./vendor/bin/doctrine orm:schema-tool:update --dump-sql
Nothing to update - your database is already in sync with the current entity metadata. So it's working fine. I'm not aware of $ ls -la vendor/doctrine/dbal/lib/Doctrine/DBAL/Platforms/Keywords If there's a file named Let me know. Thanks |
Have you recreated the database before testing ? It's possible you've already applied the migration with 'NULLs' prior to the patch (so your default values have been broken). Can be an possibility too |
Made clear demo example https://github.com/Bukashk0zzz/dbal-test With code in repo above I every time get diff. You can check it by yourself |
I have one entity https://github.com/Bukashk0zzz/dbal-test/blob/master/src/Entity/Admin.php And one init migration https://github.com/Bukashk0zzz/dbal-test/blob/master/src/Migrations/Version20171204100535.php How I run project https://github.com/Bukashk0zzz/dbal-test/blob/master/up.sh And after running I execute doctrine:migrations:diff or doctrine:schema:update |
Can you check by commenting Like this:
|
Also note in your "doctrine/dbal": {
"version": "v2.6.3"
}, Not sure exactly how it can affect.... but it could be the problem. To be sure check:
If you're on the good doctrine version, you should have a |
Commenting 5.7 helped
Add travis check for this case https://travis-ci.org/Bukashk0zzz/dbal-test/builds/311377116 |
Glad it's fixed (by the looks of it), when will this make it to master? |
@Bukashk0zzz, happy for you. server_version will bypass database detection, that explains. For the other one: @mdeboer Don't know when they are able to release, but in the meantime, please be welcome to test ;) |
@belgattitude Bukashk0zzz/dbal-test#2 as you can see mysql 5.7 have not any issue with unsigned bool. There are problems only with mariaDB Check travis buid https://travis-ci.org/Bukashk0zzz/dbal-test/builds/311772602 You can create pull-request to this repo and test any cases you want. |
Nope ! Your travis build show there's no migration, right ! But your entity does not have To figure out, please test with 'unsigned:true' AND mysql5-7 (both conditions, don't forget to remove existing migrations Anyway I just did the test on my laptop with mysql-5.7. And I can confirm, there's a migration happening with unsigned bool on mysql5.7 too. Thanks |
@belgattitude You look at master not at PR and branch mysql See PR files There are UNSIGNED in entity and in migration. |
Ok, I still don't get it. Cannot reproduce but we are using 2 different ways to tests. I cannot help with And only test with doctrine/dbal commands:
This is what I have both unsigned:true and mysql 5.7 I'm not using doctrine:migrations, that why I've always removed |
For extended info, look what doctrine creates with
Here's the output (removed some columns for clarity): CREATE TABLE admins (id INT UNSIGNED AUTO_INCREMENT NOT NULL, status TINYINT(1) DEFAULT '1' NOT NULL, PRIMARY KEY(id)) It looks it didn't set the unsigned while creating... But from schema introspection (schema:update) it always trigger a diff if using unsigned. DBAL seems to alias BOOL to TINYINT(1) and seems to remove unsigned property (mysql or mariadb). I don't think doctrine/dbal#2825 have changed that. My question now is more about how 'doctrine:migrations' handles that. Can you eventually see if there's differences in generated migrations for both databases ? It can help me to track down the problem Thanks |
@belgattitude You correct and on mysql and on mariadb with unsigned bool without my init migration always getting diff. Migrations generated by mysql and mariadb identical. Answering on question how I get this migration: I agree with you that this not related to issue #2825 But what you think this are issue that dbal not correct handle unsigned bool ? travis test for mariadb https://travis-ci.org/Bukashk0zzz/dbal-test/builds/313452048 travis test for mysql https://travis-ci.org/Bukashk0zzz/dbal-test/builds/313450766 |
Why on earth would you use an unsigned bool anyway? Unless it's part of a bigger issue I don't see why this has priority to get fixed. |
@mdeboer But why not? Near 6-7 years ago I always put unsigned for every integer that will be only with + Anyway I agree that this not an issue for now. Thats why I asked and not created issue for that. |
@Bukashk0zzz awesome, closing then! |
Attribute default models are broken otherwise, see: doctrine/orm#6565 fixes 1396
Attribute default models are broken otherwise, see: doctrine/orm#6565 fixes 1396
This issue has resurfaced for me with a clean symfony/website-skeleton install. Running MariaDB 10.2.14 and doctrine/dbal v2.7.0. I compared against a fresh symfony-standard-edition connected to the same database. Verified doctrine/* versions are the same. Set up a simple entity to map with one field nullable=true and I get the issue on the symfony 4.0 install but not the 3.4. Anyone else able to confirm my insanity? |
I opened a new [issue]#7258 for MariaDB 10.2.14 as this issue reappears there. |
@remoteclient I'll reply on #7258 7258 |
Since there was server version inside config set to 5.7, migration:diss was always generating difference for some fields. Known bug in dbal/doctrine - doctrine/orm#6565
Faced the same issue. Adding comment for searchability.
Symfony Version 4.2.2
Fix:
This solution worked for me. I suspect the problem had to do with a custom doctrine type I am using but cannot confirm. Only the entities that used this custom type were causing the issue, hence my suspicion. First I tried updating doctrine/dbal. That did not work. I had to remove symfony/orm-pack then install doctrine to resolve. |
MariaDB 10.2.7 and future releases (5.5, 10.0 and 10.1 branches are not affected) just resolve an old bug in SQL standards implementation and introduce a BC break
Ticket that explains changes https://jira.mariadb.org/browse/MDEV-13132
Ticket that confirms (in comments) only >= v10.2.7 are affected https://jira.mariadb.org/browse/MDEV-13341
Concretely, for Doctrine, schema update just gone crazy and want to update every column with NULL default because 'NULL' is return by MariaDB instead of NULL.
I don't find any other issues… for now.
For the moment, MySQL don't have the same issue.
The text was updated successfully, but these errors were encountered: