OverflowException from System.Data.Odbc.OdbcDataReader.GetSchemaTable() RRS feed

  • Question

  • I am trying to get schema from SAP HANA with ODBC driver, then I found I got an OverflowException.

    After investigating, I found the root cause may be:

    For HANA driver will return the SQL type as “WLONGVARCHAR” for some type.

    In GetSchemaTable, there is a special handle logic to divide their size by 2.

    HANA ODBC driver will return the size as 4,294,967,294, which is twice as 2^31 – 1.

    Before do the divide operation, the value “2” will be recognized as int, so the metaInfos[i].size will be converted to int, in the conversation logic, it will do the overflow checking, then OverflowException will be thrown.

    Could anyone help to identify this problem?


    Wednesday, July 31, 2019 1:47 AM

All replies