darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.45k stars 348 forks source link

pgBadger 12.2 - Windows Network Paths in SQL statements not properly displayed (missing backslashes) #801

Closed bbourgier closed 9 months ago

bbourgier commented 9 months ago

Hi,

Issue in pgBadger 12.2 In log file: 2023-10-17 02:45:18.954 CEST [21684]: [4-1] user=xxx,db=xxx,app=xxx,client=xxx LOG: duration: 9685.961 ms statement: -- SOME COMMENT call tools.dataimport(3, '\\some.site.com\folder1\folder2\', 1000); In HTML report: `

4 47s939ms
-- SOME COMMENT call tools.dataimport (3, '\\some.site.com folder1 folder2\', 1000); [...] ` As you can see: ` '\\some.site.com\folder1\folder2\' ` as been translated (tokenized) to: ` '\\some.site.com folder1 folder2\' ` After debugging I have found out something in the pgFormatter code which in the end unbalances the single-quotes around the Network Path and since backslashes outside of strings are lost to spaces, this makes out this small bug. I have done a pull request to fix this unbalancing behavior: #800 My same test with the #800 pullout code gives the following HTML code: ` 4 47s939ms
-- SOME COMMENT call tools.dataimport (3, '\\some.site.com\folder1\folder2\', 1000); [...] ` This looks good and on my side I don't see side effects, but this you only can really tell. Thanks in advance. Bertrand