I would like to purpose a change to MyODBC's cursor.c starting around line
441.


/*
  @type    : myodbc3 internal
  @purpose : checks for the float comparison in where clause
*/
static my_bool if_float_field(STMT FAR *stmt, MYSQL_FIELD *field)
{
  if (field->type == FIELD_TYPE_FLOAT || field->type == FIELD_TYPE_DOUBLE ||
      ((field->type == FIELD_TYPE_DECIMAL) && (field->decimals != 0)) )
  {
    set_error(stmt,MYERR_S1000,
              "Invalid use of floating point comparison in positioned
operations",0);
    return 1;
  }
  return 0;
}



For the life of me I do not know why more people are not upset with the way
MySQL can not compare equality for floating point numbers. If the program
allowed one to set some variance that they would allow for equality compares
then the software could use this to check that the values were within this
variance and consider the compare as true.

For sure a field declared as decimal(3,0) should be able to be used in a
where clause without problems. This is a whole number and should not cause a
problem.

As MyODBC constructs a where clause that includes all fields in the table,
how can anyone use MyODBC to do updates to their database?

In previous versions I was not able to get any table with a float to update.
Now, before my change, I could not even get a table with any numeric data to
update. How are others able to use software that prevents them from updating
a table that has numeric data?
-- 
Jim Dickenson
mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to