mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 15:57:45 +02:00
[ticket/12747] Drop support for Firebird
PHPBB3-12747
This commit is contained in:
@@ -27,15 +27,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20
|
||||
{
|
||||
global $lang;
|
||||
$available_dbms = array(
|
||||
'firebird' => array(
|
||||
'LABEL' => 'FireBird',
|
||||
'SCHEMA' => 'firebird',
|
||||
'MODULE' => 'interbase',
|
||||
'DELIM' => ';;',
|
||||
'DRIVER' => 'phpbb\db\driver\firebird',
|
||||
'AVAILABLE' => true,
|
||||
'2.0.x' => false,
|
||||
),
|
||||
// Note: php 5.5 alpha 2 deprecated mysql.
|
||||
// Keep mysqli before mysql in this list.
|
||||
'mysqli' => array(
|
||||
@@ -260,7 +251,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
||||
$prefix_length = 200;
|
||||
break;
|
||||
|
||||
case 'phpbb\db\driver\firebird':
|
||||
case 'phpbb\db\driver\oracle':
|
||||
$prefix_length = 6;
|
||||
break;
|
||||
@@ -321,87 +311,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
|
||||
}
|
||||
break;
|
||||
|
||||
case 'phpbb\db\driver\firebird':
|
||||
// check the version of FB, use some hackery if we can't get access to the server info
|
||||
if ($db->service_handle !== false && function_exists('ibase_server_info'))
|
||||
{
|
||||
$val = @ibase_server_info($db->service_handle, IBASE_SVC_SERVER_VERSION);
|
||||
preg_match('#V([\d.]+)#', $val, $match);
|
||||
if ($match[1] < 2)
|
||||
{
|
||||
$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
|
||||
{
|
||||
$sql = "SELECT *
|
||||
FROM RDB$FUNCTIONS
|
||||
WHERE RDB$SYSTEM_FLAG IS NULL
|
||||
AND RDB$FUNCTION_NAME = 'CHAR_LENGTH'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// if its a UDF, its too old
|
||||
if ($row)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = 'SELECT 1 FROM RDB$DATABASE
|
||||
WHERE BIN_AND(10, 1) = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
if (!$result) // This can only fail if BIN_AND is not defined
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
|
||||
}
|
||||
$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;
|
||||
|
||||
case 'phpbb\db\driver\oracle':
|
||||
if ($unicode_check)
|
||||
{
|
||||
|
Reference in New Issue
Block a user