[MDEV-29777] Unable to create stored generated column with "CONCAT" and a "CHAR" column as function argument. Created: 2022-10-12 Updated: 2022-10-12 Resolved: 2022-10-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | N/A |
| Affects Version/s: | 10.9.3 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Juan Lago | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | bug, columns, community, generated | ||
| Environment: |
OS: Linux Ubuntu 20.04.5 LTS |
||
| Issue Links: |
|
||||||||
| Description |
|
I found that for some reason when I try to create a stored generated column that concatenate a "char" column the following error is raised by MariaDB:
I cannot reproduce this bug with MariaDB 10.3.36 in Debian 10. so maybe is only an issue with the new versions of MariaDB. Steps to reproduce: 1. Create the following table:
2. Add one record to the table:
3. Try to add the following stored generated column:
Received result: The following error code is received:
Expected result: MariaDB should allow to create the stored generated column in the same way that is possible to do using Maria 10.3.36 or using a virtual generated column like the following example:
It also works when use "CONCAT" with a "varchar" column, like the following example:
Notes: |
| Comments |
| Comment by Juan Lago [ 2022-10-12 ] | ||||||||
|
An easy way to reproduce this issue is with the following SQL:
| ||||||||
| Comment by Alice Sherepa [ 2022-10-12 ] | ||||||||
|
10.3-10.4 return the warning, that explains the problem - dependence on the sql_mode
10.5-10.11 - error + warning (in
| ||||||||
| Comment by Juan Lago [ 2022-10-12 ] | ||||||||
|
@AliceSherepa: Thank you for the clarification. I can see that trimming the var column doesn't raise any warning. Workaround in case PAD_CHAR_TO_FULL_LENGTH mode is not changed:
|