Problem/Motivation
Installed Drupal version : 10.0.7
PHP version : 8.1.29
SQL : MariaDB 10.6.18
At admin/people, can't show more than 49 users.
Adding users (path admin/people/create) works well until I reach the 50th user. When trying to show the list of (50) users (path admin/people) an error appears on a blank screen. Removing the last added user in the database enables to view the 49 users again.
The logged error is :
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1104 <strong>The SELECT would examine more than MAX_JOIN_SIZE rows</strong>; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay: SELECT "u"."entity_id" AS "uid", "u"."roles_target_id" AS "rid" FROM "_SYNuser__roles" "u" WHERE "u"."entity_id" IN ( :uids__0, :uids__1, :uids__2, :uids__3, :uids__4, :uids__5, :uids__6, :uids__7, :uids__8, :uids__9, :uids__10, :uids__11, :uids__12, :uids__13, :uids__14, :uids__15, :uids__16, :uids__17, :uids__18, :uids__19, :uids__20, :uids__21, :uids__22, :uids__23, :uids__24, :uids__25, :uids__26, :uids__27, :uids__28, :uids__29, :uids__30, :uids__31, :uids__32, :uids__33, :uids__34, :uids__35, :uids__36, :uids__37, :uids__38, :uids__39, :uids__40, :uids__41, :uids__42, :uids__43, :uids__44, :uids__45, :uids__46, :uids__47, :uids__48, :uids__49 ) AND "u"."roles_target_id" IN ( :rids__0, :rids__1, :rids__2, :rids__3, :rids__4, :rids__5, :rids__6 ); Array ( [:uids__0] => 104 [:uids__1] => 103 [:uids__2] => 99 [:uids__3] => 98 [:uids__4] => 97 [:uids__5] => 96 [:uids__6] => 95 [:uids__7] => 94 [:uids__8] => 93 [:uids__9] => 92 [:uids__10] => 91 [:uids__11] => 90 [:uids__12] => 89 [:uids__13] => 88 [:uids__14] => 87 [:uids__15] => 86 [:uids__16] => 85 [:uids__17] => 84 [:uids__18] => 83 [:uids__19] => 82 [:uids__20] => 81 [:uids__21] => 80 [:uids__22] => 79 [:uids__23] => 78 [:uids__24] => 77 [:uids__25] => 76 [:uids__26] => 75 [:uids__27] => 74 [:uids__28] => 73 [:uids__29] => 72 [:uids__30] => 71 [:uids__31] => 70 [:uids__32] => 69 [:uids__33] => 68 [:uids__34] => 67 [:uids__35] => 66 [:uids__36] => 65 [:uids__37] => 64 [:uids__38] => 63 [:uids__39] => 62 [:uids__40] => 61 [:uids__41] => 60 [:uids__42] => 59 [:uids__43] => 58 [:uids__44] => 57 [:uids__45] => 56 [:uids__46] => 55 [:uids__47] => 4 [:uids__48] => 3 [:uids__49] => 2 [:rids__0] => anonymous [:rids__1] => authenticated [:rids__2] => content_editor [:rids__3] => administrator [:rids__4] => huurder [:rids__5] => gast [:rids__6] => eigenaar ) in Drupal\user\Plugin\views\field\Roles->preRender() (line 77 of /customers/9/8/9/vmeastrid.be/httpd.www/syn/core/modules/user/src/Plugin/views/field/Roles.php).
Is this a problem to be solved by the host provider or do I need to add SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# ?
Steps to reproduce
TBA
Proposed resolution
TBD
Remaining tasks
Does this happen on currently supported versions of Drupal.
Steps to reproduce
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Screenshot 2024-07-09 at 11.42.03 PM.png | 997.09 KB | java008 |
Comments
Comment #2
java008 commentedTried to reproduce the same issue in Local Drupal 10. There is no issue for me. Refer below screenshot.
Comment #3
mradcliffeHi @iCU, @java008, the drupal.org community section project is a project specifically for the Community section on drupal.org, and not for general support for Drupal core. I am moving this into the core project as a support request. note that Drupal 10.0.0 is out-of-date and you should update to the latest Drupal 10 minor release for security reasons.
I am removing the Novice tag from this issue because this is a support request and the Novice tag is used by Drupal core mentors to tag issues that have a clear task and resolution.
I’m using this documentation as a source: https://www.drupal.org/community/contributor-guide/task/triage-novice-is...
Comment #4
cilefen commentedHave you modified the default view?
Comment #5
cilefen commentedComment #6
petrsocha commentedAdjusting the settings.php fixes the issue:
$databases['default']['default'] = array (
...
'init_commands' => [
'big_selects' => 'SET SQL_BIG_SELECTS=1',
],
'pdo' => [
PDO::ATTR_TIMEOUT => 5,
],
);
But since 50 users isn't really a big select, I suppose the database query is not very well formed.
Comment #7
tma0 commentedSeems it is about some mysql settings. The same code I see in github for D11 so likely persists (https://github.com/drupal/drupal/blob/11.x/core/modules/user/src/Plugin/...). The error is misleading and fix is avoiding multiple IN conditions generating large sets. Even subquery does not help. But INNER JOIN furtunately works:
Comment #8
nicxvan commentedAlso which modules do you have installed?
Comment #9
tma0 commentedHow to get list of installed modules in raw list (beyond drush) ?
But related code is in core module. I have 2020 users, 5 roles in DB. I have no control on mysql as it is on hosting. I can reproduce in phpmyadmin as raw query and it always happens when "SELECT FROM WHERE IN () AND IN ()" or "SELECT FROM WHERE IN () SELECT FROM IN()" command is raised. Likely mysql does an UNION or so. INNER JOIN works well.
Comment #10
khoebekeI have the same issue, I have +/-160 users on my website, I can test some things if you want
Comment #11
smustgrave commentedI'm personally not able to replicate with a base drupal install. Could it be a DB setting perhaps?
Comment #13
quietone commentedIt is not clear to me why this was changed to a Support Request, so restoring the Bug Report category. I could be wrong.
This still needs more information.
Does this happen on a currently supported version of Drupal?
This needs steps to reproduce the issue starting from "Install Drupal core". Being able to reproduce the problem will allow the community to write tests.
Thanks.
Comment #14
danielvezaIt's been over a year since @smustgrave could not replicate this, and 4 months since @quietone asked for more information. Since we haven't had any other reports, I'm going to mark this one as closed. Thanks all!