Bug #113043 Inner join behaves like left join with aggregate function
Submitted: 10 Nov 2023 10:47 Modified: 10 Nov 2023 13:03
Reporter: keerthika K Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:8.0.1 OS:Any
Assigned to: CPU Architecture:Any

[10 Nov 2023 10:47] keerthika K
Description:
In 5.7 version of mysql the below query gives result even though table 2 has no data

SELECT Table1.CurrencyID, Table1.OutStanding, SUM(Table2.ARUnUsedCredit) as sum , IFNULL(SUM(Table2.ARUnUsedCredit), (0)) as nullcheck , (Table1.OutStanding + IFNULL(SUM(Table2.ARUnUsedCredit), (0))) AS UnusedCreditAmount FROM Table1 INNER JOIN Table2 ON Table1.CustomerID=Table2.CustomerID AND Table1.CurrencyID=Table2.CurrencyID WHERE ((Table1.CustomerID = 4154000000041029) AND (((Table1.CustomerID >= 4154000000000000) AND (Table1.CustomerID <= 4154999999999999)) OR ((Table1.CustomerID >= 0) AND (Table1.CustomerID <= 999999999999))))

But this is fixed in version 8.. I could not find anything to this in release notes. Can u please share 

How to repeat:

Create table 1 with one record and Table 2 with zero records and execute this query

Suggested fix:
Fixed in 8 but not found in release notes
[10 Nov 2023 13:03] MySQL Verification Team
Hi Mr. K,

Thank you for your bug report.

However, we must inform you that your are on the wrong forum.

This forum is intended only for true bugs with repeatable test cases. Your report is actually a question.

There are several hundreds of bugs fixed in 8.0 and we do not know them by heart. However, you can find a patch that you are looking for by going through all releases on this page:

https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-35.html

Not a bug.