Bug #57264 Query display after compilling VIEW
Submitted: 5 Oct 2010 22:02 Modified: 6 Nov 2010 4:04
Reporter: Alex Shapiro Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.28 OS:Windows (Vista)
Assigned to: CPU Architecture:Any
Tags: compilling, editor, text, VIEW, Views, workbench

[5 Oct 2010 22:02] Alex Shapiro
Description:
After compiling a view it shonw as a smal case letters in a single long line and not as entered.

(this does not occur in functions or procedures)

How to repeat:
Query:
SELECT t_id FROM table_name WHERE t_id = 1

After comilling:
... AS select `table_name`.`t_id` from `table_name`.`t_id` as `t_id`, `table_name`.`t_name`, `table_name`.`t_title` where ( `table_name`.`t_id` = 1 )

Suggested fix:
Make it so that the VIEW after comilling will show the query as entered and not as comillid (like it is in functions and procedures)
[5 Oct 2010 22:32] Peter Laursen
Not a bug!

1) First of all this is not a client (Workbench) issue.  It is a server issue.  Execute "SHOW CREATE VIEW `viewname`" from many client. When the VIEW is created on the server it gets transformed to this. If you had searched a little you'd find the same explanation lots of places.

2) One reason is that (as per SQL standards - one place (at least) where MySQL conforms with SQL standards) the VIEW is 'frozen' at create time. Should you later add one more column to the¨'underlying table' this new column is not included in the VIEW.

3) LETTERCASE for tables and Views on Windows is (or should be) handled by the 'lower_case_table_names' variable, refer http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html . But for VIEWS this is buggy is more than one respect.  Refer for instance http://bugs.mysql.com/bug.php?id=20356

Peter
(not a MySQL person)
[5 Oct 2010 22:34] Peter Laursen
sorry .. my 2nd point is misleading as you do not SELECT *
[5 Oct 2010 22:40] Peter Laursen
.. so for this the server version is more relevant than the WB version. What you experience happens 'server-side'.
[6 Oct 2010 4:04] Valeriy Kravchuk
See bug #52004 also. I think this is a duplicate.
[7 Nov 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".