Bug #35938 | Problem using MySqlCommand and Procedures | ||
---|---|---|---|
Submitted: | 9 Apr 2008 14:38 | Modified: | 23 Apr 2008 13:23 |
Reporter: | Dayvison Pellegrina | Email Updates: | |
Status: | Unsupported | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 5.0.8.1 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[9 Apr 2008 14:38]
Dayvison Pellegrina
[10 Apr 2008 6:38]
Tonci Grgin
Hi Dayvison and thanks for your report. Can you make absolutely sure the user name you connect with is allowed to execute that SP? Can you please try with root account too and inform me of result.
[15 Apr 2008 17:32]
Dayvison Pellegrina
Thanks for your feedback, I am sure that the permissions are appropriate. In some tests I've defined the following administrator permissions in my user: Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Then I've reloaded the application. With the "procedure bodies = false" directive the application did not return anything. Without it, the error bellow ocurred. ********************************************************************** Server Error in '/ASPNET' Application. Parameter '?login' not found in the collection. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Parameter '?login' not found in the collection. Source Error: Line 52: Line 53: Line 54: using (MySqlDataReader myDR = myCmd.ExecuteReader()) Line 55: { Line 56: GridView1.DataSource = myDR; Source File: e:\home\dayvison\Web\ASPNET\mysql_procedure.aspx Line: 54 Stack Trace: [ArgumentException: Parameter '?login' not found in the collection.] MySql.Data.MySqlClient.MySqlParameterCollection.GetParameter(String parameterName) +275 MySql.Data.MySqlClient.MySqlParameterCollection.get_Item(String name) +8 MySql.Data.MySqlClient.StoredProcedure.Resolve() +530 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) +510 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() +6 ASP.mysql_procedure_aspx.Button1_Click(Object sender, EventArgs e) in e:\home\dayvison\Web\ASPNET\mysql_procedure.aspx:54 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 ********************************************************************** What is the "procedure bodies = false" directive finality? Has any further hint that can help me? Thanks.
[23 Apr 2008 11:56]
Tonci Grgin
Hi Dayvison. I do owe you an answer to "What is the "procedure bodies = false" directive finality?". The only place where connector can fetch SP info is mysql.proc table. Above option tells c/NET your account has privilege to read from mysql.proc table. You should check this from command line client like this: mysql -uUser_ID -p -hYour_host mysql mysql> select * from proc; This problem of yours sure seems privilege related but I need to test it properly before I'm sure.
[23 Apr 2008 13:23]
Tonci Grgin
Dayvison, according to changelog this should be fixed in c/NET 5.1.3 and later. Please test and inform me of result. This is a duplicate of Bug#29098.
[10 May 2016 6:33]
Disha Vaghela
I had also the same issue and i checked for privileges and found that my user had no privileges at all. I assign privileges and worked fine. Thank you so much! I spent whole day to resolve this.