pingcap / pingcap/tidb

The issue of behavioral differences in returned column information when calling TiDB via the C API using C++ code

Open
#62,750 0 comments 0 reactions 1 assignee Claimed by @bb7133 View on GitHub
affects-6.5 affects-7.1 affects-7.5 affects-8.1 affects-8.5 compatibility-mysql8 contribution severity/major sig/sql-infra type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

SQL:select ifnull(max(a.make_date),:begin_date) as make_date, ifnull(max(a.fiscal_year),0) as fis_year, ifnull(max(a.fiscal_period),0) as fis_month
from TV_VoucherInventoryState a,
(
select nvl(max(make_date),0) as make_date from TV_VoucherInventoryState where
book_id = :book_id
and make_date <=:trade_date
and inventory_voucher = 1
)b
where a.make_date=b.make_date;

when sql column contaions function,and contains binding variables ,like ifnull(max(a.make_date),:begin_date).tidb will return different results ( vs mysql)

**MySQL:**

Image

**TiDB:**

Image

### 2. What did you expect to see? (Required)
tidb give the same result as mysql. (column info)

### 3. What did you see instead (Required)
tidb give the differt result as mysql.

Image

### 4. What is your TiDB version? (Required)
TiDB v7.5.6

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.