List:Commits« Previous MessageNext Message »
From:lars-erik.bjork Date:November 22 2008 12:32pm
Subject:bzr commit into mysql-6.0-falcon-team branch (lars-erik.bjork:2916) Bug#40614
View as plain text  
#At file:///home/lb200670/devel/mysql/trampoline/ based on revid:john.embretsen@stripped

 2916 lars-erik.bjork@stripped	2008-11-22
      This is a patch for bug#40614 Falcon datetime indexes can not handle 0000-00-00
      
      
      After we have found a hit in the index, registered in the bitmap, we
      check the actual value of the record to see if it really matches (the
      index may be dirty). Further down the stack, in Value::compare, we
      compare the stored value (0) to the key value (f. ex
      20061212000000). The stored value is represented as a small int,
      whereas the key value is an int64. The comparison is done by
      subtracting the key value from the stored value, and returning this as
      an integer. However, because the special 0 (not NULL) value is much
      smaller than the key value, the result will be outside the range of an
      int. Therefore, when the int only uses the last 4 bytes of the result,
      the sign-bit of the integer will vary depending on the year part of
      the datetime value. This fools Value::compare into returning that the
      0 datetime-value is greater than a much greater datetime-value for
      some values of year. The solution is to check if the result is
      greater, equal or smaller than 0, looking at the result as an int64
      and then returning 1, 0 or -1, instead of returning the result of the
      subtraction as an int directly.
      
      
      Modified file 'storage/falcon/Value.cpp'
      ----------------------------------------
      Instead of returning the result of the subtraction directly, we now
      check if the result is greater, equal or smaller than 0, and return 1,
      0 or -1. This way we won't return the wrong result because we are no
      longer only taking the last 4 bytes of the value into consideration
      
      This change was made for both int64 and double comparisons.
      
      
      Added file 'mysql-test/suite/falcon/r/falcon_bug_40614.result'
      --------------------------------------------------------------
      This is the result file for the test.
      
      
      Added file 'mysql-test/suite/falcon/t/falcon_bug_40614.test'
      ------------------------------------------------------------ 
      This is the test that tests the patch. I have tested for plenty of year
      values, since this bug did not show for all values.
added:
  mysql-test/suite/falcon/r/falcon_bug_40614.result
  mysql-test/suite/falcon/t/falcon_bug_40614.test
modified:
  storage/falcon/Value.cpp

=== added file 'mysql-test/suite/falcon/r/falcon_bug_40614.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_40614.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_40614.result	2008-11-22 12:31:45 +0000
@@ -0,0 +1,561 @@
+*** Bug #40614 ***
+SET @@storage_engine = 'Falcon';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (datetime_key datetime, key(datetime_key));
+insert into t1 values ('0000-00-00');
+select * from  t1 where datetime_key < '1970-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1971-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1972-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1973-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1974-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1975-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1976-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1977-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1978-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1979-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1980-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1981-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1982-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1983-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1984-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1985-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1986-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1987-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1988-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1989-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1990-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1991-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1992-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1993-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1994-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1995-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1996-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1997-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1998-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '1999-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2000-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2001-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2002-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2003-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2004-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2005-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2006-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2007-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2008-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2009-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2010-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2011-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2012-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2013-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2014-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2015-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2016-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2017-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2018-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2019-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2020-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2021-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2022-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2023-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2024-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2025-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2026-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2027-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2028-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2029-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2030-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2031-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2032-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2033-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2034-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2035-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2036-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2037-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2038-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2039-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2040-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2041-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2042-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2043-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2044-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2045-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2046-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2047-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2048-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2049-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2050-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2051-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2052-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2053-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2054-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2055-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2056-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2057-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2058-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2059-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2060-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2061-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2062-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2063-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2064-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2065-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2066-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2067-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2068-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2069-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2070-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2071-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2072-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2073-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2074-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2075-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2076-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2077-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2078-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2079-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2080-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2081-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2082-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2083-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2084-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2085-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2086-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2087-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2088-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2089-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2090-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2091-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2092-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2093-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2094-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2095-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2096-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2097-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2098-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2099-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2100-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2101-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2102-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2103-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2104-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2105-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2106-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2107-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2108-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2109-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2110-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2111-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2112-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2113-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2114-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2115-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2116-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2117-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2118-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2119-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2120-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2121-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2122-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2123-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2124-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2125-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2126-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2127-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2128-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2129-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2130-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2131-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2132-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2133-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2134-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2135-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2136-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2137-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2138-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2139-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2140-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2141-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2142-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2143-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2144-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2145-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2146-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2147-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2148-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2149-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2150-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2151-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2152-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2153-01-01';
+datetime_key
+0000-00-00 00:00:00
+select * from  t1 where datetime_key < '2154-01-01';
+datetime_key
+0000-00-00 00:00:00
+DROP TABLE t1;

