Unbuffered queries save memory
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1038 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
54899fd554
commit
690f8f509c
|
@ -100,7 +100,7 @@ function dump_data($table, $style, $select = "") {
|
||||||
if ($_POST["format"] != "csv" && $style == "TRUNCATE+INSERT") {
|
if ($_POST["format"] != "csv" && $style == "TRUNCATE+INSERT") {
|
||||||
dump("TRUNCATE " . idf_escape($table) . ";\n");
|
dump("TRUNCATE " . idf_escape($table) . ";\n");
|
||||||
}
|
}
|
||||||
$result = $dbh->query(($select ? $select : "SELECT * FROM " . idf_escape($table))); //! enum and set as numbers, microtime
|
$result = $dbh->query(($select ? $select : "SELECT * FROM " . idf_escape($table)), 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers, microtime
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$fields = fields($table);
|
$fields = fields($table);
|
||||||
$insert = "";
|
$insert = "";
|
||||||
|
|
|
@ -61,8 +61,8 @@ if (extension_loaded("mysqli")) {
|
||||||
return mysql_select_db($database, $this->_link);
|
return mysql_select_db($database, $this->_link);
|
||||||
}
|
}
|
||||||
|
|
||||||
function query($query) {
|
function query($query, $unbuffered = false) {
|
||||||
$result = @mysql_query($query, $this->_link); // mute mysql.trace_mode
|
$result = @($unbuffered ? mysql_unbuffered_query($query, $this->_link) : mysql_query($query, $this->_link)); // @ - mute mysql.trace_mode
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$this->error = mysql_error($this->_link);
|
$this->error = mysql_error($this->_link);
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -19,7 +19,7 @@ if (extension_loaded('pdo')) {
|
||||||
return $this->query("USE " . idf_escape($database));
|
return $this->query("USE " . idf_escape($database));
|
||||||
}
|
}
|
||||||
|
|
||||||
function query($query) {
|
function query($query) { // $unbuffered is not supported
|
||||||
$result = parent::query($query);
|
$result = parent::query($query);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
$errorInfo = $this->errorInfo();
|
$errorInfo = $this->errorInfo();
|
||||||
|
|
Loading…
Reference in a new issue