diff options
Diffstat (limited to 'it_dbi.class')
-rw-r--r-- | it_dbi.class | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/it_dbi.class b/it_dbi.class index 8210b04..3d4f2a9 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -37,6 +37,7 @@ class it_dbi 'classprefix' => "", '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 + 'unbuffered' => false, # use mysql_unbuffered_query (WARNING this is not at all equivalent to normal it_dbi WARNING) ); var $_key; # Key of currently loaded record or null (public readonly) @@ -455,7 +456,7 @@ function query($query, $p = array()) debug("{$p['user']}@{$p['server']}:{$p['db']}" . '.' . get_class($this) . "::query(\"$query\")", 4); - if (!($result = mysql_query($query, $this->_link)) && $p['safety']) + if (!($result = ($p['unbuffered'] ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link))) && $p['safety']) { $errno = mysql_errno($this->_link); if (($p['safety'] < 2) && ($errno == 1062)) # Duplicate entry @@ -465,7 +466,7 @@ function query($query, $p = array()) { it::log('sqllog', "it_dbi(): reconnecting mysql_connect {$p['server']}, {$p['db']}"); $this->_connect(array('reconnect' => true)); - $result = mysql_query($query, $this->_link); + $result = $p['unbuffered'] ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link); } if (!$result) |