=== added file 'mysql-test/suite/falcon/t/falcon_bug_40614.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_40614.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_40614.test	2008-11-22 12:31:45 +0000
@@ -0,0 +1,223 @@
+--source include/have_falcon.inc
+
+#
+# Bug #40614: Falcon datetime indexes can not handle 0000-00-00
+#
+--echo *** Bug #40614 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation                                --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# ----------------------------------------------------- #
+# --- Test                                          --- #
+# ----------------------------------------------------- #
+
+CREATE TABLE t1 (datetime_key datetime, key(datetime_key));
+insert into t1 values ('0000-00-00'); 
+
+# The returned row would vary depending on the year, testing for a lot of them
+
+select * from  t1 where datetime_key < '1970-01-01';
+select * from  t1 where datetime_key < '1971-01-01';
+select * from  t1 where datetime_key < '1972-01-01';
+select * from  t1 where datetime_key < '1973-01-01';
+select * from  t1 where datetime_key < '1974-01-01';
+select * from  t1 where datetime_key < '1975-01-01';
+select * from  t1 where datetime_key < '1976-01-01';
+select * from  t1 where datetime_key < '1977-01-01';
+select * from  t1 where datetime_key < '1978-01-01';
+select * from  t1 where datetime_key < '1979-01-01';
+select * from  t1 where datetime_key < '1980-01-01';
+select * from  t1 where datetime_key < '1981-01-01';
+select * from  t1 where datetime_key < '1982-01-01';
+select * from  t1 where datetime_key < '1983-01-01';
+select * from  t1 where datetime_key < '1984-01-01';
+select * from  t1 where datetime_key < '1985-01-01';
+select * from  t1 where datetime_key < '1986-01-01';
+select * from  t1 where datetime_key < '1987-01-01';
+select * from  t1 where datetime_key < '1988-01-01';
+select * from  t1 where datetime_key < '1989-01-01';
+select * from  t1 where datetime_key < '1990-01-01';
+select * from  t1 where datetime_key < '1991-01-01';
+select * from  t1 where datetime_key < '1992-01-01';
+select * from  t1 where datetime_key < '1993-01-01';
+select * from  t1 where datetime_key < '1994-01-01';
+select * from  t1 where datetime_key < '1995-01-01';
+select * from  t1 where datetime_key < '1996-01-01';
+select * from  t1 where datetime_key < '1997-01-01';
+select * from  t1 where datetime_key < '1998-01-01';
+select * from  t1 where datetime_key < '1999-01-01';
+select * from  t1 where datetime_key < '2000-01-01';
+select * from  t1 where datetime_key < '2001-01-01';
+select * from  t1 where datetime_key < '2002-01-01';
+select * from  t1 where datetime_key < '2003-01-01';
+select * from  t1 where datetime_key < '2004-01-01';
+select * from  t1 where datetime_key < '2005-01-01';
+select * from  t1 where datetime_key < '2006-01-01';
+select * from  t1 where datetime_key < '2007-01-01';
+select * from  t1 where datetime_key < '2008-01-01';
+select * from  t1 where datetime_key < '2009-01-01';
+select * from  t1 where datetime_key < '2010-01-01';
+select * from  t1 where datetime_key < '2011-01-01';
+select * from  t1 where datetime_key < '2012-01-01';
+select * from  t1 where datetime_key < '2013-01-01';
+select * from  t1 where datetime_key < '2014-01-01';
+select * from  t1 where datetime_key < '2015-01-01';
+select * from  t1 where datetime_key < '2016-01-01';
+select * from  t1 where datetime_key < '2017-01-01';
+select * from  t1 where datetime_key < '2018-01-01';
+select * from  t1 where datetime_key < '2019-01-01';
+select * from  t1 where datetime_key < '2020-01-01';
+select * from  t1 where datetime_key < '2021-01-01';
+select * from  t1 where datetime_key < '2022-01-01';
+select * from  t1 where datetime_key < '2023-01-01';
+select * from  t1 where datetime_key < '2024-01-01';
+select * from  t1 where datetime_key < '2025-01-01';
+select * from  t1 where datetime_key < '2026-01-01';
+select * from  t1 where datetime_key < '2027-01-01';
+select * from  t1 where datetime_key < '2028-01-01';
+select * from  t1 where datetime_key < '2029-01-01';
+select * from  t1 where datetime_key < '2030-01-01';
+select * from  t1 where datetime_key < '2031-01-01';
+select * from  t1 where datetime_key < '2032-01-01';
+select * from  t1 where datetime_key < '2033-01-01';
+select * from  t1 where datetime_key < '2034-01-01';
+select * from  t1 where datetime_key < '2035-01-01';
+select * from  t1 where datetime_key < '2036-01-01';
+select * from  t1 where datetime_key < '2037-01-01';
+select * from  t1 where datetime_key < '2038-01-01';
+select * from  t1 where datetime_key < '2039-01-01';
+select * from  t1 where datetime_key < '2040-01-01';
+select * from  t1 where datetime_key < '2041-01-01';
+select * from  t1 where datetime_key < '2042-01-01';
+select * from  t1 where datetime_key < '2043-01-01';
+select * from  t1 where datetime_key < '2044-01-01';
+select * from  t1 where datetime_key < '2045-01-01';
+select * from  t1 where datetime_key < '2046-01-01';
+select * from  t1 where datetime_key < '2047-01-01';
+select * from  t1 where datetime_key < '2048-01-01';
+select * from  t1 where datetime_key < '2049-01-01';
+select * from  t1 where datetime_key < '2050-01-01';
+select * from  t1 where datetime_key < '2051-01-01';
+select * from  t1 where datetime_key < '2052-01-01';
+select * from  t1 where datetime_key < '2053-01-01';
+select * from  t1 where datetime_key < '2054-01-01';
+select * from  t1 where datetime_key < '2055-01-01';
+select * from  t1 where datetime_key < '2056-01-01';
+select * from  t1 where datetime_key < '2057-01-01';
+select * from  t1 where datetime_key < '2058-01-01';
+select * from  t1 where datetime_key < '2059-01-01';
+select * from  t1 where datetime_key < '2060-01-01';
+select * from  t1 where datetime_key < '2061-01-01';
+select * from  t1 where datetime_key < '2062-01-01';
+select * from  t1 where datetime_key < '2063-01-01';
+select * from  t1 where datetime_key < '2064-01-01';
+select * from  t1 where datetime_key < '2065-01-01';
+select * from  t1 where datetime_key < '2066-01-01';
+select * from  t1 where datetime_key < '2067-01-01';
+select * from  t1 where datetime_key < '2068-01-01';
+select * from  t1 where datetime_key < '2069-01-01';
+select * from  t1 where datetime_key < '2070-01-01';
+select * from  t1 where datetime_key < '2071-01-01';
+select * from  t1 where datetime_key < '2072-01-01';
+select * from  t1 where datetime_key < '2073-01-01';
+select * from  t1 where datetime_key < '2074-01-01';
+select * from  t1 where datetime_key < '2075-01-01';
+select * from  t1 where datetime_key < '2076-01-01';
+select * from  t1 where datetime_key < '2077-01-01';
+select * from  t1 where datetime_key < '2078-01-01';
+select * from  t1 where datetime_key < '2079-01-01';
+select * from  t1 where datetime_key < '2080-01-01';
+select * from  t1 where datetime_key < '2081-01-01';
+select * from  t1 where datetime_key < '2082-01-01';
+select * from  t1 where datetime_key < '2083-01-01';
+select * from  t1 where datetime_key < '2084-01-01';
+select * from  t1 where datetime_key < '2085-01-01';
+select * from  t1 where datetime_key < '2086-01-01';
+select * from  t1 where datetime_key < '2087-01-01';
+select * from  t1 where datetime_key < '2088-01-01';
+select * from  t1 where datetime_key < '2089-01-01';
+select * from  t1 where datetime_key < '2090-01-01';
+select * from  t1 where datetime_key < '2091-01-01';
+select * from  t1 where datetime_key < '2092-01-01';
+select * from  t1 where datetime_key < '2093-01-01';
+select * from  t1 where datetime_key < '2094-01-01';
+select * from  t1 where datetime_key < '2095-01-01';
+select * from  t1 where datetime_key < '2096-01-01';
+select * from  t1 where datetime_key < '2097-01-01';
+select * from  t1 where datetime_key < '2098-01-01';
+select * from  t1 where datetime_key < '2099-01-01';
+select * from  t1 where datetime_key < '2100-01-01';
+select * from  t1 where datetime_key < '2101-01-01';
+select * from  t1 where datetime_key < '2102-01-01';
+select * from  t1 where datetime_key < '2103-01-01';
+select * from  t1 where datetime_key < '2104-01-01';
+select * from  t1 where datetime_key < '2105-01-01';
+select * from  t1 where datetime_key < '2106-01-01';
+select * from  t1 where datetime_key < '2107-01-01';
+select * from  t1 where datetime_key < '2108-01-01';
+select * from  t1 where datetime_key < '2109-01-01';
+select * from  t1 where datetime_key < '2110-01-01';
+select * from  t1 where datetime_key < '2111-01-01';
+select * from  t1 where datetime_key < '2112-01-01';
+select * from  t1 where datetime_key < '2113-01-01';
+select * from  t1 where datetime_key < '2114-01-01';
+select * from  t1 where datetime_key < '2115-01-01';
+select * from  t1 where datetime_key < '2116-01-01';
+select * from  t1 where datetime_key < '2117-01-01';
+select * from  t1 where datetime_key < '2118-01-01';
+select * from  t1 where datetime_key < '2119-01-01';
+select * from  t1 where datetime_key < '2120-01-01';
+select * from  t1 where datetime_key < '2121-01-01';
+select * from  t1 where datetime_key < '2122-01-01';
+select * from  t1 where datetime_key < '2123-01-01';
+select * from  t1 where datetime_key < '2124-01-01';
+select * from  t1 where datetime_key < '2125-01-01';
+select * from  t1 where datetime_key < '2126-01-01';
+select * from  t1 where datetime_key < '2127-01-01';
+select * from  t1 where datetime_key < '2128-01-01';
+select * from  t1 where datetime_key < '2129-01-01';
+select * from  t1 where datetime_key < '2130-01-01';
+select * from  t1 where datetime_key < '2131-01-01';
+select * from  t1 where datetime_key < '2132-01-01';
+select * from  t1 where datetime_key < '2133-01-01';
+select * from  t1 where datetime_key < '2134-01-01';
+select * from  t1 where datetime_key < '2135-01-01';
+select * from  t1 where datetime_key < '2136-01-01';
+select * from  t1 where datetime_key < '2137-01-01';
+select * from  t1 where datetime_key < '2138-01-01';
+select * from  t1 where datetime_key < '2139-01-01';
+select * from  t1 where datetime_key < '2140-01-01';
+select * from  t1 where datetime_key < '2141-01-01';
+select * from  t1 where datetime_key < '2142-01-01';
+select * from  t1 where datetime_key < '2143-01-01';
+select * from  t1 where datetime_key < '2144-01-01';
+select * from  t1 where datetime_key < '2145-01-01';
+select * from  t1 where datetime_key < '2146-01-01';
+select * from  t1 where datetime_key < '2147-01-01';
+select * from  t1 where datetime_key < '2148-01-01';
+select * from  t1 where datetime_key < '2149-01-01';
+select * from  t1 where datetime_key < '2150-01-01';
+select * from  t1 where datetime_key < '2151-01-01';
+select * from  t1 where datetime_key < '2152-01-01';
+select * from  t1 where datetime_key < '2153-01-01';
+select * from  t1 where datetime_key < '2154-01-01';
+
+
+# ----------------------------------------------------- #
+# --- Check                                         --- #
+# ----------------------------------------------------- #
+
+# Nothing here
+
+# ----------------------------------------------------- #
+# --- Final cleanup                                 --- #
+# ----------------------------------------------------- #
+DROP TABLE t1;

