List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:October 27 2008 3:09pm
Subject:bzr commit into mysql-6.0-falcon-team branch (cpowers:2883)
View as plain text  
#At file:///home/cpowers/work/dev/base-10/mysql/

 2883 Christopher Powers	2008-10-27 [merge]
      merge
added:
  mysql-test/suite/falcon/r/falcon_bug_39342.result
  mysql-test/suite/falcon/r/falcon_year_4digit.result
  mysql-test/suite/falcon/t/falcon_bug_39342.test
  mysql-test/suite/falcon/t/falcon_year_4digit.test
modified:
  storage/falcon/TransactionManager.cpp
  storage/falcon/ha_falcon.cpp

=== added file 'mysql-test/suite/falcon/r/falcon_bug_39342.result'
--- a/mysql-test/suite/falcon/r/falcon_bug_39342.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/r/falcon_bug_39342.result	2008-10-21 08:57:35 +0000
@@ -0,0 +1,31 @@
+*** Bug #39342 ***
+SET @@storage_engine = 'Falcon';
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a_int INT, b_year YEAR) Engine = 'falcon';
+INSERT INTO t1 values
+(1989, 1989), (1990, 1990), (1991, 1991), (1992, 1992), 
+(1993, 1993), (1994, 1994), (1995, 1995), (1996, 1996), 
+(1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000);
+ALTER TABLE t1 ADD INDEX index_year (b_year);
+SELECT * FROM t1 WHERE b_year < 1992 ORDER BY b_year ASC;
+a_int	b_year
+1989	1989
+1990	1990
+1991	1991
+SELECT * FROM t1 WHERE b_year > 1992 ORDER BY b_year ASC;
+a_int	b_year
+1993	1993
+1994	1994
+1995	1995
+1996	1996
+1997	1997
+1998	1998
+1999	1999
+2000	2000
+SELECT * FROM t1 WHERE b_year = 1992 ORDER BY b_year ASC;
+a_int	b_year
+1992	1992
+SELECT count(*) FROM t1;
+count(*)
+12
+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-26 07:59:06 +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_bug_39342.test'
--- a/mysql-test/suite/falcon/t/falcon_bug_39342.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/falcon/t/falcon_bug_39342.test	2008-10-21 08:57:35 +0000
@@ -0,0 +1,44 @@
+--source include/have_falcon.inc
+
+#
+# Bug #39342: YEAR '=' comparison fails when index is present
+#
+--echo *** Bug #39342 ***
+
+# ----------------------------------------------------- #
+# --- Initialisation                                --- #
+# ----------------------------------------------------- #
+let $engine = 'Falcon';
+eval SET @@storage_engine = $engine;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+# ----------------------------------------------------- #
+# --- Test                                          --- #
+# ----------------------------------------------------- #
+
+# Four digit YEAR column (default)
+CREATE TABLE t1 (a_int INT, b_year YEAR) Engine = 'falcon';
+
+INSERT INTO t1 values
+(1989, 1989), (1990, 1990), (1991, 1991), (1992, 1992), 
+(1993, 1993), (1994, 1994), (1995, 1995), (1996, 1996), 
+(1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000);
+
+ALTER TABLE t1 ADD INDEX index_year (b_year);
+
+SELECT * FROM t1 WHERE b_year < 1992 ORDER BY b_year ASC;
+SELECT * FROM t1 WHERE b_year > 1992 ORDER BY b_year ASC;
+SELECT * FROM t1 WHERE b_year = 1992 ORDER BY b_year ASC;
+
+# ----------------------------------------------------- #
+# --- Check                                         --- #
+# ----------------------------------------------------- #
+SELECT count(*) FROM t1;
+
+# ----------------------------------------------------- #
+# --- 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-26 08:45:22 +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;

=== modified file 'storage/falcon/TransactionManager.cpp'
--- a/storage/falcon/TransactionManager.cpp	2008-10-16 02:53:35 +0000
+++ b/storage/falcon/TransactionManager.cpp	2008-10-24 10:20:10 +0000
@@ -118,9 +118,23 @@ Transaction* TransactionManager::startTr
 		if (transaction->state == Available && transaction->dependencies == 0)
 			if (COMPARE_EXCHANGE(&transaction->state, Available, Initializing))
 				{
-				transaction->initialize(connection, INTERLOCKED_INCREMENT(transactionSequence));
+				// Check again that the dependencies are zero. The transaction
+				// object might have been re-use between the previous if-test
+				// and the actual change of state
+
+				if (transaction->dependencies != 0)
+					{
+					// Return the transaction object back to the list
+
+					transaction->state = Available;
+					}
+				else
+					{
+					ASSERT(transaction->dependencies == 0);
+					transaction->initialize(connection, INTERLOCKED_INCREMENT(transactionSequence));
 
-				return transaction;
+					return transaction;
+					}
 				}
 
 	sync.unlock();

=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp	2008-10-24 00:12:20 +0000
+++ b/storage/falcon/ha_falcon.cpp	2008-10-26 08:45:22 +0000
@@ -2676,7 +2676,6 @@ void StorageInterface::encodeRecord(ucha
 				case MYSQL_TYPE_INT24:
 				case MYSQL_TYPE_LONG:
 				case MYSQL_TYPE_LONGLONG:
-				case MYSQL_TYPE_YEAR:
 				case MYSQL_TYPE_DECIMAL:
 				case MYSQL_TYPE_ENUM:
 				case MYSQL_TYPE_SET:
@@ -2684,6 +2683,12 @@ void StorageInterface::encodeRecord(ucha
 					dataStream->encodeInt64(field->val_int());
 					break;
 
+				case MYSQL_TYPE_YEAR:
+					// Have to use the ptr directly to get the same number for
+					// both two and four digit YEAR
+					dataStream->encodeInt64((int) field->ptr[0]);
+					break;
+
 				case MYSQL_TYPE_NEWDECIMAL:
 					{
 					int precision = ((Field_new_decimal *)field)->precision;
@@ -2852,7 +2857,6 @@ void StorageInterface::decodeRecord(ucha
 				case MYSQL_TYPE_INT24:
 				case MYSQL_TYPE_LONG:
 				case MYSQL_TYPE_LONGLONG:
-				case MYSQL_TYPE_YEAR:
 				case MYSQL_TYPE_DECIMAL:
 				case MYSQL_TYPE_ENUM:
 				case MYSQL_TYPE_SET:
@@ -2861,6 +2865,12 @@ void StorageInterface::decodeRecord(ucha
 								((Field_num*)field)->unsigned_flag);
 					break;
 
+				case MYSQL_TYPE_YEAR:
+					// Must add 1900 to give Field_year::store the value it
+					// expects. See also case 'MYSQL_TYPE_YEAR' in encodeRecord()
+					field->store(dataStream->getInt64() + 1900, ((Field_num*)field)->unsigned_flag);
+					break;
+
 				case MYSQL_TYPE_NEWDECIMAL:
 					{
 					int precision = ((Field_new_decimal*) field)->precision;

Thread
bzr commit into mysql-6.0-falcon-team branch (cpowers:2883) Christopher Powers27 Oct