Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query fails when performed on data converted from SQLite, works fine on attached database #118

Open
bynomial opened this issue Oct 9, 2024 · 1 comment

Comments

@bynomial
Copy link

bynomial commented Oct 9, 2024

Steps to recreate (using CLI tested on v1.1.1 af39bd0dcf Linux aarch64)

  1. open dbsample.sqlite using duckdb
    duckdb sqlite:dbsample.sqlite
  2. perform query: .read test.sql (correctly returns result set of 6 rows)
  3. make copy of database
    ATTACH 'target.db' AS ddb;
    COPY FROM DATABASE dbsample to ddb;
  4. open database copy
    .open target.db
  5. perform query again: .read test.sql (results in error)
    INTERNAL Error: Attempted to access index 0 within vector of size 0
    This error signals an assertion failure within DuckDB. This usually occurs due to unexpected conditions or errors in the 
    program's logic.
    For more information, see https://duckdb.org/docs/dev/internal_errors
    

Archive.zip

@bynomial
Copy link
Author

bynomial commented Oct 9, 2024

if it helps, commenting out the last constraint allows the query to execute fine:

-- test query 
SELECT t1.post_date,a1.name,CAST(-CAST(s2.value_num AS DECIMAL(10,2))/s1.value_denom AS DECIMAL(10,2)) AS amount
FROM splits s1
INNER JOIN splits s2 ON s1.tx_guid=s2.tx_guid
INNER JOIN transactions t1 ON t1.guid=s2.tx_guid
INNER JOIN accounts a1 ON s1.account_guid=a1.guid
INNER JOIN accounts a2 ON s2.account_guid=a2.guid
WHERE a1.name!=a2.name ;-- and a1.name='Checking';

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

No branches or pull requests

1 participant