Project

General

Profile

Actions

Bug #100979

closed

Exception on creating a scheduler entry if additional table mappings exist

Added by Sybille Peters over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Category:
scheduler
Target version:
-
Start date:
2023-06-08
Due date:
% Done:

100%

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

Description

Problem manifests itself when creating a scheduler task with TYPO3 v11 (click "+" in scheduler list):

An exception occurred while executing 
'SELECT `TABLE_NAME` AS `Table`, `ENGINE` AS `Engine` FROM `information_schema`.`TABLES` WHERE (`TABLE_TYPE` = ?) AND (`ENGINE` IN (?, ?, ?)) AND (`TABLE_SCHEMA` = ?) AND (`TABLE_NAME` IN (?))' 
with params ["BASE TABLE", "InnoDB", "MyISAM", "ARCHIVE", "almgre", ["gruppe","gruppe_als_thema_x_werk","gruppe_x_werk","musikerfigur_x_werk","person","person_x_werk","sachthema","sachthema_x_werk","werk"]]: 

PHP Warning: Array to string conversion in 
/var/www/site-uol11/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php 
line 164

This corresponds to SQL command:

mysql> SELECT `TABLE_NAME` AS `Table`, `ENGINE` AS `Engine` FROM `information_schema`.`TABLES` WHERE (`TABLE_TYPE` = "BASE TABLE") AND (`ENGINE` IN ("InnoDB", "MyISAM", "ARCHIVE")) AND (`TABLE_SCHEMA` = "almgre") AND (`TABLE_NAME` IN (["gruppe","gruppe_als_thema_x_werk","gruppe_x_werk","musikerfigur_x_werk","person","person_x_werk","sachthema","sachthema_x_werk","werk"]));

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '["gruppe","gruppe_als_thema_x_werk","gruppe_x_werk","musikerfigur_x_werk","perso' at line 1

Passing the group of tables in brackets ([]) seems to be wrong.

I have additional table mappings defined.

Fix

OptimizeDatabaseTableAdditionalFieldProvider (in scheduler):

line 225:

if (!empty($tableNames)) {
    $queryBuilder->andWhere(
        $queryBuilder->expr()->in(
            'TABLE_NAME',
                // $queryBuilder->createNamedParameter($tableNames, Connection::PARAM_STR)
                $queryBuilder->createNamedParameter($tableNames, Connection::PARAM_STR_ARRAY)
        )
    );
}

Table mapping

$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Musikgeschichte']['driver'] = 'mysqli';
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Musikgeschichte']['dbname'] = getenv('MUSIKGESCHICHTE_DB_DATABASE');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Musikgeschichte']['host'] = getenv('MUSIKGESCHICHTE_DB_HOST');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Musikgeschichte']['password'] = getenv('MUSIKGESCHICHTE_DB_PASSWORD');
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Musikgeschichte']['port'] = 3306;
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Musikgeschichte']['user'] = getenv('MUSIKGESCHICHTE_DB_USERNAME');

// DB: table Mapping
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['gruppe'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['gruppe_als_thema_x_werk'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['gruppe_x_werk'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['musikerfigur_x_werk'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['person'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['person_x_werk'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['sachthema'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['sachthema_x_werk'] = 'Musikgeschichte';
$GLOBALS['TYPO3_CONF_VARS']['DB']['TableMapping']['werk'] = 'Musikgeschichte';

Versions

  • TYPO3 11.5.27

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #100725: Scheduler broken when using mapped tables from different DB connectionClosed2023-04-24

Actions
Actions

Also available in: Atom PDF