--source include/have_falcon.inc # # Bug #39342: Falcon: YEAR '=' comparison fails when index is present # # Works with InnoDB, MyISAM, Maria. Does not work with Falcon. # --echo *** Bug #39342 *** # ----------------------------------------------------- # # --- Initialisation --- # # ----------------------------------------------------- # let $engine = 'Falcon'; eval SET @@storage_engine = $engine; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings CREATE TABLE t1 (a_int INT, b_year YEAR); INSERT INTO t1 VALUES (1, 2008); ## Verify that '=' works when there is no index on the YEAR column: SELECT * FROM t1 WHERE b_year = 2008; # ----------------------------------------------------- # # --- Test --- # # ----------------------------------------------------- # ALTER TABLE t1 ADD INDEX index_year (b_year); SELECT * FROM t1 WHERE b_year = 2008; ## Also test "less than" and "greater than" operators. ## Both queries should return one row. SELECT * FROM t1 WHERE b_year < 2009; SELECT * FROM t1 WHERE b_year > 2007; # ----------------------------------------------------- # # --- Check --- # # ----------------------------------------------------- # SELECT * FROM t1; # ----------------------------------------------------- # # --- Final cleanup --- # # ----------------------------------------------------- # DROP TABLE t1;