pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Reduce an unnecessary O(N^3) loop in lexer.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ad871a9d78841592938a0b24cc961fd1d4185607

Modified Files
--------------
src/backend/parser/scan.l         | 29 +++++++++++++++++++++--------
src/bin/psql/psqlscan.l           | 29 +++++++++++++++++++++--------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 63 insertions(+), 24 deletions(-)



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

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0b42bd459af0532c6894d7699747986eaf4e86b5

Modified Files
--------------
src/backend/parser/scan.l         | 27 ++++++++++++++++++++-------
src/fe_utils/psqlscan.l           | 27 ++++++++++++++++++++-------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 61 insertions(+), 22 deletions(-)



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

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d4a63f829702cf28adb5db7e2ed44d2d9d893451

Modified Files
--------------
src/backend/parser/scan.l         | 27 ++++++++++++++++++++-------
src/fe_utils/psqlscan.l           | 27 ++++++++++++++++++++-------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 61 insertions(+), 22 deletions(-)



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

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9923c934df437dd4a83b2b9921d314d8bfb292b3

Modified Files
--------------
src/backend/parser/scan.l         | 29 +++++++++++++++++++++--------
src/bin/psql/psqlscan.l           | 29 +++++++++++++++++++++--------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 63 insertions(+), 24 deletions(-)



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

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6c5ed6836340a801d522f620dceca1469b5bfbbc

Modified Files
--------------
src/backend/parser/scan.l         | 29 +++++++++++++++++++++--------
src/bin/psql/psqlscan.l           | 29 +++++++++++++++++++++--------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 63 insertions(+), 24 deletions(-)



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

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2dbfbd630bc952b5e6f7e484f5538abad499533f

Modified Files
--------------
src/backend/parser/scan.l         | 27 ++++++++++++++++++++-------
src/fe_utils/psqlscan.l           | 27 ++++++++++++++++++++-------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 61 insertions(+), 22 deletions(-)



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

* pgsql: Reduce an unnecessary O(N^3) loop in lexer.
@ 2018-08-23 20:48  Andrew Gierth <rhodiumtoad@postgresql.org>
  0 siblings, 0 replies; 7+ messages in thread

From: Andrew Gierth @ 2018-08-23 20:48 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Reduce an unnecessary O(N^3) loop in lexer.

The lexer's handling of operators contained an O(N^3) hazard when
dealing with long strings of + or - characters; it seems hard to
prevent this case from being O(N^2), but the additional N multiplier
was not needed.

Backpatch all the way since this has been there since 7.x, and it
presents at least a mild hazard in that trying to do Bind, PREPARE or
EXPLAIN on a hostile query could take excessive time (without
honouring cancels or timeouts) even if the query was never executed.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4854ead60a293bb1ca235bd110c6a56c8aaaafd3

Modified Files
--------------
src/backend/parser/scan.l         | 27 ++++++++++++++++++++-------
src/fe_utils/psqlscan.l           | 27 ++++++++++++++++++++-------
src/interfaces/ecpg/preproc/pgc.l | 29 +++++++++++++++++++++--------
3 files changed, 61 insertions(+), 22 deletions(-)



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


end of thread, other threads:[~2018-08-23 20:48 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>
2018-08-23 20:48 pgsql: Reduce an unnecessary O(N^3) loop in lexer. Andrew Gierth <rhodiumtoad@postgresql.org>

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