Skip to content

Commit

Permalink
[bug-OpenMage#388] Index isn't used in Mage_Sales_Model_Resource_Quot…
Browse files Browse the repository at this point in the history
…e::isOrderIncrementIdUsed()

Cast increment ids to string to ensure use of index.
  • Loading branch information
pepijnblom authored and edannenberg committed Jul 17, 2018
1 parent d920a56 commit e9281ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/code/core/Mage/Sales/Model/Resource/Quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,14 @@ public function getReservedOrderId($quote)
/**
* Check is order increment id use in sales/order table
*
* @param string $orderIncrementId
* @param string|integer $orderIncrementId
*
* @return boolean
*/
public function isOrderIncrementIdUsed($orderIncrementId)
{
$adapter = $this->_getReadAdapter();
$bind = array(':increment_id' => $orderIncrementId);
$bind = array(':increment_id' => (string)$orderIncrementId);
$select = $adapter->select();
$select->from($this->getTable('sales/order'), 'entity_id')
->where('increment_id = :increment_id');
Expand Down

0 comments on commit e9281ef

Please sign in to comment.