ZF-8572: Zend_db_Select::union() does not accept Zend_Db_Select objects/strings

Description

{{Zend_Db_Select}}'s {{union()}} method does not follow the docs specifications, it just returns {{$this}} if the {{$select}} param isn't an array.

I made a trivial fix:


Index: library/Zend/Db/Select.php
===================================================================
--- library/Zend/Db/Select.php
+++ library/Zend/Db/Select.php
@@ -271,7 +271,7 @@
     public function union($select = array(), $type = self::SQL_UNION)
     {
         if (!is_array($select)) {
-            $select = array();
+            $select = array($select);
         }
 
         if (!in_array($type, self::$_unionTypes)) {

I use ZF v1.9.6

Comments

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.