Bug #43869 Creating stored procedures through MyOdbc reports error 1074
Submitted: 25 Mar 2009 23:30 Modified: 26 Apr 2009 7:11
Reporter: John McCormick Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S2 (Serious)
Version:5.1.5 OS:Windows
Assigned to: CPU Architecture:Any

[25 Mar 2009 23:30] John McCormick
Description:
I am trying to create stored procedures in a MySQL database (5.1.x) using an ODBC connection using MyODBC 5.1.5. I am getting error 1074 when trying to add create the stored procedure indicating that the unnamed column '' is greater than 21845.

The stored procedure has a parameter that can be 65000 characters (file name and path). I thought at first it was limited to just the stored procedure parameters but changing the stored procedure so that it was 21845 for the parameter length and having a 65000 length for a varchar internal to the function caused the same error.

Snippet below:

CREATE PROCEDURE `FindPath`
(
  IN  `pi64IndexId`  bigint(11),
  IN  `pszName`      varchar(65000)  << complains about this
)
BEGIN
	DECLARE pszFile varchar(500); << if this is > 21845 complains about this as well
	DECLARE pnLen bigint;
 
I don't know if this is being filtered by MyODBC or MySQL.

How to repeat:
Try to create a stored procedure with >21845 size varchar() using ODBC. 

Suggested fix:
Whatever code is parsing the size needs to be changed to only look for sizes on table column definitions. As parameters or internal variables of stored procedures the values are not limited the same as for the tables.
[26 Mar 2009 7:11] Sveta Smirnova
Thank you for the report.

How do you create procedure using ODBC? Do you use some application or is it something like SQLExecDirect(hstmt, (SQLWCHAR *) L"CREATE PROCEDURE ....", SQL_NTS); ?

Which version of MySQL server do you use?
[26 Apr 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".