From 5e242414e698b498f7f6db8a4738e6bd740851b1 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Fri, 9 May 2008 23:19:11 +0000 Subject: [PATCH] possibility to create tables in memory, InnoDB by default git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@68 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/webim/install/dbinfo.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/webim/install/dbinfo.php b/src/webim/install/dbinfo.php index a992983d..49135b9c 100644 --- a/src/webim/install/dbinfo.php +++ b/src/webim/install/dbinfo.php @@ -54,6 +54,8 @@ $dbtables = array( ) ); +$memtables = array(); + $dbtables_can_update = array( "chatthread" => array("agentId"), "chatmessage" => array("agentId"), @@ -72,7 +74,7 @@ function show_install_err($text) { } function create_table($id,$link) { - global $dbtables, $dbencoding; + global $dbtables, $memtables, $dbencoding; if(!isset($dbtables[$id])) { show_install_err("Unknown table: $id, ".mysql_error()); @@ -86,9 +88,13 @@ function create_table($id,$link) { } $query = preg_replace("/,\n$/", "", $query); - $query .= ") charset $dbencoding\n"; - mysql_query($query,$link) - or show_install_err(' Query failed: '.mysql_error()); + $query .= ") charset $dbencoding"; + if (in_array($id, $memtables)) { + $query .= " ENGINE=MEMORY"; + } else { + $query .= " TYPE=InnoDb"; + } + mysql_query($query,$link) or show_install_err(' Query failed: '.mysql_error()); // post create if( $id == 'chatoperator' ) {