[BUGFIX] DBAL sql_fetch_* must return boolean or array 02/29502/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Wed, 16 Apr 2014 08:58:57 +0000 (10:58 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Wed, 16 Apr 2014 18:48:34 +0000 (20:48 +0200)
If the end of a result set is reached some drivers produce NULL.
This must be changed into FALSE to be compatible with the
non-DBAL version of these functions.

Resolves: #57957
Releases: 6.2, 6.1
Change-Id: I664dd10735f88754c74e20ecd5c07fad5ef2b78d
Reviewed-on: https://review.typo3.org/29502
Reviewed-by: Mathias Schreiber
Tested-by: Mathias Schreiber
Reviewed-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index aa8e0ba..d1b5288 100644 (file)
@@ -2220,6 +2220,10 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                $output = $this->map_assocArray($output, $tables, 1);
                        }
                }
+               if ($output === NULL) {
+                       // Needed for compatibility
+                       $output = FALSE;
+               }
                // Return result:
                return $output;
        }
@@ -2272,6 +2276,10 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                $output = $res->sql_fetch_row();
                                break;
                }
+               if ($output === NULL) {
+                       // Needed for compatibility
+                       $output = FALSE;
+               }
                return $output;
        }