<p dir="auto">Make sure these boxes are checked before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if any</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">0.18.5</p>
<h3 dir="auto">Meta database</h3>
<p dir="auto">MySQL</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">No error</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">Has an error</p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16470564/28707152-ca45643a-73a9-11e7-8b9b-5df98f6d476f.png"><img src="https://user-images.githubusercontent.com/16470564/28707152-ca45643a-73a9-11e7-8b9b-5df98f6d476f.png" alt="1" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/16470564/28707159-d2057962-73a9-11e7-88c9-7b42509189ff.png"><img src="https://user-images.githubusercontent.com/16470564/28707159-d2057962-73a9-11e7-88c9-7b42509189ff.png" alt="2" style="max-width: 100%;"></a><br>
The error is:<br>
_OperationalError: (<em>mysql_exceptions.OperationalError) (1054, "Unknown column 'created_by' in 'order clause'") [SQL: u'SELECT dashboards.created_on AS dashboards_created_on, dashboards.changed_on AS dashboards_changed_on, dashboards.id AS dashboards_id, dashboards.dashboard_title AS dashboards_dashboard_title, dashboards.position_json AS dashboards_position_json, dashboards.description AS dashboards_description, dashboards.css AS dashboards_css, dashboards.json_metadata AS dashboards_json_metadata, dashboards.slug AS dashboards_slug, dashboards.changed_by_fk AS dashboards_changed_by_fk, dashboards.created_by_fk AS dashboards_created_by_fk \nFROM dashboards ORDER BY created_by asc \n LIMIT %s'] [parameters: (100,)]</em></p>
<p dir="auto">My tested result :<br>
"ORDER BY <strong>created_on</strong>" is work。<br>
“dbs” table has “created_on” field instead of “created_by”.</p>
<p dir="auto">Make sure these boxes are checked before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if any</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar</li>
</ul>
<h3 dir="auto">Superset version</h3>
<p dir="auto">superset 0.18.5<br>
python 3.4<br>
mysql: 5.7.18</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">Can be sorted by "Database" successfully</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">Throw Error:<br>
sqlalchemy.exc.ProgrammingError: (_mysql_exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asc \n LIMIT 100' at line 2") [SQL: 'SELECT <code class="notranslate">tables</code>.created_on AS tables_created_on, <code class="notranslate">tables</code>.changed_on AS tables_changed_on, <code class="notranslate">tables</code>.id AS tables_id, <code class="notranslate">tables</code>.description AS tables_description, <code class="notranslate">tables</code>.default_endpoint AS tables_default_endpoint, <code class="notranslate">tables</code>.is_featured AS tables_is_featured, <code class="notranslate">tables</code>.filter_select_enabled AS tables_filter_select_enabled, <code class="notranslate">tables</code>.offset AS tables_offset, <code class="notranslate">tables</code>.cache_timeout AS tables_cache_timeout, <code class="notranslate">tables</code>.params AS tables_params, <code class="notranslate">tables</code>.perm AS tables_perm, <code class="notranslate">tables</code>.table_name AS tables_table_name, <code class="notranslate">tables</code>.main_dttm_col AS tables_main_dttm_col, <code class="notranslate">tables</code>.database_id AS tables_database_id, <code class="notranslate">tables</code>.fetch_values_predicate AS tables_fetch_values_predicate, <code class="notranslate">tables</code>.user_id AS tables_user_id, <code class="notranslate">tables</code>.<code class="notranslate">schema</code> AS tables_schema, <code class="notranslate">tables</code>.<code class="notranslate">sql</code> AS tables_sql, <code class="notranslate">tables</code>.created_by_fk AS tables_created_by_fk, <code class="notranslate">tables</code>.changed_by_fk AS tables_changed_by_fk \nFROM <code class="notranslate">tables</code> ORDER BY database asc \n LIMIT %s'] [parameters: (100,)]</p>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>Use admin user to login Superset</li>
<li>Click navigation menu "Sources", then click sub menu "Tables"</li>
<li>Click table header "Database"</li>
</ol>