[BUGFIX] Use "user_auth" index for DataHandler:printLogErrorMessages 92/37692/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 10 Mar 2015 10:41:07 +0000 (11:41 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Tue, 10 Mar 2015 11:33:18 +0000 (12:33 +0100)
Add the database field "action" to the SQL query to be able to use
the "user_auth" index and speed up the query.

Resolves: #65634
Releases: master, 6.2
Change-Id: I3371367a2fb7c86ea4cf38ee8f7ce1e8a571ffb8
Reviewed-on: http://review.typo3.org/37692
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 0cf1c45..87a13c4 100644 (file)
@@ -7197,7 +7197,7 @@ class DataHandler {
         * @return void (Will exit on error)
         */
        public function printLogErrorMessages($redirect) {
-               $res_log = $this->databaseConnection->exec_SELECTquery('*', 'sys_log', 'type=1 AND userid=' . (int)$this->BE_USER->user['uid'] . ' AND tstamp=' . (int)$GLOBALS['EXEC_TIME'] . '        AND error<>0');
+               $res_log = $this->databaseConnection->exec_SELECTquery('*', 'sys_log', 'type=1 AND action<256 AND userid=' . (int)$this->BE_USER->user['uid'] . ' AND tstamp=' . (int)$GLOBALS['EXEC_TIME'] . ' AND error<>0');
                while ($row = $this->databaseConnection->sql_fetch_assoc($res_log)) {
                        $log_data = unserialize($row['log_data']);
                        $msg = $row['error'] . ': ' . sprintf($row['details'], $log_data[0], $log_data[1], $log_data[2], $log_data[3], $log_data[4]);