Retrieving original view

janyan28's profile image janyan28 posted 1 day ago in General Permalink

Hi, on Windows, I am able to correctly retrieve the original view description when I copy the code

SELECT CAST(LOAD_FILE(CONCAT(IFNULL(@@GLOBAL.datadir, CONCAT(@@GLOBAL.basedir, 'data/')), 'mydb/audit_view.frm')) AS CHAR CHARACTER SET utf8);

from the log. If I run that in a query window, it returns the contents of the file. If I then copy the returned code in another query window, I get the correct view.

However, I don't get the original view description in the view window. It ignores the SELECT CAST ..., and shows the long one-line view description, which is not really what I want even after using Ctl-F8 and the heidisql reformater option.

I have read every entry in this forum that remotely relates to this issue, but none of the answers addresses my particular situation. Is there something I can do to resolve this, or should I continue to live with the status quo?

Thanks in advance ...

ansgar's profile image ansgar posted 16 hours ago Permalink

That result may contain something valid, but HeidiSQL also executes a regular expression against it which needs to match:

\nsource\=(.+)\n\w+\=

If this does not match then the one-liner will appear in the view editor.

Can you post the result here? The regular expression may need an update for newer MariaDB versions.

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