Skip to content

add is distinct and not distinct from exprs#2494

Merged
jennifersp merged 8 commits intomainfrom
jennifer/distinct
Mar 30, 2026
Merged

add is distinct and not distinct from exprs#2494
jennifersp merged 8 commits intomainfrom
jennifer/distinct

Conversation

@jennifersp
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Main PR
covering_index_scan_postgres 1101.48/s 1102.99/s +0.1%
index_join_postgres 156.89/s 155.35/s -1.0%
index_join_scan_postgres 206.32/s 205.28/s -0.6%
index_scan_postgres 12.15/s 12.20/s +0.4%
oltp_point_select 2414.82/s 2404.08/s -0.5%
oltp_read_only 1844.96/s 1841.03/s -0.3%
select_random_points 129.41/s 130.59/s +0.9%
select_random_ranges 831.22/s 831.07/s -0.1%
table_scan_postgres 11.88/s 11.97/s +0.7%
types_table_scan_postgres 5.47/s 5.55/s +1.4%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Main PR
Total 42090 42090
Successful 17779 17901
Failures 24311 24189
Partial Successes1 5562 5571
Main PR
Successful 42.2404% 42.5303%
Failures 57.7596% 57.4697%

${\color{lightgreen}Progressions (124)}$

boolean

QUERY: SELECT f1
   FROM BOOLTBL1
   WHERE f1 IS TRUE;
QUERY: SELECT f1
   FROM BOOLTBL1
   WHERE f1 IS NOT FALSE;
QUERY: SELECT f1
   FROM BOOLTBL1
   WHERE f1 IS FALSE;
QUERY: SELECT f1
   FROM BOOLTBL1
   WHERE f1 IS NOT TRUE;
QUERY: SELECT f1
   FROM BOOLTBL2
   WHERE f1 IS TRUE;
QUERY: SELECT f1
   FROM BOOLTBL2
   WHERE f1 IS NOT FALSE;
QUERY: SELECT f1
   FROM BOOLTBL2
   WHERE f1 IS FALSE;
QUERY: SELECT f1
   FROM BOOLTBL2
   WHERE f1 IS NOT TRUE;
QUERY: SELECT
    d,
    b IS TRUE AS istrue,
    b IS NOT TRUE AS isnottrue,
    b IS FALSE AS isfalse,
    b IS NOT FALSE AS isnotfalse,
    b IS UNKNOWN AS isunknown,
    b IS NOT UNKNOWN AS isnotunknown
FROM booltbl3 ORDER BY o;

create_function_sql

QUERY: CREATE FUNCTION functest_A_1(text, date) RETURNS bool LANGUAGE 'sql'
       AS 'SELECT $1 = ''abcd'' AND $2 > ''2001-01-01''';
QUERY: CREATE FUNCTION functest_A_2(text[]) RETURNS int LANGUAGE 'sql'
       AS 'SELECT $1[1]::int';
QUERY: CREATE FUNCTION functest_A_3() RETURNS bool LANGUAGE 'sql'
       AS 'SELECT false';
QUERY: SELECT functest_A_1('abcd', '2020-01-01');
QUERY: SELECT functest_A_3();
QUERY: CREATE FUNCTION functest_B_1(int) RETURNS bool LANGUAGE 'sql'
       AS 'SELECT $1 > 0';
QUERY: CREATE FUNCTION functest_B_2(int) RETURNS bool LANGUAGE 'sql'
       IMMUTABLE AS 'SELECT $1 > 0';
QUERY: CREATE FUNCTION functest_B_3(int) RETURNS bool LANGUAGE 'sql'
       STABLE AS 'SELECT $1 = 0';
QUERY: CREATE FUNCTION functest_B_4(int) RETURNS bool LANGUAGE 'sql'
       VOLATILE AS 'SELECT $1 < 0';
QUERY: CREATE FUNCTION functest_C_1(int) RETURNS bool LANGUAGE 'sql'
       AS 'SELECT $1 > 0';
