#1054162: Taxonomy bundles not supported by EntityFieldQuery (followup) amended how efq queries for taxonomy are generated, there however is an issue when using say mongodb for field storage as the vid is not being cast to an integer and as a result the query no longer works because mongo expects an integer not a string.

Patch attached to fix up this issue

CommentFileSizeAuthor
cast-vid.patch893 bytesmarcingy

Comments

sun’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Entity system

This seems to impact alternative storage controllers only, so I don't see how we could test it. Thus, RTBC.

chx’s picture

I know for sure that MySQL can't use the index on a varchar column when comparing to an int. So says the manual: For comparisons of a string column with a number, MySQL cannot use an index on the column to look up the value quickly. I do not know whether the optimizer has the brains to optimize out the comparisons of a number column with a string, in this case to cast vid only once.

I am somewhat curious why vid is not int in the first place but that's a followup as both pgsql and sqlite has PDO::ATTR_STRINGIFY_FETCHES => TRUE, so that's quite deliberate.

marcingy’s picture

Project: Drupal core » MongoDB
Version: 8.x-dev » 7.x-1.x-dev
Component: taxonomy.module » Field storage
Status: Reviewed & tested by the community » Needs work

Moving to mongodb project after IRC chat with chx.

marcingy’s picture

Title: Taxonomy entity field queries don't work with none mysql field storage » Entity field queries for bundles need to cast vid to integer.
marcingy’s picture

Title: Entity field queries for bundles need to cast vid to integer. » Entity field queries with taxonomy bundles need to cast vid to integer.
chx’s picture

Title: Entity field queries with taxonomy bundles need to cast vid to integer. » Entity field queries need to read entity base table schemas
chx’s picture

Title: Entity field queries need to read entity base table schemas » Entity field queries need to read entity base table schemas to cast correctly
marcingy’s picture

Status: Needs work » Closed (duplicate)
marcingy’s picture

Issue summary: View changes

Correcting typo