Page MenuHomeIn-Portal Phabricator
  • Changed Files
  • branches/5.2.x/core/kernel/db/dblist.php

INP-1812 - Change "LeftJoinOptimizer" to find table aliases usage only at word boundaries
ClosedPublic

Authored by alex on Oct 4 2021, 6:21 AM.

Details

Test Plan

Part 1

  1. login to Admin Console
  2. go to User ManagementUsers section
  3. reset all filters (if there are any)
  4. open Debugger
  5. confirm, that grid count query looks like this:
SELECT COUNT(*) AS count
FROM 52x_Users
WHERE ((52x_Users.UserType = 0))
LIMIT 0,1 

Plan 2

  1. open \UsersEventHandler::SetCustomQuery method for editing
    1. revert any non-committed changes
    2. add $object->addFilter('testing_filter', 'img.DefaultImg = 0'); line after $object variable was initialized
    3. save changes
  2. login to Admin Console
  3. go to User ManagementUsers section
  4. reset all filters (if there are any)
  5. open Debugger
  6. confirm, that grid count query looks like this:
SELECT COUNT(*) AS count
FROM 52x_Users
LEFT JOIN 52x_CatalogImages img ON img.ResourceId = 52x_Users.ResourceId AND img.DefaultImg = 1
WHERE ((img.DefaultImg = 0) AND (52x_Users.UserType = 0))
LIMIT 0,1

Plan 3

  1. open \UsersEventHandler::SetCustomQuery method for editing
    1. revert any non-committed changes
    2. add $object->AddGroupByField('img.ImageId'); line after $object variable was initialized
    3. save changes
  2. login to Admin Console
  3. go to User ManagementUsers section
  4. reset all filters (if there are any)
  5. open Debugger
  6. confirm, that grid count query looks like this:
SELECT COUNT(*) AS count
FROM 52x_Users
LEFT JOIN 52x_CatalogImages img ON img.ResourceId = 52x_Users.ResourceId AND img.DefaultImg = 1
WHERE ((52x_Users.UserType = 0))
GROUP BY img.ImageId

v1.1

  • changed SQLs in Part 2 and Part 3 to have (52x_Users.UserType = 0) in the WHERE clause

Diff Detail

Repository
rINP In-Portal
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex created this revision.Oct 4 2021, 6:21 AM
alex requested review of this revision.Oct 4 2021, 6:21 AM
alex edited the test plan for this revision. (Show Details)Oct 4 2021, 6:21 AM
erik requested changes to this revision.Jul 14 2022, 10:35 AM

Работает всё как надо, но наверное надо исправить Test Plan. В "Plan 2" и "Plan 3" в SQL не хватает фильтра WHERE ((52x_Users.UserType = 0))

This revision now requires changes to proceed.Jul 14 2022, 10:35 AM
alex edited the test plan for this revision. (Show Details)Jul 19 2022, 5:38 AM
alex edited the test plan for this revision. (Show Details)
alex requested review of this revision.Jul 19 2022, 5:41 AM
In D416#8350, @erik wrote:

Работает всё как надо, но наверное надо исправить Test Plan. В "Plan 2" и "Plan 3" в SQL не хватает фильтра WHERE ((52x_Users.UserType = 0))

Fixed.

Please keep in mind, that all In-Portal-related communication should happen in English. Thank you.

erik accepted this revision.Jul 19 2022, 7:56 AM
This revision is now accepted and ready to land.Jul 19 2022, 7:56 AM
This revision was landed with ongoing or failed builds.Jul 20 2022, 2:06 AM
This revision was automatically updated to reflect the committed changes.