[patch]overallocate memory for curly braces in array_out - Mailing list pgsql-hackers

From Keiichi Hirobe
Subject [patch]overallocate memory for curly braces in array_out
Date
Msg-id CAH=EFxE9W0tRvQkixR2XJRRCToUYUEDkJZk6tnADXugPBRdcdg@mail.gmail.com
Whole thread Raw
Responses Re: [patch]overallocate memory for curly braces in array_out
List pgsql-hackers
Hi,

Attached is a patch that fixes a bug
for miscounting total number of curly braces in output string in array_out.

Example1
        {{1,2,3},{4,5,6}} -> dims[0] = 2, dims[1]= 3

- Without the patch
                8
- After
                3   

Example2
        N size one-dimensional array -> dims[0] = N

        - Without the patch
                N
    - After
                1

I used gdb to confirm the above behavior.

Cheers,
Keiichi Hirobe
Attachment

pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: amcheck verification for GiST
Next
From: Thomas Munro
Date:
Subject: Re: Collation versioning