[MDEV-23170] Characterset missing in routine definition in information_schema.routines Created: 2020-07-14 Updated: 2020-08-05 Resolved: 2020-08-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Information Schema, Stored routines |
| Affects Version/s: | 10.1, 10.5.4, 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Konstantin Schmidt | Assignee: | Alexander Barkov |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | upstream | ||
| Environment: |
Windows 10 1909 |
||
| Issue Links: |
|
||||||||
| Description |
|
Characterset for a literal is missing in the routine's definition in information_schema.routines. 1. create routine with explicit characterset _utf8mb4 for default varchar value
2. select definition record in information_schema.ROUTINES
Column ROUTINE_DEFINITION shows routine definition as
Characterset _utf8mb4 is missing. This makes it impossible to write a custom export for specific routines. I'm working with 5.4.11 |
| Comments |
| Comment by Elena Stepanova [ 2020-08-04 ] | |||||||||||||||||||||||||
|
mysql.proc table has two columns for a procedure body, body and body_utf8. For the example above, body contains the charset introducer, while body_utf8 doesn't:
Possibly the information schema presents the body_utf8 variant. Assigning to bar to determine whether it's expected. | |||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-08-05 ] | |||||||||||||||||||||||||
|
These columns:
are not intended for export. They exist only for information purposes. Please use mysql.proc.body instead. This behaviour is intentional (but not perfect). I agree that this behaviour is somewhat inconvenient. It would be better if the mentioned columns preserved the character set introducer as well. But we cannot fix it easily at this point. The problem is that introduces in MySQL/MariaDB unfortunately work in a different way than it is supposed by the SQL standard. Adding introducers in the output would generate a correct statement if MariaDB supported introducers in the standard way. But adding introducers with the current implementations would make the output only misleading. |