1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 14:46:36 +02:00

Prefer NULL to empty string in foreign keys (bug #3323800)

This commit is contained in:
Jakub Vrana
2011-06-23 21:21:53 +02:00
parent d9c2e80100
commit f8ae1d6360

View File

@@ -465,7 +465,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
$return = ($match["p1"] != "" ? $match["p1"] : ($match["p2"] != "" ? ($match["p2"] < 70 ? 20 : 19) . $match["p2"] : gmdate("Y"))) . "-$match[p3]$match[p4]-$match[p5]$match[p6]" . end($match);
}
$return = ($field["type"] == "bit" && ereg('^[0-9]+$', $value) ? $return : q($return));
if (!ereg('char|text', $field["type"]) && !like_bool($field) && $value == "") {
if ($value == "" && ($field["null"] || !ereg('char|text', $field["type"])) && !like_bool($field)) {
$return = "NULL";
} elseif (ereg('^(md5|sha1)$', $function)) {
$return = "$function($return)";