Can't edit function: "You have an error in your SQL syntax"
| User, date | Message |
|---|---|
|
Written by lemon_juice
1 year ago Category: General 94 posts since Tue, 29 Jun 10 |
Today I wanted to make a stored function deterministic and Heidi has a problem with that. After checking the "Deterministic" checkbox and pressing "Save" I get this error: /* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE utf8_polish_ci And this is the offending SQL as copied from the log: CREATE DEFINER=`interfoto2`@`%` FUNCTION `HeidiSQL_temproutine_1`(`path` VARCHAR(255), `delim` VARCHAR(30)) I think the problem is with the COLLATE definition which seems to be not allowed in CREATE FUNCTION syntax. |
|
Written by ansgar
1 year ago 3951 posts since Fri, 07 Apr 06 |
You have the "COLLATE utf8_polish_ci" in your SQL body I guess? How did that come in there? |
|
Written by lemon_juice
1 year ago 94 posts since Tue, 29 Jun 10 |
Well, "COLLATE utf8_polish_ci" is not in the function body - I thought you would know how it got in there :). OK, more information: "COLLATE utf8_polish_ci" is the specified collation of the "RETURNS varchar(1024)" value and I think Heidi got confused by that. Here is the original function definition as returned by "SHOW CREATE FUNCTION GET_CAT_PATH_AS_TEXT": CREATE DEFINER=`interfoto2`@`%` FUNCTION `GET_CAT_PATH_AS_TEXT`(`path` VARCHAR(255), `delim` VARCHAR(30)) RETURNS varchar(1024) CHARSET utf8 COLLATE utf8_polish_ci So "CHARSET utf8 COLLATE utf8_polish_ci" is there but Heidi puts it in the wrong place and strips "CHARSET utf8". |
|
Written by lemon_juice
1 year ago 94 posts since Tue, 29 Jun 10 |
One more thing: when I view the "Routine body" in Heidi then I can see "COLLATE utf8_polish_ci" as the first line of the body, before the "BEGIN" statement. So I think it's already wrong at that stage - no sql should be present before "BEGIN", right? PS. Don't be confused by READS SQL DATA instead of CONTAINS SQL in my post above - I changed it myself. |
|
Written by lemon_juice
1 year ago 94 posts since Tue, 29 Jun 10 |
Have you been able to look into this? I'm using the latest nightly and still I'm not able to edit this function in Heidi. |
|
Written by lemon_juice
1 year ago 94 posts since Tue, 29 Jun 10 |
I can create a bug report so it doesn't get lost if you don't have time to work on this now. |
|
Written by ansgar
1 year ago 3951 posts since Fri, 07 Apr 06 |
Didn't have the time yet. No bug report please. Here's the place with all details. Trying to find some time soon. |
|
Written by lemon_juice
1 year ago 94 posts since Tue, 29 Jun 10 |
Okay, no problem! |
|
Written by ansgar
1 year ago 3951 posts since Fri, 07 Apr 06 |
Fixed in r4115 |
|
Written by lemon_juice
1 year ago 94 posts since Tue, 29 Jun 10 |
Thanks, works very well now! |
|
Please login to leave a reply, or register at first. |