mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-13 03:54:57 +01:00
- installer now checks if the page size is correct for Firebird
- Firebird now has a proper explain page git-svn-id: file:///svn/phpbb/trunk@6863 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
27f915f305
commit
5cf6e00cf9
@ -97,6 +97,12 @@ class dbal_firebird extends dbal
|
||||
{
|
||||
global $cache;
|
||||
|
||||
// EXPLAIN only in extra debug mode
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
{
|
||||
$this->sql_report('start', $query);
|
||||
}
|
||||
|
||||
$this->last_query_text = $query;
|
||||
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
|
||||
$this->sql_add_num_queries($this->query_result);
|
||||
@ -108,6 +114,11 @@ class dbal_firebird extends dbal
|
||||
$this->sql_error($query);
|
||||
}
|
||||
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
{
|
||||
$this->sql_report('stop', $query);
|
||||
}
|
||||
|
||||
if (!$this->transaction)
|
||||
{
|
||||
if (function_exists('ibase_commit_ret'))
|
||||
@ -131,6 +142,10 @@ class dbal_firebird extends dbal
|
||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
||||
}
|
||||
}
|
||||
else if (defined('DEBUG_EXTRA'))
|
||||
{
|
||||
$this->sql_report('fromcache', $query);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1967,6 +1967,14 @@ class install_install extends module
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
|
||||
}
|
||||
$db_info = @ibase_db_info($db->service_handle, $dbname, IBASE_STS_HDR_PAGES);
|
||||
|
||||
preg_match('/^\\s*Page size\\s*(\\d+)/m', $db_info, $regs);
|
||||
$page_size = intval($regs[1]);
|
||||
if ($page_size < 8192)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1994,6 +2002,39 @@ class install_install extends module
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Setup the stuff for our random table
|
||||
$char_array = array_merge(range('A', 'Z'), range('0', '9'));
|
||||
$char_len = mt_rand(7, 9);
|
||||
$char_array_len = sizeof($char_array) - 1;
|
||||
|
||||
$final = '';
|
||||
|
||||
for ($i = 0; $i < $char_len; $i++)
|
||||
{
|
||||
$final .= $char_array[mt_rand(0, $char_array_len)];
|
||||
}
|
||||
|
||||
// Create some random table
|
||||
$sql = 'CREATE TABLE ' . $final . " (
|
||||
FIELD1 VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
|
||||
FIELD2 INTEGER DEFAULT 0 NOT NULL);";
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Create an index that should fail if the page size is less than 8192
|
||||
$sql = 'CREATE INDEX ' . $final . ' ON ' . $final . '(FIELD1, FIELD2);';
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (ibase_errmsg() !== false)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Kill the old table
|
||||
$db->sql_query('DROP TABLE ' . $final . ';');
|
||||
}
|
||||
unset($final);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -194,6 +194,7 @@ $lang = array_merge($lang, array(
|
||||
'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
|
||||
'INST_ERR_DB_NO_ORACLE' => 'The version of Oracle installed on this machine requires you to set the <var>NLS_CHARACTERSET</var> parameter to <var>UTF8</var>. Either upgrade your installation to 9.2+ or change the parameter.',
|
||||
'INST_ERR_DB_NO_FIREBIRD' => 'The version of Firebird installed on this machine is older than 2.0, please upgrade to a newer version.',
|
||||
'INST_ERR_DB_NO_FIREBIRD_PS'=> 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.',
|
||||
'INST_ERR_DB_NO_POSTGRES' => 'The database you have selected was not created in <var>UNICODE</var> or <var>UTF8</var> encoding. Try installing with a database in <var>UNICODE</var> or <var>UTF8</var> encoding',
|
||||
'INST_ERR_DB_NO_NAME' => 'No database name specified',
|
||||
'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid',
|
||||
|
Loading…
x
Reference in New Issue
Block a user