Fix some scenarios where ^userpoints records are not present and generate issues #605
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.
Assuming a user is overriding the
QA_MYSQL_USERS_PREFIX
then there are different sites each with its own^userpoints
table. The thing is when a site creates a user then that site (and only that site) executes this line:question2answer/qa-include/app/users-edit.php
Line 192 in cfec3c0
As sites are independent I don't think making a site communicate to each other the creation of the user would make any sense.
That means having to cope with the fact that there might be records in the
^users
table that are not in the^userpoints
table. I don't think this is a big deal.The current issue can be seen when listing top users. The query uses an
INNER JOIN
against theuserpoints
table which immediately removes all non present users. The suggestion would be to make aLEFT JOIN
. It will make queries a bit slower but I don't think there any other way. To compensate, the fix also checks if there are multiple sites sharing the same^users
table so that the most performant query is used.