Dolibarr ERP & CRM » Bugs » bug #1913 [EXPORT] [PGSQL] Bug when filtering export on a specific yearDernières modifications
Répondre
État Détails |
Last Modified On: | 30/03/2015 19:19 | | Submitted by: | damien clochard (daamien) |
Submitted on: | 25/03/2015 16:17 | |
Summary: | [EXPORT] [PGSQL] Bug when filtering export on a specific year |
Description: | go to the export module :
https://...../exports/export.php
Step 1- select "export client invoice" and click next
Step 2- select the invoice date and click next
Step 3- type 2014 in the filter form in front of invoice date and click next
Step 4- click next
Step 5- click on "generate"
You get the following error message :
ERROR: 42883: operator does not exist: text = integer LINE 1: ...rowid AND f.entity = 1 and date_format(f.datef,'%Y') = 2014 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. LOCATION: op_error, parse_oper.c:722 - sql=SELECT DISTINCT s.rowid as s_rowid, f.total as f_total, f.paye as f_paye FROM llx_societe as s LEFT JOIN llx_c_pays as c on s.fk_pays = c.rowid, llx_facture as f LEFT JOIN llx_paiement_facture as pf ON pf.fk_facture = f.rowid LEFT JOIN llx_paiement as p ON pf.fk_paiement = p.rowid WHERE f.fk_soc = s.rowid AND f.entity = 1 and date_format(f.datef,'%Y') = 2014
|
Step to reproduce bug: | The date_format function returns a string and PostgreSQL will not allow you to compare string and numbers. You have to make an explicit cast to transform the number in string or use date_part instead of date_format :
http://www.postgresql.org/docs/9.1/static/functions-datetime.html
I know MySQL allows you to compare strings and numbers but it's a really bad idea... I would suggest that you activate the MySQL's SQL strict mode before running your test :) |
Detected in version: | 3.6.2 | | Category: | Module: Data Exports |
Severity: | 5 - Major | | OS Type/Version: | |
PHP version: | | | Database type and version: | |
Etat |
Status: | Open | | Assigned to: | HENRY Florian (fhenry) |
Resolution: | Fixed | |
Commentaires- HENRY Florian 30/03/2015 19:19
- https://github.com/Dolibarr/dolibarr/pull/2508
- HENRY Florian 30/03/2015 19:19
- The bug has been corrected. Pull request send inside GIT sources
(http://www.github.com/Dolibarr/dolibarr) and waiting to merge
into develop branch. |
|