1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 04:11:27 +02:00

Non-MySQL: Better field types in SQL command

This commit is contained in:
Jakub Vrana
2025-03-24 14:41:08 +01:00
parent f5d23a8cad
commit 50cdbbe415
7 changed files with 10 additions and 9 deletions

View File

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

View File

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

View File

@@ -70,10 +70,10 @@ if (isset($_GET["sqlite"])) {
function fetch_field() {
$column = $this->offset++;
$type = $this->result->columnType($column); //! map to MySQL numbers
$type = $this->result->columnType($column);
return (object) array(
"name" => $this->result->columnName($column),
"type" => $type,
"type" => ($type == SQLITE3_TEXT ? 15 : 0),
"charsetnr" => ($type == SQLITE3_BLOB ? 63 : 0), // 63 - binary
);
}