aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2006-08-09 15:53:10 +0000
committerDavid M <davidmj@users.sourceforge.net>2006-08-09 15:53:10 +0000
commitb470f34807dc2e54be72d26ae354ee0be2e1c7dc (patch)
treea8c0fe9cb25b2386682251e8547e144d41cd8f08 /phpBB/install
parentc69a6f7acd9c9c0b1293e6977fe1ec5b490725d4 (diff)
downloadforums-b470f34807dc2e54be72d26ae354ee0be2e1c7dc.tar
forums-b470f34807dc2e54be72d26ae354ee0be2e1c7dc.tar.gz
forums-b470f34807dc2e54be72d26ae354ee0be2e1c7dc.tar.bz2
forums-b470f34807dc2e54be72d26ae354ee0be2e1c7dc.tar.xz
forums-b470f34807dc2e54be72d26ae354ee0be2e1c7dc.zip
Nobody found this bug so i guess nobody has such an old DB :P
MySQL < 4.1.2 has a broken varbinary. TINYBLOB is (2**8)-1 characters = 255. This means we can let older DBs use our stuff without any fear. git-svn-id: file:///svn/phpbb/trunk@6255 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rwxr-xr-xphpBB/install/install_install.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index f64bddceee..9c825a72b0 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -981,6 +981,11 @@ class install_install extends module
{
$sql_query = preg_replace('/^\);$/m', ') DEFAULT CHARACTER SET latin1;', $sql_query);
}
+ else
+ {
+ // versions older than 4.1.2 never had a good, working varbinary. TINYBLOB is just as good.
+ $sql_query = str_replace(array("varbinary(255) DEFAULT ''", 'varbinary(255) DEFAULT 0x90D8'), "TINYBLOB DEFAULT ''", $sql_query);
+ }
break;
@@ -1011,9 +1016,25 @@ class install_install extends module
// Ok tables have been built, let's fill in the basic information
$sql_query = file_get_contents('schemas/schema_data.sql');
- // Deal with any special comments
+ // Deal with any special comments and with MySQL < 4.1.2
switch ($dbms)
{
+ case 'mysql':
+ case 'mysql4':
+ if (version_compare(mysql_get_server_info(), '4.1.2', '<'))
+ {
+ $bitfield = new bitfield();
+ $bitfield->set(0);
+ $bitfield->set(3);
+ $bitfield->set(8);
+ $bitfield->set(9);
+ $bitfield->set(11);
+ $bitfield->set(12);
+
+ $sql_query = str_replace("INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path) VALUES ('subSilver', '&copy; phpBB Group', 'subSilver');", "INSERT INTO phpbb_styles_template (template_name, template_copyright, template_path, bbcode_bitfield) VALUES ('subSilver', '&copy; phpBB Group', 'subSilver', '" . $bitfield->data . "');", $sql_query);
+ }
+ break;
+
case 'mssql':
case 'mssql_odbc':
$sql_query = preg_replace('#\# MSSQL IDENTITY (phpbb_[a-z_]+) (ON|OFF) \##s', 'SET IDENTITY_INSERT \1 \2;', $sql_query);