Skip to content

Instantly share code, notes, and snippets.

@stith
Created May 19, 2011 07:04
Show Gist options
  • Save stith/980324 to your computer and use it in GitHub Desktop.
Save stith/980324 to your computer and use it in GitHub Desktop.
Magento 1.4.1.1 Memory Leak Patch
*** lib/Varien/Db/Select.php 2010-07-26 16:09:28.000000000 -0400
--- lib/Varien/Db/Select.php 2010-12-28 15:42:19.000000000 -0500
***************
*** 33,38 ****
--- 33,40 ----
*/
class Varien_Db_Select extends Zend_Db_Select
{
+ const TYPE_CONDITION = 'TYPE_CONDITION';
+
const STRAIGHT_JOIN_ON = 'straight_join';
const STRAIGHT_JOIN = 'straightjoin';
const SQL_STRAIGHT_JOIN = 'STRAIGHT_JOIN';
***************
*** 45,52 ****
public function __construct(Zend_Db_Adapter_Abstract $adapter)
{
parent::__construct($adapter);
! self::$_joinTypes[] = self::STRAIGHT_JOIN_ON;
! self::$_partsInit = array(self::STRAIGHT_JOIN => false) + self::$_partsInit;
}
/**
--- 47,56 ----
public function __construct(Zend_Db_Adapter_Abstract $adapter)
{
parent::__construct($adapter);
! if (!in_array(self::STRAIGHT_JOIN_ON, self::$_joinTypes)) {
! self::$_joinTypes[] = self::STRAIGHT_JOIN_ON;
! self::$_partsInit = array(self::STRAIGHT_JOIN => false) + self::$_partsInit;
! }
}
/**
***************
*** 86,91 ****
--- 90,101 ----
if (is_null($value) && is_null($type)) {
$value = '';
}
+ /**
+ * Additional internal type used for really null value
+ */
+ if ($type == self::TYPE_CONDITION) {
+ $type = null;
+ }
if (is_array($value)) {
$cond = $this->_adapter->quoteInto($cond, $value);
$value = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment