Still no access to the original view definition

One of the biggest annoyances in the current MySQL versions is that you still have no access to the original view definition (at least by SQL, there is a way through the file system, which I described in a former article).

So again, if you create a view like

CREATE VIEW v_checktest AS
SELECT id, val FROM checktest\n  
  WHERE val >= 1 AND val <= 5\n  
  WITH CHECK OPTION

SHOW CREATE VIEW v_checktest returns

mysql> SHOW CREATE VIEW v_checktest\G

*************************** 1. row ***************************
       View: v_checktest
Create View: CREATE ALGORITHM=UNDEFINED 
  DEFINER=`mpopp`@`localhost` 
  SQL SECURITY DEFINER VIEW `v_checktest` AS 
select `checktest`.`id` AS `id`,
  `checktest`.`val` AS `val` 
  from `checktest` 
  where ((`checktest`.`val` >= 1) 
    and (`checktest`.`val` <= 5)) 
  WITH CASCADED CHECK OPTION
1 row in set (0.00 sec)

A feature request about this issue was filed about 9 months ago, and there was a discussion at http://lists.mysql.com/internals/25571. I have added a little comment to the feature request, hoping that someone pays attention to this request again.

I have heard of other people too, who are waiting to see this being implemented. So if you do, don’t hesitate to add comments to this feature request. This might raise its priority.

I have also filed a feature request (I hope that it’s no duplicate – I have been looking for existing feature request, but didn’t find any) for SHOW TRIGGER STATUS, SHOW CREATE TRIGGER and DROP TRIGGER IF EXISTS commands.

I suppose that it’s most intuitive, if procedures, functions (where the according commands are already available), triggers, events, etc. work all with the same syntax.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.