diff --git a/webapp/resources/adminer.php b/webapp/resources/adminer.php index 312dfe2c4e..c82c162eeb 100644 --- a/webapp/resources/adminer.php +++ b/webapp/resources/adminer.php @@ -865,7 +865,7 @@ enum_input($U,$wa,$n,$Y,$Yb=null){global$c;preg_match_all("~'((?:[^']|'')*)'~",$ ',confirm(),' ';}$Cc=$c->dumpFormat();foreach((array)$_GET["columns"]as$d){if($d["fun"]){unset($Cc['sql']);break;}}if($Cc){print_fieldset("export",lang(62)." ");$Ie=$c->dumpOutput();echo($Ie?html_select("output",$Ie,$ma["output"])." ":""),html_select("format",$Cc,$ma["format"])," \n","\n";}$c->selectEmailPrint(array_filter($Xb,'strlen'),$e);}echo"\n";if($c->selectImportPrint()){echo"
","".lang(61)."",script("qsl('a').onclick = partial(toggle, 'import');",""),"","
";}echo"\n","\n",(!$s&&$N?"":script("tableCheck();"));}}}if(is_ajax()){ob_end_clean();exit;}}elseif(isset($_GET["variables"])){$ig=isset($_GET["status"]);page_header($ig?lang(112):lang(111));$sh=($ig?show_status():show_variables());if(!$sh)echo"

".lang(12)."\n";else{echo"\n";foreach($sh -as$z=>$X){echo"","
".h($z)."","".h($X);}echo"
\n";}}elseif(isset($_GET["script"])){header("Content-Type: text/javascript; charset=utf-8");if($_GET["script"]=="db"){$rg=array("Data_length"=>0,"Index_length"=>0,"Data_free"=>0);foreach(table_status()as$E=>$R){json_row("Comment-$E",h($R["Comment"]));if(!is_view($R)){foreach(array("Engine","Collation")as$z)json_row("$z-$E",h($R[$z]));foreach($rg+array("Auto_increment"=>0,"Rows"=>0)as$z=>$X){if($R[$z]!=""){$X=format_number($R[$z]);json_row("$z-$E",($z=="Rows"&&$X&&$R["Engine"]==($dg=="pgsql"?"table":"InnoDB")?"~ $X":$X));if(isset($rg[$z]))$rg[$z]+=($R["Engine"]!="InnoDB"||$z!="Data_free"?$R[$z]:0);}elseif(array_key_exists($z,$R))json_row("$z-$E");}}}foreach($rg +as$z=>$X){echo"","".h($z)."","".h($X);}echo"\n";}}elseif(isset($_GET["script"])){header("Content-Type: text/javascript; charset=utf-8");if($_GET["script"]=="db"){$rg=array("Data_length"=>0,"Index_length"=>0,"Data_free"=>0);foreach(table_status()as$E=>$R){json_row("Comment-$E",h($R["Comment"]));if(!is_view($R)){foreach(array("Engine","Collation")as$z)json_row("$z-$E",h($R[$z]));foreach($rg+array("Auto_increment"=>0,"Rows"=>0)as$z=>$X){if($R[$z]!=""){$X=format_number($R[$z]);json_row("$z-$E",($z=="Rows"&&$X&&$R["Engine"]==($y=="pgsql"?"table":"InnoDB")?"~ $X":$X));if(isset($rg[$z]))$rg[$z]+=($R["Engine"]!="InnoDB"||$z!="Data_free"?$R[$z]:0);}elseif(array_key_exists($z,$R))json_row("$z-$E");}}}foreach($rg as$z=>$X)json_row("sum-$z",format_number($X));json_row("");}elseif($_GET["script"]=="kill")$g->query("KILL ".number($_POST["kill"]));else{foreach(count_tables($c->databases())as$k=>$X){json_row("tables-$k",$X);json_row("size-$k",db_size($k));}json_row("");}exit;}else{$zg=array_merge((array)$_POST["tables"],(array)$_POST["views"]);if($zg&&!$m&&!$_POST["search"]){$J=true;$D="";if($y=="sql"&&$_POST["tables"]&&count($_POST["tables"])>1&&($_POST["drop"]||$_POST["truncate"]||$_POST["copy"]))queries("SET foreign_key_checks = 0");if($_POST["truncate"]){if($_POST["tables"])$J=truncate_tables($_POST["tables"]);$D=lang(245);}elseif($_POST["move"]){$J=move_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$D=lang(246);}elseif($_POST["copy"]){$J=copy_tables((array)$_POST["tables"],(array)$_POST["views"],$_POST["target"]);$D=lang(247);}elseif($_POST["drop"]){if($_POST["views"])$J=drop_views($_POST["views"]);if($J&&$_POST["tables"])$J=drop_tables($_POST["tables"]);$D=lang(248);}elseif($y!="sql"){$J=($y=="sqlite"?queries("VACUUM"):apply_queries("VACUUM".($_POST["optimize"]?"":" ANALYZE"),$_POST["tables"]));$D=lang(249);}elseif(!$_POST["tables"])$D=lang(9);elseif($J=queries(($_POST["optimize"]?"OPTIMIZE":($_POST["check"]?"CHECK":($_POST["repair"]?"REPAIR":"ANALYZE")))." TABLE ".implode(", ",array_map('idf_escape',$_POST["tables"])))){while($L=$J->fetch_assoc())$D.="".h($L["Table"]).": ".h($L["Msg_text"])."
";}queries_redirect(substr(ME,0,-1),$D,$J);}page_header(($_GET["ns"]==""?lang(26).": ".h(DB):lang(189).": ".h($_GET["ns"])),$m,true);if($c->homepage()){if($_GET["ns"]!==""){echo"

".lang(250)."

\n";$yg=tables_list();if(!$yg)echo"

".lang(9)."\n";else{echo"

\n";if(support("table")){echo"
".lang(251)."
","",script("qsl('input').onkeydown = partialArg(bodyKeydown, 'search');","")," \n","
\n";if($_POST["search"]&&$_POST["query"]!=""){$_GET["where"][0]["op"]="LIKE %%";search_tables();}}echo"
\n","\n",script("mixin(qsl('table'), {onclick: tableClick, ondblclick: partialArg(tableClick, true)});"),'','\n";$S=0;foreach($yg as$E=>$U){$vh=($U!==null&&!preg_match('~table|sequence~i',$U));$u=h("Table-".$E);echo'
'.script("qs('#check-all').onclick = partial(formCheck, /^(tables|views)\[/);",""),''.lang(124),''.lang(252).doc_link(array('sql'=>'storage-engines.html')),''.lang(116).doc_link(array('sql'=>'charset-charsets.html','mariadb'=>'supported-character-sets-and-collations/')),''.lang(253).doc_link(array('sql'=>'show-table-status.html',)),''.lang(254).doc_link(array('sql'=>'show-table-status.html',)),''.lang(255).doc_link(array('sql'=>'show-table-status.html')),''.lang(40).doc_link(array('sql'=>'example-auto-increment.html','mariadb'=>'auto_increment/')),''.lang(256).doc_link(array('sql'=>'show-table-status.html',)),(support("comment")?''.lang(39).doc_link(array('sql'=>'show-table-status.html',)):''),"
'.checkbox(($vh?"views[]":"tables[]"),$E,in_array($E,$zg,true),"","","",$u),''.(support("table")||support("indexes")?"".h($E).'':h($E));if($vh){echo''.(preg_match('~materialized~i',$U)?lang(122):lang(123)).'','?';}else{foreach(array("Engine"=>array(),"Collation"=>array(),"Data_length"=>array("create",lang(33)),"Index_length"=>array("indexes",lang(126)),"Data_free"=>array("edit",lang(34)),"Auto_increment"=>array("auto_increment=1&create",lang(33)),"Rows"=>array("select",lang(30)),)as$z=>$A){$u=" id='$z-".h($E)."'";echo($A?"".(support("table")||$z=="Rows"||(support("indexes")&&$z!="Data_length")?"?":"?"):"");}$S++;}echo(support("comment")?"":"");}echo"
".lang(229,count($yg)),"".h($y=="sql"?$g->result("SELECT @@default_storage_engine"):""),"".h(db_collation(DB,collations()));foreach(array("Data_length","Index_length","Data_free")as$z)echo"";echo"
\n","
\n";if(!information_schema(DB)){echo"\n";}echo"
\n",script("tableCheck();");}echo'

".lang(136)."

\n";$Hf=routines();if($Hf){echo"\n",'\n";odd('');foreach($Hf
'.lang(176).''.lang(38).''.lang(212)."