phpBB

Code Changes

File: phpbb/db/driver/postgres.php

  Unmodified   Added   Modified   Removed
Line 188Line 188

if ($this->query_result === false)
{


if ($this->query_result === false)
{

				if (($this->query_result = @pg_query($this->db_connect_id, $query)) === false)










				try
{
$this->query_result = @pg_query($this->db_connect_id, $query);
}
catch (\Error $e)
{
// Do nothing as SQL driver will report the error
}

if ($this->query_result === false)

				{
$this->sql_error($query);
}

				{
$this->sql_error($query);
}

Line 342Line 351
	}

/**

	}

/**

	* {@inheritDoc}

	 * {@inheritdoc}

	*/

	*/

	function sql_nextid()

	public function sql_last_inserted_id()

	{
$query_id = $this->query_result;


	{
$query_id = $this->query_result;


Line 546Line 555
	function sql_quote($msg)
{
return '"' . $msg . '"';

	function sql_quote($msg)
{
return '"' . $msg . '"';

	}

/**
* Ensure query ID can be used by cache
*
* @param resource|int|string $query_id Mixed type query id
*
* @return int|string Query id in string or integer format
*/
private function clean_query_id($query_id)
{
// As of PHP 8.1 PgSQL functions accept/return \PgSQL\* objects instead of "pgsql *" resources
// Attempting to cast object to int will throw error, hence correctly handle all cases
if (is_resource($query_id))
{
return function_exists('get_resource_id') ? get_resource_id($query_id) : (int) $query_id;
}
else
{
return is_object($query_id) ? spl_object_id($query_id) : $query_id;
}

 
	}
}


	}
}