Обсуждение: change NAMEDATALEN to 64

Поиск
Список
Период
Сортировка

change NAMEDATALEN to 64

От
Kathy Zhu
Дата:
Hi,

We have tables with long names so I modified postgres_ext.h and change
NAMEDATALEN to 64 (originally is 32).

When I do "gmake check", I failed the test on "name", see below.

parallel group (13 tests):  float8 boolean float4 oid int4 int8 char int2 name t
ext varchar bit numeric
     boolean              ... ok
     char                 ... ok
     name                 ... FAILED
     varchar              ... ok
     text                 ... ok
     int2                 ... ok
     int4                 ... ok
     int8                 ... ok
     oid                  ... ok
     float4               ... ok
     float8               ... ok
     bit                  ... ok
     numeric              ... ok
test strings              ... ok


I am attaching the regression.diffs file created by the regression test, which I
don't know how to interprate.

**** The question is, is it ok to fail this regression test since I do change
the NAMEDATALEN ???


thanks,
kathy
*** ./expected/name.out    Tue Jan  4 09:19:34 2000
--- ./results/name.out    Mon Jul 14 15:45:11 2003
***************
*** 28,52 ****
  INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
  SELECT '' AS seven, NAME_TBL.*;
   seven |               f1
! -------+---------------------------------
         | ABCDEFGHIJKLMNOP
         | abcdefghijklmnop
         | asdfghjkl;
         | 343f%2a
         | d34aaasdf
         |
!        | 1234567890ABCDEFGHIJKLMNOPQRSTU
  (7 rows)

  SELECT '' AS six, c.f1 FROM NAME_TBL c WHERE c.f1 <> 'ABCDEFGHIJKLMNOP';
   six |               f1
! -----+---------------------------------
       | abcdefghijklmnop
       | asdfghjkl;
       | 343f%2a
       | d34aaasdf
       |
!      | 1234567890ABCDEFGHIJKLMNOPQRSTU
  (6 rows)

  SELECT '' AS one, c.f1 FROM NAME_TBL c WHERE c.f1 = 'ABCDEFGHIJKLMNOP';
--- 28,52 ----
  INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
  SELECT '' AS seven, NAME_TBL.*;
   seven |                  f1
! -------+--------------------------------------
         | ABCDEFGHIJKLMNOP
         | abcdefghijklmnop
         | asdfghjkl;
         | 343f%2a
         | d34aaasdf
         |
!        | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
  (7 rows)

  SELECT '' AS six, c.f1 FROM NAME_TBL c WHERE c.f1 <> 'ABCDEFGHIJKLMNOP';
   six |                  f1
! -----+--------------------------------------
       | abcdefghijklmnop
       | asdfghjkl;
       | 343f%2a
       | d34aaasdf
       |
!      | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
  (6 rows)

  SELECT '' AS one, c.f1 FROM NAME_TBL c WHERE c.f1 = 'ABCDEFGHIJKLMNOP';
***************
*** 57,75 ****

  SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 < 'ABCDEFGHIJKLMNOP';
   three |               f1
! -------+---------------------------------
         | 343f%2a
         |
!        | 1234567890ABCDEFGHIJKLMNOPQRSTU
  (3 rows)

  SELECT '' AS four, c.f1 FROM NAME_TBL c WHERE c.f1 <= 'ABCDEFGHIJKLMNOP';
   four |               f1
! ------+---------------------------------
        | ABCDEFGHIJKLMNOP
        | 343f%2a
        |
!       | 1234567890ABCDEFGHIJKLMNOPQRSTU
  (4 rows)

  SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 > 'ABCDEFGHIJKLMNOP';
--- 57,75 ----

  SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 < 'ABCDEFGHIJKLMNOP';
   three |                  f1
! -------+--------------------------------------
         | 343f%2a
         |
!        | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
  (3 rows)

  SELECT '' AS four, c.f1 FROM NAME_TBL c WHERE c.f1 <= 'ABCDEFGHIJKLMNOP';
   four |                  f1
! ------+--------------------------------------
        | ABCDEFGHIJKLMNOP
        | 343f%2a
        |
!       | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
  (4 rows)

  SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 > 'ABCDEFGHIJKLMNOP';
***************
*** 91,104 ****

  SELECT '' AS seven, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
   seven |               f1
! -------+---------------------------------
         | ABCDEFGHIJKLMNOP
         | abcdefghijklmnop
         | asdfghjkl;
         | 343f%2a
         | d34aaasdf
         |
!        | 1234567890ABCDEFGHIJKLMNOPQRSTU
  (7 rows)

  SELECT '' AS zero, c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
--- 91,104 ----

  SELECT '' AS seven, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
   seven |                  f1
! -------+--------------------------------------
         | ABCDEFGHIJKLMNOP
         | abcdefghijklmnop
         | asdfghjkl;
         | 343f%2a
         | d34aaasdf
         |
!        | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
  (7 rows)

  SELECT '' AS zero, c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
***************
*** 108,117 ****

  SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
   three |               f1
! -------+---------------------------------
         | 343f%2a
         | d34aaasdf
!        | 1234567890ABCDEFGHIJKLMNOPQRSTU
  (3 rows)

  SELECT '' AS two, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';
--- 108,117 ----

  SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
   three |                  f1
! -------+--------------------------------------
         | 343f%2a
         | d34aaasdf
!        | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
  (3 rows)

  SELECT '' AS two, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';

======================================================================


Re: change NAMEDATALEN to 64

От
Kathy Zhu
Дата:
I think I figured out what went wrong.


regression.diffs is created by compareing src/test/regress/expect/name.out with
src/test/regress/results/name.out.

Since expected/name.out comes with the jar, so any changes I made won't be
reflected in the that file.

Now the question is, is there a way to update the expected/*out files ??

thanks,
kathy



> X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org
> Date: Mon, 14 Jul 2003 16:10:15 -0600 (MDT)
> From: Kathy Zhu <Kathy.Zhu@sun.com>
> Subject: [GENERAL] change NAMEDATALEN to 64
> To: pgsql-general@postgresql.org
> X-Virus-Scanned: by amavisd-new at postgresql.org
>
> Hi,
>
> We have tables with long names so I modified postgres_ext.h and change
> NAMEDATALEN to 64 (originally is 32).
>
> When I do "gmake check", I failed the test on "name", see below.
>
> parallel group (13 tests):  float8 boolean float4 oid int4 int8 char int2 name
t
> ext varchar bit numeric
>      boolean              ... ok
>      char                 ... ok
>      name                 ... FAILED
>      varchar              ... ok
>      text                 ... ok
>      int2                 ... ok
>      int4                 ... ok
>      int8                 ... ok
>      oid                  ... ok
>      float4               ... ok
>      float8               ... ok
>      bit                  ... ok
>      numeric              ... ok
> test strings              ... ok
>
>
> I am attaching the regression.diffs file created by the regression test, which
I
> don't know how to interprate.
>
> **** The question is, is it ok to fail this regression test since I do change
> the NAMEDATALEN ???
>
>
> thanks,
> kathy




Re: change NAMEDATALEN to 64

От
Alvaro Herrera
Дата:
On Mon, Jul 14, 2003 at 04:10:15PM -0600, Kathy Zhu wrote:

> parallel group (13 tests):  float8 boolean float4 oid int4 int8 char int2 name t
> ext varchar bit numeric
>      boolean              ... ok
>      char                 ... ok
>      name                 ... FAILED
>
>
> I am attaching the regression.diffs file created by the regression test, which I
> don't know how to interprate.
>
> **** The question is, is it ok to fail this regression test since I do change
> the NAMEDATALEN ???

AFAICS this is testing the ability to correctly truncate the identifier
length to 31 chars, so yes, the test is supposed to fail.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Linux transformó mi computadora, de una `máquina para hacer cosas',
en un aparato realmente entretenido, sobre el cual cada día aprendo
algo nuevo" (Jaime Salinas)

Re: change NAMEDATALEN to 64

От
Tom Lane
Дата:
Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> On Mon, Jul 14, 2003 at 04:10:15PM -0600, Kathy Zhu wrote:
>> **** The question is, is it ok to fail this regression test since I do change
>> the NAMEDATALEN ???

> AFAICS this is testing the ability to correctly truncate the identifier
> length to 31 chars, so yes, the test is supposed to fail.

Indeed; see the changes to that regression result made between 7.2 and 7.3:
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/test/regress/expected/name.out

Kathy, you might want to think about switching to a not-yet-obsolete
release ;-)

            regards, tom lane