Editor: Display tinyint(1) as checkbox (fix #1246, regression from 5.4.2)

This commit is contained in:
Jakub Vrana
2026-02-27 16:28:48 +01:00
parent 8fa7dedc4b
commit 45c7082373
2 changed files with 3 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
- Foreign key: Display new field in case of an error
- PostgreSQL: Order NULL last
- PostgreSQL: Display all SQL command warnings and only once
- Editor: Display tinyint(1) as checkbox (bug #1246, regression from 5.4.2)
- Croatian translation
## Adminer 5.4.2 (released 2026-02-08)

View File

@@ -43,8 +43,8 @@ function send_mail(string $email, string $subject, string $message, string $from
}
/** Check whether the column looks like boolean
* @param array{type: string} $field single field returned from fields()
* @param array{type: string, length?: string} $field single field returned from fields()
*/
function like_bool(array $field): bool {
return preg_match("~bool|bit~", $field["type"]);
return $field["type"] == "bool" || (preg_match('~bit|tinyint~', $field["type"]) && $field["length"] == 1);
}