View Formatting

[expired user #6140]'s profile image [expired user #6140] posted 12 years ago in General Permalink
Question on the display of a view in HeidiSQL. I have a root account with global permissions and I can see the view fully formatted and looking just as entered.

When I create a new user account with minimal permissions, that account sees the view as a single string. Ctrl-F8 does format it but not the way it was entered and not the way I see the view.

Question, what setting is there to allow the view to be observed fully? I suspect this isn't a HeidiSQL question but rather a MySQL question but I thought I'd give it a shot anyways.

Thanks in advance
ansgar's profile image ansgar posted 12 years ago Permalink
The original VIEW code is fetched using a LOAD_FILE command on the servers data directory:
SELECT LOAD_FILE(CONCAT(IFNULL(@@GLOBAL.datadir, CONCAT(@@GLOBAL.basedir, 'data/')), 'mydb/myview.frm'));


But if this does not return something, the VIEW code is taken from SHOW CREATE VIEW, and if that fails the code is put together from pieces in information_schema.VIEWS.

The LOAD_FILE command needs global FILE privileges I guess.
[expired user #6140]'s profile image [expired user #6140] posted 12 years ago Permalink
You have correctly identified the issue and required fix. By granting FILE permission, the view format structure is preserved.

Thanks

Please login to leave a reply, or register at first.