dev/core#1747 don't drop temp tables on class destruct. #17438
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Fixes a regression whereby saved searches off the Date Added search can't load as the temp table is cleaned up too aggressively - description etc copied from gitlab as it was well explained
Since upgrading to 5.24 creating smart group using 'Date Added to CiviCRM' fails with DB Error: no such table. Also when a smart group is based on 'Date Added to CiviCRM' and try to refresh the count it fails with same error message
Reproduction steps
Current behaviour
Get DB error 'Database Error Code: Table 'dmastercivi_g5lis.civicrm_tmp_e_ig_6f1e2d3b300d50a856f5cb9140996451' doesn't exist, 1146' when trying to create smart group or refresh count
Expected behaviour
smart should be created with correct contacts in it and also when refreshing the group count, the group should show correct count
Technical Details
Recent code clean up means the search class is now dropped more quickly - meaning that dropping
these tables in the destructors is too aggressive. Since they are memory tables & temp tables they get
cleaned up anyway I think. Regardless the odd slow cleanup is better than the current situation
We should move this search to an extension that ships with core, not necessarily
enabled on initial install but that is up for discussion
Comments