diff --git a/.idea/doctrine1.iml b/.idea/doctrine1.iml
new file mode 100755
index 000000000..17733114e
--- /dev/null
+++ b/.idea/doctrine1.iml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100755
index 000000000..f13fa3379
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100755
index 000000000..2a03e9527
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100755
index 000000000..22f2a676a
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/php-docker-settings.xml b/.idea/php-docker-settings.xml
new file mode 100755
index 000000000..21ef7014e
--- /dev/null
+++ b/.idea/php-docker-settings.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/php.xml b/.idea/php.xml
new file mode 100755
index 000000000..aa2abf639
--- /dev/null
+++ b/.idea/php.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100755
index 000000000..9661ac713
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100755
index 000000000..941650e57
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $PROJECT_DIR$/composer.json
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _addDqlQueryPart
+ Constructor
+ getSqlQuery
+ function _apply
+ ->getSqlQuery(
+ $this->_sql =
+ ->_index_parts = []
+ ->_index_parts =
+ getCountSql
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1587673370435
+
+
+ 1587673370435
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/Doctrine/Query.php b/lib/Doctrine/Query.php
index 27d778016..43c54321e 100755
--- a/lib/Doctrine/Query.php
+++ b/lib/Doctrine/Query.php
@@ -1517,6 +1517,8 @@ public function getLimitSubquery()
// add driver specific limit clause
$subquery = $this->_conn->modifyLimitSubquery($table, $subquery, $this->_sqlParts['limit'], $this->_sqlParts['offset']);
+ // apply any outstanding indexes to the subquery before we rebuild the query parts using new Aliases
+ $subquery = $this->_applyIndexesToQuery($subquery);
$parts = $this->_tokenizer->quoteExplode($subquery, ' ', "'", "'");
@@ -1586,6 +1588,7 @@ public function getLimitSubquery()
}
$subquery = implode(' ', $parts);
+
return $subquery;
}
@@ -2112,7 +2115,7 @@ public function getCountSqlQuery()
. $this->_conn->quoteIdentifier('dctrn_count_query');
}
- return $q;
+ return $this->_applyIndexesToQuery($q);
}
/**
diff --git a/lib/Doctrine/Query/Abstract.php b/lib/Doctrine/Query/Abstract.php
index a5ff0a10b..00ab38c90 100755
--- a/lib/Doctrine/Query/Abstract.php
+++ b/lib/Doctrine/Query/Abstract.php
@@ -2503,8 +2503,7 @@ protected function _applyIndexesToQuery($sql)
}
}
}
- // Empty the index part array to prevent us from accidentally appending twice.
- $this->_index_parts = [];
+
return $sql;
}
diff --git a/lib/Doctrine/RawSql.php b/lib/Doctrine/RawSql.php
old mode 100644
new mode 100755
index 199fde9b8..10f844f3c
--- a/lib/Doctrine/RawSql.php
+++ b/lib/Doctrine/RawSql.php
@@ -283,7 +283,7 @@ public function getSqlQuery($params = array())
if ( ! empty($string)) {
array_pop($this->_sqlParts['where']);
}
- return $q;
+ return $this->_applyIndexesToQuery($q);
}
/**
@@ -326,7 +326,7 @@ public function getCountSqlQuery($params = array())
array_pop($this->_sqlParts['where']);
}
- return $q;
+ return $this->_applyIndexesToQuery($q);
}
/**