File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222class DatabaseHandler
2323{
24- public const FLAG_DISABLE_OPTIMIZER = 0b00010000 ;
25-
2624 private $ compiler ;
2725 private $ driver ;
2826
@@ -88,9 +86,9 @@ public function setChunkSize(?int $chunkSize)
8886 $ this ->chunkSize = $ chunkSize ;
8987 }
9088
91- public function executeSelect (SelectQuery $ query, int $ flags = 0 ): SelectResult
89+ public function executeSelect (SelectQuery $ query ): SelectResult
9290 {
93- if (( $ flags & self :: FLAG_DISABLE_OPTIMIZER ) === 0 ) {
91+ if (! $ query -> isQueryOptimizerDisabled () ) {
9492 $ query = QueryOptimizer::optimizeSelect ($ query );
9593 }
9694 $ compiled = $ this ->compiler ->compileSelect ($ query );
Original file line number Diff line number Diff line change @@ -167,4 +167,16 @@ public function getAfterExecuteActions()
167167 return $ this ->actions ;
168168 }
169169 #endregion
170+
171+ private $ disabledQueryOptimizer = false ;
172+
173+ public function disableQueryOptimizer ($ disabled = true )
174+ {
175+ $ this ->disabledQueryOptimizer = $ disabled ;
176+ }
177+
178+ public function isQueryOptimizerDisabled ()
179+ {
180+ return $ this ->disabledQueryOptimizer ;
181+ }
170182}
You can’t perform that action at this time.
0 commit comments