QUERY: CREATE FUNCTION functest_C_2(int) RETURNS bool LANGUAGE 'sql'
       SECURITY DEFINER AS 'SELECT $1 = 0';
QUERY: CREATE FUNCTION functest_C_3(int) RETURNS bool LANGUAGE 'sql'
       SECURITY INVOKER AS 'SELECT $1 < 0';
QUERY: CREATE FUNCTION functest_E_1(int) RETURNS bool LANGUAGE 'sql'
       AS 'SELECT $1 > 100';
QUERY: CREATE FUNCTION functest_E_2(int) RETURNS bool LANGUAGE 'sql'
       LEAKPROOF AS 'SELECT $1 > 100';
QUERY: CREATE FUNCTION functest_F_1(int) RETURNS bool LANGUAGE 'sql'
       AS 'SELECT $1 > 50';
QUERY: CREATE FUNCTION functest_F_2(int) RETURNS bool LANGUAGE 'sql'
       CALLED ON NULL INPUT AS 'SELECT $1 = 50';
QUERY: CREATE FUNCTION functest_F_3(int) RETURNS bool LANGUAGE 'sql'
       RETURNS NULL ON NULL INPUT AS 'SELECT $1 < 50';
QUERY: CREATE FUNCTION functest_F_4(int) RETURNS bool LANGUAGE 'sql'
       STRICT AS 'SELECT $1 = 50';
QUERY: CREATE FUNCTION functest_B_2(bigint) RETURNS bool LANGUAGE 'sql'
       IMMUTABLE AS 'SELECT $1 > 0';

domain

QUERY: create function sql_is_distinct_from(anyelement, anyelement)
returns boolean language sql
as 'select $1 is distinct from $2 limit 1';
QUERY: create domain inotnull int
  check (sql_is_distinct_from(value, null));
QUERY: create table dom_table (x inotnull);
QUERY: drop table dom_table;
QUERY: drop domain inotnull;
QUERY: drop function sql_is_distinct_from(anyelement, anyelement);

drop_if_exists

QUERY: DROP FUNCTION IF EXISTS foo(no_such_type);
QUERY: DROP FUNCTION IF EXISTS foo(no_such_schema.no_such_type);

fast_default

QUERY: CREATE FUNCTION set(tabname name) RETURNS VOID
AS $$
BEGIN
  UPDATE m
  SET id = (SELECT c.relfilenode
            FROM pg_class AS c, pg_namespace AS s
            WHERE c.relname = tabname
                AND c.relnamespace = s.oid
                AND s.nspname = 'fast_default');
END;
$$ LANGUAGE 'plpgsql';
QUERY: CREATE FUNCTION comp() RETURNS TEXT
AS $$
BEGIN
  RETURN (SELECT CASE
               WHEN m.id = c.relfilenode THEN 'Unchanged'
               ELSE 'Rewritten'
               END
           FROM m, pg_class AS c, pg_namespace AS s
           WHERE c.relname = 't'
               AND c.relnamespace = s.oid
               AND s.nspname = 'fast_default');
END;
$$ LANGUAGE 'plpgsql';
QUERY: DROP FUNCTION set(name);
QUERY: DROP FUNCTION comp();

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

@jennifersp jennifersp requested a review from Hydrocharged March 25, 2026 23:44
Copy link
Copy Markdown
Collaborator

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of this is fine, but definitely need to fix the double evaluation in the expressions

@jennifersp jennifersp requested a review from Hydrocharged March 26, 2026 23:37
Copy link
Copy Markdown
Collaborator

@Hydrocharged Hydrocharged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closer, but still need to revise the comparison handling. I'll approve though since you'll be good to go once it's in.

@jennifersp jennifersp merged commit 5da9081 into main Mar 30, 2026
17 checks passed
@jennifersp jennifersp deleted the jennifer/distinct branch March 30, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants