diff options
author | David Rothstein <drothstein@gmail.com> | 2014-09-02 22:58:02 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2014-09-02 22:58:02 -0400 |
commit | be54be0d14db49f655f610bda8d365c7e1c88fc0 (patch) | |
tree | ec4e71d4f3c016962a32cfecf931edd065311d60 /modules/field/tests | |
parent | 0867207af614d7f416dc81548a832f68fc533b7b (diff) | |
download | brdo-be54be0d14db49f655f610bda8d365c7e1c88fc0.tar.gz brdo-be54be0d14db49f655f610bda8d365c7e1c88fc0.tar.bz2 |
Issue #1859084 by Jorrit, David_Rothstein, attiks: Improved database queries generated by EntityFieldQuery in the case where delta or language condition groups are used, to reduce the number of INNER JOINs.
Diffstat (limited to 'modules/field/tests')
-rw-r--r-- | modules/field/tests/field_test.module | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/field/tests/field_test.module b/modules/field/tests/field_test.module index dc2023a74..9daa2c305 100644 --- a/modules/field/tests/field_test.module +++ b/modules/field/tests/field_test.module @@ -267,3 +267,14 @@ function field_test_query_efq_table_prefixing_test_alter(&$query) { // exception if the EFQ does not properly prefix the base table. $query->join('test_entity','te2','%alias.ftid = test_entity.ftid'); } + +/** + * Implements hook_query_TAG_alter() for tag 'store_global_test_query'. + */ +function field_test_query_store_global_test_query_alter($query) { + // Save the query in a global variable so that it can be examined by tests. + // This can be used by any test which needs to check a query, but see + // FieldSqlStorageTestCase::testFieldSqlStorageMultipleConditionsSameColumn() + // for an example. + $GLOBALS['test_query'] = $query; +} |