File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
wcfsetup/install/files/lib/system/session Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -588,9 +588,17 @@ private function getExistingSession(string $sessionID): bool
588588
589589 $ spiderIdentifier = SpiderHandler::getInstance ()->getIdentifier (UserUtil::getUserAgent ());
590590 if ($ spiderIdentifier === null ) {
591- $ condition ->add ('(sessionID = ? AND spiderIdentifier IS NULL) ' , [
592- $ row ['sessionID ' ],
593- ]);
591+ // MySQL 8.4 does not like `OR spiderIdentifier = ?` with the
592+ // placeholder being supplied with `NULL`. Instead of raising
593+ // a warning or something, it will cause the query planer to
594+ // pick some odd indices to work with instead of focusing on
595+ // the session id.
596+ //
597+ // Technically we don’t care for the spider identifier at
598+ // this point which means that we can optimize the query
599+ // right away. This query also lives in the hot path of a
600+ // request which makes it even more reasonable.
601+ $ condition ->add ('sessionID = ? ' , [$ row ['sessionID ' ]]);
594602 } else {
595603 $ condition ->add ('(sessionID = ? OR spiderIdentifier = ?) ' , [
596604 $ row ['sessionID ' ],
You can’t perform that action at this time.
0 commit comments