Issue Bug New Orphaned Regression

#106719Install tool - SchemaMigrator & DBAL 4 - MySQL float type

Yohann CERDAN 05/16/25, 11:39 updated 05/23/25, 15:13

Description

Hi,

In my extension i have a field declare as my_field FLOAT,
In typo3 v12, in the Analyze Database Structure the field type stay as float.
In typo3 v13, it returns an update like ALTER TABLE `my_table` CHANGE `my_field ` `my_field ` DOUBLE PRECISION.

This can throw a lot of exceptions in extensions if the dev doesnt cast to float or check the entry type.
I think this a side effect of DBAL 4 and we should be allowed to use a MySQL float type.

In typo3, the process is located in \TYPO3\CMS\Core\Database\Schema\Parser\TableBuilder::getDoctrineColumnTypeName() :

...
case RealDataType::class:
case FloatDataType::class:
case DoubleDataType::class:
$doctrineType = Types::FLOAT;
break;
...

We force Types::FLOAT for this fields type who result in :

 public function getFloatDeclarationSQL(array $column): string
{
 return 'DOUBLE PRECISION' . $this->getUnsignedDeclaration($column);
}

I think the correct doctrine type is Types::SMALLFLOAT who will keep the MySQL float type.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Install tool - SchemaMigrator & DBAL 4 - MySQL float type Resolves: #106719 Releases: main