Fix: Try a fix to avoid error on big sql
This commit is contained in:
parent
44a78ca884
commit
d8216a09e1
@ -96,6 +96,7 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
|
||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
$idpays = $p[0];
|
||||
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref_supplier, f.type, f.datef, f.libelle,";
|
||||
$sql.= " fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type, fd.localtax1_tx, fd.localtax2_tx, fd.total_localtax1, fd.total_localtax2,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur,";
|
||||
@ -111,6 +112,9 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql.= " AND f.t
|
||||
else $sql.= " AND f.type IN (0,1,2,3)";
|
||||
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
|
||||
// TODO Find a better trick to avoid problem with some mysql installations
|
||||
if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1');
|
||||
|
||||
dol_syslog("sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@ -116,6 +116,9 @@ $sql.= " AND fd.product_type IN (0,1)";
|
||||
if ($date_start && $date_end) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'";
|
||||
$sql.= " ORDER BY f.rowid";
|
||||
|
||||
// TODO Find a better trick to avoid problem with some mysql installations
|
||||
if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1');
|
||||
|
||||
dol_syslog("sql=".$sql);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user