Bug #66088 Visual studio plugin
Submitted: 30 Jul 2012 14:18 Modified: 23 Aug 2012 17:12
Reporter: Finn Nielsen Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.5.4.0 OS:Windows
Assigned to: Gabriela Martinez Sanchez CPU Architecture:Any
Tags: mysql.func, plugin, Visual Studio

[30 Jul 2012 14:18] Finn Nielsen
Description:
Tryed VS-plugin - great - but
On every single change i make i get a dialog about SELECT privilege for the mysql.func table (change IS actually made).

I'm connected to my webserver providers mysql-db.
There is no mysql.func table.

I tried creating an empty user table

CREATE TABLE `mysql.func` (
  `name` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `ret` tinyint(1) DEFAULT '0',
  `dl` char(128) COLLATE utf8_danish_ci DEFAULT NULL,
  `type` enum('function','aggregate') COLLATE utf8_danish_ci DEFAULT 'function',
  PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci COMMENT='Dummy table for VS plugin'

did'nt help.
Then again - there might be a better solution.

How to repeat:
Connect to db with no UDFs from VS.
[30 Jul 2012 14:27] Valeriy Kravchuk
What exact server version, x.y.z, are you working with?
[30 Jul 2012 15:56] Finn Nielsen
What exact server version, x.y.z, are you working with?
select version();
5.1.48
[9 Aug 2012 16:36] Fernando Gonzalez.Sanchez
Hi,

Can you provide more details to reproduce this? you can also upload some code or copy & paste it.

It is not clear if this is happening when typing in the editor with MySql Intellisense or when issuing an INSERT or UPDATE, please help yourself check the guidelines to report bug: http://bugs.mysql.com/how-to-report.php

Thanks.
[9 Aug 2012 19:40] Finn Nielsen
VS 2010 error message

Attachment: Error.png (image/x-png, text), 9.44 KiB.

[9 Aug 2012 19:44] Finn Nielsen
Hi

It's not INSERT or UPDATE and it's not a question about code at all.
I can run data change queries with no problems (and no error dialog).
I fully understand my description was poor - sorry.

It's in the "Server Explorer" window i MS Visual Studio 2010:
- Right click table | Design | make some changes | close window | Click Yes to save changes
- Right click view | Alter View | make some changes | close window | Click Yes .......
- Right click Stored Procedure | Alter Routine | make .......
- Right click Stored Function | Alter Routine | .......

I get the error reporting dialog (file Error.png) every time.

The changes are made to the Table / View / Stored Procedue / Stored Function,
it's just annoying
[15 Aug 2012 17:17] Gabriela Martinez Sanchez
Hi F. E. Nielsen, I tried to reproduce this bug but wasn't able to see it. I tried creating a simple user with some basic permission in the DB to see if the problem could be something about user privileges but not. Do you know if the user you use to connect with your database has some custom privileges? You can check it by running the following mysql command:

show grants for 'nameofyouruser'@'nameofyourserver';

Hope you can give us more information.

Thanks,
[16 Aug 2012 18:52] Finn Nielsen
Hi

show grants for 'MyUserName'@'mysql8.unoeuro.com';
Error Code: 1141. There is no such grant defined for user 'MyUserName' on host 'mysql8.unoeuro.com'

SHOW GRANTS FOR CURRENT_USER;
'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `MyDatabase`.* TO ''MyUserName''@''%'''

Also my web supplier UnoEuro informs me I have full rights to the database.

Did some testing and actually found kind of a workaround.
When I click the folder-expand plus (+) on UDFs (which I always did until now) the error dialog shows, and after that it shows on every DB-object modification as mentioned above.
When I leave UDFs unexpanded the error dialog dos'nt show at all. After "axidently" expanding UDFs I have to restart VS 2010 to get rid of the annoying error dialog.

Tryed installing - and connecting to a local running 5.5.27 Community Server. No problems - no error dialog shows - with or without expanded UDFs.
[20 Aug 2012 3:44] Gabriela Martinez Sanchez
Hi, I did some more testing but no luck reproducing it. Indeed the problem is due to some of the values of this mysql.func table, since every time you try to expand the UDF node in the Server Explorer a query for this table is done. Could you please run the following select and let us know what your result is?

SELECT name,ret,dl FROM mysql.func

Looks like one of the values in the rows result is not in the expected type.

Thanks in advance.
[20 Aug 2012 15:02] Finn Nielsen
Hi

SELECT name,ret,dl FROM mysql.func;

Error Code: 1142. SELECT command denied to user 'MyUserName'@'MyIP' for table 'func'

Also asked my web host for a comment (translated from danish):

Because you are attempting to Access the "mysql" system database, which you don't have access to.

You do NOT have access to the hole server or global commands/databases, you have only access to your own database on the server:

Grants for MyUsername@%
GRANT USAGE ON *.* TO 'MyUsername'@'%' IDENTIFIED BY PASSWORD 'XXXXXXXX'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `MyUsername\_db`.* TO 'MyUsername'@'%

Maybe thats it then?
[23 Aug 2012 17:12] Gabriela Martinez Sanchez
Hi again, thanks for your response. Finally I was able to reproduce the same case locally so definitely this is not a bug and the message is very accurate for the lack of the permissions in the mysql.func table.

If you have any other question you can post it in the forums so it can be available for all the community in http://forums.mysql.com/list.php?38

Thanks for your interest and bug report.