Skip site navigation (1) Skip section navigation (2)

off-by-one mistake in array code error reporting

From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: off-by-one mistake in array code error reporting
Date: 2011-01-31 08:19:25
Message-ID: E61E49CA-5CC5-4CD3-BE14-297FC04B397F@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

While working on PL/Perl patch for arrays as input arguments I've noticed that
PostgreSQL reports one less dimension in the 'number of array dimensions (%d)
exceeds the maximum allowed (%d)", i.e.

select '{{{{{{{1,2},{3,4}},{{5,6},{7,8}}},{{{9,10},{11,12}},{{13,14},{15,16}}}},                                                                     {{{{17,18},{19,20}},{{21,22},{23,24}}},{{{25,26},{27,28}},{{29,30},{31,32}}}}}, {{{{{1,2},{3,4}},{{5,6},{7,8}}},{{{9,10},{11,12}},{{13,14},{15,16}}}},          {{{{17,18},{19,20}},{{21,22},{23,24}}},{{{25,26},{27,28}},{{29,30},{31,32}}}}}},                                                                                {{{{{{1,2},{3,4}},{{5,6},{7,8}}},{{{9,10},{11,12}},{{13,14},{15,16}}}},         {{{{17,18},{19,20}},{{21,22},{23,24}}},{{{25,26},{27,28}},{{29,30},{31,32}}}}}, {{{{{1,2},{3,4}},{{5,6},{7,8}}},{{{9,10},{11,12}},{{13,14},{15,16}}}},          {{{{17,18},{19,20}},{{21,22},{23,24}}},{{{25,26},{27,28}},{{29,30},{31,32}}}}}}}'                                                                               ::int[];

ERROR:  number of array dimensions (6) exceeds the maximum allowed (6)

Attached is the simple fix for that.

/A

--
Alexey Klyukin
The PostgreSQL Company - Command Prompt, Inc.




Attachment: array_error_msg_fix.diff
Description: application/octet-stream (2.7 KB)

Responses

pgsql-hackers by date

Next:From: Jörg Roman RudnickDate: 2011-01-31 08:32:54
Subject: [pgsql-general 2011-1-21:] Are there any projects interested in object functionality? (+ rule bases)
Previous:From: Itagaki TakahiroDate: 2011-01-31 08:04:22
Subject: Re: Spread checkpoint sync

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group