|
From: Jonathan H. <the...@us...> - 2002-01-11 17:01:34
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv7120
Modified Files:
admin_db_utilities.php
Log Message:
Fix for various postgres bugs
Index: admin_db_utilities.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_db_utilities.php,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** admin_db_utilities.php 2001/11/20 20:33:15 1.30
--- admin_db_utilities.php 2002/01/11 17:01:31 1.31
***************
*** 97,101 ****
while($i_seq < $num_seq)
{
! $row = sql_fetchrow($seq);
$sequence = $row['relname'];
--- 97,101 ----
while($i_seq < $num_seq)
{
! $row = $db->sql_fetchrow($seq);
$sequence = $row['relname'];
***************
*** 138,142 ****
// This function returns, will return the table def's for postgres...
//
! function get_table_def_postgres($table, $crlf)
{
global $drop, $db;
--- 138,142 ----
// This function returns, will return the table def's for postgres...
//
! function get_table_def_postgresql($table, $crlf)
{
global $drop, $db;
***************
*** 147,156 ****
//
! $field_query = "SELECT a.attnum, a.attname AS field, t.typename as type, a.attlen AS length, a.atttypmod as lengthvar, a.attnotnull as notnull
FROM pg_class c, pg_attribute a, pg_type t
WHERE c.relname = '$table'
AND a.attnum > 0
AND a.attrelid = c.oid
! AND a.attypid = t.oid
ORDER BY a.attnum";
$result = $db->sql_query($field_query);
--- 147,156 ----
//
! $field_query = "SELECT a.attnum, a.attname AS field, t.typname as type, a.attlen AS length, a.atttypmod as lengthvar, a.attnotnull as notnull
FROM pg_class c, pg_attribute a, pg_type t
WHERE c.relname = '$table'
AND a.attnum > 0
AND a.attrelid = c.oid
! AND a.atttypid = t.oid
ORDER BY a.attnum";
$result = $db->sql_query($field_query);
***************
*** 464,468 ****
// Here is the function for postgres...
//
! function get_table_content_postgres($table, $handler)
{
global $db;
--- 464,468 ----
// Here is the function for postgres...
//
! function get_table_content_postgresql($table, $handler)
{
global $db;
***************
*** 489,493 ****
$iRec = 0;
! while($row = $db->fetchrow($result))
{
unset($schema_vals);
--- 489,493 ----
$iRec = 0;
! while($row = $db->sql_fetchrow($result))
{
unset($schema_vals);
***************
*** 812,816 ****
echo "#\n";
! if(SQL_LAYER == 'postgres')
{
echo "\n" . pg_get_sequences("\n", $backup_type);
--- 812,816 ----
echo "#\n";
! if(SQL_LAYER == 'postgresql')
{
echo "\n" . pg_get_sequences("\n", $backup_type);
***************
*** 968,972 ****
$result = $db->sql_query($sql);
! if(!$result && ( !(SQL_LAYER == 'postgres' && eregi("drop table", $sql) ) ) )
{
//include('page_header_admin.'.$phpEx);
--- 968,972 ----
$result = $db->sql_query($sql);
! if(!$result && ( !(SQL_LAYER == 'postgresql' && eregi("drop table", $sql) ) ) )
{
//include('page_header_admin.'.$phpEx);
|