File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -213,11 +213,10 @@ public function getSize(): int
213
213
if ($ request !== false && Db::$ db ->num_rows ($ request ) == 1 ) {
214
214
$ row = Db::$ db ->fetch_assoc ($ request );
215
215
$ this ->size = (int ) $ row ['Data_length ' ] + (int ) $ row ['Index_length ' ];
216
+ Db::$ db ->free_result ($ request );
216
217
}
217
218
}
218
219
219
- Db::$ db ->free_result ($ request );
220
-
221
220
return $ this ->size ;
222
221
}
223
222
Original file line number Diff line number Diff line change @@ -188,6 +188,14 @@ public function getSize(): int
188
188
$ this ->size = 0 ;
189
189
190
190
if (Db::$ db ->title === POSTGRE_TITLE ) {
191
+
192
+ // Postgres will throw an error if the tables don't exist, so check first
193
+ $ search_tables = Db::$ db ->list_tables (Db::$ db ->name , Db::$ db ->prefix . 'log_search% ' );
194
+
195
+ if (array_intersect ([Db::$ db ->prefix . 'log_search_dictionary ' , Db::$ db ->prefix . 'log_search_parsed ' ], $ search_tables ) == []) {
196
+ return $ this ->size ;
197
+ }
198
+
191
199
$ request = Db::$ db ->query (
192
200
'' ,
193
201
'SELECT (
@@ -203,6 +211,8 @@ public function getSize(): int
203
211
while ($ row = Db::$ db ->fetch_assoc ($ request )) {
204
212
$ this ->size = (int ) $ row ['total_size ' ];
205
213
}
214
+
215
+ Db::$ db ->free_result ($ request );
206
216
} else {
207
217
$ request = Db::$ db ->query (
208
218
'' ,
You can’t perform that action at this time.
0 commit comments