Support for unbuffered queries - PMA_DBI_QUERY_UNBUFFERED and fix support of PMA_DBI_QUERY_STORE.

This commit is contained in:
Michal Čihař
2004-03-10 11:01:50 +00:00
parent f28ddb784f
commit 39f110f82c
3 changed files with 12 additions and 3 deletions

View File

@@ -5,7 +5,8 @@
/**
* Common Option Constants For DBI Functions
*/
define('PMA_DBI_QUERY_STORE', 1); // Force STORE_RESULT method, ignored by classic MySQL.
define('PMA_DBI_QUERY_STORE', 1); // Force STORE_RESULT method, ignored by classic MySQL.
define('PMA_DBI_QUERY_UNBUFFERED', 2); // Do not read whole query
/**
* Including The DBI Plugin

View File

@@ -119,7 +119,13 @@ function PMA_DBI_try_query($query, $link = NULL, $options = 0) {
if (PMA_MYSQL_INT_VERSION < 40100) {
$query = PMA_convert_charset($query);
}
return mysql_query($query, $link);
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
return mysql_query($query, $link);
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
return mysql_unbuffered_query($query, $link);
} else {
return mysql_query($query, $link);
}
}
// The following function is meant for internal use only.

View File

@@ -92,8 +92,10 @@ function PMA_DBI_select_db($dbname, $link = NULL) {
}
function PMA_DBI_try_query($query, $link = NULL, $options = 0) {
if ($options == $options | PMA_DBI_QUERY_STORE) {
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
$method = MYSQLI_STORE_RESULT;
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
$method = MYSQLI_USE_RESULT;
} else {
$method = MYSQLI_USE_RESULT;
}