[MDEV-22776] wrong (at least inconsistent) expression evaluation in SQL_MODE "STRICT_ALL_TABLES" Created: 2020-06-02 Updated: 2020-06-24 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Procedure, Documentation, OTHER |
| Affects Version/s: | 10.4.13 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | L. Schwarz | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
docker image "mariadb/server:10.4" on linux ubuntu 16.04. |
||
| Attachments: |
|
| Description |
|
This issue applies to stored functions or procedures that calculate expressions containing flow-control sub-expression like IF(,,) or CASE ... WHEN ... THEN etc: The bug is that the expression calculation may fail because of errors in paths of the expression that were not executed at all. I found out that it seems to happen only if SQL_MODE "STRICT_ALL_TABLES" was enabled when function/procedure was defined. Should this be by design (I hope it's not), then there are this issues:
How to reproduce (the attached expression-eval-bug.sql contains all this commands):
|
| Comments |
| Comment by Alice Sherepa [ 2020-06-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I could not reproduce the issue with t2_tolrnt/t2_strict - both work for me on a freshly installed 10.4.13.
For the t3_tolrnt when sql_mode="" there is a warning, while with STRICT_ALL_TABLES it results in error, seems to be an expected behaviour.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by L. Schwarz [ 2020-06-03 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thank you for checking this. To make test case independent from configuration parameters, I did some investigations. I found out that from all the character-set-settings it is the character_set_connection that is important here. Here are the steps to reproduce the issue starting from a fresh 10.4.13 without modifying /etc/mysql/mariadb.cnf:
It does not only happen with utf8mb4:
Regarding t3_tolrnt("a") and t3_strict("a"):To be honest I didn't noticed the warning that t3_tolrnt("a") generates. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by L. Schwarz [ 2020-06-24 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I provided some feedback and now removed the need_feedback label. |