Skip to content

Regression: incorrect results after UPDATE operation when migrating from DuckDB 1.1.2 to 1.2.1 #16836

@M2ATrail

Description

@M2ATrail

What happens?

#16780
I was able to reproduce it, I've hashed certain columns but still don't feel comfortable sharing them in public, but I have the archive.

To Reproduce

unarchive the 7z file
run this in python 3.12.7 duckdb 1.1.2 in the same folder.

import duckdb
with duckdb.connect('ddb.db') as conn:
    conn.execute(fr"""
            CREATE OR REPLACE TABLE 'everflow_daily' AS SELECT * FROM read_csv_auto('myexport/*.csv', union_by_name = true, filename = true);
        UPDATE everflow_daily SET sub5 = replace(sub5, '''', '');
        UPDATE everflow_daily SET sub5 = lower(trim(sub5));
        UPDATE everflow_daily SET sub5 = NULL WHERE sub5 = 'n/a';
        UPDATE everflow_daily SET sub4 = NULL WHERE sub4 = 'N/A';
        UPDATE everflow_daily SET sub3 = NULL WHERE sub3 = 'N/A';
        ALTER TABLE everflow_daily
        ADD offer_type VARCHAR(32);

        UPDATE everflow_daily
        SET offer_type = CASE 
            WHEN UPPER(offer_name) LIKE '%CPA%' THEN 'CPA'
            WHEN UPPER(offer_name) LIKE '%CPC%' THEN 'CPC'
            WHEN UPPER(offer_name) LIKE '%CPL%' THEN 'CPL'
            ELSE 'Other'
        END;
            """)

run this to see results

select sub4, sum(revenue), len(sub4), count(*) from everflow_daily
where network_affiliate_id <> 16201
and sub4 = 'N/A'
or sub4 = ''
or sub4 is null
group by 1
order by 2 desc

Image

then run it again in 1.2.1 CLI

Image

OS:

linux

DuckDB Version:

1.2.1

DuckDB Client:

CLI

Hardware:

No response

Full Name:

John Doe

Affiliation:

John Doe

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Python version, Linux distribution) to reproduce the issue?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions