File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -94,28 +94,16 @@ public function toSelect() {
94
94
}
95
95
96
96
public function asExplain () {
97
- switch ($ this ->type ) {
98
- case self ::SELECT :
99
- case self ::UNION :
100
- $ sql = $ this ->sql ;
101
- break ;
102
- case self ::DELETE :
103
- case self ::DELETEMULTI :
104
- case self ::UPDATE :
105
- case self ::INSERTSELECT :
106
- $ sql = $ this ->toSelect ();
107
- break ;
108
- default :
109
- return null ;
110
- }
97
+ $ sql = $ this ->toSelect ();
98
+ if (is_null ($ sql ))
99
+ return null ;
111
100
return "EXPLAIN $ sql " ;
112
101
}
113
102
114
103
public function asExtendedExplain () {
115
- $ sql = $ this ->asExplain ();
104
+ $ sql = $ this ->toSelect ();
116
105
if (is_null ($ sql ))
117
106
return null ;
118
- $ sql = preg_replace ('/^EXPLAIN /i ' , 'EXPLAIN EXTENDED ' , $ sql );
119
- return $ sql ;
107
+ return "EXPLAIN EXTENDED $ sql " ;
120
108
}
121
109
}
You can’t perform that action at this time.
0 commit comments