Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34864

SHOW INDEX FROM - SEQ_IN_INDEX - mysql-connector-net incompatiblity

    XMLWordPrintable

Details

    Description

      From: https://github.com/MariaDB/mariadb-docker/issues/613

      Within a mysql-connector-net application, a call to GetSchema errors within the connector.

      The error is Unhandled exception. System.InvalidCastException: Unable to cast object of type 'System.Int64' to type 'System.UInt32'.

      The cause is this cast: https://github.com/mysql/mysql-connector-net/blob/87939c99fdad68b30803e9f4bb115e17cfabb8ce/MySQL.Data/src/SchemaProvider.cs#L299

      Given our current components in an index limit (32 for InnoDB), returning 64 bits is excessive.

      Our current SHOW INDEX implementation is returning a SLonglong for SEQ_IN_INDEX. Can we reduce this?

      POC:

      diff --git a/sql/sql_show.cc b/sql/sql_show.cc
      index ed32d298d19..9057ff8712f 100644
      --- a/sql/sql_show.cc
      +++ b/sql/sql_show.cc
      @@ -9392,7 +9392,7 @@ ST_FIELD_INFO stat_fields_info[]=
         Column("NON_UNIQUE",    SLonglong(1),NOT_NULL, "Non_unique",  OPEN_FRM_ONLY),
         Column("INDEX_SCHEMA",  Name(),      NOT_NULL,                OPEN_FRM_ONLY),
         Column("INDEX_NAME",    Name(),      NOT_NULL, "Key_name",    OPEN_FRM_ONLY),
      -  Column("SEQ_IN_INDEX",  SLonglong(2),NOT_NULL, "Seq_in_index",OPEN_FRM_ONLY),
      +  Column("SEQ_IN_INDEX",  ULong(2),    NOT_NULL, "Seq_in_index",OPEN_FRM_ONLY),
         Column("COLUMN_NAME",   Name(),      NOT_NULL, "Column_name", OPEN_FRM_ONLY),
         Column("COLLATION",     Varchar(1),  NULLABLE, "Collation",   OPEN_FULL_TABLE),
         Column("CARDINALITY",   SLonglong(), NULLABLE, "Cardinality", OPEN_FULL_TABLE),
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.