Skip to content

Commit 082e620

Browse files
committed
Merge branch 'master' of github.com:darold/pgbadger
2 parents 4ea7450 + af1f7b6 commit 082e620

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

pgbadger

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19821,8 +19821,20 @@ sub query
1982119821

1982219822
# Replace any \\ by BSLHPGF
1982319823
$self->{ 'query' } =~ s/\\\\/BSLHPGF/sg;
19824-
# Replace any \' by PGFBSLHQ
19825-
$self->{ 'query' } =~ s/\\'/PGFBSLHQ/sg;
19824+
19825+
### BBO - 2023-10-18 - FIX - single-quoted Windows Network paths tokenization
19826+
### Do not have single quote disappear from tokenization otherwise strings like:
19827+
### '\\some.site.com\folder1\folder2\'
19828+
### get wrongly tokenized into: ( ('\\some.site.com),(folder1),(folder2\') )
19829+
### (related to Windows-convention network paths)
19830+
### Fix consists still in characterizing the \' part but while keeping the quote in the string
19831+
### for proper quote-to-quote string tokenization
19832+
###
19833+
### # Replace any \' by PGFBSLHQ
19834+
### $self->{ 'query' } =~ s/\\'/PGFBSLHQ/sg;
19835+
# Replace any \' by PGFBSLBEFOREHQ'
19836+
$self->{ 'query' } =~ s/\\'/PGFBSLBEFOREHQ'/sg;
19837+
1982619838
# Replace any '' by PGFESCQ1
1982719839
while ($self->{ 'query' } =~ s/([^'])''([^'])/$1PGFESCQ1$2/s) {};
1982819840
# Replace any '''' by PGFESCQ1PGFESCQ1
@@ -20011,8 +20023,13 @@ sub content
2001120023

2001220024
# Replace any BSLHPGF by \\
2001320025
$self->{ 'content' } =~ s/BSLHPGF/\\\\/g;
20014-
# Replace any PGFBSLHQ by \'
20015-
$self->{ 'content' } =~ s/PGFBSLHQ/\\'/g;
20026+
20027+
### BBO - 2023-10-18 - FIX - single-quoted Windows Network paths tokenization
20028+
### # Replace any PGFBSLHQ by \'
20029+
### $self->{ 'content' } =~ s/PGFBSLHQ/\\'/g;
20030+
# Replace any PGFBSLBEFOREHQ by \
20031+
$self->{ 'content' } =~ s/PGFBSLBEFOREHQ/\\/g;
20032+
2001620033
# Replace any $PGFDLM$ by code delimiter '
2001720034
$self->{ 'content' } =~ s/\$PGFDLM\$/'/g;
2001820035

0 commit comments

Comments
 (0)