Maarch 1.6, pgsql errors

Discussions sur les fonctionnalités et la roadmap de l'application
Discussions about the features and the roadmap of the application

Maarch 1.6, pgsql errors

Message par fangebault » 13 Jan 2017, 17:01

Hi,

I'm testing maarch_courrier 1.6 and I've hit the same kind of SQL bug on many pages.
Here is an an example:
Code : Tout sélectionner
ERREUR:  syntaxe en entrée invalide pour l'entier : «  »
2016-12-16 10:45:24 CET [10354-586] maarch_dcpaf@maarch16_dcpaf INSTRUCTION :  SELECT  res_view_letterbox.res_id,res_view_letterbox.res_id as is_labeled,res_view_letterbox.status,res_view_letterbox.subject,res_view_letterbox.category_id as category_img,res_view_letterbox.contact_firstname,res_view_letterbox.contact_lastname,res_view_letterbox.contact_society,res_view_letterbox.user_lastname,res_view_letterbox.user_firstname,res_view_letterbox.dest_user,res_view_letterbox.type_label,res_view_letterbox.creation_date,res_view_letterbox.entity_label,res_view_letterbox.category_id, exp_user_id,res_view_letterbox.alt_identifier,regexp_replace(alt_identifier, '[^a-zA-Z]', '', 'g'),regexp_replace(alt_identifier, '[^0-9]', '', 'g')::int,res_view_letterbox.count_attachment,res_view_letterbox.is_multicontacts,res_view_letterbox.priority,res_view_letterbox.folders_system_id,res_view_letterbox.folder_name FROM res_view_letterbox  WHERE (status not in ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)) and ((( (DESTINATION = 'EMUDGAC' or 1=2) )) or ( (  scan_location = 'EMUDGAC'  AND  status = 'ATT') or (  status = 'RES' AND (scan_location = 'EMUDGAC' or initiator = 'EMUDGAC')) or (  status IN ('NEW', 'COU') AND dest_user in (SELECT user_id FROM users_entities WHERE entity_id = 'EMUDGAC')) or (  status = 'VAL' AND destination <> 'COU' AND dest_user in (SELECT user_id FROM users_entities WHERE entity_id = 'EMUDGAC')) or (  status = 'RET' AND (scan_location = 'EMUDGAC' or initiator = 'EMUDGAC')))) order by creation_date desc OFFSET 0 LIMIT 500


After some investigations it appears that the problem comes from unexpected blank values in mlb_coll_ext.alt_identifier.
I don't know if such inconsistency is possible in real usage. I'm working with sample data provided during installation. The fact is that "good rows" look like this "MAARCH/2016A/5" and bad rows contains the empty string instead of null.

However I wrote a patch that seems to circumvent this issue. Can you review it and possibly integrate it?

PS: I've installed maarch_courrier 1.6 from SVN by following the instructions for Debian-Ubuntu in the wiki.
fangebault
 
Message(s) : 5
Inscription : 13 Jan 2017, 16:21

Re: Maarch 1.6, pgsql errors

Message par fangebault » 14 Fév 2017, 16:46

Hi, I just noticed that I forgot to upload the patch. Here it is.
Pièces jointes
fix_query_cast_empty_string_to_int.zip
(1.14 Kio) Téléchargé 41 fois
fangebault
 
Message(s) : 5
Inscription : 13 Jan 2017, 16:21

Re: Maarch 1.6, pgsql errors

Message par lgi » 15 Mars 2017, 12:04

Hello,

Thank you for the patch.

We can not accept this patch because it generates regressions.

We advise you rather to set the application correctly so as not to arrive in case the chrono number is empty.
Se réveiller, c'est se mettre à la recherche du monde.
lgi
 
Message(s) : 113
Inscription : 12 Déc 2007, 18:58

Re: Maarch 1.6, pgsql errors

Message par odaniel » 24 Mars 2017, 15:40

Hello,

Can you tell me what regressions are generated please ?
odaniel
 
Message(s) : 1
Inscription : 24 Mars 2017, 15:30

Re: Maarch 1.6, pgsql errors

Message par fangebault » 28 Mars 2017, 10:48

I guess the regression occurs with postgresql < 9.1 because my patch uses the 'concat()' syntax.
Here is the same patch using the more portable syntax "||" for postgresql.
Can you please review this new patch?
Pièces jointes
fix_query_cast_empty_string_to_int_v2.zip
patch compatible with older postgresql versions
(1.14 Kio) Téléchargé 36 fois
fangebault
 
Message(s) : 5
Inscription : 13 Jan 2017, 16:21


Retour vers Fonctionnalités & Roadmap

Qui est en ligne ?

Utilisateur(s) parcourant ce forum : Aucun utilisateur inscrit et 1 invité

cron