[MDEV-29318] Inconsistent data truncation handling with simple UNION vs CTE Created: 2022-08-17 Updated: 2022-10-23 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
CTE respects sql_modeAfter the patch for
UNION does not respect sql_modeHowever, queries with simple UNION do not respect sql_mode. These two scripts:
silently truncate the data on the third row (which has the MEDIUMTEXT data type), and return a result set, with neither errors nor warnings. This behavior has two problems:
Possible desired behaviorSimple UNION could probably be fixed in the same way with CTE to:
Another option is to raise the error for all sql_mode values in both CTE and simple UNION, as there are no real tables involved in these statements. There are only temporary tables involved internally. In any cases, silent truncation should not happen for sure. |