Skip to content
Snippets Groups Projects
  • Mergen Imeev's avatar
    b5b37629
    sql: remove one row limit in EXISTS subquery · b5b37629
    Mergen Imeev authored
    According to ANSI, EXISTS is a predicate that tests a given subquery and
    returns true if it returns more than 0 rows, false otherwise. However,
    after 2a720d11, EXISTS worked correctly only if there were exactly 0
    or 1 rows, and in all other cases it gave an error. This patch makes
    EXITS work properly.
    
    Closes #8676
    
    NO_DOC=bugfix
    
    (cherry picked from commit a5e498d1)
    sql: remove one row limit in EXISTS subquery
    Mergen Imeev authored
    According to ANSI, EXISTS is a predicate that tests a given subquery and
    returns true if it returns more than 0 rows, false otherwise. However,
    after 2a720d11, EXISTS worked correctly only if there were exactly 0
    or 1 rows, and in all other cases it gave an error. This patch makes
    EXITS work properly.
    
    Closes #8676
    
    NO_DOC=bugfix
    
    (cherry picked from commit a5e498d1)
gh-8676-fix-exists-predicate.md 150 B

bugfix/sql

  • The EXISTS predicate no longer requires LIMIT 1 to work correctly if more than one row is returned in the subselect (gh-8676).