1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00
Commit Graph

8 Commits

Author SHA1 Message Date
Sergei Golubchik
9fc124f8f9 MDEV-25415 CASE function handles NULL inconsistently
SQL Standard specifies that a <simple case> should return the <result>
from the left-most <simple when clause> where the comparison evaluates
to TRUE.

That is, it should not stop comparing on NULLs
2025-07-17 09:18:17 +02:00
raghunandanbhat
bff9b1e472 MDEV-36851: COALESCE() returns nullable column while IFNULL() does not
Nullability is decided in two stages-

1. Based on argument NULL-ness

Problem:
- COALESCE currently uses a generic logic- "Result of a function
  is nullable if any of the arguments is nullable", which is wrong.
- IFNULL sets nullability using second argument alone, which incorrectly
  sets the result to NULL even when first argument is not null.

Fix:
- Result of COALESCE and IFNULL is set to NULL only if all arguments are
  NULL.

2. Based on type conversion safety of fallback value

Problem:
- The generic `Item_hybrid_func_fix_attributes` logic would mark the
  function's result as nullable if any argument involved a type
  conversion that could yield NULL.

Fix:
- For COALESCE and IFNULL, nullability is set to NOT NULL if the first
  non-null argument can be safely converted to function's target return
  type.
- For other functions, if any argument's conversion to target type could
  result in NULL, the function is marked nullable.

Tests included in `mysql-test/main/func_hybrid_type.test`
2025-06-12 16:58:52 +05:30
Oleksandr Byelkin
d594f1e531 Removing MDEV-27871 because it is not a bug
Part 1
2023-10-13 14:09:22 +02:00
Alexander Barkov
f1544424de MDEV-29446 Change SHOW CREATE TABLE to display default collation 2022-09-12 22:10:39 +04:00
Marko Mäkelä
a8de8f261d Merge 10.2 into 10.3 2020-10-28 10:01:50 +02:00
Alexander Barkov
4de0d920be MDEV-17411 Wrong WHERE optimization with simple CASE and searched CASE 2018-10-11 13:39:53 +04:00
Sergei Golubchik
17bbab5fb0 cleanup: remove get_datetime_value()
this is a 10.3 version of 27d94b7e03

It disables caching of the first argument of IN,
if it's of a temporal type. Because other types are not
cached in this context.
2018-03-30 09:45:05 +02:00
Michael Widenius
a7abddeffa Create 'main' test directory and move 't' and 'r' there 2018-03-29 13:59:44 +03:00