vitess icon indicating copy to clipboard operation
vitess copied to clipboard

Bug Report: Encountering error when connecting with the MySQL ODBC driver 8.0.32

Open fooforge opened this issue 2 years ago • 8 comments

Overview of the Issue

Opening this issue on behalf of @dBianchii who's first reported this issue in https://github.com/vitessio/vitess/issues/4386#issuecomment-1499253926.

When you try connecting with the MySQL ODBC Driver 8.0.x to a Vitess cluster, the initial connection test succeeds, and establishing the connection seems to work as well, but when you select a table, the below error gets raised:

ODBC--call failed.
[MySQLIODBC 8.0(w) Driver\(mysqld-8.0.23-PlanetScale]command handling not implemented yet: 4 (#1047)

Screenshots:

mysql-odbc-1

mysql-odbc-2

Reproduction Steps

  • Download the latest MySQL ODBC Driver 8.0.x from https://dev.mysql.com/downloads/connector/odbc/
  • Try establishing a connection with the driver, e.g. through Microsoft Access, and access a table

Binary Version

I haven't tested this with a specific Vitess release, but a database hosted on PlanetScale. Vitess image version is 2023-04-12.74a0ec4.

Operating System and Environment details

Windows 11 22H2 64 Bit

Log Fragments

No response

fooforge avatar Apr 17 '23 14:04 fooforge

+1 To this. Thank you @fooforge

dBianchii avatar Apr 17 '23 14:04 dBianchii

It will be really helpful if one of you can use Wireshark or something similar to tell us which command has not yet been implemented by Vitess. You can see everything we do handle here And the list of constants here

deepthi avatar Apr 17 '23 21:04 deepthi

@deepthi No problem. I have set up Vitess 16.0.1 on a root server today, but I could use some help making sense of what I see in the pcap dump.

In frame 31 I see this:

<7Yð)Ô]dÔçE4º¥@À¨²4Y:1iàN;Êî4¬Jî¸6fPþý¦corder

In frame 32, Vitess returns a 08S01 network-related error:

Ô]dÔç<7Yð)E\¨@75tY:1iÀ¨²4;ÊàNî¸6fî4¬VP~0ÿ#08S01command handling not implemented yet: 4

Prior to these frames, I see the ODBC driver running these statements:

SET NAMES utf8mb4;
SET character_set_results=NULL;
SET SQL_AUTO_IS_NULL=0;
SHOW SESSION VARIABLES LIKE 'MAX_EXECUTION_TIME';
SET @@max_execution_time=60000;
SET @@sql_select_limit=DEFAULT;
SELECT
        TABLE_NAME
        ,TABLE_COMMENT
        ,IF (
            TABLE_TYPE = BASE TABLE
                ,TABLE
                    ,TABLE_TYPE
        )
        ,TABLE_SCHEMA
    FROM
        INFORMATION_SCHEMA.TABLES
    WHERE
        TABLE_SCHEMA = DATABASE( )
        AND (
            TABLE_TYPE = BASE TABLE
                OR TABLE_TYPE = VIEW
        )
    ORDER BY
        TABLE_SCHEMA
        ,TABLE_NAME
;

I also see two performance_schema related queries (?) in frame 19 and 25 that I can't make any sense of. Are these actual queries?

As an aside, I have updated the initial description of the bug. You can, in fact, connect with the MySQL ODBC driver just fine and I'm seeing the table names in the GUI. The problem surfaces when I select a table in the GUI which is what, I think, we see happening in frame 31.

Here's the full txt export: pcap-export_mysql-odbc-vitess.txt

And here's the zip'd pcap itself: pcap_mysql-odbc-vitess.pcapng.zip

fooforge avatar Apr 18 '23 09:04 fooforge

it is COM_FIELD_LIST which is not implemented at the protocol level in Vitess.

harshit-gangal avatar Apr 19 '23 09:04 harshit-gangal

reason for not implementing is

As of MySQL 5.7.11, COM_FIELD_LIST is deprecated and will be removed in a future version of MySQL. Instead, use COM_QUERY to execute a SHOW COLUMNS statement.

harshit-gangal avatar Apr 19 '23 09:04 harshit-gangal

@harshit-gangal Interesting, thanks.

So, I assume, this is for Microsoft to update on their end then and a won't-fix for us?

fooforge avatar Apr 20 '23 13:04 fooforge

Hi, any updates on this? @harshit-gangal, do you have more information if it's something only Microsoft can fix ? Thank you

dBianchii avatar Dec 15 '23 03:12 dBianchii

This is not prioritized yet. Is this a blocker for your case?

harshit-gangal avatar Dec 15 '23 14:12 harshit-gangal