From 1bc6de3d8260d4149b851c3b8f9ca09afa0bc618 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 20:57:21 +0200 Subject: [PATCH] reverted: Add ForceIndex function to DB Select.php #350 --- library/Zend/Db/Select.php | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/library/Zend/Db/Select.php b/library/Zend/Db/Select.php index fd2a721a01..4929cda058 100644 --- a/library/Zend/Db/Select.php +++ b/library/Zend/Db/Select.php @@ -47,7 +47,6 @@ class Zend_Db_Select const DISTINCT = 'distinct'; const COLUMNS = 'columns'; const FROM = 'from'; - const FORCE_INDEX = 'forceindex'; const UNION = 'union'; const WHERE = 'where'; const GROUP = 'group'; @@ -74,7 +73,6 @@ class Zend_Db_Select const SQL_UNION = 'UNION'; const SQL_UNION_ALL = 'UNION ALL'; const SQL_FROM = 'FROM'; - const SQL_FORCE_INDEX = 'FORCE INDEX'; const SQL_WHERE = 'WHERE'; const SQL_DISTINCT = 'DISTINCT'; const SQL_GROUP_BY = 'GROUP BY'; @@ -468,19 +466,6 @@ public function joinNatural($name, $cols = self::SQL_WILDCARD, $schema = null) { return $this->_join(self::NATURAL_JOIN, $name, null, $cols, $schema); } - - /** - * Adds an index hint for a given schema.index - * @param $tableIndex - * @throws Zend_Db_Select_Exception - */ - public function forceIndex($tableIndex) - { - list($table,$index) = explode('.',$tableIndex); - if (empty($table) || empty($index)) { - throw new Zend_Db_Select_Exception("Format of forceIndex is table_name.index_name"); - } - } /** * Adds a WHERE condition to the query by AND. @@ -1104,19 +1089,6 @@ protected function _getQuotedTable($tableName, $correlationName = null) { return $this->_adapter->quoteTableAs($tableName, $correlationName, true); } - - /** - * Returns force index statement for _renderFrom processing - * @param $tableName - * @return string - */ - protected function _getForceIndexForTable($tableName) - { - if ($this->_parts[self::FORCE_INDEX][$tableName]) { - return ' ' . self::SQL_FORCE_INDEX . ' ('.$this->_parts[self::FORCE_INDEX][$tableName].')'; - } - return ''; - } /** * Render DISTINCT clause @@ -1196,7 +1168,6 @@ protected function _renderFrom($sql) $tmp .= $this->_getQuotedSchema($table['schema']); $tmp .= $this->_getQuotedTable($table['tableName'], $correlationName); - $tmp .= $this->_getForceIndexForTable($table['tableName']); // Add join conditions (if applicable) if (!empty($from) && ! empty($table['joinCondition'])) { @@ -1214,7 +1185,7 @@ protected function _renderFrom($sql) return $sql; } - + /** * Render UNION query *