mirror of
https://github.com/vrana/adminer.git
synced 2026-02-01 20:30:13 +01:00
MongoDB: Don't store unset values
This commit is contained in:
@@ -116,6 +116,10 @@ if (isset($_GET["mongo"])) {
|
|||||||
class Min_Driver extends Min_SQL {
|
class Min_Driver extends Min_SQL {
|
||||||
public $primary = "_id";
|
public $primary = "_id";
|
||||||
|
|
||||||
|
function quote($value) {
|
||||||
|
return ($value === null ? $value : parent::quote($value));
|
||||||
|
}
|
||||||
|
|
||||||
function select($table, $select, $where, $group, $order, $limit, $page, $print = false) {
|
function select($table, $select, $where, $group, $order, $limit, $page, $print = false) {
|
||||||
$select = ($select == array("*")
|
$select = ($select == array("*")
|
||||||
? array()
|
? array()
|
||||||
|
|||||||
@@ -10,6 +10,14 @@
|
|||||||
$this->_conn = $connection;
|
$this->_conn = $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Quote a SQL string or null value
|
||||||
|
* @param string
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function quote($value) {
|
||||||
|
return ($value === null ? "NULL" : $this->_conn->quote($value));
|
||||||
|
}
|
||||||
|
|
||||||
/** Select data from table
|
/** Select data from table
|
||||||
* @param string
|
* @param string
|
||||||
* @param array result of $adminer->selectColumnsProcess()[0]
|
* @param array result of $adminer->selectColumnsProcess()[0]
|
||||||
|
|||||||
@@ -249,13 +249,13 @@ function sid() {
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Shortcut for $connection->quote($string)
|
/** Shortcut for $driver->quote($string)
|
||||||
* @param string
|
* @param string
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function q($string) {
|
function q($string) {
|
||||||
global $connection;
|
global $driver;
|
||||||
return $connection->quote($string);
|
return $driver->quote($string);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get list of values from database
|
/** Get list of values from database
|
||||||
@@ -880,7 +880,7 @@ function process_input($field) {
|
|||||||
return ($field["on_update"] == "CURRENT_TIMESTAMP" ? idf_escape($field["field"]) : false);
|
return ($field["on_update"] == "CURRENT_TIMESTAMP" ? idf_escape($field["field"]) : false);
|
||||||
}
|
}
|
||||||
if ($function == "NULL") {
|
if ($function == "NULL") {
|
||||||
return "NULL";
|
$value = null;
|
||||||
}
|
}
|
||||||
if ($field["type"] == "set") {
|
if ($field["type"] == "set") {
|
||||||
return array_sum((array) $value);
|
return array_sum((array) $value);
|
||||||
|
|||||||
Reference in New Issue
Block a user