diff --git a/2601282-4.patch b/2601282-4.patch
new file mode 100644
index 0000000..d393000
--- /dev/null
+++ b/2601282-4.patch
@@ -0,0 +1,88 @@
+diff --git a/2601282-4.patch b/2601282-4.patch
+new file mode 100644
+index 0000000..e69de29
+diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+index 9d8f4f8..03619eb 100644
+--- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
++++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+@@ -234,9 +234,34 @@ public function isFieldCaseSensitive($field_name) {
+   /**
+    * Join entity table if necessary and return the alias for it.
+    *
++   * @param string $index_prefix
++   *   Table name prefix to discern the same table used in several
++   *   relationships.
++   *   Example:
++   *   When its empty.
++   *   @code
++   *   ->condition('tags', 2, '>')
++   *   @endcode
++   *   When it is node_reference.nid.
++   *   @code
++   *   ->condition('node_reference.nid.entity.tags', 2)
++   *   @endcode
+    * @param string $property
++   *   Mapped field table name.
++   * @param string $type
++   *   Join type, can either be INNER or LEFT.
++   * @param string $langcode
++   *   Language code.
++   * @param string $base_table
++   *   Base table name.
++   * @param string $id_field
++   *   Field name.
++   * @param array $entity_tables
++   *   A two dimensional array, the first is the name of a base or data table,
++   *   the second is a column name.
+    *
+    * @return string
++   *   The table alias.
+    *
+    * @throws \Drupal\Core\Entity\Query\QueryException
+    */
+@@ -255,9 +280,34 @@ protected function ensureEntityTable($index_prefix, $property, $type, $langcode,
+   /**
+    * Join field table if necessary.
+    *
+-   * @param $field_name
+-   *   Name of the field.
++   * @param string $index_prefix
++   *   Table name prefix to discern the same table used in several
++   *   relationships.
++   *   Example:
++   *   When its empty.
++   *   @code
++   *   ->condition('tags', 2, '>')
++   *   @endcode
++   *   When it is node_reference.nid.
++   *   @code
++   *   ->condition('node_reference.nid.entity.tags', 2)
++   *   @endcode
++   * @param object $field
++   *   A field object.
++   * @param string $type
++   *   Join type, can either be INNER or LEFT.
++   * @param string $langcode
++   *   Language code.
++   * @param string $base_table
++   *   Base table name.
++   * @param string $entity_id_field
++   *   Either entity field ID value, or revision field ID value.
++   * @param array $field_id_field
++   *   Whether it is entity ID, or revision ID.
++   *
+    * @return string
++   *   The table alias.
++   *
+    * @throws \Drupal\Core\Entity\Query\QueryException
+    */
+   protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field) {
+@@ -295,6 +345,8 @@ protected function addJoin($type, $table, $join_condition, $langcode) {
+    *
+    * @param string $table
+    *   The table name.
++   * @param int $entity_type_id
++   *   The entity type ID.
+    *
+    * @return array|bool
+    *   The table field mapping for the given table or FALSE if not available.
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
index 9d8f4f8..03619eb 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
@@ -234,9 +234,34 @@ public function isFieldCaseSensitive($field_name) {
   /**
    * Join entity table if necessary and return the alias for it.
    *
+   * @param string $index_prefix
+   *   Table name prefix to discern the same table used in several
+   *   relationships.
+   *   Example:
+   *   When its empty.
+   *   @code
+   *   ->condition('tags', 2, '>')
+   *   @endcode
+   *   When it is node_reference.nid.
+   *   @code
+   *   ->condition('node_reference.nid.entity.tags', 2)
+   *   @endcode
    * @param string $property
+   *   Mapped field table name.
+   * @param string $type
+   *   Join type, can either be INNER or LEFT.
+   * @param string $langcode
+   *   Language code.
+   * @param string $base_table
+   *   Base table name.
+   * @param string $id_field
+   *   Field name.
+   * @param array $entity_tables
+   *   A two dimensional array, the first is the name of a base or data table,
+   *   the second is a column name.
    *
    * @return string
+   *   The table alias.
    *
    * @throws \Drupal\Core\Entity\Query\QueryException
    */
@@ -255,9 +280,34 @@ protected function ensureEntityTable($index_prefix, $property, $type, $langcode,
   /**
    * Join field table if necessary.
    *
-   * @param $field_name
-   *   Name of the field.
+   * @param string $index_prefix
+   *   Table name prefix to discern the same table used in several
+   *   relationships.
+   *   Example:
+   *   When its empty.
+   *   @code
+   *   ->condition('tags', 2, '>')
+   *   @endcode
+   *   When it is node_reference.nid.
+   *   @code
+   *   ->condition('node_reference.nid.entity.tags', 2)
+   *   @endcode
+   * @param object $field
+   *   A field object.
+   * @param string $type
+   *   Join type, can either be INNER or LEFT.
+   * @param string $langcode
+   *   Language code.
+   * @param string $base_table
+   *   Base table name.
+   * @param string $entity_id_field
+   *   Either entity field ID value, or revision field ID value.
+   * @param array $field_id_field
+   *   Whether it is entity ID, or revision ID.
+   *
    * @return string
+   *   The table alias.
+   *
    * @throws \Drupal\Core\Entity\Query\QueryException
    */
   protected function ensureFieldTable($index_prefix, &$field, $type, $langcode, $base_table, $entity_id_field, $field_id_field) {
@@ -295,6 +345,8 @@ protected function addJoin($type, $table, $join_condition, $langcode) {
    *
    * @param string $table
    *   The table name.
+   * @param int $entity_type_id
+   *   The entity type ID.
    *
    * @return array|bool
    *   The table field mapping for the given table or FALSE if not available.
