View Formatting

jsdeter posted 5 years ago in General
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 posted 5 years ago
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.
jsdeter posted 5 years ago
You have correctly identified the issue and required fix. By granting FILE permission, the view format structure is preserved.


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