2
0
forked from Wavyzz/dolibarr

Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0

Conflicts:
	htdocs/filefunc.inc.php
This commit is contained in:
Laurent Destailleur
2019-02-08 10:44:45 +01:00
9 changed files with 113 additions and 42 deletions

View File

@@ -152,6 +152,7 @@ class DoliDBPgsql extends DoliDB
*/
static function convertSQLFromMysql($line,$type='auto',$unescapeslashquot=false)
{
global $conf;
// Removed empty line if this is a comment line for SVN tagging
if (preg_match('/^--\s\$Id/i',$line)) {
return '';
@@ -311,7 +312,14 @@ class DoliDBPgsql extends DoliDB
}
// To have postgresql case sensitive
$line=str_replace(' LIKE \'',' ILIKE \'',$line);
$count_like=0;
$line=str_replace(' LIKE \'',' ILIKE \'',$line,$count_like);
if (!empty($conf->global->PSQL_USE_UNACCENT) && $count_like > 0)
{
// @see https://docs.postgresql.fr/11/unaccent.html : 'unaccent()' function must be installed before
$line=preg_replace('/\s+(\(+\s*)([a-zA-Z0-9\-\_\.]+) ILIKE /', ' \1unaccent(\2) ILIKE ', $line);
}
$line=str_replace(' LIKE BINARY \'',' LIKE \'',$line);
// Replace INSERT IGNORE into INSERT