Skip to content

internal error: entered unreachable code: invalid value: 0, FixedSizeBinary(16) #478

@yuyang-ok

Description

@yuyang-ok

I have blow table

CREATE TABLE test_types4 (
                my_uhugeint UHUGEINT,
                my_uinteger UINTEGER,
                my_usmallint USMALLINT,
                my_utinyint UTINYINT,
                my_varchar VARCHAR
            );

I insert some test data .
when I want to select data I this this error blew.

running 1 test
dbnexus-db/src/duckdb.rs:1049  INFO - sql:
                SELECT c.column_name
                    FROM information_schema.table_constraints tc
                    JOIN information_schema.constraint_column_usage c
                    ON tc.constraint_name = c.constraint_name
                    WHERE tc.table_name = 'test_types4'
                    AND tc.table_schema = 'test'  -- 指定 schema 名称
                    and tc.table_catalog = 'main'
                    AND tc.constraint_type = 'PRIMARY KEY';
           
dbnexus-db/src/duckdb.rs:1073  INFO - sql:
            SELECT column_name, data_type, is_nullable , column_default
                FROM information_schema.columns
                WHERE table_name = 'test_types4'
                AND table_schema = 'main' 
                AND table_catalog = 'test';  -- 指定 schema 名称
        
dbnexus-db/src/duckdb.rs:1306  TRACE - encode type:uhugeint value:Some("12345678901234567890")
dbnexus-db/src/duckdb.rs:1306  TRACE - encode type:uinteger value:Some("3000000000")
dbnexus-db/src/duckdb.rs:1306  TRACE - encode type:usmallint value:Some("65000")
dbnexus-db/src/duckdb.rs:1306  TRACE - encode type:utinyint value:Some("123")
dbnexus-db/src/duckdb.rs:1306  TRACE - encode type:varchar value:Some("Example1")
dbnexus-db/src/duckdb.rs:1231  INFO - sql:INSERT INTO main.test_types4(my_uhugeint,my_uinteger,my_usmallint,my_utinyint,my_varchar) VALUES (12345678901234567890,3000000000,65000,123,'Example1')
dbnexus-db/src/duckdb.rs:1194  INFO - sql:SELECT * from "main"."test_types4" OFFSET 0 LIMIT 100
dbnexus-db/src/duckdb.rs:1049  INFO - sql:
                SELECT c.column_name
                    FROM information_schema.table_constraints tc
                    JOIN information_schema.constraint_column_usage c
                    ON tc.constraint_name = c.constraint_name
                    WHERE tc.table_name = 'test_types4'
                    AND tc.table_schema = 'test'  -- 指定 schema 名称
                    and tc.table_catalog = 'main'
                    AND tc.constraint_type = 'PRIMARY KEY';
           
dbnexus-db/src/duckdb.rs:1073  INFO - sql:
            SELECT column_name, data_type, is_nullable , column_default
                FROM information_schema.columns
                WHERE table_name = 'test_types4'
                AND table_schema = 'main' 
                AND table_catalog = 'test';  -- 指定 schema 名称
        
/home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlparser-0.55.0/src/parser/mod.rs:439  DEBUG - Parsing sql 'UHUGEINT'...
/home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlparser-0.55.0/src/parser/mod.rs:439  DEBUG - Parsing sql 'UINTEGER'...
/home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlparser-0.55.0/src/parser/mod.rs:439  DEBUG - Parsing sql 'USMALLINT'...
/home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlparser-0.55.0/src/parser/mod.rs:439  DEBUG - Parsing sql 'UTINYINT'...
/home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlparser-0.55.0/src/parser/mod.rs:439  DEBUG - Parsing sql 'VARCHAR'...
thread 'duckdb::tests::test_types4' panicked at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/duckdb-1.2.1/src/row.rs:624:18:
internal error: entered unreachable code: invalid value: 0, FixedSizeBinary(16)
stack backtrace:
   0: rust_begin_unwind
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/panicking.rs:76:14
   2: duckdb::row::Row::value_ref_internal
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/duckdb-1.2.1/src/row.rs:624:18
   3: duckdb::row::Row::value_ref
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/duckdb-1.2.1/src/row.rs:343:9
   4: duckdb::row::Row::get
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/duckdb-1.2.1/src/row.rs:303:21
   5: dbnexus_db::duckdb::encode_row
             at ./src/duckdb.rs:785:39
   6: <dbnexus_db::duckdb::DuckDB as dbnexus_db::db::SchemaTrait>::show_table::{{closure}}
             at ./src/duckdb.rs:1209:23
   7: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /home/yuyang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/future.rs:124:9
   8: dbnexus_db::duckdb::tests::test_types4::{{closure}}
             at ./src/duckdb.rs:2033:14
   9: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /home/yuyang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/future/future.rs:124:9
  10: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/park.rs:284:60
  11: tokio::task::coop::with_budget
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/task/coop/mod.rs:167:5
  12: tokio::task::coop::budget
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/task/coop/mod.rs:133:5
  13: tokio::runtime::park::CachedParkThread::block_on
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/park.rs:284:31
  14: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/context/blocking.rs:66:9
  15: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/scheduler/multi_thread/mod.rs:87:13
  16: tokio::runtime::context::runtime::enter_runtime
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/context/runtime.rs:65:16
  17: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/scheduler/multi_thread/mod.rs:86:9
  18: tokio::runtime::runtime::Runtime::block_on_inner
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/runtime.rs:370:45
  19: tokio::runtime::runtime::Runtime::block_on
             at /home/yuyang/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.44.1/src/runtime/runtime.rs:342:13
  20: dbnexus_db::duckdb::tests::test_types4
             at ./src/duckdb.rs:2037:9
  21: dbnexus_db::duckdb::tests::test_types4::{{closure}}
             at ./src/duckdb.rs:1999:27
  22: core::ops::function::FnOnce::call_once
             at /home/yuyang/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5
  23: core::ops::function::FnOnce::call_once
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test duckdb::tests::test_types4 ... FAILED

successes:

successes:

failures:

failures:
    duckdb::tests::test_types4

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 269 filtered out; finished in 0.51s

error: test failed, to rerun pass `-p dbnexus-db --lib`

 *  The terminal process "cargo 'test', '--package', 'dbnexus-db', '--lib', '--features', 'duckdb', '--', 'duckdb::tests::test_types4', '--exact', '--show-output', '--nocapture'" terminated with exit code: 101. 
 *  Terminal will be reused by tasks, press any key to close it. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions