| @@ -253,8 +253,15 @@ | ||
| 253 | 253 | if (preg_match("/^(SELECT|SHOW)/i", $sql)) |
| 254 | 254 | { |
| 255 | 255 | // result should contain an array |
| 256 | 256 | $this->result = $this->db->get_results($sql); |
| 257 | + | |
| 258 | + /** | |
| 259 | + * Flush result after executing the query to free disk space. | |
| 260 | + * | |
| 261 | + * @since 10.1.73 | |
| 262 | + */ | |
| 263 | + $this->db->flush(); | |
| 257 | 264 | } |
| 258 | 265 | // otherwise we can launch a generic query |
| 259 | 266 | else |
| 260 | 267 | { |
| @@ -323,9 +330,17 @@ | ||
| 323 | 330 | } |
| 324 | 331 | |
| 325 | 332 | if (is_array($this->result)) |
| 326 | 333 | { |
| 327 | - return $this->result; | |
| 334 | + /** | |
| 335 | + * Copy result on a local variable and flush the cached value. | |
| 336 | + * | |
| 337 | + * @since 10.1.73 | |
| 338 | + */ | |
| 339 | + $result = $this->result; | |
| 340 | + $this->result = null; | |
| 341 | + | |
| 342 | + return $result; | |
| 328 | 343 | } |
| 329 | 344 | |
| 330 | 345 | return array(); |
| 331 | 346 | } |
| @@ -665,8 +680,20 @@ | ||
| 665 | 680 | // store affected rows |
| 666 | 681 | $this->result = (int) $affected; |
| 667 | 682 | |
| 668 | 683 | return $affected !== false; |
| 684 | + } | |
| 685 | + | |
| 686 | + /** | |
| 687 | + * Returns the error faced (if any) during the last query execution. | |
| 688 | + * | |
| 689 | + * @return string The error message. | |
| 690 | + * | |
| 691 | + * @since 10.1.58 | |
| 692 | + */ | |
| 693 | + public function getLastError() | |
| 694 | + { | |
| 695 | + return $this->db->last_error; | |
| 669 | 696 | } |
| 670 | 697 | |
| 671 | 698 | /** |
| 672 | 699 | * Returns a PHP date() function compliant date format for the database driver. |