1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Notices: Declare properties in fetch_field()

This commit is contained in:
Jakub Vrana
2025-03-24 09:49:42 +01:00
parent c47590bb0d
commit b8eb0ad8f5
12 changed files with 19 additions and 23 deletions

View File

@@ -140,8 +140,8 @@ if (isset($_GET["mssql"])) {
$field = $this->fields[$this->offset++];
$return = new \stdClass;
$return->name = $field["Name"];
$return->orgname = $field["Name"];
$return->type = ($field["Type"] == 1 ? 254 : 0);
$return->charsetnr = 0;
return $return;
}

View File

@@ -219,12 +219,11 @@ if (!defined('Adminer\DRIVER')) {
}
/** Fetch next field
* @return object properties: name, type, orgtable, orgname, charsetnr
* @return object properties: name, type (9 for number, 254 for char), charsetnr (63 for binary); optionally: table, orgtable, orgname
*/
function fetch_field() {
$return = mysql_fetch_field($this->result, $this->offset++); // offset required under certain conditions
$return->orgtable = $return->table;
$return->orgname = $return->name;
$return->charsetnr = ($return->blob ? 63 : 0);
return $return;
}

View File

@@ -112,8 +112,7 @@ if (isset($_GET["oracle"])) {
$column = $this->offset++;
$return = new \stdClass;
$return->name = oci_field_name($this->result, $column);
$return->orgname = $return->name;
$return->type = oci_field_type($this->result, $column);
$return->type = oci_field_type($this->result, $column); //! map to MySQL numbers
$return->charsetnr = (preg_match("~raw|blob|bfile~", $return->type) ? 63 : 0); // 63 - binary
return $return;
}

View File

@@ -133,12 +133,9 @@ if (isset($_GET["pgsql"])) {
function fetch_field() {
$column = $this->offset++;
$return = new \stdClass;
if (function_exists('pg_field_table')) {
$return->orgtable = pg_field_table($this->result, $column);
}
$return->orgtable = pg_field_table($this->result, $column);
$return->name = pg_field_name($this->result, $column);
$return->orgname = $return->name;
$return->type = pg_field_type($this->result, $column);
$return->type = pg_field_type($this->result, $column); //! map to MySQL numbers
$return->charsetnr = ($return->type == "bytea" ? 63 : 0); // 63 - binary
return $return;
}

View File

@@ -70,7 +70,7 @@ if (isset($_GET["sqlite"])) {
function fetch_field() {
$column = $this->offset++;
$type = $this->result->columnType($column);
$type = $this->result->columnType($column); //! map to MySQL numbers
return (object) array(
"name" => $this->result->columnName($column),
"type" => $type,