git-svn-id: file:///svn/phpbb/trunk@7783 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2007-06-19 15:24:40 +00:00
parent 22b970ef1e
commit 65442c6bdd
3 changed files with 43 additions and 1 deletions

View file

@ -290,7 +290,7 @@ p a {
<li>[Fix] Fix sorting by author on "unanswered posts" (Bug #12545)</li> <li>[Fix] Fix sorting by author on "unanswered posts" (Bug #12545)</li>
<li>[Fix] Allow searching for multibyte authors (Bug #11793)</li> <li>[Fix] Allow searching for multibyte authors (Bug #11793)</li>
<li>[Fix] Writing directories/files with correct permissions using FTP for transfers on PHP4</li> <li>[Fix] Writing directories/files with correct permissions using FTP for transfers on PHP4</li>
<li>[Fix] Oracle sequences during conversions are now corrected (Bug #12555)</li>
</ul> </ul>
</div> </div>

View file

@ -287,6 +287,20 @@ function phpbb_insert_forums()
case 'mssql_odbc': case 'mssql_odbc':
$db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF'); $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF');
break; break;
case 'oracle':
$result = $db->sql_query('SELECT MAX(forum_id) as max_id FROM ' . FORUMS_TABLE);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$largest_id = (int) $row['max_id'];
if ($largest_id)
{
$db->sql_query('DROP SEQUENCE ' . FORUMS_TABLE . '_seq');
$db->sql_query('CREATE SEQUENCE ' . FORUMS_TABLE . '_seq START WITH ' . ($largest_id + 1));
}
break;
} }
} }

View file

@ -1112,6 +1112,20 @@ class install_convert extends module
case 'postgres': case 'postgres':
$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); $db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));');
break; break;
case 'oracle':
$result = $db->sql_query('SELECT MAX(' . $schema['autoincrement'] . ') as max_id FROM ' . $schema['target']);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$largest_id = (int) $row['max_id'];
if ($largest_id)
{
$db->sql_query('DROP SEQUENCE ' . $schema['target'] . '_seq');
$db->sql_query('CREATE SEQUENCE ' . $schema['target'] . '_seq START WITH ' . ($largest_id + 1));
}
break;
} }
} }
} }
@ -1367,6 +1381,20 @@ class install_convert extends module
case 'postgres': case 'postgres':
$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); $db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));');
break; break;
case 'oracle':
$result = $db->sql_query('SELECT MAX(' . $schema['autoincrement'] . ') as max_id FROM ' . $schema['target']);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$largest_id = (int) $row['max_id'];
if ($largest_id)
{
$db->sql_query('DROP SEQUENCE ' . $schema['target'] . '_seq');
$db->sql_query('CREATE SEQUENCE ' . $schema['target'] . '_seq START WITH ' . ($largest_id + 1));
}
break;
} }
} }
} }