Skip to content

Serveral internal errors found in nightly build #12009

Closed
@fuboat

Description

What happens?

I found several internal errors in the nightly build.

Maybe they are not bugs or flaws. I just list them here.

To Reproduce

All PoCs except PoC No.6 can be reproduced on both the release cli binary v0.10.2 (duckdb_cli-linux-amd64) and the nightly build in python.

PoC No.1:

-- INTERNAL Error: Calling StringValue::Get on a NULL value
SELECT CURRENT_SETTING(CAST(NULL AS TEXT));

PoC No.2:

-- INTERNAL Error: JSON path cannot be NULL
SELECT JSON_EXTRACT_PATH('{"a":2,"c":[4,5,{"f":7}]}', [NULL, '$.a']);

PoC No.3, maybe related to issue #12004 :

-- Invalid Error: std::bad_alloc
SELECT LIST_RESIZE([1, 2, 3], 999999999999999999);

PoC No.4:

-- INTERNAL Error: Unrecognized expression type in logical operator visitor
SELECT LIST_TRANSFORM(NULL, x -> UNNEST(x));

PoC No.5:

-- INTERNAL Error: Attempted to dereference unique_ptr that is NULL!
SELECT LIST_ZIP('');

PoC No.6:

-- INTERNAL Error: Unimplemented type for value access
SELECT MAP_CONCAT(MAP([1], NULL), NULL);
SELECT MAP_CONCAT(MAP([1], NULL), NULL);

PoC No.7:

-- INTERNAL Error: Calling ListValue::GetChildren on a NULL value
SELECT APPROX_QUANTILE(42, CAST(NULL AS INT[]));

PoC No.8:

-- INTERNAL Error: Calling GetValueInternal on a value that is NULL
SELECT 'A', 'B' ORDER BY NULL COLLATE NOCASE;

PoC No.9, maybe related to issue #12008 :

-- INTERNAL Error: Unimplemented type for value access
SELECT [LIST_WHERE([NULL], [TRUE, TRUE, TRUE])];

PoC No.10:

-- INTERNAL Error: Unimplemented type for UNNEST
SELECT UNNEST([ARRAY_VALUE('1', NULL)]);

PoC No.11:

-- INTERNAL Error: Unrecognized expression type in logical operator visitor
SELECT [LOWER(REGEXP_SPLIT_TO_TABLE(s, ' ')) FOR s IN ['a=1', 'b=2', 'c=3']];

Note that PoC No.6 can only be reproduced on the nightly build in python with the following code:

import duckdb
c = duckdb.connect()
c.execute("SELECT MAP_CONCAT(MAP([1], NULL), NULL);")
c.execute("SELECT MAP_CONCAT(MAP([1], NULL), NULL);")

Output:

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> r = c.execute("SELECT [LIST_WHERE(['abc'], [TRUE, FALSE, TRUE, TRUE, TRUE, TRUE])]")
KeyboardInterrupt
>>> import duckdb
>>> c = duckdb.connect()
>>> c.execute("SELECT MAP_CONCAT(MAP([1], NULL), NULL);")
<duckdb.duckdb.DuckDBPyConnection object at 0x7f9e62fd0d70>
>>> c.execute("SELECT MAP_CONCAT(MAP([1], NULL), NULL);")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
duckdb.duckdb.InternalException: INTERNAL Error: Unimplemented type for value access
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
>>> 

Other PoCs can be reproduced on both the release cli binary v0.10.2 and the nightly build in python.

OS:

Ubuntu 22.04 x64

DuckDB Version:

v0.10.2 or nightly build (v0.10.3-dev848)

DuckDB Client:

cli (0.10.2) or Python (nightly build)

Full Name:

Jingzhou Fu

Affiliation:

Wingtecher Lab of Tsinghua University

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

I have tested with a nightly build

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

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions