MySQL lower_case_table_names – Differences Between Tables and Views

MySQLmysql-5.6

I've set lower_case_table_names=2 in my.ini.

When I create tables, the case is respected. However, when creating views, everything is changed to lower case.

Also, when I generate my scripts using dbForge, the tables keep their case and the views are in lower case.

Is this normal/expected? How can this be fixed?

Update #1

Tried generating scripts for my functions and there too the case is respected.

Update #2

Creating the following table: TableCamelCase, will show up in both dbForge and Workbench respecting the case specified.

Creating the following view: ViewCamelCase, will show up in lower case in both dbForge and Workbench.

The generate scripts from dbForge will respect the case for the table and match the lower case of the view.

Best Answer

I guess this is correct behaviour, don't you think?

0 : Table names are stored as specified and comparisons are case sensitive.

1 : Table names are stored in lowercase on disk and comparisons are not case sensitive.

2 : Table names are stored as given but compared in lowercase.

Last line explains the case. Referred: Dealing with MySQL case-sensitivity

Update: For views and case-sensitivity, refer this bug report.