Project

General

Profile

Actions

Bug #64616

closed

Compare Database does not remove 'NOT NULL'

Added by Philipp Gampe about 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2015-01-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

The compare database wizard does not detect if fields to not have the NOT NULL clause anymore (if they had such a clause previously).

MariaDB [dummy]> SHOW FIELDS FROM sys_file_processedfile;
+-------------------+--------------+------+-----+---------+----------------+
| Field             | Type         | Null | Key | Default | Extra          |
+-------------------+--------------+------+-----+---------+----------------+
| uid               | int(11)      | NO   | PRI | NULL    | auto_increment |
| pid               | int(11)      | NO   | MUL | 0       |                |
| tstamp            | int(11)      | NO   |     | 0       |                |
| crdate            | int(11)      | NO   |     | 0       |                |
| cruser_id         | int(11)      | NO   |     | 0       |                |
| deleted           | tinyint(4)   | NO   |     | 0       |                |
| storage           | int(11)      | NO   | MUL | 0       |                |
| original          | int(11)      | NO   | MUL | 0       |                |
| identifier        | varchar(512) | YES  |     |         |                |
| name              | tinytext     | YES  |     | NULL    |                |
| configuration     | text         | YES  |     | NULL    |                |
| context           | varchar(200) | NO   |     |         |                |
| checksum          | varchar(255) | NO   |     |         |                |
| is_processed      | varchar(200) | NO   |     |         |                |
| extension         | varchar(255) | NO   |     |         |                |
| mime_type         | varchar(255) | NO   |     |         |                |
| sha1              | tinytext     | YES  |     | NULL    |                |
| size              | int(11)      | NO   |     | 0       |                |
| width             | int(11)      | NO   |     | 0       |                |
| height            | int(11)      | NO   |     | 0       |                |
| originalfilesha1  | char(40)     | YES  |     |         |                |
| task_type         | varchar(200) | NO   |     |         |                |
| configurationsha1 | char(40)     | YES  |     |         |                |
+-------------------+--------------+------+-----+---------+----------------+

Notice the NO for NULL for the fields width and height. The corresponding SQL file (from core sysext):

CREATE TABLE sys_file_processedfile (
    uid int(11) NOT NULL auto_increment,
    tstamp int(11) DEFAULT '0' NOT NULL,
    crdate int(11) DEFAULT '0' NOT NULL,

    storage int(11) DEFAULT '0' NOT NULL,
    original int(11) DEFAULT '0' NOT NULL,
    identifier varchar(512) DEFAULT '' NOT NULL,
    name tinytext,
    configuration text,
    configurationsha1 char(40) DEFAULT '' NOT NULL,
    originalfilesha1 char(40) DEFAULT '' NOT NULL,
    task_type varchar(200) DEFAULT '' NOT NULL,
    checksum varchar(255) DEFAULT '' NOT NULL,
    width int(11) DEFAULT '0',
    height int(11) DEFAULT '0',

    PRIMARY KEY (uid),
    KEY combined_1 (original,task_type,configurationsha1),
    KEY identifier (storage,identifier(199))
);

Notice that it does not have a NOT NULL for the width and height fields.

The database compare does not detect this.


Related issues 5 (0 open5 closed)

Related to TYPO3 Core - Task #64697: Add Tests for NULL fields when comparing SQL field definitions Closed2015-01-31

Actions
Related to TYPO3 Core - Bug #60514: Database analyzer does not parse TEXT null / not null fieldsClosedMorton Jonuschat2014-07-24

Actions
Related to TYPO3 Core - Bug #51090: SQL parser does not analyse NOT NULL in extension SQL filesClosedMorton Jonuschat2013-08-15

Actions
Has duplicate TYPO3 Core - Bug #58019: FAL Indexer for broken files: Column 'width' cannot be nullRejected2014-04-17

Actions
Has duplicate TYPO3 Core - Bug #63713: Check fields for NOT NULL by default in getDatabaseExtra() Closed2014-12-09

Actions
Actions

Also available in: Atom PDF