Project

General

Profile

Actions

Bug #32427

closed

No datatype in "Remove unused fields" section

Added by Boris Gulay over 12 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2011-12-09
Due date:
% Done:

0%

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

Description

In Install Tool, Database Analyser, Compare, section Remove unused fields I see the following SQL scripts:

(EXT) ALTER TABLE be_groups CHANGE tx_dam_mountpoints zzz_deleted_tx_dam_mountpoints (255) default '';
(EXT) ALTER TABLE be_users CHANGE tx_t3blog_avatar zzz_deleted_tx_t3blog_avatar (60) default '\'\'::character varying';

As you can see there is no datatype for fields. If I try to run something from this section I receive the error:

Oops, an error occured!
ERROR: Query could not be parsed: "SQL engine parse ERROR: Field type unknown in parseFieldDef()!: near "(255) default '' "". Query: "ALTER TABLE be_groups CHANGE tx_dam_mountpoints zzz_deleted_tx_dam_mountpoints (255) default '';"

I have traced the calls down till admin_get_fields function. I found that it returns incorrect field type in "Type" key, but "type" key (from lover case letter) contains correct value.
This function calls MetaType function for each field in a table passing value from "type" array member and table name.
MetaType function, in case ADODB is used, performs SQL query "SELECT * FROM <table> LIMIT 1" and calls MetaType function from returned object. BUT ONLY if table name exists in cache_fieldType class variable. Existence is checked by in_array($table, $this->cache_fieldType).

BUT!!! $this->cache_fieldType is not an array, it's a dictionary! So, in_array will always return false. array_key_exists must be used instead!

Please, find patch attached.


Files

dbal.patch (674 Bytes) dbal.patch Boris Gulay, 2011-12-09 17:12
Actions

Also available in: Atom PDF