diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 77f05c30..0d66ac48 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -616,19 +616,30 @@ class Adminer { * @return string */ function messageQuery($query, $time) { - global $jush; + global $jush, $driver; restart_session(); $history = &get_session("queries"); if (!$history[$_GET["db"]]) { $history[$_GET["db"]] = array(); } - $id = "sql-" . count($history[$_GET["db"]]); if (strlen($query) > 1e6) { $query = preg_replace('~[\x80-\xFF]+$~', '', substr($query, 0, 1e6)) . "\n..."; // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment } $history[$_GET["db"]][] = array($query, time(), $time); // not DB - $_GET["db"] is changed in database.inc.php //! respect $_GET["ns"] - return " " . @date("H:i:s") . "" // @ - time zone may be not set + $return = " " . @date("H:i:s") . ""; // @ - time zone may be not set + $warnings = $driver->warnings(); + $print = ""; + if ($warnings && $warnings->num_rows) { + $id = "warnings-" . count($history[$_GET["db"]]); + $return .= " " . lang('Warnings') . ","; + ob_start(); + select($warnings); // select() usually needs to print a big table progressively + $print = "
" . shorten_utf8($query, 1000) . '
'
. ($time ? " ($time)" : '')
. (support("sql") ? '' . lang('Edit') . '' : '') diff --git a/adminer/static/default.css b/adminer/static/default.css index 7e46dcd5..898f2724 100644 --- a/adminer/static/default.css +++ b/adminer/static/default.css @@ -37,6 +37,7 @@ input.wayoff { left: -1000px; position: absolute; } .error { color: red; background: #fee; } .error b { background: #fff; font-weight: normal; } .message { color: green; background: #efe; } +.message table { color: #000; background: #fff; } .error, .message { padding: .5em .8em; margin: 1em 20px 0 0; } .char { color: #007F00; } .date { color: #7F007F; } diff --git a/changes.txt b/changes.txt index 38f0cc1c..9e46a6cf 100644 --- a/changes.txt +++ b/changes.txt @@ -4,7 +4,7 @@ PHP <5.3 compatibility even with Elasticsearch enabled Fully support functions in default values Stop redirecting links via adminer.org Support X-Forwarded-Prefix -MySQL: Display warnings in SQL command and select +MySQL: Display warnings MariaDB: Support JSON since MariaDB 10.2 PostgreSQL: Support functions PostgreSQL: Allow editing views with uppercase letters (bug #467)