Download & Extend

Entity field queries need to read entity base table schemas to cast correctly

Project:Mongodb
Version:7.x-1.x-dev
Component:Field storage
Category:bug report
Priority:major
Assigned:Unassigned
Status:closed (duplicate)
Issue tags:Entity system

Issue Summary

#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

AttachmentSizeStatusTest resultOperations
cast-vid.patch893 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 39,746 pass(es).View details | Re-test

Comments

#1

Status:needs review» reviewed & tested by the community

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

#2

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.

#3

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.

#4

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

#5

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

#6

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

#7

Title:Entity field queries need to read entity base table schemas» Entity field queries need to read entity base table schemas to cast correctly

#8

Status:needs work» closed (duplicate)

Duplicate of #1737238: MongoDB storage query doesn't cast.

nobody click here