mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Fix: pgsql driver not complete
This commit is contained in:
@@ -46,7 +46,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
static $versionmin=array(8,4,0); // Version min database
|
static $versionmin=array(8,4,0); // Version min database
|
||||||
//! Resultset of last query
|
//! Resultset of last query
|
||||||
private $_results;
|
private $_results;
|
||||||
|
|
||||||
public $unescapeslashquot;
|
public $unescapeslashquot;
|
||||||
public $standard_conforming_strings;
|
public $standard_conforming_strings;
|
||||||
|
|
||||||
@@ -172,6 +172,8 @@ class DoliDBPgsql extends DoliDB
|
|||||||
else if (preg_match('/DROP TABLE/i',$line)) $type='dml';
|
else if (preg_match('/DROP TABLE/i',$line)) $type='dml';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$line=preg_replace('/ as signed/i',' as integer',$line);
|
||||||
|
|
||||||
if ($type == 'dml')
|
if ($type == 'dml')
|
||||||
{
|
{
|
||||||
$line=preg_replace('/\s/',' ',$line); // Replace tabulation with space
|
$line=preg_replace('/\s/',' ',$line); // Replace tabulation with space
|
||||||
@@ -196,8 +198,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
|
|
||||||
// nuke unsigned
|
// nuke unsigned
|
||||||
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
$line=preg_replace('/(int\w+|smallint)\s+unsigned/i','\\1',$line);
|
||||||
$line=preg_replace('/as signed/i','as integer',$line);
|
|
||||||
|
|
||||||
// blob -> text
|
// blob -> text
|
||||||
$line=preg_replace('/\w*blob/i','text',$line);
|
$line=preg_replace('/\w*blob/i','text',$line);
|
||||||
|
|
||||||
@@ -463,7 +464,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
function query($query,$usesavepoint=0,$type='auto')
|
function query($query,$usesavepoint=0,$type='auto')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$query = trim($query);
|
$query = trim($query);
|
||||||
|
|
||||||
// Convert MySQL syntax to PostgresSQL syntax
|
// Convert MySQL syntax to PostgresSQL syntax
|
||||||
@@ -484,7 +485,7 @@ class DoliDBPgsql extends DoliDB
|
|||||||
else $loop=false;
|
else $loop=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($usesavepoint && $this->transaction_opened)
|
if ($usesavepoint && $this->transaction_opened)
|
||||||
{
|
{
|
||||||
@pg_query($this->db, 'SAVEPOINT mysavepoint');
|
@pg_query($this->db, 'SAVEPOINT mysavepoint');
|
||||||
|
|||||||
Reference in New Issue
Block a user