From: Date: October 21 2008 3:02pm Subject: bzr commit into mysql-6.0-falcon-team branch (lars-erik.bjork:2873) Bug#39342 List-Archive: http://lists.mysql.com/commits/56687 X-Bug: 39342 Message-Id: <200810211302.m9LD2G7B013362@dm-norway-02.uk.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/lb200670/devel/mysql/trampoline/ 2873 lars-erik.bjork@stripped 2008-10-21 This commit introduces two new tests for the YEAR type in Falcon and is a part of the patch for bug#39342. The first test tests the 2 digit version of the YEAR type. This test will currently break due to a bug in the server (40171). The second test tests the 4 digit version of the YEAR type. This test should pass with the fix provided in another commit for this patch. Both tests test 2 digit, 4 digit, and character input in combination with indexes and LIMITs. Also some functions are tested. I encourage the reviewer to pay most attention to the result file for the 2 digit test, as it is hard to confirm the correctness of the expected output on a test that currently is not runnable. added: mysql-test/suite/falcon/r/falcon_year_2digit.result mysql-test/suite/falcon/r/falcon_year_4digit.result mysql-test/suite/falcon/t/falcon_year_2digit.test mysql-test/suite/falcon/t/falcon_year_4digit.test === added file 'mysql-test/suite/falcon/r/falcon_year_2digit.result' --- a/mysql-test/suite/falcon/r/falcon_year_2digit.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/falcon/r/falcon_year_2digit.result 2008-10-21 13:02:02 +0000 @@ -0,0 +1,3757 @@ +*** Falcon YEAR 2 digit: Testing the implementation of 2 digit YEAR on Falcon *** +SET @@storage_engine = 'Falcon'; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a_int INT, b_year YEAR(2)) Engine = 'falcon'; +INSERT INTO t1 VALUES +(1970, '1970'), (1971, 1971), (1972, 1972), +(1973, '1973'), (1974, 1974), (1975, 1975), (1976, 1976), +(1977, '1977'), (1978, 1978), (1979, 1979), (1980, 1980), +(1981, '1981'), (1982, 1982), (1983, 1983), (1984, 1984), +(1985, '1985'), (1986, 1986), (1987, 1987), (1988, 1988), +(1989, '1989'), (1990, 1990), (1991, 1991), (1992, 1992), +(1993, '1993'), (1994, 1994), (1995, 1995), (1996, 1996), +(1997, '1997'), (1998, 1998), (1999, 1999), (2000, 2000), +(2001, '2001'), (2002, 2002), (2003, 2003), (2004, 2004), +(2005, '2005'), (2006, 2006), (2007, 2007), (2008, 2008), +(2009, '2009'), (2010, 2010), (2011, 2011), (2012, 2012), +(2013, '2013'), (2014, 2014), (2015, 2015), (2016, 2016), +(2017, '2017'), (2018, 2018), (2019, 2019), (2020, 2020), +(2021, '2021'), (2022, 2022), (2023, 2023), (2024, 2024), +(2025, '2025'), (2026, 2026), (2027, 2027), (2028, 2028), +(2029, '2029'), (2030, 2030), (2031, 2031), (2032, 2032), +(2033, '2033'), (2034, 2034), (2035, 2035), (2036, 2036), +(2037, '2037'), (2038, 2038), (2039, 2039), (2040, 2040), +(2041, '2041'), (2042, 2042), (2043, 2043), (2044, 2044), +(2045, '2045'), (2046, 2046), (2047, 2047), (2048, 2048), +(2049, '2049'), (2050, 2050), (2051, 2051), (2052, 2052), +(2053, '2053'), (2054, 2054), (2055, 2055), (2056, 2056), +(2057, '2057'), (2058, 2058), (2059, 2059), (2060, 2060), +(2061, '2061'), (2062, 2062), (2063, 2063), (2064, 2064), +(2065, '2065'), (2066, 2066), (2067, 2067), (2068, 2068), +(2069, '2069'); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +2022 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +2022 22 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 22 +ALTER TABLE t1 ADD INDEX index_year (b_year); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +2022 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +2022 22 +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +1980 80 +1981 81 +1982 82 +1983 83 +1984 84 +1985 85 +1986 86 +1987 87 +1988 88 +1989 89 +1990 90 +1991 91 +1992 92 +1993 93 +1994 94 +1995 95 +1996 96 +1997 97 +1998 98 +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +2011 11 +2012 12 +2013 13 +2014 14 +2015 15 +2016 16 +2017 17 +2018 18 +2019 19 +2020 20 +2021 21 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +2033 33 +2034 34 +2035 35 +2036 36 +2037 37 +2038 38 +2039 39 +2040 40 +2041 41 +2042 42 +2043 43 +2044 44 +2045 45 +2046 46 +2047 47 +2048 48 +2049 49 +2050 50 +2051 51 +2052 52 +2053 53 +2054 54 +2055 55 +2056 56 +2057 57 +2058 58 +2059 59 +2060 60 +2061 61 +2062 62 +2063 63 +2064 64 +2065 65 +2066 66 +2067 67 +2068 68 +2069 69 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +2022 22 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +2009 09 +2010 10 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 99 +2000 00 +2001 01 +2002 02 +2003 03 +2004 04 +2005 05 +2006 06 +2007 07 +2008 08 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1970 70 +1971 71 +1972 72 +1973 73 +1974 74 +1975 75 +1976 76 +1977 77 +1978 78 +1979 79 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 23 +2024 24 +2025 25 +2026 26 +2027 27 +2028 28 +2029 29 +2030 30 +2031 31 +2032 32 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 22 +DROP TABLE t1; +CREATE TABLE t1 (a_int INT, b_year YEAR(2)) Engine = 'falcon'; +INSERT INTO t1 VALUES +(0, '0'), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), +(7, '7'), (8,8), (9, 9), (10, 10), (11, 11), (12, 12), +(13, '13'), (14, 14), (15, 15), (16, 16), (17, 17), +(18, '18'), (19, 19), (20, 20), (21, 21), (22, 22), +(23, '23'), (24, 24), (25, 25), (26, 26), (27, 27), +(28, '28'), (29, 29), (30, 30), (31, 31), (32, 32), +(33, '33'), (34, 34), (35, 35), (36, 36), (37, 37), +(38, '38'), (39, 39), (40, 40), (41, 41), (42, 42), +(43, '43'), (44, 44), (45, 45), (46, 46), (47, 47), +(48, '48'), (49, 49), (50, 50), (51, 51), (52, 52), +(53, '53'), (54, 54), (55, 55), (56, 56), (57, 57), +(58, '58'), (59, 59), (60, 60), (61, 61), (62, 62), +(63, '63'), (64, 64), (65, 65), (66, 66), (67, 67), +(68, '68'), (69, 69), (70, 70), (71, 71), (72, 72), +(73, '73'), (74, 74), (75, 75), (76, 76), (77, 77), +(78, '78'), (79, 79), (80, 80), (81, 81), (82, 82), +(83, '83'), (84, 84), (85, 85), (86, 86), (87, 87), +(88, '88'), (89, 89), (90, 90), (91, 91), (92, 92), +(93, '93'), (94, 94), (95, 95), (96, 96), (97, 97), +(98, '98'), (99, 99); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +22 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +22 22 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 22 +ALTER TABLE t1 ADD INDEX index_year (b_year); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +22 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +22 22 +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +11 11 +12 12 +13 13 +14 14 +15 15 +16 16 +17 17 +18 18 +19 19 +20 20 +21 21 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +33 33 +34 34 +35 35 +36 36 +37 37 +38 38 +39 39 +40 40 +41 41 +42 42 +43 43 +44 44 +45 45 +46 46 +47 47 +48 48 +49 49 +50 50 +51 51 +52 52 +53 53 +54 54 +55 55 +56 56 +57 57 +58 58 +59 59 +60 60 +61 61 +62 62 +63 63 +64 64 +65 65 +66 66 +67 67 +68 68 +69 69 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +22 22 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 22 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +9 09 +10 10 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 00 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +8 08 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 98 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 23 +24 24 +25 25 +26 26 +27 27 +28 28 +29 29 +30 30 +31 31 +32 32 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 22 +DROP TABLE t1; +CREATE TABLE t1 (a_int INT, b_year YEAR(2)) Engine = 'falcon'; +INSERT INTO t1 VALUES +(0, '0'), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), +(7, '7'), (58, 58), (59, 59), (60, 60), (61, 61), (62, 62), +(63, '63'), (64, 64), (65, 65), (66, 66), (67, 67), (68, 68), +(69, '69'), (70, 70), (71, 71), (72, 72), (73, 73), (74, 74), +(75, '75'), (76, 76), (77, 77), (78, 78), (79, 79), (80, 80), +(81, '81'), (82, 82), (83, 83), (84, 84), (85, 85), (86, 86), +(87, '87'), (88, 88), (89, 89), (90, 90), (91, 91), (92, 92), +(93, '93'), (94, 94), (95, 95), (96, 96), (97, 97), (98, 98), +(99, '99'); +SELECT * FROM t1 where b_year < NOW(); +a_int b_year +70 70 +71 71 +72 72 +73 73 +74 74 +75 75 +76 76 +77 77 +78 78 +79 79 +80 80 +81 81 +82 82 +83 83 +84 84 +85 85 +86 86 +87 87 +88 88 +89 89 +90 90 +91 91 +92 92 +93 93 +94 94 +95 95 +96 96 +97 97 +98 98 +99 99 +0 00 +1 01 +2 02 +3 03 +4 04 +5 05 +6 06 +7 07 +DROP TABLE t1; === added file 'mysql-test/suite/falcon/r/falcon_year_4digit.result' --- a/mysql-test/suite/falcon/r/falcon_year_4digit.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/falcon/r/falcon_year_4digit.result 2008-10-21 13:02:02 +0000 @@ -0,0 +1,6080 @@ +*** Falcon YEAR 4 digit: Testing the implementation of 4 digit YEAR on Falcon *** +SET @@storage_engine = 'Falcon'; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a_int INT, b_year YEAR(4)) Engine = 'falcon'; +INSERT INTO t1 VALUES (0, 0000), +(1901, '1901'), (1902, 1902), (1903, 1903), (1904, 1904), +(1905, '1905'), (1906, 1906), (1907, 1907), (1908, 1908), +(1909, '1909'), (1910, 1910), (1911, 1911), (1912, 1912), +(1913, '1913'), (1914, 1914), (1915, 1915), (1916, 1916), +(1917, '1917'), (1918, 1918), (1919, 1919), (1920, 1920), +(1921, '1921'), (1922, 1922), (1923, 1923), (1924, 1924), +(1925, '1925'), (1926, 1926), (1927, 1927), (1928, 1928), +(1929, '1929'), (1930, 1930), (1931, 1931), (1932, 1932), +(1933, '1933'), (1934, 1934), (1935, 1935), (1936, 1936), +(1937, '1937'), (1938, 1938), (1939, 1939), (1940, 1940), +(1941, '1941'), (1942, 1942), (1943, 1943), (1944, 1944), +(1945, '1945'), (1946, 1946), (1947, 1947), (1948, 1948), +(1949, '1949'), (1950, 1950), (1951, 1951), (1952, 1952), +(1953, '1953'), (1954, 1954), (1955, 1955), (1956, 1956), +(1957, '1957'), (1958, 1958), (1959, 1959), (1960, 1960), +(1961, '1961'), (1962, 1962), (1963, 1963), (1964, 1964), +(1965, '1965'), (1966, 1966), (1967, 1967), (1968, 1968), +(1969, '1969'), (1970, 1970), (1971, 1971), (1972, 1972), +(1973, '1973'), (1974, 1974), (1975, 1975), (1976, 1976), +(1977, '1977'), (1978, 1978), (1979, 1979), (1980, 1980), +(1981, '1981'), (1982, 1982), (1983, 1983), (1984, 1984), +(1985, '1985'), (1986, 1986), (1987, 1987), (1988, 1988), +(1989, '1989'), (1990, 1990), (1991, 1991), (1992, 1992), +(1993, '1993'), (1994, 1994), (1995, 1995), (1996, 1996), +(1997, '1997'), (1998, 1998), (1999, 1999), (2000, 2000), +(2001, '2001'), (2002, 2002), (2003, 2003), (2004, 2004), +(2005, '2005'), (2006, 2006), (2007, 2007), (2008, 2008), +(2009, '2009'), (2010, 2010), (2011, 2011), (2012, 2012), +(2013, '2013'), (2014, 2014), (2015, 2015), (2016, 2016), +(2017, '2017'), (2018, 2018), (2019, 2019), (2020, 2020), +(2021, '2021'), (2022, 2022), (2023, 2023), (2024, 2024), +(2025, '2025'), (2026, 2026), (2027, 2027), (2028, 2028), +(2029, '2029'), (2030, 2030), (2031, 2031), (2032, 2032), +(2033, '2033'), (2034, 2034), (2035, 2035), (2036, 2036), +(2037, '2037'), (2038, 2038), (2039, 2039), (2040, 2040), +(2041, '2041'), (2042, 2042), (2043, 2043), (2044, 2044), +(2045, '2045'), (2046, 2046), (2047, 2047), (2048, 2048), +(2049, '2049'), (2050, 2050), (2051, 2051), (2052, 2052), +(2053, '2053'), (2054, 2054), (2055, 2055), (2056, 2056), +(2057, '2057'), (2058, 2058), (2059, 2059), (2060, 2060), +(2061, '2061'), (2062, 2062), (2063, 2063), (2064, 2064), +(2065, '2065'), (2066, 2066), (2067, 2067), (2068, 2068), +(2069, '2069'), (2070, 2070), (2071, 2071), (2072, 2072), +(2073, '2073'), (2074, 2074), (2075, 2075), (2076, 2076), +(2077, '2077'), (2078, 2078), (2079, 2079), (2080, 2080), +(2081, '2081'), (2082, 2082), (2083, 2083), (2084, 2084), +(2085, '2085'), (2086, 2086), (2087, 2087), (2088, 2088), +(2089, '2089'), (2090, 2090), (2091, 2091), (2092, 2092), +(2093, '2093'), (2094, 2094), (2095, 2095), (2096, 2096), +(2097, '2097'), (2098, 2098), (2099, 2099), (2100, 2100), +(2101, '2101'), (2102, 2102), (2103, 2103), (2104, 2104), +(2105, '2105'), (2106, 2106), (2107, 2107), (2108, 2108), +(2109, '2109'), (2110, 2110), (2111, 2111), (2112, 2112), +(2113, '2113'), (2114, 2114), (2115, 2115), (2116, 2116), +(2117, '2117'), (2118, 2118), (2119, 2119), (2120, 2120), +(2121, '2121'), (2122, 2122), (2123, 2123), (2124, 2124), +(2125, '2125'), (2126, 2126), (2127, 2127), (2128, 2128), +(2129, '2129'), (2130, 2130), (2131, 2131), (2132, 2132), +(2133, '2133'), (2134, 2134), (2135, 2135), (2136, 2136), +(2137, '2137'), (2138, 2138), (2139, 2139), (2140, 2140), +(2141, '2141'), (2142, 2142), (2143, 2143), (2144, 2144), +(2145, '2145'), (2146, 2146), (2147, 2147), (2148, 2148), +(2149, '2149'), (2150, 2150), (2151, 2151), (2152, 2152), +(2153, '2153'), (2154, 2154); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +2022 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +2022 2022 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 2022 +ALTER TABLE t1 ADD INDEX index_year (b_year); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +2022 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +2022 2022 +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +2011 2011 +2012 2012 +2013 2013 +2014 2014 +2015 2015 +2016 2016 +2017 2017 +2018 2018 +2019 2019 +2020 2020 +2021 2021 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +2033 2033 +2034 2034 +2035 2035 +2036 2036 +2037 2037 +2038 2038 +2039 2039 +2040 2040 +2041 2041 +2042 2042 +2043 2043 +2044 2044 +2045 2045 +2046 2046 +2047 2047 +2048 2048 +2049 2049 +2050 2050 +2051 2051 +2052 2052 +2053 2053 +2054 2054 +2055 2055 +2056 2056 +2057 2057 +2058 2058 +2059 2059 +2060 2060 +2061 2061 +2062 2062 +2063 2063 +2064 2064 +2065 2065 +2066 2066 +2067 2067 +2068 2068 +2069 2069 +2070 2070 +2071 2071 +2072 2072 +2073 2073 +2074 2074 +2075 2075 +2076 2076 +2077 2077 +2078 2078 +2079 2079 +2080 2080 +2081 2081 +2082 2082 +2083 2083 +2084 2084 +2085 2085 +2086 2086 +2087 2087 +2088 2088 +2089 2089 +2090 2090 +2091 2091 +2092 2092 +2093 2093 +2094 2094 +2095 2095 +2096 2096 +2097 2097 +2098 2098 +2099 2099 +2100 2100 +2101 2101 +2102 2102 +2103 2103 +2104 2104 +2105 2105 +2106 2106 +2107 2107 +2108 2108 +2109 2109 +2110 2110 +2111 2111 +2112 2112 +2113 2113 +2114 2114 +2115 2115 +2116 2116 +2117 2117 +2118 2118 +2119 2119 +2120 2120 +2121 2121 +2122 2122 +2123 2123 +2124 2124 +2125 2125 +2126 2126 +2127 2127 +2128 2128 +2129 2129 +2130 2130 +2131 2131 +2132 2132 +2133 2133 +2134 2134 +2135 2135 +2136 2136 +2137 2137 +2138 2138 +2139 2139 +2140 2140 +2141 2141 +2142 2142 +2143 2143 +2144 2144 +2145 2145 +2146 2146 +2147 2147 +2148 2148 +2149 2149 +2150 2150 +2151 2151 +2152 2152 +2153 2153 +2154 2154 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +2022 2022 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +2009 2009 +2010 2010 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2000 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +2008 2008 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1998 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2023 2023 +2024 2024 +2025 2025 +2026 2026 +2027 2027 +2028 2028 +2029 2029 +2030 2030 +2031 2031 +2032 2032 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +2022 2022 +DROP TABLE t1; +CREATE TABLE t1 (a_int INT, b_year YEAR(4)) Engine = 'falcon'; +INSERT INTO t1 VALUES +(0, '0'), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), +(7, '7'), (8,8), (9, 9), (10, 10), (11, 11), (12, 12), +(13, '13'), (14, 14), (15, 15), (16, 16), (17, 17), +(18, '18'), (19, 19), (20, 20), (21, 21), (22, 22), +(23, '23'), (24, 24), (25, 25), (26, 26), (27, 27), +(28, '28'), (29, 29), (30, 30), (31, 31), (32, 32), +(33, '33'), (34, 34), (35, 35), (36, 36), (37, 37), +(38, '38'), (39, 39), (40, 40), (41, 41), (42, 42), +(43, '43'), (44, 44), (45, 45), (46, 46), (47, 47), +(48, '48'), (49, 49), (50, 50), (51, 51), (52, 52), +(53, '53'), (54, 54), (55, 55), (56, 56), (57, 57), +(58, '58'), (59, 59), (60, 60), (61, 61), (62, 62), +(63, '63'), (64, 64), (65, 65), (66, 66), (67, 67), +(68, '68'), (69, 69), (70, 70), (71, 71), (72, 72), +(73, '73'), (74, 74), (75, 75), (76, 76), (77, 77), +(78, '78'), (79, 79), (80, 80), (81, 81), (82, 82), +(83, '83'), (84, 84), (85, 85), (86, 86), (87, 87), +(88, '88'), (89, 89), (90, 90), (91, 91), (92, 92), +(93, '93'), (94, 94), (95, 95), (96, 96), (97, 97), +(98, '98'), (99, 99); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +22 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +22 2022 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 2022 +ALTER TABLE t1 ADD INDEX index_year (b_year); +SELECT * FROM t1 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; +a_int b_year +22 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +22 2022 +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +80 1980 +81 1981 +82 1982 +83 1983 +84 1984 +85 1985 +86 1986 +87 1987 +88 1988 +89 1989 +90 1990 +91 1991 +92 1992 +93 1993 +94 1994 +95 1995 +96 1996 +97 1997 +98 1998 +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +11 2011 +12 2012 +13 2013 +14 2014 +15 2015 +16 2016 +17 2017 +18 2018 +19 2019 +20 2020 +21 2021 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +33 2033 +34 2034 +35 2035 +36 2036 +37 2037 +38 2038 +39 2039 +40 2040 +41 2041 +42 2042 +43 2043 +44 2044 +45 2045 +46 2046 +47 2047 +48 2048 +49 2049 +50 2050 +51 2051 +52 2052 +53 2053 +54 2054 +55 2055 +56 2056 +57 2057 +58 2058 +59 2059 +60 2060 +61 2061 +62 2062 +63 2063 +64 2064 +65 2065 +66 2066 +67 2067 +68 2068 +69 2069 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; +a_int b_year +22 2022 +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 2022 +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +9 2009 +10 2010 +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; +a_int b_year +0 2000 +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +99 1999 +0 2000 +1 2001 +2 2002 +3 2003 +4 2004 +5 2005 +6 2006 +7 2007 +8 2008 +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +a_int b_year +98 1998 +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +70 1970 +71 1971 +72 1972 +73 1973 +74 1974 +75 1975 +76 1976 +77 1977 +78 1978 +79 1979 +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +23 2023 +24 2024 +25 2025 +26 2026 +27 2027 +28 2028 +29 2029 +30 2030 +31 2031 +32 2032 +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; +a_int b_year +22 2022 +DROP TABLE t1; +CREATE TABLE t1 (a_int INT, b_year YEAR(4)) Engine = 'falcon'; +INSERT INTO t1 VALUES (0, 0000), +(1901, '1901'), (1902, 1902), (1903, 1903), (1904, 1904), +(1905, '1905'), (1906, 1906), (1907, 1907), (1908, 1908), +(1909, '1909'), (1910, 1910), (1911, 1911), (1912, 1912), +(1913, '1913'), (1914, 1914), (1915, 1915), (1916, 1916), +(1917, '1917'), (1918, 1918), (1919, 1919), (1920, 1920), +(1921, '1921'), (1922, 1922), (1923, 1923), (1924, 1924), +(1925, '1925'), (1926, 1926), (1927, 1927), (1928, 1928), +(1929, '1929'), (1930, 1930), (1931, 1931), (1932, 1932), +(1933, '1933'), (1934, 1934), (1935, 1935), (1936, 1936), +(1937, '1937'), (1938, 1938), (1939, 1939), (1940, 1940), +(1941, '1941'), (1942, 1942), (1943, 1943), (1944, 1944), +(1945, '1945'), (1946, 1946), (1947, 1947), (1948, 1948), +(1949, '1949'), (1950, 1950), (1951, 1951), (1952, 1952), +(1953, '1953'), (1954, 1954), (1955, 1955), (1956, 1956), +(1957, '1957'), (1958, 1958), (1959, 1959), (1960, 1960), +(1961, '1961'), (1962, 1962), (1963, 1963), (1964, 1964), +(1965, '1965'), (1966, 1966), (1967, 1967), (1968, 1968), +(1969, '1969'), (1970, 1970), (1971, 1971), (1972, 1972), +(1973, '1973'), (1974, 1974), (1975, 1975), (1976, 1976), +(1977, '1977'), (1978, 1978), (1979, 1979), (1980, 1980), +(1981, '1981'), (1982, 1982), (1983, 1983), (1984, 1984), +(1985, '1985'), (1986, 1986), (1987, 1987), (1988, 1988), +(1989, '1989'), (1990, 1990), (1991, 1991), (1992, 1992), +(1993, '1993'), (1994, 1994), (1995, 1995), (1996, 1996), +(1997, '1997'), (1998, 1998), (1999, 1999), (2000, 2000), +(2001, '2001'), (2002, 2002), (2003, 2003), (2004, 2004), +(2005, '2005'), (2006, 2006), (2007, 2007), (2058, 2058), +(2059, '2059'), (2060, 2060), (2061, 2061), (2062, 2062), +(2063, '2063'), (2064, 2064), (2065, 2065), (2066, 2066), +(2067, '2067'), (2068, 2068), (2069, 2069), (2070, 2070), +(2071, '2071'), (2072, 2072), (2073, 2073), (2074, 2074), +(2075, '2075'), (2076, 2076), (2077, 2077), (2078, 2078), +(2079, '2079'), (2080, 2080), (2081, 2081), (2082, 2082), +(2083, '2083'), (2084, 2084), (2085, 2085), (2086, 2086), +(2087, '2087'), (2088, 2088), (2089, 2089), (2090, 2090), +(2091, '2091'), (2092, 2092), (2093, 2093), (2094, 2094), +(2095, '2095'), (2096, 2096), (2097, 2097), (2098, 2098), +(2099, '2099'), (2100, 2100), (2101, 2101), (2102, 2102), +(2103, '2103'), (2104, 2104), (2105, 2105), (2106, 2106), +(2107, '2107'), (2108, 2108), (2109, 2109), (2110, 2110), +(2111, '2111'), (2112, 2112), (2113, 2113), (2114, 2114), +(2115, '2115'), (2116, 2116), (2117, 2117), (2118, 2118), +(2119, '2119'), (2120, 2120), (2121, 2121), (2122, 2122), +(2123, '2123'), (2124, 2124), (2125, 2125), (2126, 2126), +(2127, '2127'), (2128, 2128), (2129, 2129), (2130, 2130), +(2131, '2131'), (2132, 2132), (2133, 2133), (2134, 2134), +(2135, '2135'), (2136, 2136), (2137, 2137), (2138, 2138), +(2139, '2139'), (2140, 2140), (2141, 2141), (2142, 2142), +(2143, '2143'), (2144, 2144), (2145, 2145), (2146, 2146), +(2147, '2147'), (2148, 2148), (2149, 2149), (2150, 2150), +(2151, '2151'), (2152, 2152), (2153, 2153), (2154, 2154); +SELECT * FROM t1 where b_year < NOW(); +a_int b_year +0 0000 +1901 1901 +1902 1902 +1903 1903 +1904 1904 +1905 1905 +1906 1906 +1907 1907 +1908 1908 +1909 1909 +1910 1910 +1911 1911 +1912 1912 +1913 1913 +1914 1914 +1915 1915 +1916 1916 +1917 1917 +1918 1918 +1919 1919 +1920 1920 +1921 1921 +1922 1922 +1923 1923 +1924 1924 +1925 1925 +1926 1926 +1927 1927 +1928 1928 +1929 1929 +1930 1930 +1931 1931 +1932 1932 +1933 1933 +1934 1934 +1935 1935 +1936 1936 +1937 1937 +1938 1938 +1939 1939 +1940 1940 +1941 1941 +1942 1942 +1943 1943 +1944 1944 +1945 1945 +1946 1946 +1947 1947 +1948 1948 +1949 1949 +1950 1950 +1951 1951 +1952 1952 +1953 1953 +1954 1954 +1955 1955 +1956 1956 +1957 1957 +1958 1958 +1959 1959 +1960 1960 +1961 1961 +1962 1962 +1963 1963 +1964 1964 +1965 1965 +1966 1966 +1967 1967 +1968 1968 +1969 1969 +1970 1970 +1971 1971 +1972 1972 +1973 1973 +1974 1974 +1975 1975 +1976 1976 +1977 1977 +1978 1978 +1979 1979 +1980 1980 +1981 1981 +1982 1982 +1983 1983 +1984 1984 +1985 1985 +1986 1986 +1987 1987 +1988 1988 +1989 1989 +1990 1990 +1991 1991 +1992 1992 +1993 1993 +1994 1994 +1995 1995 +1996 1996 +1997 1997 +1998 1998 +1999 1999 +2000 2000 +2001 2001 +2002 2002 +2003 2003 +2004 2004 +2005 2005 +2006 2006 +2007 2007 +SELECT EXTRACT(YEAR FROM '2008-07-02'); +EXTRACT(YEAR FROM '2008-07-02') +2008 +DROP TABLE t1; === added file 'mysql-test/suite/falcon/t/falcon_year_2digit.test' --- a/mysql-test/suite/falcon/t/falcon_year_2digit.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/falcon/t/falcon_year_2digit.test 2008-10-21 13:02:02 +0000 @@ -0,0 +1,342 @@ +--source include/have_falcon.inc + +# +# Falcon YEAR 2 digit: Testing the implementation of 2 digit YEAR on Falcon +# +--echo *** Falcon YEAR 2 digit: Testing the implementation of 2 digit YEAR on Falcon *** + +# ----------------------------------------------------- # +# --- Initialisation --- # +# ----------------------------------------------------- # +let $engine = 'Falcon'; +eval SET @@storage_engine = $engine; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# ----------------------------------------------------- # +# --- Test --- # +# ----------------------------------------------------- # + +# Two digit YEAR column +CREATE TABLE t1 (a_int INT, b_year YEAR(2)) Engine = 'falcon'; + +# Four digit insert +INSERT INTO t1 VALUES +(1970, '1970'), (1971, 1971), (1972, 1972), +(1973, '1973'), (1974, 1974), (1975, 1975), (1976, 1976), +(1977, '1977'), (1978, 1978), (1979, 1979), (1980, 1980), +(1981, '1981'), (1982, 1982), (1983, 1983), (1984, 1984), +(1985, '1985'), (1986, 1986), (1987, 1987), (1988, 1988), +(1989, '1989'), (1990, 1990), (1991, 1991), (1992, 1992), +(1993, '1993'), (1994, 1994), (1995, 1995), (1996, 1996), +(1997, '1997'), (1998, 1998), (1999, 1999), (2000, 2000), +(2001, '2001'), (2002, 2002), (2003, 2003), (2004, 2004), +(2005, '2005'), (2006, 2006), (2007, 2007), (2008, 2008), +(2009, '2009'), (2010, 2010), (2011, 2011), (2012, 2012), +(2013, '2013'), (2014, 2014), (2015, 2015), (2016, 2016), +(2017, '2017'), (2018, 2018), (2019, 2019), (2020, 2020), +(2021, '2021'), (2022, 2022), (2023, 2023), (2024, 2024), +(2025, '2025'), (2026, 2026), (2027, 2027), (2028, 2028), +(2029, '2029'), (2030, 2030), (2031, 2031), (2032, 2032), +(2033, '2033'), (2034, 2034), (2035, 2035), (2036, 2036), +(2037, '2037'), (2038, 2038), (2039, 2039), (2040, 2040), +(2041, '2041'), (2042, 2042), (2043, 2043), (2044, 2044), +(2045, '2045'), (2046, 2046), (2047, 2047), (2048, 2048), +(2049, '2049'), (2050, 2050), (2051, 2051), (2052, 2052), +(2053, '2053'), (2054, 2054), (2055, 2055), (2056, 2056), +(2057, '2057'), (2058, 2058), (2059, 2059), (2060, 2060), +(2061, '2061'), (2062, 2062), (2063, 2063), (2064, 2064), +(2065, '2065'), (2066, 2066), (2067, 2067), (2068, 2068), +(2069, '2069'); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +# Adding indexes +ALTER TABLE t1 ADD INDEX index_year (b_year); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +DROP TABLE t1; + +# Two digit YEAR column +CREATE TABLE t1 (a_int INT, b_year YEAR(2)) Engine = 'falcon'; + +# Two digit insert +INSERT INTO t1 VALUES +(0, '0'), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), +(7, '7'), (8,8), (9, 9), (10, 10), (11, 11), (12, 12), +(13, '13'), (14, 14), (15, 15), (16, 16), (17, 17), +(18, '18'), (19, 19), (20, 20), (21, 21), (22, 22), +(23, '23'), (24, 24), (25, 25), (26, 26), (27, 27), +(28, '28'), (29, 29), (30, 30), (31, 31), (32, 32), +(33, '33'), (34, 34), (35, 35), (36, 36), (37, 37), +(38, '38'), (39, 39), (40, 40), (41, 41), (42, 42), +(43, '43'), (44, 44), (45, 45), (46, 46), (47, 47), +(48, '48'), (49, 49), (50, 50), (51, 51), (52, 52), +(53, '53'), (54, 54), (55, 55), (56, 56), (57, 57), +(58, '58'), (59, 59), (60, 60), (61, 61), (62, 62), +(63, '63'), (64, 64), (65, 65), (66, 66), (67, 67), +(68, '68'), (69, 69), (70, 70), (71, 71), (72, 72), +(73, '73'), (74, 74), (75, 75), (76, 76), (77, 77), +(78, '78'), (79, 79), (80, 80), (81, 81), (82, 82), +(83, '83'), (84, 84), (85, 85), (86, 86), (87, 87), +(88, '88'), (89, 89), (90, 90), (91, 91), (92, 92), +(93, '93'), (94, 94), (95, 95), (96, 96), (97, 97), +(98, '98'), (99, 99); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +# Adding indexes +ALTER TABLE t1 ADD INDEX index_year (b_year); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +DROP TABLE t1; + +# Creating a table with a hole of 50 years, so that the +# SELECT * FROM t1 where b_year < NOW() will be valid +# for some more time + +CREATE TABLE t1 (a_int INT, b_year YEAR(2)) Engine = 'falcon'; +INSERT INTO t1 VALUES +(0, '0'), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), +(7, '7'), (58, 58), (59, 59), (60, 60), (61, 61), (62, 62), +(63, '63'), (64, 64), (65, 65), (66, 66), (67, 67), (68, 68), +(69, '69'), (70, 70), (71, 71), (72, 72), (73, 73), (74, 74), +(75, '75'), (76, 76), (77, 77), (78, 78), (79, 79), (80, 80), +(81, '81'), (82, 82), (83, 83), (84, 84), (85, 85), (86, 86), +(87, '87'), (88, 88), (89, 89), (90, 90), (91, 91), (92, 92), +(93, '93'), (94, 94), (95, 95), (96, 96), (97, 97), (98, 98), +(99, '99'); + +SELECT * FROM t1 where b_year < NOW(); + +# ----------------------------------------------------- # +# --- Check --- # +# ----------------------------------------------------- # + +# Nothing here + +# ----------------------------------------------------- # +# --- Final cleanup --- # +# ----------------------------------------------------- # + +DROP TABLE t1; === added file 'mysql-test/suite/falcon/t/falcon_year_4digit.test' --- a/mysql-test/suite/falcon/t/falcon_year_4digit.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/falcon/t/falcon_year_4digit.test 2008-10-21 13:02:02 +0000 @@ -0,0 +1,424 @@ +--source include/have_falcon.inc + +# +# Falcon YEAR 4 digit: Testing the implementation of 4 digit YEAR on Falcon +# +--echo *** Falcon YEAR 4 digit: Testing the implementation of 4 digit YEAR on Falcon *** + +# ----------------------------------------------------- # +# --- Initialisation --- # +# ----------------------------------------------------- # +let $engine = 'Falcon'; +eval SET @@storage_engine = $engine; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# ----------------------------------------------------- # +# --- Test --- # +# ----------------------------------------------------- # + +# Four digit YEAR column +CREATE TABLE t1 (a_int INT, b_year YEAR(4)) Engine = 'falcon'; + +# Four digit insert +INSERT INTO t1 VALUES (0, 0000), +(1901, '1901'), (1902, 1902), (1903, 1903), (1904, 1904), +(1905, '1905'), (1906, 1906), (1907, 1907), (1908, 1908), +(1909, '1909'), (1910, 1910), (1911, 1911), (1912, 1912), +(1913, '1913'), (1914, 1914), (1915, 1915), (1916, 1916), +(1917, '1917'), (1918, 1918), (1919, 1919), (1920, 1920), +(1921, '1921'), (1922, 1922), (1923, 1923), (1924, 1924), +(1925, '1925'), (1926, 1926), (1927, 1927), (1928, 1928), +(1929, '1929'), (1930, 1930), (1931, 1931), (1932, 1932), +(1933, '1933'), (1934, 1934), (1935, 1935), (1936, 1936), +(1937, '1937'), (1938, 1938), (1939, 1939), (1940, 1940), +(1941, '1941'), (1942, 1942), (1943, 1943), (1944, 1944), +(1945, '1945'), (1946, 1946), (1947, 1947), (1948, 1948), +(1949, '1949'), (1950, 1950), (1951, 1951), (1952, 1952), +(1953, '1953'), (1954, 1954), (1955, 1955), (1956, 1956), +(1957, '1957'), (1958, 1958), (1959, 1959), (1960, 1960), +(1961, '1961'), (1962, 1962), (1963, 1963), (1964, 1964), +(1965, '1965'), (1966, 1966), (1967, 1967), (1968, 1968), +(1969, '1969'), (1970, 1970), (1971, 1971), (1972, 1972), +(1973, '1973'), (1974, 1974), (1975, 1975), (1976, 1976), +(1977, '1977'), (1978, 1978), (1979, 1979), (1980, 1980), +(1981, '1981'), (1982, 1982), (1983, 1983), (1984, 1984), +(1985, '1985'), (1986, 1986), (1987, 1987), (1988, 1988), +(1989, '1989'), (1990, 1990), (1991, 1991), (1992, 1992), +(1993, '1993'), (1994, 1994), (1995, 1995), (1996, 1996), +(1997, '1997'), (1998, 1998), (1999, 1999), (2000, 2000), +(2001, '2001'), (2002, 2002), (2003, 2003), (2004, 2004), +(2005, '2005'), (2006, 2006), (2007, 2007), (2008, 2008), +(2009, '2009'), (2010, 2010), (2011, 2011), (2012, 2012), +(2013, '2013'), (2014, 2014), (2015, 2015), (2016, 2016), +(2017, '2017'), (2018, 2018), (2019, 2019), (2020, 2020), +(2021, '2021'), (2022, 2022), (2023, 2023), (2024, 2024), +(2025, '2025'), (2026, 2026), (2027, 2027), (2028, 2028), +(2029, '2029'), (2030, 2030), (2031, 2031), (2032, 2032), +(2033, '2033'), (2034, 2034), (2035, 2035), (2036, 2036), +(2037, '2037'), (2038, 2038), (2039, 2039), (2040, 2040), +(2041, '2041'), (2042, 2042), (2043, 2043), (2044, 2044), +(2045, '2045'), (2046, 2046), (2047, 2047), (2048, 2048), +(2049, '2049'), (2050, 2050), (2051, 2051), (2052, 2052), +(2053, '2053'), (2054, 2054), (2055, 2055), (2056, 2056), +(2057, '2057'), (2058, 2058), (2059, 2059), (2060, 2060), +(2061, '2061'), (2062, 2062), (2063, 2063), (2064, 2064), +(2065, '2065'), (2066, 2066), (2067, 2067), (2068, 2068), +(2069, '2069'), (2070, 2070), (2071, 2071), (2072, 2072), +(2073, '2073'), (2074, 2074), (2075, 2075), (2076, 2076), +(2077, '2077'), (2078, 2078), (2079, 2079), (2080, 2080), +(2081, '2081'), (2082, 2082), (2083, 2083), (2084, 2084), +(2085, '2085'), (2086, 2086), (2087, 2087), (2088, 2088), +(2089, '2089'), (2090, 2090), (2091, 2091), (2092, 2092), +(2093, '2093'), (2094, 2094), (2095, 2095), (2096, 2096), +(2097, '2097'), (2098, 2098), (2099, 2099), (2100, 2100), +(2101, '2101'), (2102, 2102), (2103, 2103), (2104, 2104), +(2105, '2105'), (2106, 2106), (2107, 2107), (2108, 2108), +(2109, '2109'), (2110, 2110), (2111, 2111), (2112, 2112), +(2113, '2113'), (2114, 2114), (2115, 2115), (2116, 2116), +(2117, '2117'), (2118, 2118), (2119, 2119), (2120, 2120), +(2121, '2121'), (2122, 2122), (2123, 2123), (2124, 2124), +(2125, '2125'), (2126, 2126), (2127, 2127), (2128, 2128), +(2129, '2129'), (2130, 2130), (2131, 2131), (2132, 2132), +(2133, '2133'), (2134, 2134), (2135, 2135), (2136, 2136), +(2137, '2137'), (2138, 2138), (2139, 2139), (2140, 2140), +(2141, '2141'), (2142, 2142), (2143, 2143), (2144, 2144), +(2145, '2145'), (2146, 2146), (2147, 2147), (2148, 2148), +(2149, '2149'), (2150, 2150), (2151, 2151), (2152, 2152), +(2153, '2153'), (2154, 2154); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +# Adding indexes +ALTER TABLE t1 ADD INDEX index_year (b_year); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +DROP TABLE t1; + +# Four digit Table +CREATE TABLE t1 (a_int INT, b_year YEAR(4)) Engine = 'falcon'; + +# Two digit insert +INSERT INTO t1 VALUES +(0, '0'), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), +(7, '7'), (8,8), (9, 9), (10, 10), (11, 11), (12, 12), +(13, '13'), (14, 14), (15, 15), (16, 16), (17, 17), +(18, '18'), (19, 19), (20, 20), (21, 21), (22, 22), +(23, '23'), (24, 24), (25, 25), (26, 26), (27, 27), +(28, '28'), (29, 29), (30, 30), (31, 31), (32, 32), +(33, '33'), (34, 34), (35, 35), (36, 36), (37, 37), +(38, '38'), (39, 39), (40, 40), (41, 41), (42, 42), +(43, '43'), (44, 44), (45, 45), (46, 46), (47, 47), +(48, '48'), (49, 49), (50, 50), (51, 51), (52, 52), +(53, '53'), (54, 54), (55, 55), (56, 56), (57, 57), +(58, '58'), (59, 59), (60, 60), (61, 61), (62, 62), +(63, '63'), (64, 64), (65, 65), (66, 66), (67, 67), +(68, '68'), (69, 69), (70, 70), (71, 71), (72, 72), +(73, '73'), (74, 74), (75, 75), (76, 76), (77, 77), +(78, '78'), (79, 79), (80, 80), (81, 81), (82, 82), +(83, '83'), (84, 84), (85, 85), (86, 86), (87, 87), +(88, '88'), (89, 89), (90, 90), (91, 91), (92, 92), +(93, '93'), (94, 94), (95, 95), (96, 96), (97, 97), +(98, '98'), (99, 99); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with chracter input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +# Adding indexes +ALTER TABLE t1 ADD INDEX index_year (b_year); + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC; + +# Two digit select with chracter input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC; + +# Testing the same with LIMIT + +# Four digit select +SELECT * FROM t1 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 2000 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 2000 ORDER BY b_year ASC LIMIT 10; + +# Two digit select +SELECT * FROM t1 WHERE b_year < 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 98 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > 22 ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = 22 ORDER BY b_year ASC LIMIT 10; + +# Four digit select with character input +SELECT * FROM t1 WHERE b_year < '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '2000' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '2000' ORDER BY b_year ASC LIMIT 10; + +# Two digit select with character input +SELECT * FROM t1 WHERE b_year < '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '98' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year < '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year > '22' ORDER BY b_year ASC LIMIT 10; +SELECT * FROM t1 WHERE b_year = '22' ORDER BY b_year ASC LIMIT 10; + +DROP TABLE t1; + +# Creating a table with a hole of 50 years, so that the +# SELECT * FROM t1 where b_year < NOW() will be valid +# for some more time + +# Four digit YEAR column +CREATE TABLE t1 (a_int INT, b_year YEAR(4)) Engine = 'falcon'; +INSERT INTO t1 VALUES (0, 0000), +(1901, '1901'), (1902, 1902), (1903, 1903), (1904, 1904), +(1905, '1905'), (1906, 1906), (1907, 1907), (1908, 1908), +(1909, '1909'), (1910, 1910), (1911, 1911), (1912, 1912), +(1913, '1913'), (1914, 1914), (1915, 1915), (1916, 1916), +(1917, '1917'), (1918, 1918), (1919, 1919), (1920, 1920), +(1921, '1921'), (1922, 1922), (1923, 1923), (1924, 1924), +(1925, '1925'), (1926, 1926), (1927, 1927), (1928, 1928), +(1929, '1929'), (1930, 1930), (1931, 1931), (1932, 1932), +(1933, '1933'), (1934, 1934), (1935, 1935), (1936, 1936), +(1937, '1937'), (1938, 1938), (1939, 1939), (1940, 1940), +(1941, '1941'), (1942, 1942), (1943, 1943), (1944, 1944), +(1945, '1945'), (1946, 1946), (1947, 1947), (1948, 1948), +(1949, '1949'), (1950, 1950), (1951, 1951), (1952, 1952), +(1953, '1953'), (1954, 1954), (1955, 1955), (1956, 1956), +(1957, '1957'), (1958, 1958), (1959, 1959), (1960, 1960), +(1961, '1961'), (1962, 1962), (1963, 1963), (1964, 1964), +(1965, '1965'), (1966, 1966), (1967, 1967), (1968, 1968), +(1969, '1969'), (1970, 1970), (1971, 1971), (1972, 1972), +(1973, '1973'), (1974, 1974), (1975, 1975), (1976, 1976), +(1977, '1977'), (1978, 1978), (1979, 1979), (1980, 1980), +(1981, '1981'), (1982, 1982), (1983, 1983), (1984, 1984), +(1985, '1985'), (1986, 1986), (1987, 1987), (1988, 1988), +(1989, '1989'), (1990, 1990), (1991, 1991), (1992, 1992), +(1993, '1993'), (1994, 1994), (1995, 1995), (1996, 1996), +(1997, '1997'), (1998, 1998), (1999, 1999), (2000, 2000), +(2001, '2001'), (2002, 2002), (2003, 2003), (2004, 2004), +(2005, '2005'), (2006, 2006), (2007, 2007), (2058, 2058), +(2059, '2059'), (2060, 2060), (2061, 2061), (2062, 2062), +(2063, '2063'), (2064, 2064), (2065, 2065), (2066, 2066), +(2067, '2067'), (2068, 2068), (2069, 2069), (2070, 2070), +(2071, '2071'), (2072, 2072), (2073, 2073), (2074, 2074), +(2075, '2075'), (2076, 2076), (2077, 2077), (2078, 2078), +(2079, '2079'), (2080, 2080), (2081, 2081), (2082, 2082), +(2083, '2083'), (2084, 2084), (2085, 2085), (2086, 2086), +(2087, '2087'), (2088, 2088), (2089, 2089), (2090, 2090), +(2091, '2091'), (2092, 2092), (2093, 2093), (2094, 2094), +(2095, '2095'), (2096, 2096), (2097, 2097), (2098, 2098), +(2099, '2099'), (2100, 2100), (2101, 2101), (2102, 2102), +(2103, '2103'), (2104, 2104), (2105, 2105), (2106, 2106), +(2107, '2107'), (2108, 2108), (2109, 2109), (2110, 2110), +(2111, '2111'), (2112, 2112), (2113, 2113), (2114, 2114), +(2115, '2115'), (2116, 2116), (2117, 2117), (2118, 2118), +(2119, '2119'), (2120, 2120), (2121, 2121), (2122, 2122), +(2123, '2123'), (2124, 2124), (2125, 2125), (2126, 2126), +(2127, '2127'), (2128, 2128), (2129, 2129), (2130, 2130), +(2131, '2131'), (2132, 2132), (2133, 2133), (2134, 2134), +(2135, '2135'), (2136, 2136), (2137, 2137), (2138, 2138), +(2139, '2139'), (2140, 2140), (2141, 2141), (2142, 2142), +(2143, '2143'), (2144, 2144), (2145, 2145), (2146, 2146), +(2147, '2147'), (2148, 2148), (2149, 2149), (2150, 2150), +(2151, '2151'), (2152, 2152), (2153, 2153), (2154, 2154); + +SELECT * FROM t1 where b_year < NOW(); +SELECT EXTRACT(YEAR FROM '2008-07-02'); + +# ----------------------------------------------------- # +# --- Check --- # +# ----------------------------------------------------- # + +# Nothing here + +# ----------------------------------------------------- # +# --- Final cleanup --- # +# ----------------------------------------------------- # + +DROP TABLE t1; \ No newline at end of file