beta2 make check failed on Win32

Lists: pgsql-hackers
From: "William ZHANG" <uniware(at)zedware(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: beta2 make check failed on Win32
Date: 2005-09-20 09:29:57
Message-ID: dgokqf$2ua9$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

pgsql-8.1beta2 "make check" failed on Win32 under MinGW.
Here is some lines from log/initdb.log.

<skipped>
creating configuration files ... ok
creating template1 database in
C:/MSYS/home/wlzhang/postgresql-8.1beta2/src/test/regress/tmp_check/data/bas
e/1 ... FATAL: syntax error in file
"C:/MSYS/home/wlzhang/postgresql-8.1beta2/src/test/regress/tmp_check/data/po
stgresql.conf" line 386, near token "'s Republic of China.936'"
child process was terminated by signal 1
initdb: data directory
"C:/MSYS/home/wlzhang/postgresql-8.1beta2/src/test/regress/tmp_check/data"
not removed at user's request

And some lines from postgresql.conf.

# These settings are initialized by initdb -- they might be changed
lc_messages = 'Chinese_People''s Republic of China.936' # locale for
system error message

# strings
lc_monetary = 'Chinese_People''s Republic of China.936' # locale for
monetary formatting
lc_numeric = 'Chinese_People''s Republic of China.936' # locale for
number formatting
lc_time = 'Chinese_People''s Republic of China.936' # locale for
time formatting

It seems that we cannot deal with embedded quotes correctly.
For simplicity, we can test using any parameter with string type. e.g.
bonjour_name.

--
Regards,
William ZHANG


From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: beta2 make check failed on Win32
Date: 2005-09-21 09:31:32
Message-ID: dgquo8$2rsd$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


"William ZHANG" <uniware(at)zedware(dot)org> wrote

> lc_messages = 'Chinese_People''s Republic of China.936' # locale
> for
> system error message
>

Diff current version vs. some earlier version, you see this:

/*
* signal handler in case we are interrupted.
@@ -1951,12 +2035,12 @@ escape_quotes(const char *src)
{
int len = strlen(src),
i, j;
- char *result = xmalloc(len * 2 + 1);
+ char *result = pg_malloc(len * 2 + 1);

for (i = 0, j = 0; i < len; i++)
{
- if (src[i] == '\'' || src[i] == '\\')
- result[j++] = '\\';
+ if (SQL_STR_DOUBLE(src[i]))
+ result[j++] = src[i];
result[j++] = src[i];
}

So the problem is this line:

result[j++] = src[i];

That is, use the old line then the 'People\'s republic of China' string gets
right. But I am quite sure if revoke this will affect other things.

Regards,
Qingqing


From: "William ZHANG" <uniware(at)zedware(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: beta2 make check failed on Win32
Date: 2005-09-21 12:12:24
Message-ID: dgriph$28im$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


What you find is in initdb.c. Maybe the author want to make single quotes
escaped just the same as in SQL. But guc-file.l is unaware of it.

"Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> wrote
>
> Diff current version vs. some earlier version, you see this:
>
> /*
> * signal handler in case we are interrupted.
> @@ -1951,12 +2035,12 @@ escape_quotes(const char *src)
> {
> int len = strlen(src),
> i, j;
> - char *result = xmalloc(len * 2 + 1);
> + char *result = pg_malloc(len * 2 + 1);
>
> for (i = 0, j = 0; i < len; i++)
> {
> - if (src[i] == '\'' || src[i] == '\\')
> - result[j++] = '\\';
> + if (SQL_STR_DOUBLE(src[i]))
> + result[j++] = src[i];
> result[j++] = src[i];
> }
>
> So the problem is this line:
>
> result[j++] = src[i];
>
> That is, use the old line then the 'People\'s republic of China' string
gets
> right. But I am quite sure if revoke this will affect other things.
>
> Regards,
> Qingqing
>
>
>
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "William ZHANG" <uniware(at)zedware(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: beta2 make check failed on Win32
Date: 2005-09-21 20:35:51
Message-ID: 21666.1127334951@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"William ZHANG" <uniware(at)zedware(dot)org> writes:
> # These settings are initialized by initdb -- they might be changed
> lc_messages = 'Chinese_People''s Republic of China.936' # locale for
> system error message

Bruce seems to have gotten a bit ahead of himself on the
SQL-standard-strings project --- guc-file.l did not actually accept
the above as legal syntax. Seems it should though; fixed accordingly.

regards, tom lane