Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-371

Incorrect fractional part conversion

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.7, 3.1.0
    • None
    • None

    Description

      If datetime value is represented by a string, and fetched to MYSQL_TIME buffer, the fractional part is converted incorrectly.
      str_to_TIME simply read the number after decimal point, and save it to the second_part of the MYSQL_TIME structure, no matter of how many zeros it has. While it has to save number of microseconds, for 0.1 or 0.01 or 0.000000001 the second_part will be 1.
      Attached is the diff against master branch with the testcase.

      To fix this, str_to_TIME probably should memorize '.' position, and using it calculate number of decimal digits, compare it to 6, and then multiply or divide the number by 10 required number of times.

      Attachments

        Issue Links

          Activity

            People

              georg Georg Richter
              Lawrin Lawrin Novitsky
              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.