code2pg icon indicating copy to clipboard operation
code2pg copied to clipboard

Support to Perl files and Exclusion of instructions from analyze

Open darold opened this issue 4 years ago • 5 comments

This PR include several improvements:

  • Fix detection of the Oracle ASCII function.
  • Add -E, --exclude-instr command line option to be able to exclude
  • Add support to Perl file analyze using extensions pl and pm.
  • Add documentation about -E or --exclude-instr option

darold avatar Jul 23 '21 09:07 darold

Hi Anthony

Actually I had lot of false positive with some instruction like USER or DELETE_WITHOUT_FROM in some Java JSP file so I find useful to be able to exclude them from the report.

I have also processed hundred of Perl files containing SQL queries so I have added the support in code2pg. For the moment it only support string with double quote but I will add support to qq{} notation when I will have more time.

Thanks for this useful tool, this is a good companion to Ora2Pg :-)

darold avatar Jul 23 '21 09:07 darold

Hi Gilles, thanks for the pull request. I will have a detailled look at it (just coming back from vacation). Anthony

e7e6 avatar Aug 19 '21 07:08 e7e6

Hum right, looks that this is not the right patch, actually the hash key should be 'pl' and 'pm' instead of just 'perl' let me look at this.

darold avatar Aug 20 '21 10:08 darold

My last comment is wrong, I don't remember exactly what was done. Don't waste time on this I will check what I have exactly done to add Perl support.

darold avatar Aug 20 '21 10:08 darold

Ok I have found what I have done before switching to more complex code to support qq{...} Perl notation. I have pushed the missing code in previous patch to add minimal support for Perl language.

I have also add a fix to eliminate other false positive with the DELETE_WITHOUT_FROM. Honestly this rule brings too much false positive and imo it should be removed when it is not plain SQL statements.

darold avatar Aug 20 '21 12:08 darold

Hi Gilles, best new year wishes first of all. What you have proposed should have been accepted long ago... so are you ok to re-open the PR and have it integrated here ? Anthony

e7e6 avatar Jan 01 '23 16:01 e7e6

I have answered privately to your gmail address, let me know if it doesn't work anymore.

darold avatar Jan 02 '23 15:01 darold