pingcap / pingcap/tiflash

Unexpected error "Cannot convert NULL value to non-Nullable type"

Open
#10,437 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component/compute contribution type/bug
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)
DROP TABLE IF EXISTS tb0;
CREATE TABLE tb0 (c0 VARCHAR(70) NOT NULL);
ALTER TABLE tb0 SET TIFLASH REPLICA 1;

SELECT /*+ read_from_storage(tiflash[t0]) */ t0.c0 AS col_0 FROM tb0 AS t0 WHERE ((ACOS(2) NOT IN (SELECT 1)));
2. What did you expect to see? (Required)

no error

3. What did you see instead (Required)
[HY000][1105] other error for mpp stream: Code: 349, e.displayText() = DB::Exception: Cannot convert NULL value to non-Nullable type, e.what() = DB::Exception,
4. What is your TiFlash version? (Required)
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v9.0.0-beta.2.pre-250-ga6d415f24a
Edition: Community
Git Commit Hash: a6d415f24a7d182ebca3d189c457d9044537028f
Git Branch: HEAD
UTC Build Time: 2025-08-03 10:01:12
GoVersion: go1.23.11
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Kernel Type: Classic |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied SQL reproduction against TiFlash, including the ACOS predicate, subquery, and read_from_storage hint. Trace the resulting NULL-to-non-Nullable error through the affected query execution path; done means the query completes without the reported error and regression coverage verifies the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.