Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-413

ODBC. Value from DOUBLE rounded and trimmed to 1st digit

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 3.1.17, 3.1.19, 3.1.20
    • None
    • General
    • None

    Description

      Hello.
      My small, simple, VisualStudio C++ application queries database via ODBC driver/Data Source.
      This database contains the “val” table containing fields of DOUBLE and DECIMAL type.

      < < < Problem < < <
      Value from DECIMAL field is displayed properly but value from DOUBLE field is wrong: is rounded and trimmed so only the first digit remains.
      > > >

      I have performed some investigation.

      a. When I query my database directly, via “MySQL Client(MariaDB...) as user, it works well:
      “select * from val;” gives proper answers from both type fields: DOUBLE and DECIMAL.

      b. When I examine my database with HeidiSQL it also looks good.

      c. But when I debug my application with VisualStudio I get CRecordset record with some errors.
      GetFieldValue(...DECIMAL field...) returns string with the proper value (it is OK) but
      GetFieldValue(...DOUBLE field...) returns string with error as above.
      Hence my application displays wrong values.

      Here are some examples for DOUBLE field:
      a, b: (proper value: directly from db) - > c: (from/via ODBC driver/Data Source):
      3000 - > 3
      12000 - > 1
      21.27 - > 2
      175.68 - > 2
      19.68 - > 2
      So value is rounded and only the first digit remains.

      d. When I roll the ODBC connector back to version 3.1.11 (the database was created at):
      ( mariadb-connector-odbc-3.1.11-win64.msi )
      everything works well, for both field types: DOUBLE and DECIMAL.
      But with this ODBC connector versions: 3.1.20, 3.1.19, 3.1.17 it works wrong again, as above.

      e. When I change (with HeidiSQL) the type of field from DOUBLE to DECIMAL, forth and back, the problem follows: works good for DECIMAL and wrong for DOUBLE. And this is stable.

      Environment:
      Win10 64bit, fresh installation: locale still (and only)=English(United Kingdom) but I am in Poland.
      mariadb-10.11.6-winx64.msi (UTF8 chosen)
      mariadb-connector-odbc-3.1.20-win64.msi
      Data Source filled only with necessary, minimal options set (like tcp, user, Database, Timeouts, ConnCharSet: utf8mb4), remaining: left unchecked.

      The database created years ago (could be that at locale=polish). Now I import it after total, fresh Win10 and applications reinstallation.

      Collation seems to has none influence: was mainly utf8mb3_unicode_ci, all changed to utf8mb4_unicode_ci.

      Have you ever seen such a tricks

      Thank you very much for any help.
      Regards
      Robert

      Attachments

        Activity

          People

            Lawrin Lawrin Novitsky
            RgKrk Robert Gornicki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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