pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix bogus tree-flattening logic in QTNTernary().
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix bogus tree-flattening logic in QTNTernary().
@ 2016-10-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-10-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix bogus tree-flattening logic in QTNTernary().

QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',
which is all well and good, but it tries to do that to NOT nodes as well,
so that '!!a' gets changed to '!a'.  Explicitly restrict the conversion to
be done only on AND and OR nodes, and add a test case illustrating the bug.

In passing, provide some comments for the sadly naked functions in
tsquery_util.c, and simplify some baroque logic in QTNFree(), which
I think may have been leaking some items it intended to free.

Noted while investigating a complaint from Andreas Seltenreich.
Back-patch to all supported versions.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/24ebc444c61306f50777f674544e8559e765ad81

Modified Files
--------------
src/backend/utils/adt/tsquery_util.c  | 82 +++++++++++++++++++++++++----------
src/test/regress/expected/tsearch.out |  7 +++
src/test/regress/sql/tsearch.sql      |  2 +
3 files changed, 68 insertions(+), 23 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] 6+ messages in thread

* pgsql: Fix bogus tree-flattening logic in QTNTernary().
@ 2016-10-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-10-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix bogus tree-flattening logic in QTNTernary().

QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',
which is all well and good, but it tries to do that to NOT nodes as well,
so that '!!a' gets changed to '!a'.  Explicitly restrict the conversion to
be done only on AND and OR nodes, and add a test case illustrating the bug.

In passing, provide some comments for the sadly naked functions in
tsquery_util.c, and simplify some baroque logic in QTNFree(), which
I think may have been leaking some items it intended to free.

Noted while investigating a complaint from Andreas Seltenreich.
Back-patch to all supported versions.

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2a2b439cc14288c539b4b875df275766845c4c99

Modified Files
--------------
src/backend/utils/adt/tsquery_util.c  | 82 +++++++++++++++++++++++++----------
src/test/regress/expected/tsearch.out |  7 +++
src/test/regress/sql/tsearch.sql      |  2 +
3 files changed, 68 insertions(+), 23 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] 6+ messages in thread

* pgsql: Fix bogus tree-flattening logic in QTNTernary().
@ 2016-10-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-10-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix bogus tree-flattening logic in QTNTernary().

QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',
which is all well and good, but it tries to do that to NOT nodes as well,
so that '!!a' gets changed to '!a'.  Explicitly restrict the conversion to
be done only on AND and OR nodes, and add a test case illustrating the bug.

In passing, provide some comments for the sadly naked functions in
tsquery_util.c, and simplify some baroque logic in QTNFree(), which
I think may have been leaking some items it intended to free.

Noted while investigating a complaint from Andreas Seltenreich.
Back-patch to all supported versions.

Branch
------
REL9_5_STABLE

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

Modified Files
--------------
src/backend/utils/adt/tsquery_util.c  | 81 ++++++++++++++++++++++++++---------
src/test/regress/expected/tsearch.out |  7 +++
src/test/regress/sql/tsearch.sql      |  2 +
3 files changed, 69 insertions(+), 21 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] 6+ messages in thread

* pgsql: Fix bogus tree-flattening logic in QTNTernary().
@ 2016-10-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-10-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix bogus tree-flattening logic in QTNTernary().

QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',
which is all well and good, but it tries to do that to NOT nodes as well,
so that '!!a' gets changed to '!a'.  Explicitly restrict the conversion to
be done only on AND and OR nodes, and add a test case illustrating the bug.

In passing, provide some comments for the sadly naked functions in
tsquery_util.c, and simplify some baroque logic in QTNFree(), which
I think may have been leaking some items it intended to free.

Noted while investigating a complaint from Andreas Seltenreich.
Back-patch to all supported versions.

Branch
------
REL9_4_STABLE

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

Modified Files
--------------
src/backend/utils/adt/tsquery_util.c  | 81 ++++++++++++++++++++++++++---------
src/test/regress/expected/tsearch.out |  7 +++
src/test/regress/sql/tsearch.sql      |  2 +
3 files changed, 69 insertions(+), 21 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] 6+ messages in thread

* pgsql: Fix bogus tree-flattening logic in QTNTernary().
@ 2016-10-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-10-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix bogus tree-flattening logic in QTNTernary().

QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',
which is all well and good, but it tries to do that to NOT nodes as well,
so that '!!a' gets changed to '!a'.  Explicitly restrict the conversion to
be done only on AND and OR nodes, and add a test case illustrating the bug.

In passing, provide some comments for the sadly naked functions in
tsquery_util.c, and simplify some baroque logic in QTNFree(), which
I think may have been leaking some items it intended to free.

Noted while investigating a complaint from Andreas Seltenreich.
Back-patch to all supported versions.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/77a22f898e6633c9f15e0c3edfa6f6296ba6f17b

Modified Files
--------------
src/backend/utils/adt/tsquery_util.c  | 81 ++++++++++++++++++++++++++---------
src/test/regress/expected/tsearch.out |  7 +++
src/test/regress/sql/tsearch.sql      |  2 +
3 files changed, 69 insertions(+), 21 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] 6+ messages in thread

* pgsql: Fix bogus tree-flattening logic in QTNTernary().
@ 2016-10-30 19:25 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2016-10-30 19:25 UTC (permalink / raw)
  To: pgsql-committers

Fix bogus tree-flattening logic in QTNTernary().

QTNTernary() contains logic to flatten, eg, '(a & b) & c' into 'a & b & c',
which is all well and good, but it tries to do that to NOT nodes as well,
so that '!!a' gets changed to '!a'.  Explicitly restrict the conversion to
be done only on AND and OR nodes, and add a test case illustrating the bug.

In passing, provide some comments for the sadly naked functions in
tsquery_util.c, and simplify some baroque logic in QTNFree(), which
I think may have been leaking some items it intended to free.

Noted while investigating a complaint from Andreas Seltenreich.
Back-patch to all supported versions.

Branch
------
REL9_2_STABLE

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

Modified Files
--------------
src/backend/utils/adt/tsquery_util.c  | 81 ++++++++++++++++++++++++++---------
src/test/regress/expected/tsearch.out |  7 +++
src/test/regress/sql/tsearch.sql      |  2 +
3 files changed, 69 insertions(+), 21 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] 6+ messages in thread


end of thread, other threads:[~2016-10-30 19:25 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-30 19:25 pgsql: Fix bogus tree-flattening logic in QTNTernary(). Tom Lane <tgl@sss.pgh.pa.us>
2016-10-30 19:25 pgsql: Fix bogus tree-flattening logic in QTNTernary(). Tom Lane <tgl@sss.pgh.pa.us>
2016-10-30 19:25 pgsql: Fix bogus tree-flattening logic in QTNTernary(). Tom Lane <tgl@sss.pgh.pa.us>
2016-10-30 19:25 pgsql: Fix bogus tree-flattening logic in QTNTernary(). Tom Lane <tgl@sss.pgh.pa.us>
2016-10-30 19:25 pgsql: Fix bogus tree-flattening logic in QTNTernary(). Tom Lane <tgl@sss.pgh.pa.us>
2016-10-30 19:25 pgsql: Fix bogus tree-flattening logic in QTNTernary(). 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