These constants are better as a part of DatabaseInterface class
This commit is contained in:
parent
4e09cb513b
commit
3dd99512f0
@ -285,7 +285,11 @@ if ($cfgRelation['pdfwork'] && $num_tables > 0) {
|
||||
FROM ' . PMA_Util::backquote($GLOBALS['cfgRelation']['db'])
|
||||
. '.' . PMA_Util::backquote($cfgRelation['pdf_pages']) . '
|
||||
WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
|
||||
$test_rs = PMA_queryAsControlUser($test_query, null, PMA_DBI_QUERY_STORE);
|
||||
$test_rs = PMA_queryAsControlUser(
|
||||
$test_query,
|
||||
null,
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
/*
|
||||
* Export Relational Schema View
|
||||
|
||||
@ -261,7 +261,7 @@ class PMA_DbQbe
|
||||
$all_tables = $GLOBALS['dbi']->query(
|
||||
'SHOW TABLES FROM ' . PMA_Util::backquote($this->_db) . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$all_tables_count = $GLOBALS['dbi']->numRows($all_tables);
|
||||
if (0 == $all_tables_count) {
|
||||
|
||||
@ -9,23 +9,6 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force STORE_RESULT method, ignored by classic MySQL.
|
||||
*/
|
||||
define('PMA_DBI_QUERY_STORE', 1);
|
||||
/**
|
||||
* Do not read whole query.
|
||||
*/
|
||||
define('PMA_DBI_QUERY_UNBUFFERED', 2);
|
||||
/**
|
||||
* Get session variable.
|
||||
*/
|
||||
define('PMA_DBI_GETVAR_SESSION', 1);
|
||||
/**
|
||||
* Get global variable.
|
||||
*/
|
||||
define('PMA_DBI_GETVAR_GLOBAL', 2);
|
||||
|
||||
$extension = null;
|
||||
if (defined('TESTSUITE')) {
|
||||
/**
|
||||
@ -100,6 +83,23 @@ $GLOBALS['dbi'] = new PMA_DatabaseInterface($extension);
|
||||
*/
|
||||
class PMA_DatabaseInterface
|
||||
{
|
||||
/**
|
||||
* Force STORE_RESULT method, ignored by classic MySQL.
|
||||
*/
|
||||
const QUERY_STORE = 1;
|
||||
/**
|
||||
* Do not read whole query.
|
||||
*/
|
||||
const QUERY_UNBUFFERED = 2;
|
||||
/**
|
||||
* Get session variable.
|
||||
*/
|
||||
const GETVAR_SESSION = 1;
|
||||
/**
|
||||
* Get global variable.
|
||||
*/
|
||||
const GETVAR_GLOBAL = 2;
|
||||
|
||||
private $_extension;
|
||||
|
||||
/**
|
||||
@ -378,7 +378,7 @@ class PMA_DatabaseInterface
|
||||
null,
|
||||
0,
|
||||
$link,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
|
||||
@ -1487,10 +1487,10 @@ class PMA_DatabaseInterface
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case PMA_DBI_GETVAR_SESSION:
|
||||
case self::GETVAR_SESSION:
|
||||
$modifier = ' SESSION';
|
||||
break;
|
||||
case PMA_DBI_GETVAR_GLOBAL:
|
||||
case self::GETVAR_GLOBAL:
|
||||
$modifier = ' GLOBAL';
|
||||
break;
|
||||
default:
|
||||
@ -1588,7 +1588,9 @@ class PMA_DatabaseInterface
|
||||
if (!PMA_DRIZZLE) {
|
||||
if (! empty($GLOBALS['collation_connection'])) {
|
||||
$this->query(
|
||||
"SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE
|
||||
"SET CHARACTER SET 'utf8';",
|
||||
$link,
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$set_collation_con_query = "SET collation_connection = '"
|
||||
. PMA_Util::sqlAddSlashes($GLOBALS['collation_connection'])
|
||||
@ -1596,13 +1598,13 @@ class PMA_DatabaseInterface
|
||||
$this->query(
|
||||
$set_collation_con_query,
|
||||
$link,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
} else {
|
||||
$this->query(
|
||||
"SET NAMES 'utf8' COLLATE 'utf8_general_ci';",
|
||||
$link,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1647,7 +1649,12 @@ class PMA_DatabaseInterface
|
||||
$value = false;
|
||||
|
||||
if (is_string($result)) {
|
||||
$result = $this->tryQuery($result, $link, PMA_DBI_QUERY_STORE, false);
|
||||
$result = $this->tryQuery(
|
||||
$result,
|
||||
$link,
|
||||
PMA_DatabaseInterface::QUERY_STORE,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
// return false if result is empty or false
|
||||
@ -1700,7 +1707,12 @@ class PMA_DatabaseInterface
|
||||
public function fetchSingleRow($result, $type = 'ASSOC', $link = null)
|
||||
{
|
||||
if (is_string($result)) {
|
||||
$result = $this->tryQuery($result, $link, PMA_DBI_QUERY_STORE, false);
|
||||
$result = $this->tryQuery(
|
||||
$result,
|
||||
$link,
|
||||
PMA_DatabaseInterface::QUERY_STORE,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
// return null if result is empty or false
|
||||
@ -2126,7 +2138,7 @@ class PMA_DatabaseInterface
|
||||
$result = (bool) $GLOBALS['dbi']->tryQuery(
|
||||
'SELECT COUNT(*) FROM mysql.user',
|
||||
$GLOBALS['userlink'],
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
PMA_Util::cacheSet('is_superuser', $result, true);
|
||||
|
||||
@ -5574,7 +5574,11 @@ class PMA_DisplayResults
|
||||
. PMA_Util::backquote($map[$meta->name][1])
|
||||
. $where_comparison;
|
||||
|
||||
$dispresult = $GLOBALS['dbi']->tryQuery($dispsql, null, PMA_DBI_QUERY_STORE);
|
||||
$dispresult = $GLOBALS['dbi']->tryQuery(
|
||||
$dispsql,
|
||||
null,
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if ($dispresult && $GLOBALS['dbi']->numRows($dispresult) > 0) {
|
||||
list($dispval) = $GLOBALS['dbi']->fetchRow($dispresult, 0);
|
||||
|
||||
@ -435,7 +435,7 @@ class PMA_Menu
|
||||
'Log_name',
|
||||
null,
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -615,7 +615,7 @@ class PMA_Table
|
||||
. PMA_Util::backquote($table) . ' LIMIT '
|
||||
. $GLOBALS['cfg']['MaxExactCountViews'],
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (!$GLOBALS['dbi']->getError()) {
|
||||
$row_count = $GLOBALS['dbi']->numRows($result);
|
||||
@ -720,10 +720,10 @@ class PMA_Table
|
||||
. PMA_Util::backquote($GLOBALS['cfgRelation'][$pma_table]) . '
|
||||
WHERE ' . implode(' AND ', $where_parts);
|
||||
|
||||
// must use PMA_DBI_QUERY_STORE here, since we execute another
|
||||
// must use PMA_DatabaseInterface::QUERY_STORE here, since we execute another
|
||||
// query inside the loop
|
||||
$table_copy_rs = PMA_queryAsControlUser(
|
||||
$table_copy_query, true, PMA_DBI_QUERY_STORE
|
||||
$table_copy_query, true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
while ($table_copy_row = @$GLOBALS['dbi']->fetchAssoc($table_copy_rs)) {
|
||||
|
||||
@ -3174,7 +3174,9 @@ class PMA_Util
|
||||
$wktsql .= ", SRID(x'" . $hex . "')";
|
||||
}
|
||||
|
||||
$wktresult = $GLOBALS['dbi']->tryQuery($wktsql, null, PMA_DBI_QUERY_STORE);
|
||||
$wktresult = $GLOBALS['dbi']->tryQuery(
|
||||
$wktsql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$wktarr = $GLOBALS['dbi']->fetchRow($wktresult, 0);
|
||||
$wktval = $wktarr[0];
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ function PMA_Bookmark_getList($db)
|
||||
. ' AND user = \'' . PMA_Util::sqlAddSlashes($cfgBookmark['user']) . '\''
|
||||
. ' ORDER BY label';
|
||||
$per_user = $GLOBALS['dbi']->fetchResult(
|
||||
$query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE
|
||||
$query, 'id', 'label', $controllink, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
$query = 'SELECT label, id FROM '. PMA_Util::backquote($cfgBookmark['db'])
|
||||
@ -75,7 +75,7 @@ function PMA_Bookmark_getList($db)
|
||||
. ' AND user = \'\''
|
||||
. ' ORDER BY label';
|
||||
$global = $GLOBALS['dbi']->fetchResult(
|
||||
$query, 'id', 'label', $controllink, PMA_DBI_QUERY_STORE
|
||||
$query, 'id', 'label', $controllink, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
foreach ($global as $key => $val) {
|
||||
|
||||
@ -325,7 +325,7 @@ function PMA_getTableCount($db)
|
||||
{
|
||||
$tables = $GLOBALS['dbi']->tryQuery(
|
||||
'SHOW TABLES FROM ' . PMA_Util::backquote($db) . ';',
|
||||
null, PMA_DBI_QUERY_STORE
|
||||
null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($tables) {
|
||||
$num_tables = $GLOBALS['dbi']->numRows($tables);
|
||||
|
||||
@ -83,7 +83,7 @@ if (true === $cfg['SkipLockedTables']) {
|
||||
if (isset($sot_cache)) {
|
||||
$db_info_result = $GLOBALS['dbi']->query(
|
||||
'SHOW TABLES FROM ' . PMA_Util::backquote($db) . $tbl_group_sql . ';',
|
||||
null, PMA_DBI_QUERY_STORE
|
||||
null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($db_info_result && $GLOBALS['dbi']->numRows($db_info_result) > 0) {
|
||||
while ($tmp = $GLOBALS['dbi']->fetchRow($db_info_result)) {
|
||||
|
||||
@ -61,7 +61,7 @@ if (empty($is_table)
|
||||
$_result = $GLOBALS['dbi']->tryQuery(
|
||||
'SHOW TABLES LIKE \'' . PMA_Util::sqlAddSlashes($table, true)
|
||||
. '\';',
|
||||
null, PMA_DBI_QUERY_STORE
|
||||
null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$is_table = @$GLOBALS['dbi']->numRows($_result);
|
||||
$GLOBALS['dbi']->freeResult($_result);
|
||||
@ -84,7 +84,7 @@ if (empty($is_table)
|
||||
$_result = $GLOBALS['dbi']->tryQuery(
|
||||
'SELECT COUNT(*) FROM ' . PMA_Util::backquote($table) . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$is_table = ($_result && @$GLOBALS['dbi']->numRows($_result));
|
||||
$GLOBALS['dbi']->freeResult($_result);
|
||||
|
||||
@ -198,7 +198,7 @@ class PMA_DBI_Drizzle implements PMA_DBI_Extension
|
||||
*/
|
||||
public function realQuery($query, $link, $options)
|
||||
{
|
||||
$buffer_mode = $options & PMA_DBI_QUERY_UNBUFFERED
|
||||
$buffer_mode = $options & PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
? PMA_Drizzle::BUFFER_ROW
|
||||
: PMA_Drizzle::BUFFER_RESULT;
|
||||
$res = $link->query($query, $buffer_mode);
|
||||
|
||||
@ -222,9 +222,9 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension
|
||||
*/
|
||||
public function realQuery($query, $link, $options)
|
||||
{
|
||||
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
|
||||
if ($options == ($options | PMA_DatabaseInterface::QUERY_STORE)) {
|
||||
return mysql_query($query, $link);
|
||||
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
|
||||
} elseif ($options == ($options | PMA_DatabaseInterface::QUERY_UNBUFFERED)) {
|
||||
return mysql_unbuffered_query($query, $link);
|
||||
} else {
|
||||
return mysql_query($query, $link);
|
||||
|
||||
@ -267,9 +267,9 @@ class PMA_DBI_Mysqli implements PMA_DBI_Extension
|
||||
*/
|
||||
public function realQuery($query, $link, $options)
|
||||
{
|
||||
if ($options == ($options | PMA_DBI_QUERY_STORE)) {
|
||||
if ($options == ($options | PMA_DatabaseInterface::QUERY_STORE)) {
|
||||
$method = MYSQLI_STORE_RESULT;
|
||||
} elseif ($options == ($options | PMA_DBI_QUERY_UNBUFFERED)) {
|
||||
} elseif ($options == ($options | PMA_DatabaseInterface::QUERY_UNBUFFERED)) {
|
||||
$method = MYSQLI_USE_RESULT;
|
||||
} else {
|
||||
$method = 0;
|
||||
|
||||
@ -82,7 +82,9 @@ function PMA_analyzeWhereClauses(
|
||||
. PMA_Util::backquote($db) . '.'
|
||||
. PMA_Util::backquote($table)
|
||||
. ' WHERE ' . $where_clause . ';';
|
||||
$result[$key_id] = $GLOBALS['dbi']->query($local_query, null, PMA_DBI_QUERY_STORE);
|
||||
$result[$key_id] = $GLOBALS['dbi']->query(
|
||||
$local_query, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$rows[$key_id] = $GLOBALS['dbi']->fetchAssoc($result[$key_id]);
|
||||
|
||||
$where_clauses[$key_id] = str_replace('\\', '\\\\', $where_clause);
|
||||
@ -155,7 +157,7 @@ function PMA_loadFirstRow($table, $db)
|
||||
'SELECT * FROM ' . PMA_Util::backquote($db)
|
||||
. '.' . PMA_Util::backquote($table) . ' LIMIT 1;',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$rows = array_fill(0, $GLOBALS['cfg']['InsertRows'], false);
|
||||
return array($result, $rows);
|
||||
@ -1993,7 +1995,9 @@ function PMA_getDisplayValueForForeignTableColumn($where_comparison,
|
||||
. '.' . PMA_Util::backquote($map[$relation_field]['foreign_table'])
|
||||
. ' WHERE ' . PMA_Util::backquote($map[$relation_field]['foreign_field'])
|
||||
. $where_comparison;
|
||||
$dispresult = $GLOBALS['dbi']->tryQuery($dispsql, null, PMA_DBI_QUERY_STORE);
|
||||
$dispresult = $GLOBALS['dbi']->tryQuery(
|
||||
$dispsql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($dispresult && $GLOBALS['dbi']->numRows($dispresult) > 0) {
|
||||
list($dispval) = $GLOBALS['dbi']->fetchRow($dispresult, 0);
|
||||
}
|
||||
|
||||
@ -246,7 +246,9 @@ class ExportCsv extends ExportPlugin
|
||||
global $what, $csv_terminated, $csv_separator, $csv_enclosed, $csv_escaped;
|
||||
|
||||
// Gets the data from the database
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$fields_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
|
||||
// If required, get fields name at the first line
|
||||
|
||||
@ -212,7 +212,9 @@ class ExportHtmlword extends ExportPlugin
|
||||
}
|
||||
|
||||
// Gets the data from the database
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$fields_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
|
||||
// If required, get fields name at the first line
|
||||
|
||||
@ -158,7 +158,9 @@ class ExportJson extends ExportPlugin
|
||||
*/
|
||||
public function exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
{
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$columns_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
|
||||
// Get field information
|
||||
|
||||
@ -290,7 +290,9 @@ class ExportLatex extends ExportPlugin
|
||||
*/
|
||||
public function exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
{
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
|
||||
$columns_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||
|
||||
@ -315,7 +315,9 @@ class ExportMediawiki extends ExportPlugin
|
||||
}
|
||||
|
||||
// Get the table data from the database
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$fields_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
|
||||
while ($row = $GLOBALS['dbi']->fetchRow($result)) {
|
||||
|
||||
@ -226,7 +226,9 @@ class ExportOds extends ExportPlugin
|
||||
global $what;
|
||||
|
||||
// Gets the data from the database
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$fields_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
|
||||
$field_flags = array();
|
||||
|
||||
@ -244,7 +244,9 @@ class ExportOdt extends ExportPlugin
|
||||
global $what;
|
||||
|
||||
// Gets the data from the database
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$fields_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
|
||||
$field_flags = array();
|
||||
|
||||
@ -163,7 +163,9 @@ class ExportPhparray extends ExportPlugin
|
||||
*/
|
||||
public function exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
{
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
|
||||
$columns_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||
|
||||
@ -903,12 +903,13 @@ class ExportSql extends ExportPlugin
|
||||
$compat = 'NONE';
|
||||
}
|
||||
|
||||
// need to use PMA_DBI_QUERY_STORE with $GLOBALS['dbi']->numRows() in mysqli
|
||||
// need to use PMA_DatabaseInterface::QUERY_STORE
|
||||
// with $GLOBALS['dbi']->numRows() in mysqli
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SHOW TABLE STATUS FROM ' . PMA_Util::backquote($db)
|
||||
. ' LIKE \'' . PMA_Util::sqlAddSlashes($table, true) . '\'',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($result != false) {
|
||||
if ($GLOBALS['dbi']->numRows($result) > 0) {
|
||||
@ -1005,7 +1006,7 @@ class ExportSql extends ExportPlugin
|
||||
// results below. Nonetheless, we got 2 user reports about this
|
||||
// (see bug 1562533) so I removed the unbuffered mode.
|
||||
// $result = $GLOBALS['dbi']->query('SHOW CREATE TABLE ' . backquote($db)
|
||||
// . '.' . backquote($table), null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
// . '.' . backquote($table), null, PMA_DatabaseInterface::QUERY_UNBUFFERED);
|
||||
//
|
||||
// Note: SHOW CREATE TABLE, at least in MySQL 5.1.23, does not
|
||||
// produce a displayable result for the default value of a BIT
|
||||
@ -1557,7 +1558,9 @@ class ExportSql extends ExportPlugin
|
||||
// are used, we did not get the true column name in case of aliases)
|
||||
$analyzed_sql = PMA_SQP_analyze(PMA_SQP_parse($sql_query));
|
||||
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
// a possible error: the table has crashed
|
||||
$tmp_error = $GLOBALS['dbi']->getError();
|
||||
if ($tmp_error) {
|
||||
|
||||
@ -188,7 +188,9 @@ class ExportTexytext extends ExportPlugin
|
||||
}
|
||||
|
||||
// Gets the data from the database
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$fields_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
|
||||
// If required, get fields name at the first line
|
||||
|
||||
@ -445,7 +445,9 @@ class ExportXml extends ExportPlugin
|
||||
if (isset($GLOBALS['xml_export_contents'])
|
||||
&& $GLOBALS['xml_export_contents']
|
||||
) {
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
|
||||
$columns_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
$columns = array();
|
||||
|
||||
@ -156,7 +156,9 @@ class ExportYaml extends ExportPlugin
|
||||
*/
|
||||
public function exportData($db, $table, $crlf, $error_url, $sql_query)
|
||||
{
|
||||
$result = $GLOBALS['dbi']->query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
|
||||
$columns_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||
|
||||
@ -277,7 +277,9 @@ class PMA_ExportPdf extends PMA_PDF
|
||||
/**
|
||||
* Pass 1 for column widths
|
||||
*/
|
||||
$this->results = $GLOBALS['dbi']->query($query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$this->results = $GLOBALS['dbi']->query(
|
||||
$query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$this->numFields = $GLOBALS['dbi']->numFields($this->results);
|
||||
$this->fields = $GLOBALS['dbi']->getFieldsMeta($this->results);
|
||||
|
||||
@ -395,7 +397,7 @@ class PMA_ExportPdf extends PMA_PDF
|
||||
|
||||
// Pass 2
|
||||
|
||||
$this->results = $GLOBALS['dbi']->query($query, null, PMA_DBI_QUERY_UNBUFFERED);
|
||||
$this->results = $GLOBALS['dbi']->query($query, null, PMA_DatabaseInterface::QUERY_UNBUFFERED);
|
||||
$this->setY($this->tMargin);
|
||||
$this->AddPage();
|
||||
$this->SetFont(PMA_PDF_FONT, '', 9);
|
||||
|
||||
@ -84,7 +84,7 @@ function get_columns_info()
|
||||
true
|
||||
),
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$tbl_name_i = $GLOBALS['PMD']['TABLE_NAME'][$i];
|
||||
$j = 0;
|
||||
@ -112,7 +112,7 @@ function get_script_contr()
|
||||
$alltab_rs = $GLOBALS['dbi']->query(
|
||||
'SHOW TABLES FROM ' . PMA_Util::backquote($GLOBALS['db']),
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
while ($val = @$GLOBALS['dbi']->fetchRow($alltab_rs)) {
|
||||
$row = PMA_getForeigners($GLOBALS['db'], $val[0], '', 'internal');
|
||||
@ -255,7 +255,11 @@ function get_tab_pos()
|
||||
FROM " . PMA_Util::backquote($cfgRelation['db'])
|
||||
. "." . PMA_Util::backquote($cfgRelation['designer_coords']);
|
||||
$tab_pos = $GLOBALS['dbi']->fetchResult(
|
||||
$query, 'name', null, $GLOBALS['controllink'], PMA_DBI_QUERY_STORE
|
||||
$query,
|
||||
'name',
|
||||
null,
|
||||
$GLOBALS['controllink'],
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
return count($tab_pos) ? $tab_pos : null;
|
||||
}
|
||||
|
||||
@ -387,7 +387,9 @@ function PMA_checkRelationsParam()
|
||||
. PMA_Util::backquote(
|
||||
$GLOBALS['cfg']['Server']['pmadb']
|
||||
);
|
||||
$tab_rs = PMA_queryAsControlUser($tab_query, false, PMA_DBI_QUERY_STORE);
|
||||
$tab_rs = PMA_queryAsControlUser(
|
||||
$tab_query, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if (! $tab_rs) {
|
||||
// query failed ... ?
|
||||
@ -702,7 +704,9 @@ function PMA_getDbComment($db)
|
||||
WHERE db_name = '" . PMA_Util::sqlAddSlashes($db) . "'
|
||||
AND table_name = ''
|
||||
AND column_name = '(db_comment)'";
|
||||
$com_rs = PMA_queryAsControlUser($com_qry, true, PMA_DBI_QUERY_STORE);
|
||||
$com_rs = PMA_queryAsControlUser(
|
||||
$com_qry, true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if ($com_rs && $GLOBALS['dbi']->numRows($com_rs) > 0) {
|
||||
$row = $GLOBALS['dbi']->fetchAssoc($com_rs);
|
||||
@ -733,7 +737,9 @@ function PMA_getDbComments()
|
||||
FROM " . PMA_Util::backquote($cfgRelation['db'])
|
||||
. "." . PMA_Util::backquote($cfgRelation['column_info']) . "
|
||||
WHERE `column_name` = '(db_comment)'";
|
||||
$com_rs = PMA_queryAsControlUser($com_qry, true, PMA_DBI_QUERY_STORE);
|
||||
$com_rs = PMA_queryAsControlUser(
|
||||
$com_qry, true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if ($com_rs && $GLOBALS['dbi']->numRows($com_rs) > 0) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($com_rs)) {
|
||||
|
||||
@ -229,7 +229,9 @@ class Table_Stats
|
||||
|
||||
$this->tableName = $tableName;
|
||||
$sql = 'DESCRIBE ' . PMA_Util::backquote($tableName);
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql, null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$dia->dieSchema(
|
||||
$pageNumber, "DIA",
|
||||
@ -263,7 +265,9 @@ class Table_Stats
|
||||
. ' AND table_name = \''
|
||||
. PMA_Util::sqlAddSlashes($tableName) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
$result = PMA_queryAsControlUser($sql, false, PMA_DBI_QUERY_STORE);
|
||||
$result = PMA_queryAsControlUser(
|
||||
$sql, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$dia->dieSchema(
|
||||
$pageNumber,
|
||||
@ -287,7 +291,7 @@ class Table_Stats
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($GLOBALS['dbi']->numRows($result) > 0) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
|
||||
@ -418,7 +418,9 @@ class Table_Stats
|
||||
|
||||
$this->_tableName = $tableName;
|
||||
$sql = 'DESCRIBE ' . PMA_Util::backquote($tableName);
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql, null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$eps->dieSchema(
|
||||
$pageNumber, "EPS",
|
||||
@ -465,7 +467,9 @@ class Table_Stats
|
||||
. ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_Util::sqlAddSlashes($tableName) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
$result = PMA_queryAsControlUser($sql, false, PMA_DBI_QUERY_STORE);
|
||||
$result = PMA_queryAsControlUser(
|
||||
$sql, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$eps->dieSchema(
|
||||
@ -484,7 +488,7 @@ class Table_Stats
|
||||
// index
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';',
|
||||
null, PMA_DBI_QUERY_STORE
|
||||
null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($GLOBALS['dbi']->numRows($result) > 0) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
|
||||
@ -199,7 +199,9 @@ class PMA_Export_Relation_Schema
|
||||
. ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
|
||||
$tab_rs = PMA_queryAsControlUser($tab_sql, null, PMA_DBI_QUERY_STORE);
|
||||
$tab_rs = PMA_queryAsControlUser(
|
||||
$tab_sql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $tab_rs || ! $GLOBALS['dbi']->numRows($tab_rs) > 0) {
|
||||
$this->dieSchema('', __('This page does not contain any tables!'));
|
||||
}
|
||||
|
||||
@ -405,7 +405,9 @@ class Table_Stats
|
||||
|
||||
$this->_tableName = $tableName;
|
||||
$sql = 'DESCRIBE ' . PMA_Util::backquote($tableName);
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql, null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$pdf->Error(sprintf(__('The %s table doesn\'t exist!'), $tableName));
|
||||
}
|
||||
@ -443,7 +445,9 @@ class Table_Stats
|
||||
. ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_Util::sqlAddSlashes($tableName) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
$result = PMA_queryAsControlUser($sql, false, PMA_DBI_QUERY_STORE);
|
||||
$result = PMA_queryAsControlUser(
|
||||
$sql, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$pdf->Error(
|
||||
sprintf(
|
||||
@ -464,7 +468,7 @@ class Table_Stats
|
||||
*/
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';',
|
||||
null, PMA_DBI_QUERY_STORE
|
||||
null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($GLOBALS['dbi']->numRows($result) > 0) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
|
||||
@ -384,7 +384,9 @@ class Table_Stats
|
||||
|
||||
$this->_tableName = $tableName;
|
||||
$sql = 'DESCRIBE ' . PMA_Util::backquote($tableName);
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql, null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$svg->dieSchema(
|
||||
$pageNumber,
|
||||
@ -433,7 +435,9 @@ class Table_Stats
|
||||
. ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_Util::sqlAddSlashes($tableName) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
$result = PMA_queryAsControlUser($sql, false, PMA_DBI_QUERY_STORE);
|
||||
$result = PMA_queryAsControlUser(
|
||||
$sql, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$svg->dieSchema(
|
||||
@ -454,7 +458,7 @@ class Table_Stats
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($GLOBALS['dbi']->numRows($result) > 0) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
|
||||
@ -182,7 +182,7 @@ class PMA_User_Schema
|
||||
. PMA_Util::backquote($cfgRelation['pdf_pages'])
|
||||
. ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\'';
|
||||
$page_rs = PMA_queryAsControlUser(
|
||||
$page_query, false, PMA_DBI_QUERY_STORE
|
||||
$page_query, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if ($page_rs && $GLOBALS['dbi']->numRows($page_rs) > 0) {
|
||||
@ -248,7 +248,7 @@ class PMA_User_Schema
|
||||
$alltab_rs = $GLOBALS['dbi']->query(
|
||||
'SHOW TABLES FROM ' . PMA_Util::backquote($db) . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
while ($val = @$GLOBALS['dbi']->fetchRow($alltab_rs)) {
|
||||
$selectboxall[] = $val[0];
|
||||
@ -745,7 +745,7 @@ class PMA_User_Schema
|
||||
. ' GROUP BY master_table'
|
||||
. ' ORDER BY COUNT(master_table) DESC';
|
||||
$master_tables_rs = PMA_queryAsControlUser(
|
||||
$master_tables, false, PMA_DBI_QUERY_STORE
|
||||
$master_tables, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($master_tables_rs && $GLOBALS['dbi']->numRows($master_tables_rs) > 0) {
|
||||
/* first put all the master tables at beginning
|
||||
@ -886,7 +886,7 @@ class PMA_User_Schema
|
||||
. ' AND pdf_page_number = \''
|
||||
. PMA_Util::sqlAddSlashes($this->chosenPage) . '\'';
|
||||
$test_rs = PMA_queryAsControlUser(
|
||||
$test_query, false, PMA_DBI_QUERY_STORE
|
||||
$test_query, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
//echo $test_query;
|
||||
if ($test_rs && $GLOBALS['dbi']->numRows($test_rs) > 0) {
|
||||
|
||||
@ -224,7 +224,9 @@ class Table_Stats
|
||||
|
||||
$this->_tableName = $tableName;
|
||||
$sql = 'DESCRIBE ' . PMA_Util::backquote($tableName);
|
||||
$result = $GLOBALS['dbi']->tryQuery($sql, null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->tryQuery(
|
||||
$sql, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$visio->dieSchema(
|
||||
$pageNumber,
|
||||
@ -273,7 +275,9 @@ class Table_Stats
|
||||
. ' WHERE db_name = \'' . PMA_Util::sqlAddSlashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_Util::sqlAddSlashes($tableName) . '\''
|
||||
. ' AND pdf_page_number = ' . $pageNumber;
|
||||
$result = PMA_queryAsControlUser($sql, false, PMA_DBI_QUERY_STORE);
|
||||
$result = PMA_queryAsControlUser(
|
||||
$sql, false, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if (! $result || ! $GLOBALS['dbi']->numRows($result)) {
|
||||
$visio->dieSchema(
|
||||
@ -293,7 +297,7 @@ class Table_Stats
|
||||
// index
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SHOW INDEX FROM ' . PMA_Util::backquote($tableName) . ';', null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
if ($GLOBALS['dbi']->numRows($result) > 0) {
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
|
||||
@ -49,7 +49,7 @@ $binary_logs = PMA_DRIZZLE
|
||||
'Log_name',
|
||||
null,
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
PMA_Util::checkParameters(
|
||||
|
||||
@ -2331,7 +2331,7 @@ function PMA_displayTablesInEditPrivs($dbname, $found_rows)
|
||||
PMA_Util::unescapeMysqlWildcards($dbname)
|
||||
) . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if ($result) {
|
||||
@ -2588,7 +2588,7 @@ function PMA_getHtmlForDisplayTheInitials($array_initials, $conditional_class)
|
||||
$initials = $GLOBALS['dbi']->tryQuery(
|
||||
'SELECT DISTINCT UPPER(LEFT(`User`,1)) FROM `user` ORDER BY `User` ASC',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
while (list($tmp_initial) = $GLOBALS['dbi']->fetchRow($initials)) {
|
||||
$array_initials[$tmp_initial] = true;
|
||||
@ -2924,7 +2924,9 @@ function PMA_getHtmlForDisplayUserOverviewPage($link_edit, $pmaThemeImage,
|
||||
: '');
|
||||
|
||||
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
|
||||
$res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DBI_QUERY_STORE);
|
||||
$res = $GLOBALS['dbi']->tryQuery(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if (! $res) {
|
||||
// the query failed! This may have two reasons:
|
||||
@ -2933,7 +2935,9 @@ function PMA_getHtmlForDisplayUserOverviewPage($link_edit, $pmaThemeImage,
|
||||
// so let's try a more simple query
|
||||
|
||||
$sql_query = 'SELECT * FROM `mysql`.`user`';
|
||||
$res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA_DBI_QUERY_STORE);
|
||||
$res = $GLOBALS['dbi']->tryQuery(
|
||||
$sql_query, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if (! $res) {
|
||||
$html_output .= PMA_Message::error(__('No Privileges'))->getDisplay();
|
||||
@ -3118,7 +3122,7 @@ function PMA_getTablePrivsQueriesForChangeOrCopyUser($user_host_condition,
|
||||
$res = $GLOBALS['dbi']->query(
|
||||
'SELECT `Db`, `Table_name`, `Table_priv` FROM `mysql`.`tables_priv`' . $user_host_condition,
|
||||
$GLOBALS['userlink'],
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($res)) {
|
||||
|
||||
@ -3135,7 +3139,7 @@ function PMA_getTablePrivsQueriesForChangeOrCopyUser($user_host_condition,
|
||||
.' = \'' . PMA_Util::sqlAddSlashes($row['Table_name']) . "'"
|
||||
.';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
$tmp_privs1 = PMA_extractPrivInfo($row);
|
||||
|
||||
@ -669,7 +669,7 @@ function PMA_getValuesForColumn($db, $table, $column)
|
||||
$field_info_query = $GLOBALS['dbi']->getColumnsSql($db, $table, $column);
|
||||
|
||||
$field_info_result = $GLOBALS['dbi']->fetchResult(
|
||||
$field_info_query, null, null, null, PMA_DBI_QUERY_STORE
|
||||
$field_info_query, null, null, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
$values = PMA_Util::parseEnumSetValues($field_info_result[0]['Type']);
|
||||
|
||||
@ -280,7 +280,9 @@ function PMA_setMIME($db, $table, $key, $mimetype, $transformation,
|
||||
AND `table_name` = \'' . PMA_Util::sqlAddSlashes($table) . '\'
|
||||
AND `column_name` = \'' . PMA_Util::sqlAddSlashes($key) . '\'';
|
||||
|
||||
$test_rs = PMA_queryAsControlUser($test_qry, true, PMA_DBI_QUERY_STORE);
|
||||
$test_rs = PMA_queryAsControlUser(
|
||||
$test_qry, true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
if ($test_rs && $GLOBALS['dbi']->numRows($test_rs) > 0) {
|
||||
$row = @$GLOBALS['dbi']->fetchAssoc($test_rs);
|
||||
|
||||
@ -64,7 +64,7 @@ if (isset($mode)) {
|
||||
. " FROM " . $pmd_table
|
||||
. " WHERE db_name = '" . PMA_Util::sqlAddSlashes($db) . "'";
|
||||
|
||||
PMA_queryAsControlUser($sql, true, PMA_DBI_QUERY_STORE);
|
||||
PMA_queryAsControlUser($sql, true, PMA_DatabaseInterface::QUERY_STORE);
|
||||
}
|
||||
|
||||
if ('import' == $mode) {
|
||||
@ -79,7 +79,7 @@ if (isset($mode)) {
|
||||
AND
|
||||
' . $pmd_table . '.`db_name`=\''. PMA_Util::sqlAddSlashes($db) . '\'
|
||||
AND pdf_page_number = ' . $pdf_page_number_q . ';',
|
||||
true, PMA_DBI_QUERY_STORE
|
||||
true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ if (PMA_Util::isForeignKeySupported($type_T1)
|
||||
. '\'' . PMA_Util::sqlAddSlashes($T1) . '\','
|
||||
. '\'' . PMA_Util::sqlAddSlashes($F1) . '\')';
|
||||
|
||||
if (PMA_queryAsControlUser($q, false, PMA_DBI_QUERY_STORE)) {
|
||||
if (PMA_queryAsControlUser($q, false, PMA_DatabaseInterface::QUERY_STORE)) {
|
||||
PMD_return_new(1, __('Internal relation added'));
|
||||
} else {
|
||||
PMD_return_new(0, __('Error: Relation not added.'));
|
||||
|
||||
@ -60,7 +60,7 @@ if ($try_to_delete_internal_relation) {
|
||||
. ' AND foreign_table = \'' . PMA_Util::sqlAddSlashes($T1) . '\''
|
||||
. ' AND foreign_field = \'' . PMA_Util::sqlAddSlashes($F1) . '\'',
|
||||
false,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
PMD_return_upd(1, __('Relation deleted'));
|
||||
|
||||
@ -45,7 +45,7 @@ foreach ($t_x as $key => $value) {
|
||||
. '.' . PMA_Util::backquote($GLOBALS['cfgRelation']['designer_coords'])
|
||||
. ' WHERE `db_name` = \'' . PMA_Util::sqlAddSlashes($DB) . '\''
|
||||
. ' AND `table_name` = \'' . PMA_Util::sqlAddSlashes($TAB) . '\'',
|
||||
true, PMA_DBI_QUERY_STORE
|
||||
true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
PMA_queryAsControlUser(
|
||||
@ -59,7 +59,7 @@ foreach ($t_x as $key => $value) {
|
||||
. '\'' . PMA_Util::sqlAddSlashes($t_y[$key]) . '\', '
|
||||
. '\'' . PMA_Util::sqlAddSlashes($t_v[$key]) . '\', '
|
||||
. '\'' . PMA_Util::sqlAddSlashes($t_h[$key]) . '\')',
|
||||
true, PMA_DBI_QUERY_STORE
|
||||
true, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
4
sql.php
4
sql.php
@ -548,7 +548,9 @@ if (isset($GLOBALS['show_as_php']) || ! empty($GLOBALS['validatequery'])) {
|
||||
// Measure query time.
|
||||
$querytime_before = array_sum(explode(' ', microtime()));
|
||||
|
||||
$result = @$GLOBALS['dbi']->tryQuery($full_sql_query, null, PMA_DBI_QUERY_STORE);
|
||||
$result = @$GLOBALS['dbi']->tryQuery(
|
||||
$full_sql_query, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
|
||||
// If a stored procedure was called, there may be more results that are
|
||||
// queued up and waiting to be flushed from the buffer. So let's do that.
|
||||
|
||||
@ -332,7 +332,9 @@ if ($cfgRelation['relwork']
|
||||
// [0] of the row is the name
|
||||
}
|
||||
|
||||
$tab_rs = $GLOBALS['dbi']->query($tab_query, null, PMA_DBI_QUERY_STORE);
|
||||
$tab_rs = $GLOBALS['dbi']->query(
|
||||
$tab_query, null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$selectboxall[] = '';
|
||||
$selectboxall_foreign[] = '';
|
||||
|
||||
@ -362,7 +364,7 @@ if ($cfgRelation['relwork']
|
||||
} // end if
|
||||
|
||||
// Now find out the columns of our $table
|
||||
// need to use PMA_DBI_QUERY_STORE with $GLOBALS['dbi']->numRows() in mysqli
|
||||
// need to use PMA_DatabaseInterface::QUERY_STORE with $GLOBALS['dbi']->numRows() in mysqli
|
||||
$columns = $GLOBALS['dbi']->getColumns($db, $table);
|
||||
|
||||
if (count($columns) > 0) {
|
||||
|
||||
@ -61,7 +61,9 @@ if (isset($_REQUEST['get_data_row']) && $_REQUEST['get_data_row'] == true) {
|
||||
$extra_data = array();
|
||||
$row_info_query = 'SELECT * FROM `' . $_REQUEST['db'] . '`.`'
|
||||
. $_REQUEST['table'] . '` WHERE ' . $_REQUEST['where_clause'];
|
||||
$result = $GLOBALS['dbi']->query($row_info_query . ";", null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$row_info_query . ";", null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
// for bit fields we need to convert them to printable form
|
||||
@ -138,7 +140,9 @@ if (isset($zoom_submit)
|
||||
$sql_query .= ' LIMIT ' . $maxPlotLimit;
|
||||
|
||||
//Query execution part
|
||||
$result = $GLOBALS['dbi']->query($sql_query . ";", null, PMA_DBI_QUERY_STORE);
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
$sql_query . ";", null, PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
|
||||
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
|
||||
//Need a row with indexes as 0,1,2 for the getUniqueCondition
|
||||
|
||||
@ -51,14 +51,14 @@ if (isset($where_clause)) {
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SELECT * FROM ' . PMA_Util::backquote($table) . ' WHERE ' . $where_clause . ';',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$row = $GLOBALS['dbi']->fetchAssoc($result);
|
||||
} else {
|
||||
$result = $GLOBALS['dbi']->query(
|
||||
'SELECT * FROM ' . PMA_Util::backquote($table) . ' LIMIT 1;',
|
||||
null,
|
||||
PMA_DBI_QUERY_STORE
|
||||
PMA_DatabaseInterface::QUERY_STORE
|
||||
);
|
||||
$row = $GLOBALS['dbi']->fetchAssoc($result);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user