Bug #33704
closedSQL parser does not support NULL as default value
100%
Description
When preparing a database schema with proper referential integrity, one typically has to choose NULL as default value for foreign keys:
CREATE TABLE tx_myext_domain_model_member ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, some_fk int(11) DEFAULT NULL,
However, database analyzer does not support NULL as default value and shows an empty string ('') instead, thus suggesting that the underlying table structure is invalid and should be adapted.
Updated by Markus Klein over 12 years ago
I had a look at these things a while ago. I discovered that the MySQL driver for PHP actually doesn't tell you the difference between a default '' and defaul NULL. It always returns '' (with type string).
So I'm not entirely sure, whether we can really fix this.
Updated by Xavier Perseguers over 12 years ago
I have the 3-line fix. I just have to test it with DBAL.
Updated by Gerrit Code Review over 12 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/8861
Updated by Markus Klein over 12 years ago
I had a very similar fix and it didn't work with native mysql access. (I didn't test with DBAL back then.)
I hope yours is working better.
Updated by Xavier Perseguers over 12 years ago
It works fine with native MySQL for me.
Updated by Markus Klein over 12 years ago
Just for the sake of completeness, this was the discussion about default values:
http://lists.typo3.org/pipermail/typo3-english/2011-December/078504.html
And the referenced mysql ticket:
http://bugs.mysql.com/bug.php?id=34198
Updated by Gerrit Code Review over 12 years ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/8879
Updated by Xavier Perseguers over 12 years ago
- Status changed from Under Review to Resolved
- Target version set to 4.6.5
- % Done changed from 0 to 100
Updated by Riccardo De Contardi almost 7 years ago
- Status changed from Resolved to Closed