Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1, 11.8.9
-
Linux x86_64, MariaDB 11.8.9 binary distribution
-
Unexpected results
Description
A query against INFORMATION_SCHEMA.COLUMNS returns an incorrect empty result when its WHERE predicate is wrapped in a CASE expression with identical branches containing OR FALSE. Both branches are equivalent to the original predicate, so the two queries should return the same row.
CREATE TABLE target (to_seconds BIGINT);
|
|
|
CREATE TABLE target (to_seconds BIGINT);
|
|
|
SELECT data_type FROM information_schema.columns WHERE column_name = 'to_seconds';
|
|
|
SELECT data_type FROM information_schema.columns WHERE CASE WHEN EXISTS ( SELECT 1 FROM information_schema.columns WHERE column_name = 'to_seconds') THEN column_name = 'to_seconds' OR FALSE ELSE column_name = 'to_seconds' OR FALSE END;
|
Actual result on 11.8.9-MariaDB:
The first query returns:
data_type
|
bigint
|
The second query returns:
Empty set
|
Expected result:
Both queries should return:
data_type
|
bigint
|