On Thu, 9 Feb 2006, Bruce Momjian wrote:
Log Message:
-----------
Allow psql multi-line column values to align in the proper columns
There is a problem with this on AIX.
http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=asp&dt=2006-02-10%2006:23:00
For tables that have no columns AIX thinks it has an out of memory error.
src/bin/psql/print.c:pg_local_calloc bails out if calloc returns NULL. I
believe AIX is returning NULL for calloc with a count of zero. Efforts
are made not to call pg_local_calloc with a count of zero, but one place
is missed, the attached patch fixes that.
Additionally there are a whole lot of of signedness warnings introduced
which I've attached.
Kris Jurka
Index: src/bin/psql/print.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/psql/print.c,v
retrieving revision 1.80
diff -c -r1.80 print.c
*** src/bin/psql/print.c 10 Feb 2006 00:39:04 -0000 1.80
--- src/bin/psql/print.c 10 Feb 2006 07:07:47 -0000
***************
*** 451,457 ****
* format_space contains maximum space required to store formatted
string
* so we prepare the formatting structures
*/
! {
int heights_total = 0;
struct lineptr *lineptr;
--- 451,457 ----
* format_space contains maximum space required to store formatted
string
* so we prepare the formatting structures
*/
! if (col_count > 0) {
int heights_total = 0;
struct lineptr *lineptr;
***************
*** 469,474 ****
--- 469,476 ----
col_lineptrs[i]->ptr = format_buf[i];
}
+ } else {
+ lineptr_list = NULL;
}
/* print title */
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g -DFRONTEND
-I. -I../../../src/interfaces/libpq -I../../../src/bin/pg_dump
-I../../../src/include -D_GNU_SOURCE -c -o print.o print.c -MMD
print.c: In function 'print_aligned_text':
print.c:408: warning: pointer targets in passing argument 4 of 'pg_wcssize'
differ in signedness
print.c:428: warning: pointer targets in passing argument 4 of 'pg_wcssize'
differ in signedness
print.c:481: warning: pointer targets in passing argument 4 of 'pg_wcssize'
differ in signedness
print.c:590: warning: pointer targets in passing argument 1 of
'format_numeric_locale' differ in signedness
print.c:591: warning: field width should have type 'int', but argument 3 has
type 'size_t'
print.c: In function 'print_aligned_vertical':
print.c:692: warning: pointer targets in passing argument 4 of 'pg_wcssize'
differ in signedness
print.c:716: warning: pointer targets in passing argument 4 of 'pg_wcssize'
differ in signedness
print.c:825: warning: pointer targets in passing argument 1 of
'format_numeric_locale' differ in signedness
print.c:829: warning: field width should have type 'int', but argument 4 has
type 'size_t'
print.c: In function 'printQuery':
print.c:1755: warning: pointer targets in passing argument 1 of 'mbvalidate'
differ in signedness
print.c:1755: warning: pointer targets in assignment differ in signedness
print.c:1766: warning: pointer targets in passing argument 1 of 'mbvalidate'
differ in signedness
print.c:1766: warning: pointer targets in assignment differ in signedness
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g -DFRONTEND
-I. -I../../../src/interfaces/libpq -I../../../src/bin/pg_dump
-I../../../src/include -D_GNU_SOURCE -c -o mbprint.o mbprint.c -MMD
mbprint.c: In function 'pg_wcswidth':
mbprint.c:161: warning: pointer targets in passing argument 1 of 'PQmblen'
differ in signedness
mbprint.c:165: warning: pointer targets in passing argument 1 of 'PQdsplen'
differ in signedness
mbprint.c: In function 'pg_wcssize':
mbprint.c:194: warning: pointer targets in passing argument 1 of 'PQmblen'
differ in signedness
mbprint.c:197: warning: pointer targets in passing argument 1 of 'PQdsplen'
differ in signedness
mbprint.c: In function 'pg_wcsformat':
mbprint.c:260: warning: pointer targets in initialization differ in signedness
mbprint.c:264: warning: pointer targets in passing argument 1 of 'PQmblen'
differ in signedness
mbprint.c:267: warning: pointer targets in passing argument 1 of 'PQdsplen'
differ in signedness
mbprint.c:281: warning: pointer targets in assignment differ in signedness
---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly