[BUGFIX] exec_SELECTcountRows where clause must not be empty 70/39070/2
authorXavier Perseguers <xavier@typo3.org>
Thu, 30 Apr 2015 08:25:27 +0000 (10:25 +0200)
committerAndreas Fernandez <andreas.fernandez@aspedia.de>
Thu, 30 Apr 2015 09:54:01 +0000 (11:54 +0200)
When using DBAL, the where clause of database query must not be
left empty. exec_SELECTcountRows() defaults to an empty string
and causes the Install Tool to fail to create the tables for the
extension manager.

Change-Id: I9fd66147bf662bbf7e527860756d83ca247a2260
Resolves: #66675
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/39070
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
typo3/sysext/core/Classes/Database/DatabaseConnection.php

index 8de1bdc..e5eb5b2 100644 (file)
@@ -431,7 +431,7 @@ class DatabaseConnection {
         * @param string $where (optional) WHERE statement of the query
         * @return mixed Number of rows counter (int) or FALSE if something went wrong (bool)
         */
-       public function exec_SELECTcountRows($field, $table, $where = '') {
+       public function exec_SELECTcountRows($field, $table, $where = '1=1') {
                $count = FALSE;
                $resultSet = $this->exec_SELECTquery('COUNT(' . $field . ')', $table, $where);
                if ($resultSet !== FALSE) {