diff options
author | Nathan Gass | 2023-02-28 10:55:25 +0100 |
---|---|---|
committer | Nathan Gass | 2023-02-28 10:55:25 +0100 |
commit | 9ba6dd60b3f0887bb321e248deb701bedf273bc7 (patch) | |
tree | b59db9a5654d14600d49894e4a9bbd1dc95b2c6d /it_dbi.class | |
parent | 886f01f62a20a16b6763b6b4e3293bbd89740b82 (diff) | |
download | itools-9ba6dd60b3f0887bb321e248deb701bedf273bc7.tar.gz itools-9ba6dd60b3f0887bb321e248deb701bedf273bc7.tar.bz2 itools-9ba6dd60b3f0887bb321e248deb701bedf273bc7.zip |
remove unbuffered support
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/it_dbi.class b/it_dbi.class index 786fb90..c9cef54 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -42,7 +42,6 @@ class it_dbi implements Iterator 'getfieldinfo' => true, # do not read schema. only select() allowed 'localized_defaultlanguage' => "de", # Localize fields with this suffix, e.g. copy title_de to title on read 'throttle_writes' => 0, # sleep for 'throttle_writes' multiplied by the execution time after every write - 'unbuffered' => false, # use MYSQLI_USE_RESULT (WARNING this is not at all equivalent to normal it_dbi WARNING) 'ignored_warnings' => "", # regex of additional mysql warnings numbers to ignore 'interruptible_queries' => false, # make queries interruptible by php signal handlers 'timeout' => null, # timeout for queries @@ -680,7 +679,7 @@ function select(...$args) $this->clear(); if ($this->_result = $this->query($sql = "SELECT $what " . $this->_from($query) . " " . $this->_where($query))) { - $result = $this->_p['unbuffered'] ? true : $this->_num_rows($this->_result); + $result = $this->_num_rows($this->_result); if ($calc_found_rows) { @@ -754,8 +753,6 @@ function iterate() else { $this->clear(); - if ($this->_p['unbuffered']) - $this->_result->close(); } } else @@ -1133,7 +1130,7 @@ function __query($query, $p) if ($p['timeout'] || $this->_p['interruptible_queries']) { $starttime = microtime(true); - mysqli_query($this->_link, $query, ($p['unbuffered'] ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT) | MYSQLI_ASYNC); + mysqli_query($this->_link, $query, MYSQLI_STORE_RESULT | MYSQLI_ASYNC); do { $read = $error = $reject = [$this->_link]; if ($p['timeout'] && (microtime(true) - $starttime) > $p['timeout']) @@ -1143,7 +1140,7 @@ function __query($query, $p) } else { - return mysqli_query($this->_link, $query, $p['unbuffered'] ? MYSQLI_USE_RESULT : MYSQLI_STORE_RESULT); + return mysqli_query($this->_link, $query, MYSQLI_STORE_RESULT); } } |