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

conversion from string to decimal isn´t working (or i´m doing it wrong)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.62
    • Fix Version/s: 5.5.25
    • Component/s: None
    • Labels:
      None
    • Environment:
      i didn´t found the version, but it´s mariadb 5.3.2

      Description

      CREATE TABLE `tmp` (
      `id` int(10) unsigned NOT NULL DEFAULT '0',
      `datahora` decimal(17,6) NOT NULL DEFAULT '0.000000',
      `value` decimal(20,10) NOT NULL DEFAULT '0.0000000000',
      PRIMARY KEY (`id`,`datahora`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1

      ====
      INSERT INTO `tmp` (`id`, `datahora`, `value`) VALUES (1, 1340977500.000000, 1.0000000000);
      ====

      this don´t work...:
      SELECT * FROM tmp WHERE id=1 AND
      datahora="1340977500.00000000000000"

      this work: (without conversion)
      SELECT * FROM tmp WHERE id=1 AND
      datahora=1340977500.00000000000000

      any idea?

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            rspadim roberto spadim added a comment -

            yes

            Show
            rspadim roberto spadim added a comment - yes
            Hide
            rspadim roberto spadim added a comment -

            just a doubt, in this case, is the "=" being used as a <float-point "=" float-point> instead of a <decimal "=" decimal>?

            Show
            rspadim roberto spadim added a comment - just a doubt, in this case, is the "=" being used as a <float-point "=" float-point> instead of a <decimal "=" decimal>?
            Hide
            elenst Elena Stepanova added a comment -

            The effect is not observed in MariaDB or MySQL 5.5, only in 5.1-based versions.

            Show
            elenst Elena Stepanova added a comment - The effect is not observed in MariaDB or MySQL 5.5, only in 5.1-based versions.
            Hide
            elenst Elena Stepanova added a comment -

            >> just a doubt, in this case, is the "=" being used as a <float-point "=" float-point> instead of a <decimal "=" decimal>?

            Roberto,

            For a general discussion, it would be more productive for you to use IRC, #mysql or #maria channel, they have a much bigger audience and suit better for talks or questions.

            Show
            elenst Elena Stepanova added a comment - >> just a doubt, in this case, is the "=" being used as a <float-point "=" float-point> instead of a <decimal "=" decimal>? Roberto, For a general discussion, it would be more productive for you to use IRC, #mysql or #maria channel, they have a much bigger audience and suit better for talks or questions.
            Hide
            rspadim roberto spadim added a comment -

            nice thanks!

            Show
            rspadim roberto spadim added a comment - nice thanks!

              People

              • Assignee:
                Unassigned
                Reporter:
                rspadim roberto spadim
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: