pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Improve index AMs' opclass validation procedures.
3+ messages / 2 participants
[nested] [flat]

* pgsql: Improve index AMs' opclass validation procedures.
@ 2016-01-22 00:47 Tom Lane <tgl@sss.pgh.pa.us>
  2016-01-22 01:48 ` Re: pgsql: Improve index AMs' opclass validation procedures. David Rowley <david.rowley@2ndquadrant.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2016-01-22 00:47 UTC (permalink / raw)
  To: pgsql-committers

Improve index AMs' opclass validation procedures.

The amvalidate functions added in commit 65c5fcd353a859da were on the
crude side.  Improve them in a few ways:

* Perform signature checking for operators and support functions.

* Apply more thorough checks for missing operators and functions,
where possible.

* Instead of reporting problems as ERRORs, report most problems as INFO
messages and make the amvalidate function return FALSE.  This allows
more than one problem to be discovered per run.

* Report object names rather than OIDs, and work a bit harder on making
the messages understandable.

Also, remove a few more opr_sanity regression test queries that are
now superseded by the amvalidate checks.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/be44ed27b86ebd165bbedf06a4ac5a8eb943d43c

Modified Files
--------------
src/backend/access/brin/brin_validate.c  |  260 ++++++++++++++++++++-------
src/backend/access/gin/ginvalidate.c     |  233 ++++++++++++++++++------
src/backend/access/gist/gistvalidate.c   |  241 +++++++++++++++++++------
src/backend/access/hash/hashvalidate.c   |  289 +++++++++++++++++++++++-------
src/backend/access/index/Makefile        |    2 +-
src/backend/access/index/amvalidate.c    |  246 +++++++++++++++++++++++++
src/backend/access/nbtree/nbtvalidate.c  |  274 ++++++++++++++++------------
src/backend/access/spgist/spgvalidate.c  |  211 +++++++++++++++++-----
src/backend/utils/cache/lsyscache.c      |   23 +++
src/include/access/amvalidate.h          |   36 ++++
src/include/utils/lsyscache.h            |    1 +
src/test/regress/expected/opr_sanity.out |  204 +--------------------
src/test/regress/sql/opr_sanity.sql      |  171 +-----------------
13 files changed, 1417 insertions(+), 774 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: Improve index AMs' opclass validation procedures.
  2016-01-22 00:47 pgsql: Improve index AMs' opclass validation procedures. Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-01-22 01:48 ` David Rowley <david.rowley@2ndquadrant.com>
  2016-01-22 02:14   ` Re: pgsql: Improve index AMs' opclass validation procedures. Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: David Rowley @ 2016-01-22 01:48 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers

On 22 January 2016 at 13:47, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Improve index AMs' opclass validation procedures.
>
> The amvalidate functions added in commit 65c5fcd353a859da were on the
> crude side.  Improve them in a few ways:
>
> * Perform signature checking for operators and support functions.
>
> * Apply more thorough checks for missing operators and functions,
> where possible.
>
> * Instead of reporting problems as ERRORs, report most problems as INFO
> messages and make the amvalidate function return FALSE.  This allows
> more than one problem to be discovered per run.
>
> * Report object names rather than OIDs, and work a bit harder on making
> the messages understandable.
>
> Also, remove a few more opr_sanity regression test queries that are
> now superseded by the amvalidate checks.

I'm getting 3 new warnings with this change which mention about 32-bit
bit shifting then bitwise anding to a 64-bit variable.

The attached fixes the warnings

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Attachments:

amvalidate_64bit_bitshift.patch (application/octet-stream, 1.7K) download diff --git a/src/backend/access/gin/ginvalidate.c b/src/backend/access/gin/ginvalidate.c index b87833b..d39c5bf 100644 --- a/src/backend/access/gin/ginvalidate.c +++ b/src/backend/access/gin/ginvalidate.c @@ -234,7 +234,8 @@ ginvalidate(Oid opclassoid) /* Check that the originally-named opclass is complete */ for (i = 1; i <= GINNProcs; i++) { - if (opclassgroup && (opclassgroup->functionset & (1 << i)) != 0) + if (opclassgroup && + (opclassgroup->functionset & ((uint64) 1 << i)) != 0) continue; /* got it */ if (i == GIN_COMPARE_PARTIAL_PROC) continue; /* optional method */ diff --git a/src/backend/access/gist/gistvalidate.c b/src/backend/access/gist/gistvalidate.c index 190b978..6c2ab12 100644 --- a/src/backend/access/gist/gistvalidate.c +++ b/src/backend/access/gist/gistvalidate.c @@ -254,7 +254,8 @@ gistvalidate(Oid opclassoid) /* Check that the originally-named opclass is complete */ for (i = 1; i <= GISTNProcs; i++) { - if (opclassgroup && (opclassgroup->functionset & (1 << i)) != 0) + if (opclassgroup && + (opclassgroup->functionset & ((uint64) 1 << i)) != 0) continue; /* got it */ if (i == GIST_DISTANCE_PROC || i == GIST_FETCH_PROC) continue; /* optional methods */ diff --git a/src/backend/access/spgist/spgvalidate.c b/src/backend/access/spgist/spgvalidate.c index ba7c828..d911eaa 100644 --- a/src/backend/access/spgist/spgvalidate.c +++ b/src/backend/access/spgist/spgvalidate.c @@ -213,7 +213,7 @@ spgvalidate(Oid opclassoid) for (i = 1; i <= SPGISTNProc; i++) { - if ((thisgroup->functionset & (1 << i)) != 0) + if ((thisgroup->functionset & ((uint64) 1 << i)) != 0) continue; /* got it */ ereport(INFO, (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: pgsql: Improve index AMs' opclass validation procedures.
  2016-01-22 00:47 pgsql: Improve index AMs' opclass validation procedures. Tom Lane <tgl@sss.pgh.pa.us>
  2016-01-22 01:48 ` Re: pgsql: Improve index AMs' opclass validation procedures. David Rowley <david.rowley@2ndquadrant.com>
@ 2016-01-22 02:14   ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2016-01-22 02:14 UTC (permalink / raw)
  To: David Rowley <david.rowley@2ndquadrant.com>; +Cc: pgsql-committers

David Rowley <david.rowley@2ndquadrant.com> writes:
> I'm getting 3 new warnings with this change which mention about 32-bit
> bit shifting then bitwise anding to a 64-bit variable.
> The attached fixes the warnings

Pushed, thanks.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2016-01-22 02:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-01-22 00:47 pgsql: Improve index AMs' opclass validation procedures. Tom Lane <tgl@sss.pgh.pa.us>
2016-01-22 01:48 ` David Rowley <david.rowley@2ndquadrant.com>
2016-01-22 02:14   ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox