sasha-alias / sqltabs

Rich SQL client for Postgresql, MySQL, MS SQL, Amazon Redshift, Google Firebase (Firestore)
https://www.sqltabs.com
GNU General Public License v3.0
803 stars 57 forks source link

Error: Unknown table 'SESSION_VARIABLES' in information_schema #94

Open n9yty opened 7 years ago

n9yty commented 7 years ago

I just came across this project and wanted to have a look. We are running an old MySQL install (5.0.27), for various reasons, but this error is coming up when we try to do Database Information and Object Info, unsure where else it may happen.

sasha-alias commented 7 years ago

Thanks for reporting! MySQL connector doesn't have that much love as Postgres one, but let's take a look how we can fix that. The exception apparently happens when trying to get DB version with this query If you can help me to rewrite it for your version I will make a fix for next release which is planned on July 5.

n9yty commented 7 years ago

I'll admit that I am not quite following the query that you are using, but to just retrieve the specific variables the current connection is using I think a generic query like this should do it:

SHOW VARIABLES LIKE "version%";

But to list just the ones you want, this works:

SHOW VARIABLES WHERE variable_name IN ('version_comment', 'version', 'version_compile_os', 'version_compile_machine');

However, this returns them as rows with the variable name and value as columns.

Does that help?