Skip to content

Give the pushed down MySQL query a select list #497

Description

@robinskil

Problem

A count query on a MySQL external table pushes down a query with an empty select list. MySQL rejects the statement:

ERROR 42000 (1064): You have an error in your SQL syntax; check the manual ... near 'FROM companies WHERE (companies.revenue > 40.0)) AS ...

The plan projects no column. The generated SQL puts FROM directly after SELECT.

Steps

  1. Create an external table with STORED AS MYSQL.
  2. Run SELECT count(*) FROM <table> WHERE revenue > 40.
  3. The server answers 400.

The failure repeats when the file runs alone.

Failed test

  • test_mysql.py::test_mysql_filter_result

Task

  1. Emit SELECT 1 when the pushed down plan projects no column.
  2. Add a test for a count query with a filter.

Environment

Branch features/reimplement-atlas. Image beacon-integration:local.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    beacon-kernelbugSomething isn't workingeffort-S1 to 3 daysrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions