Bug #62455 | ALTER SCHEMA or TABLE needs to recompile associated routines | ||
---|---|---|---|
Submitted: | 16 Sep 2011 22:13 | Modified: | 29 Sep 2011 16:57 |
Reporter: | denixx baykin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.5.15.0 | OS: | Any (Win XP SP3) |
Assigned to: | CPU Architecture: | Any | |
Tags: | ALTER TABLE, charsets, routines |
[16 Sep 2011 22:13]
denixx baykin
[16 Sep 2011 22:20]
denixx baykin
Here is java program.
Attachment: Test10_utf8mb4_3.java (application/octet-stream, text), 2.51 KiB.
[16 Sep 2011 22:22]
denixx baykin
If you want to repeat this again, you need to drop the schema and restart server.
[17 Sep 2011 6:40]
Valeriy Kravchuk
Why do you expect that ALTER SCHEMA should change collation for routines or variables inside routines in that schema? Our manual, http://dev.mysql.com/doc/refman/5.5/en/create-procedure.html, says: "For character data types, if there is a CHARACTER SET attribute in the declaration, the specified character set and its default collation is used. If the COLLATE attribute is also present, that collation is used rather than the default collation. If there is no CHARACTER SET attribute, the database character set and collation in effect at routine creation time are used." I think this is not a bug.
[17 Sep 2011 9:44]
denixx baykin
Ok, thats a "feature". Then how I can quickly update the procedure without the source? Only with SHOW CREATE PROCEDURE test.testRecord; Copy the contents of Create Procedure field. Make DROP PROCEDURE test.testRecord; Then make a paste the contents of a Create Procedure field, and does not forget about DELIMITER $$. Execute this and at last get an working stored procedure. I think there is too much to do manually. There is a need in the command RECOMPILE PROCEDURE procname; And documentation. When people are faced with the problem, they are looking for a solution in the documentation. For example, I searched in google before I realized that the problem is in the stored procedure. I thought I was to blame ALTER TABLE in a malfunction. Documentation needs an updates: http://dev.mysql.com/doc/refman/5.5/en/alter-table.html Here insert a note that charset change not affect stored procedures ant they need a recompilation somewhere after the "If you want to change the table default character set and all character columns (CHAR, VARCHAR, TEXT) to a new character set". http://dev.mysql.com/doc/refman/5.5/en/charset-applications.html Here add the warning link, leading to ALTER TABLE page, where problem is described. I think then google will be more helpful after indexing these two pages :)
[17 Sep 2011 9:48]
Valeriy Kravchuk
Let's consider this a valid documentation request. We should say explicitly that procedures need recompilation. Feel free to open new feature request for ALTER PROCEDURE ... RECOMPILE or something like that.
[17 Sep 2011 10:04]
denixx baykin
Where can I do a feature request? Here, in MySQL bugs tracker?
[17 Sep 2011 10:18]
Valeriy Kravchuk
Yes, just set severity 4 for a new bug and it will be treated as a feature request.
[29 Sep 2011 16:57]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products. This is not an ALTER TABLE issue. Instead, I have added a note to the ALTER DATABASE, CREATE PROCEDURE, and charset-applications pages about it.