* @param Min_Result
* @param Min_DB connection to examine indexes
* @param array
+* @param int
* @return array $orgtables
*/
-function select($result, $connection2 = null, $orgtables = array()) {
+function select($result, $connection2 = null, $orgtables = array(), $limit = 0) {
global $jush;
$links = array(); // colno => orgtable - create links from these columns
$indexes = array(); // orgtable => array(column => colno) - primary keys
$types = array(); // colno => type - display char in <code>
$return = array(); // table => orgtable - mapping to use in EXPLAIN
odd(''); // reset odd for each result
- for ($i=0; $row = $result->fetch_row(); $i++) {
+ for ($i=0; (!$limit || $i < $limit) && ($row = $result->fetch_row()); $i++) {
if (!$i) {
echo "<table cellspacing='0' class='nowrap'>\n";
echo "<thead><tr>";
<?php
-$VERSION = "4.1.1-dev";
+$VERSION = "4.2.0-dev";
'Sort' => 'Seřadit',
'descending' => 'sestupně',
'Limit' => 'Limit',
+ 'Limit rows' => 'Limit řádek',
'Text length' => 'Délka textů',
'Action' => 'Akce',
'Full table scan' => 'Průchod celé tabulky',
'Unable to select the table' => 'Nepodařilo se vypsat tabulku',
'No rows.' => 'Žádné řádky.',
+ '%d / ' => '%d / ',
'%d row(s)' => array('%d řádek', '%d řádky', '%d řádků'),
'Page' => 'Stránka',
'last' => 'poslední',
'%d byte(s)' => array('%d byte', '%d bytes'),
'Routine has been called, %d row(s) affected.' => array('Routine has been called, %d row affected.', 'Routine has been called, %d rows affected.'),
'%d process(es) have been killed.' => array('%d process has been killed.', '%d processes have been killed.'),
+ '%d / ' => '%d / ',
'%d row(s)' => array('%d row', '%d rows'),
'%d item(s) have been affected.' => array('%d item has been affected.', '%d items have been affected.'),
'%d row(s) have been imported.' => array('%d row has been imported.', '%d rows have been imported.'),
'Sort' => 'xx',
'descending' => 'xx',
'Limit' => 'xx',
+ 'Limit rows' => 'xx',
'Text length' => 'xx',
'Action' => 'xx',
'Full table scan' => 'xx',
'Unable to select the table' => 'xx',
'No rows.' => 'xx',
+ '%d / ' => 'xx',
'%d row(s)' => array('xx', 'xx'),
'Page' => 'xx',
'last' => 'xx',
}
} elseif (is_object($result)) {
- $orgtables = select($result, $connection2);
+ $limit = $_POST["limit"];
+ $orgtables = select($result, $connection2, array(), $limit);
if (!$_POST["only_errors"]) {
echo "<form action='' method='post'>\n";
- echo "<p>" . ($result->num_rows ? lang('%d row(s)', $result->num_rows) : "") . $time;
+ $num_rows = $result->num_rows;
+ echo "<p>" . ($num_rows ? ($limit && $num_rows > $limit ? lang('%d / ', $limit) : "") . lang('%d row(s)', $num_rows) : "");
+ echo $time;
$id = "export-$commands";
$export = ", <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('Export') . "</a><span id='$id' class='hidden'>: "
. html_select("output", $adminer->dumpOutput(), $adminer_export["output"]) . " "
textarea("query", $q, 20);
echo ($_POST ? "" : "<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n");
echo "<p>$execute\n";
+ echo lang('Limit rows') . ": <input type='number' name='limit' class='size' value='" . h($_POST ? $_POST["limit"] : $_GET["limit"]) . "'>\n";
} else {
echo "<fieldset><legend>" . lang('File upload') . "</legend><div>";
-Adminer 4.1.1-dev:
+Adminer 4.2.0-dev:
+Allow limiting number of displayed rows in SQL command
Fix reading routine column collations
Unlock session in alter database
Make master key unreadable to others (bug #410)