OSDN Git Service

Added "UPDATE STATISTICS ON" to CUBRID.
authorKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sun, 10 Jul 2011 02:47:03 +0000 (02:47 +0000)
committerKazuki Przyborowski <kazuki.przyborowski@gmail.com>
Sun, 10 Jul 2011 02:47:03 +0000 (02:47 +0000)
git-svn-id: svn://svn.code.sf.net/p/intdb/svn/trunk@703 2b68903e-0b30-0410-9a39-a2e4f3c5be39

inc/admin/main.php
inc/admin/sqldumper/cubrid.php
inc/versioninfo.php
setup/sql/cubrid.php

index 2a846ee..352504f 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2004-2011 iDB Support - http://idb.berlios.de/
     Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: main.php - Last Update: 07/09/2011 SVN 702 - Author: cooldude2k $
+    $FileInfo: main.php - Last Update: 07/09/2011 SVN 703 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="main.php"||$File3Name=="/main.php") {
@@ -354,7 +354,6 @@ $themeresult=sql_query($themequery,$SQLStat);
 $themenum=sql_num_rows($themeresult);
 require($SettDir['inc'].'sqlthemes.php');
 $_POST['update'] = "now"; $_GET['act'] = "optimize"; }
-if($_GET['act']=="optimize"&&$Settings['sqltype']=="cubrid") { $_GET['act'] = "view"; }
 if($_GET['act']=="optimize"&&$GroupInfo['ViewDBInfo']=="yes") {
 $TablePreFix = $Settings['sqltable'];
 function add_prefix($tarray) {
@@ -369,9 +368,10 @@ while ($ti < $tcount) {
 if(isset($OptimizeAr["Msg_text"])) { unset($OptimizeAr["Msg_text"]); }
 if(isset($OptimizeAr[3])) { unset($OptimizeAr[3]); }
 if($Settings['sqltype']=="mysql"||
-       $Settings['sqltype']=="mysqli"||
-       $Settings['sqltype']=="cubrid") {
+       $Settings['sqltype']=="mysqli") {
 $OptimizeTea = sql_query(sql_pre_query("OPTIMIZE TABLE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
+if($Settings['sqltype']=="cubrid") {
+$OptimizeTea = sql_query(sql_pre_query("UPDATE STATISTICS ON \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
 if($Settings['sqltype']=="pgsql") {
 $OptimizeTea = sql_query(sql_pre_query("VACUUM ANALYZE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat); }
 if($Settings['sqltype']=="mysql"||
@@ -392,6 +392,8 @@ if($Settings['sqltype']=="pgsql") {
 $OutPutLog = "PGSQL Output: All tables optimized."; }
 if($Settings['sqltype']=="sqlite") {
 $OutPutLog = "SQLite Output: All tables optimized."; }
+if($Settings['sqltype']=="cubrid") {
+$OutPutLog = "CUBRID Output: All tables optimized."; }
 $_POST['update'] = "now"; $_GET['act'] = "view"; }
 ?>
 </td>
index 758715d..7debb9e 100644 (file)
     Copyright 2004-2011 iDB Support - http://idb.berlios.de/
     Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: cubrid.php - Last Update: 07/08/2011 SVN 697 - Author: cooldude2k $
+    $FileInfo: cubrid.php - Last Update: 07/09/2011 SVN 703 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="cubrid.php"||$File3Name=="/cubrid.php") {
        require('index.php');
        exit(); }
 
-if($_SESSION['UserGroup']==$Settings['GuestGroup']||$GroupInfo['HasAdminCP']=="no") {
+//Nothing here for now :P 
 redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if($Settings['sqltype']!="mysql"&&$Settings['sqltype']!="mysqli") {
-redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
-ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
-gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
-if(!isset($_GET['outtype'])) { $_GET['outtype'] = "UTF-8"; }
-header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
-header("Cache-Control: private",false); 
-header("Content-Description: File Transfer");
-if(!isset($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if(!is_numeric($_GET['comlevel'])) {
-       $_GET['comlevel'] = -1; }
-if($_GET['comlevel']>9||$_GET['comlevel']<-1) {
-       $_GET['comlevel'] = -1; }
-if(!isset($_GET['compress'])) {
-       $_GET['compress'] = "none"; }
-if($_GET['compress']=="gzip") {
-       $_GET['compress'] = "gzencode"; }
-if($_GET['compress']=="bzip"||
-       $_GET['compress']=="bzip2") {
-       $_GET['compress'] = "bzcompress"; }
-if($_GET['compress']!="none"&&
-       $_GET['compress']!="gzencode"&&
-       $_GET['compress']!="gzcompress"&&
-       $_GET['compress']!="gzdeflate"&&
-       $_GET['compress']!="bzcompress") {
-       $_GET['compress'] = "none"; }
-if(!extension_loaded("zlib")) {
-if($_GET['compress']=="gzencode"&&
-       $_GET['compress']=="gzcompress"&&
-       $_GET['compress']=="gzdeflate") {
-       $_GET['compress'] = "none"; } }
-if(!extension_loaded("bz2")) {
-if($_GET['compress']=="bzcompress") {
-       $_GET['compress'] = "none"; } }
-if($_GET['compress']=="bzcompress") {
-if($_GET['comlevel']>9||$_GET['comlevel']<0) {
-       $_GET['comlevel'] = 4; } }
-$fname = null;
-if(isset($Settings['sqldb'])&&$Settings['sqldb']!="") {
-$fname = str_replace("_","", $Settings['sqldb'])."_"; }
-if($_GET['compress']=="none") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql"; }
-if($_GET['compress']=="gzencode") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="gzdeflate") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.gz"; }
-if($_GET['compress']=="bzcompress") {
-$fname .= str_replace("_","", $Settings['sqltable']).".sql.bz2"; }
-header("Content-Disposition: attachment; filename=".$fname);
-header("Content-Type: application/octet-stream");
-header("Content-Transfer-Encoding: binary");
-if(!isset($AltSQLDumper)||$AltSQLDumper===null) {
-       $SQLDumper = "SQL Dumper"; }
-if(isset($AltSQLDumper)&&$AltSQLDumper!==null) {
-       $SQLDumper = $AltSQLDumper; }
-function GetAllRows($table) { $rene_j = 0; $trowout = null;
-global $SQLStat;
-$tresult = sql_query("SELECT * FROM \"".$table."\"",$SQLStat);
-while ($trow = sql_fetch_assoc($tresult)) {
-$trowout[$rene_j] = $trow;
-++$rene_j; }
-sql_free_result($tresult);
-return $trowout; }
-$TablePreFix = $Settings['sqltable'];
-function add_prefix($tarray) {
-global $TablePreFix;
-return $TablePreFix.$tarray; }
-$TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "themes", "topics", "wordfilter");
-$TableChCk = array_map("add_prefix",$TableChCk);
-if(!isset($_GET['outtype'])||$_GET['outtype']=="UTF-8") {
-header("Content-Type: text/plain; charset=UTF-8"); }
-if($_GET['outtype']=="latin1") {
-header("Content-Type: text/plain; charset=ISO-8859-1"); }
-if($_GET['outtype']=="latin15") {
-header("Content-Type: text/plain; charset=ISO-8859-15"); }
-$sql = "SHOW TABLES LIKE '".$Settings['sqltable']."%'";
-$result = sql_query($sql,$SQLStat);
-if (!$result) {
-echo "DB Error, could not list tables\n";
-echo 'MySQL Error: ' . sql_error($SQLStat);
-exit; }
-$DropTable = null; $CreateTable = null; $TableNames = null; $l = 0;
-while ($row = sql_fetch_row($result)) { 
-if(in_array($row[0],$TableChCk)) {
-$TableNames[$l] = $row[0];
-$DropTable[$l] = "DROP TABLE IF EXISTS \"".$row[0]."\";\n";
-$CreateTable[$l] = "CREATE TABLE IF NOT EXISTS \"".$row[0]."\" (\n";
-$CreateTable[$l] = null;
-$result2 = sql_query("SHOW COLUMNS FROM ".$row[0],$SQLStat);
-$tabsta = sql_query("SHOW TABLE STATUS LIKE '".$row[0]."'",$SQLStat);
-$tabstats = sql_fetch_array($tabsta); $AutoIncrement = " ";
-$tabstaz = sql_query("SHOW CREATE TABLE \"".$row[0]."\"",$SQLStat);
-$tabstatz = sql_fetch_array($tabstaz);
-$FullTable[$l] = $DropTable[$l].$tabstatz[1].";\n";
-$tabstats = sql_fetch_array($tabsta); $AutoIncrement = " ";
-/*
-if($tabstats["Auto_increment"]!="") {
-$AutoIncrement = " AUTO_INCREMENT=".$tabstats["Auto_increment"]." "; }
-       $TableInfo[$l] = null; $TableStats = null; $i = 0;
-       while ($row2 = sql_fetch_assoc($result2)) {
-               $row2["Default"] = "'".$row2["Default"]."'"; 
-               if($i==0) { $row2["Default"] = null; } $DefaVaule = null;
-               if($row2["Default"]!=null) { $DefaVaule = " default ".$row2["Default"]; }
-               if($row2["Extra"]!="") { $row2["Extra"] = " ".$row2["Extra"]; }
-       if($row2["Type"]=="text") { $DefaVaule = null; }
-       if(isset($PrimaryKey[$l])) { 
-       if($row2["Key"]=="PRI"||$row2["Key"]=="UNI") {
-       $PrimaryKey[$l] .= ",\n"; } }
-       if(!isset($PrimaryKey[$l])) { $PrimaryKey[$l] = null; }
-        $TableInfo[$l] .= "  \"".$row2["Field"]."\" ".$row2["Type"]." NOT NULL".$DefaVaule.$row2["Extra"].",\n";
-               if($row2["Key"]=="PRI") { $PrimaryKey[$l] .= "  PRIMARY KEY (\"".$row2["Field"]."\")"; }
-               if($row2["Key"]=="UNI") { $PrimaryKey[$l] .= "  UNIQUE KEY \"".$row2["Field"]."\" (\"".$row2["Field"]."\")"; }
-       ++$i; } */
-       /*
-       $TableStats[$l] = ") ENGINE=".$tabstats["Engine"]." DEFAULT CHARSET=".mysql_client_encoding()." COLLATE=".$tabstats["Collation"].$AutoIncrement.";\n";
-       $TableInfo[$l] .= $PrimaryKey[$l]."\n".$TableStats[$l];
-       $FullTable[$l] = $DropTable[$l].$CreateTable[$l].$TableInfo[$l];
-        }
-       $TableStats[$l] = ") ENGINE=".$tabstats["Engine"]." DEFAULT CHARSET=".mysql_client_encoding()." COLLATE=".$tabstats["Collation"].$AutoIncrement.";\n";
-       $TableInfo[$l] .= $PrimaryKey[$l]."\n".$TableStats[$l];
-       $FullTable[$l] = $DropTable[$l].$CreateTable[$l].$TableInfo[$l]; */ }
-if (!$result2) {
-    echo 'Could not run query: ' . sql_error($SQLStat);
-    exit; }
-sql_free_result($result2);
-sql_free_result($tabsta);
-++$l; } $tableout = null;
-$num = count($TableNames); $renee_s = 0;
-$sqldump = "-- ".$OrgName." ".$SQLDumper."\n";
-$sqldump .= "-- version ".$VerInfo['iDB_Ver_SVN']."\n";
-$sqldump .= "-- ".$iDBHome."support/\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Host: ".$Settings['sqlhost']."\n";
-$sqldump .= "-- Generation Time: ".GMTimeGet('F d, Y \a\t h:i A',$_SESSION['UserTimeZone'],0,$_SESSION['UserDST'])."\n";
-$sqldump .= "-- Server version: ".sql_server_info($SQLStat)."\n";
-$sqldump .= "-- PHP Version: ".phpversion()."\n\n";
-$sqldump .= "SET SESSION SQL_MODE='ANSI_QUOTES,NO_AUTO_VALUE_ON_ZERO';\n\n";
-$sqldump .= "--\n";
-$sqldump .= "-- Database: \"".$Settings['sqldb']."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "-- --------------------------------------------------------\n\n";
-while ($renee_s < $num) { $tnum = $num - 1;
-$trow = GetAllRows($TableNames[$renee_s]);
-$numz = count($trow); $kazuki_p = 0;
-$sqldump .= "--\n";
-$sqldump .= "-- Table structure for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= $FullTable[$renee_s]."\n";
-while ($kazuki_p < $numz) { $tnumz = $numz - 1;
-$srow = null; $srowvalue = null;
-$trownew = $trow[$kazuki_p];
-$trowname = array_keys($trownew);
-$nums = count($trownew); $il = 0;
-while ($il < $nums) { $tnums = $nums - 1;
-$trowrname = sql_escape_string($trowname[$il],$SQLStat);
-$trowrvalue = sql_escape_string($trownew[$trowrname],$SQLStat);
-if($_GET['outtype']=="UTF-8"&&$Settings['charset']!="UTF-8") {
-$trowrvalue = utf8_encode($trowrvalue); }
-$trowrvalue = str_replace( array("\n", "\r"), array('\n', '\r'), $trowrvalue);
-/*if($kazuki_p===0) {*/
-if($il===0) { $srow = "INSERT INTO \"".$TableNames[$renee_s]."\" ("; }
-if($il<$tnums&&$il!=$tnums) { $srow .= "\"".$trowrname."\", "; }
-if($il==$tnums) { $srow .= "\"".$trowrname."\") VALUES"; } /*}*/
-if($il===0) { $srowvalue = "("; }
-if(!is_numeric($trowrvalue)) { $trowrvalue = "'".$trowrvalue."'"; }
-if($il<$tnums) { $srowvalue .= $trowrvalue.", "; }
-if($il==$tnums) { $srowvalue .= $trowrvalue;
-/*if($kazuki_p<$tnumz) { $srowvalue .= "),"; }*/
-/*if($kazuki_p==$tnumz) {*/ $srowvalue .= ");"; /*}*/ }
-++$il; }
-if($kazuki_p===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n"; }
-$sqldump .= $srow."\n"; /*}*/
-$sqldump .= $srowvalue."\n";
-if($kazuki_p==$tnumz&&$renee_s<$tnum) {
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-++$kazuki_p; }
-if($numz===0) {
-$sqldump .= "--\n";
-$sqldump .= "-- Dumping data for table \"".$TableNames[$renee_s]."\"\n";
-$sqldump .= "--\n\n";
-$sqldump .= "\n-- --------------------------------------------------------\n"; }
-$sqldump .= "\n";
-++$renee_s; }
-if($_GET['compress']=="none") { echo $sqldump; }
-if($_GET['compress']=="gzencode") { echo gzencode($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzcompress") { echo gzcompress($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="gzdeflate") { echo gzdeflate($sqldump,$_GET['comlevel']); }
-if($_GET['compress']=="bzcompress") { echo bzcompress($sqldump,$_GET['comlevel']); }
-fix_amp($Settings['use_gzip'],$GZipEncode['Type']);
+ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
+gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die();
 ?>
index 6b13fb9..f6034f4 100644 (file)
@@ -11,7 +11,7 @@
     Copyright 2008-2011 iDB Support - http://idb.berlios.de/
     Copyright 2008-2011 Game Maker 2k - http://gamemaker2k.org/
 
-    $FileInfo: versioninfo.php - Last Update: 07/09/2011 SVN 702 - Author: cooldude2k $
+    $FileInfo: versioninfo.php - Last Update: 07/09/2011 SVN 703 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="versioninfo.php"||$File3Name=="/versioninfo.php") {
@@ -27,7 +27,7 @@ function version_info($proname,$subver,$ver,$supver,$reltype,$svnver,$showsvn) {
        return $return_var; }
 // Version number and date stuff. :P
 $VER1[0] = 0; $VER1[1] = 4; $VER1[2] = 7; $VERFull[1] = $VER1[0].".".$VER1[1].".".$VER1[2];
-$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 702;
+$VER2[0] = "Alpha"; $VER2[1] = "Al"; $VER2[2] = "SVN"; $SubVerN = 703;
 $SVNDay[0] = 07; $SVNDay[1] = 09; $SVNDay[2] = 2011; $SVNDay[3] = $SVNDay[0]."/".$SVNDay[1]."/".$SVNDay[2];
 $AltName = "RDB"; $AltName2 = "ReneeDB"; $RName = "iDB"; $SFName = "IntDB";
 $RFullName = "Internet Discussion Boards"; $AltFullName = "Renee Discussion Boards"; $AltGM2k = "ReneeDB Team";
index 34bc95f..fffc12a 100644 (file)
@@ -12,7 +12,7 @@
     Copyright 2004-2011 Game Maker 2k - http://gamemaker2k.org/
     iDB Installer made by Game Maker 2k - http://idb.berlios.net/
 
-    $FileInfo: cubrid.php - Last Update: 06/28/2011 SVN 685 - Author: cooldude2k $
+    $FileInfo: cubrid.php - Last Update: 07/09/2011 SVN 703 - Author: cooldude2k $
 */
 $File3Name = basename($_SERVER['SCRIPT_NAME']);
 if ($File3Name=="cubrid.php"||$File3Name=="/cubrid.php") {
@@ -438,7 +438,7 @@ $query=sql_pre_query("CREATE TABLE \"".$_POST['tableprefix']."wordfilter\" (\n".
 "  \"WholeWord\" varchar(5) NOT NULL default ''\n".
 ");", array(null));
 sql_query($query,$SQLStat);
-/*
+
 $TableChCk = array("categories", "catpermissions", "events", "forums", "groups", "members", "mempermissions", "messenger", "permissions", "polls", "posts", "restrictedwords", "sessions", "smileys", "topics", "wordfilter");
 $TablePreFix = $_POST['tableprefix'];
 function add_prefix($tarray) {
@@ -447,7 +447,6 @@ return $TablePreFix.$tarray; }
 $TableChCk = array_map("add_prefix",$TableChCk);
 $tcount = count($TableChCk); $ti = 0;
 while ($ti < $tcount) {
-$OptimizeTea = sql_query(sql_pre_query("OPTIMIZE TABLE \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
+$OptimizeTea = sql_query(sql_pre_query("UPDATE STATISTICS ON \"".$TableChCk[$ti]."\"", array(null)),$SQLStat);
 ++$ti; }
-*/
 ?>