[MDEV-29217] Assertion failure in Item_param::can_return_value upon PS with SET STATEMENT and placeholder for a value Created: 2022-07-30 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Variables |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Apparently the range of affected variables is the same as in
Before Non-debug build returns
|
| Comments |
| Comment by Sergei Golubchik [ 2022-08-06 ] | |||||||||||||||||||
|
Not GET_BIT only:
Every variable is affected:
note that tmp_disk_table_size incorrectly thinks that ? is a string (it's another bug), so fails with "wrong type", but cast bypasses that | |||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-08-06 ] | |||||||||||||||||||
|
This is caused by the incorrect fix for
without changing the sql_mode at the prepare phase, the table structure was incorrect.
which made any Item_str_func (such as CONCAT() to decide at prepare phase whether it can be null or not, based on the sql_mode. And the test case above with the set statement was just one of the effects. Another one is
Or even something as simple as
can, likely, make a maybe_null=false item to return NULL. | |||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-08-06 ] | |||||||||||||||||||
|
possible ideas how to fix:
| |||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-08-06 ] | |||||||||||||||||||
|
followup question, what other sql modes, except strict, can affect metadata?
| |||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2022-08-11 ] | |||||||||||||||||||
|
OK, I agree, to make it clear it should:
| |||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-10-23 ] | |||||||||||||||||||
|
More thoughts.
why is that? If we say that sql_mode changes forces a reprepare, it's not |