UNION queries: "Sorry, you don’t have permission to see that"

Hello,

I am trying to create a native query with UNION statement inside. Database is MySQL 5.7.25.
This query works:
SELECT column1 FROM table1
UNION
SELECT column2 FROM table2;

However same query with WHERE conditions gives “Sorry, you don’t have permission to see that” error:
SELECT column1 FROM table1 WHERE column1=“column1”
UNION
SELECT column2 FROM table2 WHERE column2=“column2”;

Is there any way, I could UNION 2 different queries with WHERE conditions, using Metabase native query?

Hi @natalya
Please post “Diagnostic Info” from Admin > Troubleshooting.
And check the log for more details - Admin > Troubleshooting > Logs.
I cannot reproduce on 0.36.2 with MySQL 5.7

Diagnostics:
{
“browser-info”: {
“language”: “en-GB”,
“platform”: “MacIntel”,
“userAgent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.7+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.7”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.7+10”,
“os.name”: “Linux”,
“os.version”: “4.14.138+”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“h2”,
“mysql”,
“bigquery”
],
“hosting-env”: “unknown”,
“application-database”: “mysql”,
“application-database-details”: {
“database”: {
“name”: “MySQL”,
“version”: “5.7.25-google-log”
},
“jdbc-driver”: {
“name”: “MariaDB Connector/J”,
“version”: “2.5.1”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-07-21”,
“tag”: “v0.36.0”,
“branch”: “release-0.36.x”,
“hash”: “b31049f”
},
“settings”: {
“report-timezone”: “Asia/Kuala_Lumpur”
}
}
}

As for the log, there are just these 2 lines in the log:
[25ab61cb-5fd3-4db7-a5ca-244b9b8aed0a] 2020-08-04T18:46:31+08:00 ERROR metabase.server Unexpected Exception in API request handler
[25ab61cb-5fd3-4db7-a5ca-244b9b8aed0a] 2020-08-04T18:46:31+08:00 ERROR metabase.server Unexpected exception in endpoint

@natalya So I guess that Google has removed that functionality from their version of MySQL. I cannot reproduce with 0.36.2 on regular MySQL 5.7

I see. Got it. Thanks for checking @flamber!