mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11469] Use multi insert property from DB. Do not copy value to buffer.
PHPBB3-11469
This commit is contained in:
parent
4132573088
commit
1bd13acb75
1 changed files with 1 additions and 5 deletions
|
@ -58,9 +58,6 @@ class phpbb_db_sql_insert_buffer
|
||||||
/** @var phpbb_db_driver */
|
/** @var phpbb_db_driver */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
/** @var bool */
|
|
||||||
protected $db_supports_multi_insert;
|
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $table_name;
|
protected $table_name;
|
||||||
|
|
||||||
|
@ -78,7 +75,6 @@ class phpbb_db_sql_insert_buffer
|
||||||
public function __construct(phpbb_db_driver $db, $table_name, $max_buffered_rows = 500)
|
public function __construct(phpbb_db_driver $db, $table_name, $max_buffered_rows = 500)
|
||||||
{
|
{
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->db_supports_multi_insert = $db->multi_insert;
|
|
||||||
$this->table_name = $table_name;
|
$this->table_name = $table_name;
|
||||||
$this->max_buffered_rows = $max_buffered_rows;
|
$this->max_buffered_rows = $max_buffered_rows;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +96,7 @@ class phpbb_db_sql_insert_buffer
|
||||||
|
|
||||||
// Flush buffer if it is full or when DB does not support multi inserts.
|
// Flush buffer if it is full or when DB does not support multi inserts.
|
||||||
// In the later case, the buffer will always only contain one row.
|
// In the later case, the buffer will always only contain one row.
|
||||||
if (!$this->db_supports_multi_insert || sizeof($this->buffer) >= $this->max_buffered_rows)
|
if (!$this->db->multi_insert || sizeof($this->buffer) >= $this->max_buffered_rows)
|
||||||
{
|
{
|
||||||
return $this->flush();
|
return $this->flush();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue