Page 1 of 1

Defining View -- comments disappear

Posted: Sun 09 Jun 2013 21:04
by antonio.romero.mule
Hi,

I had a database in which I'd defined several views, using, among other things, "-- comment" comments in the view... When I open these in dbForge, the comments don't appear; when I save them back to the DB after editing them in dbForge, it seems like the comments are gone forever. I was depending on those to make up for my poor memory for what my convoluted queries do :(

Is there a way to configure dbForge to leave those comments in place? If not, I will have to select a different product for my mySQL development. Tools like HeidiSQL are weak in so many ways, compared to dbForge, but they never did this to me ...

-A

Re: Defining View -- comments disappear

Posted: Mon 10 Jun 2013 12:07
by Deniss
MySQL deletes comments from view description on its own.
We get the description using the SHOW CREATE VIEW <view> command.
HeidiSQL gets descriptions using the SELECT LOAD_FILE(CONCAT(IFNULL(@@GLOBAL.datadir, CONCAT(@@GLOBAL.basedir, 'data/')), 'db/<view>.frm')) command. Due to this construction the full description of the view is read from the file where it is defined. But this option is available only if user has enough privileges.
That's why if user does not have FILE privileges, neither we, nor HeidiSQL will show view without comments.

Re: Defining View -- comments disappear

Posted: Mon 10 Jun 2013 16:43
by antonio.romero.mule
I see. So basically, even if I grant enough privileges to the DB user to access the filesystem, you will not be able to keep the comments intact? You do retain the comments when I'm working with stored procedures and stored functions. Are these that different?

Thanks for the reply,

-A
PS-- I really do appreciate you looking at the source code for HeidiSQL as part of researching the response to this question :) that was a nice bit of extra effort.

Re: Defining View -- comments disappear

Posted: Tue 11 Jun 2013 08:05
by .jp
... if I grant enough privileges to the DB user to access the filesystem, you will not be able to keep the comments intact?
You're quite right. This feature hasn't implemented yet in our product. So, dbForge Studio will not show view's comments in any case.
I've added the feature on the voting at our user-voice forum: http://devart.uservoice.com/forums/7729 ... iew-editor , please vote.
You do retain the comments when I'm working with stored procedures and stored functions. Are these that different?
Yes, our tool displays routines' comments, because SHOW CREATE PROCEDURE (FUNCTION, TRIGGER) command retrieves them.