=== modified file 'storage/falcon/Value.cpp'
--- a/storage/falcon/Value.cpp	2008-04-28 20:47:43 +0000
+++ b/storage/falcon/Value.cpp	2008-11-22 12:31:45 +0000
@@ -480,15 +480,42 @@ int Value::compare(Value * value)
 
 		case Double:
 		case Float:
-			return (int) (getDouble() - value->getDouble());
+		    {
+			double res = getDouble() - value->getDouble();
+
+			if (res > 0)
+				{
+				return 1;
+				}
+			else if (res < 0)
+				{
+				return -1;
+				}
+			else
+				{
+				return 0;
+				}
+			}
 
 		case Int64:
 			{
 			int s1 = getScale();
 			int s2 = value->getScale();
 			int maxScale = MAX(s1, s2);
+			int64 res = getQuad(maxScale) - value->getQuad(maxScale);
 
-			return (int) (getQuad(maxScale) - value->getQuad(maxScale));
+			if (res > 0)
+				{
+				return 1;
+				}
+			else if (res < 0)
+				{
+				return -1;
+				}
+			else
+				{
+				return 0;
+				}
 			}
 
 		case Short:

Thread
bzr commit into mysql-6.0-falcon-team branch (lars-erik.bjork:2916) Bug#40614lars-erik.bjork22 Nov
  • Re: bzr commit into mysql-6.0-falcon-team branch(lars-erik.bjork:2916) Bug#40614Hakan Kuecuekyilmaz22 Nov