-
-
Save xaprb/f1695009025bca103087 to your computer and use it in GitHub Desktop.
Extracts a view's source SQL from its .frm file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE( | |
SUBSTRING_INDEX(LOAD_FILE('/var/lib/mysql/world/Oceania.frm'), | |
'\nsource=', -1), | |
'\\_','\_'), '\\%','\%'), '\\\\','\\'), '\\Z','\Z'), '\\t','\t'), | |
'\\r','\r'), '\\n','\n'), '\\b','\b'), '\\\"','\"'), '\\\'','\''), | |
'\\0','\0') | |
AS source; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment