Complex Group By Query Fails with Misleading "No space" Error

Issue:
Found an inconsistency in error handling for a complex query. When using multiple GROUP BY clauses:

Error writing file '/tmp/MYqMk1xr' (Errcode: 28 - No space left on device)

Key observations:

  1. Query returns only 1,911 rows
  2. Removing one GROUP BY clause makes it work
  3. Metabase incorrectly marks it as :error_type :invalid-query
  4. The actual error is SQLTransientConnectionException
  5. Same query works directly in MySQL

Environment:

  • Database: MySQL
  • Deployment: Docker + Postgres

This suggests the "No space left" error might be masking a timeout or query optimization issue rather than an actual storage problem. Could Metabase's timeout settings be affecting how MySQL handles temporary tables for GROUP BY operations?