> c:\dbs\5.5\bin\mysql -uroot --port=3550 -p --local_infile=1 --prompt="mysql 5.5 > " Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.5.61 Source distribution 2018-MAR-08 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.5 > CREATE DATABASE m; Query OK, 1 row affected (0.01 sec) mysql 5.5 > USE m Database changed mysql 5.5 > CREATE TABLE `select_tab` (`pk` bigint(11) NOT NULL AUTO_INCREMENT,`year_test` year(4) DEFAULT NULL,PRIMARY KEY (`pk`), KEY `index_year_test` (`year_test`) -> ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=gbk ROW_FORMAT=DYNAMIC; Query OK, 0 rows affected, 2 warnings (0.02 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(1,2014); Query OK, 1 row affected (0.00 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(2,2014); Query OK, 1 row affected (0.00 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(3,2014); Query OK, 1 row affected (0.00 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(4,2014); Query OK, 1 row affected (0.01 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(5,2014); Query OK, 1 row affected (0.01 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(6,2014); Query OK, 1 row affected (0.00 sec) mysql 5.5 > select count(*) FROM select_tab where 31 between 31 AND (year_test) ; +----------+ | count(*) | +----------+ | 6 | +----------+ 1 row in set (0.01 sec) mysql 5.5 > insert into select_tab (pk , year_test) values(7,2014); Query OK, 1 row affected (0.01 sec) mysql 5.5 > select count(*) FROM select_tab where 31 between 31 AND (year_test); +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) mysql 5.5 > **************************************************************************************** > c:\dbs\5.6\bin\mysql -uroot --local-infile --port=3560 -p --prompt="mysql 5.6 > " Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.6.41-log Source distribution 2018-MAR-08 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.6 > CREATE DATABASE m; Query OK, 1 row affected (0.01 sec) mysql 5.6 > USE m Database changed mysql 5.6 > CREATE TABLE `select_tab` (`pk` bigint(11) NOT NULL AUTO_INCREMENT,`year_test` year(4) DEFAULT NULL,PRIMARY KEY (`pk`), KEY `index_year _test` (`year_test`) -> ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=gbk ROW_FORMAT=DYNAMIC; Query OK, 0 rows affected, 2 warnings (0.05 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(1,2014); Query OK, 1 row affected (0.01 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(2,2014); Query OK, 1 row affected (0.00 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(3,2014); Query OK, 1 row affected (0.00 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(4,2014); Query OK, 1 row affected (0.00 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(5,2014); Query OK, 1 row affected (0.01 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(6,2014); Query OK, 1 row affected (0.00 sec) mysql 5.6 > select count(*) FROM select_tab where 31 between 31 AND (year_test) ; +----------+ | count(*) | +----------+ | 6 | +----------+ 1 row in set (0.01 sec) mysql 5.6 > insert into select_tab (pk , year_test) values(7,2014); Query OK, 1 row affected (0.00 sec) mysql 5.6 > select count(*) FROM select_tab where 31 between 31 AND (year_test); +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) **************************************************************************************** > c:\dbs\5.7\bin\mysql -uroot --port=3570 -p --local-infile --prompt="mysql 5.7 > " Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.23-log Source distribution 2018-MAR-08 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.7 > CREATE DATABASE m; ERROR 1007 (HY000): Can't create database 'm'; database exists mysql 5.7 > USE m Database changed mysql 5.7 > CREATE TABLE `select_tab` (`pk` bigint(11) NOT NULL AUTO_INCREMENT,`year_test` year(4) DEFAULT NULL,PRIMARY KEY (`pk`), KEY `index_year_test` (`year_test`) -> ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=gbk ROW_FORMAT=DYNAMIC; Query OK, 0 rows affected (0.07 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(1,2014); Query OK, 1 row affected (0.01 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(2,2014); Query OK, 1 row affected (0.00 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(3,2014); Query OK, 1 row affected (0.00 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(4,2014); Query OK, 1 row affected (0.00 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(5,2014); Query OK, 1 row affected (0.01 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(6,2014); Query OK, 1 row affected (0.01 sec) mysql 5.7 > select count(*) FROM select_tab where 31 between 31 AND (year_test) ; +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.01 sec) mysql 5.7 > insert into select_tab (pk , year_test) values(7,2014); Query OK, 1 row affected (0.01 sec) mysql 5.7 > select count(*) FROM select_tab where 31 between 31 AND (year_test); +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) mysql 5.7 > **************************************************************************************** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.6 Source distribution 2018-MAR-08 Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 8.0 > CREATE DATABASE m; mysql 8.0 > USE m Database changed mysql 8.0 > CREATE TABLE `select_tab` (`pk` bigint(11) NOT NULL AUTO_INCREMENT,`year_test` year(4) DEFAULT NULL,PRIMARY KEY (`pk`), KEY `index_year_test` (`year_test`) -> ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=gbk ROW_FORMAT=DYNAMIC; Query OK, 0 rows affected (1.47 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(1,2014); Query OK, 1 row affected (0.26 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(2,2014); Query OK, 1 row affected (0.20 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(3,2014); Query OK, 1 row affected (0.23 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(4,2014); Query OK, 1 row affected (0.20 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(5,2014); Query OK, 1 row affected (0.21 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(6,2014); Query OK, 1 row affected (0.21 sec) mysql 8.0 > select count(*) FROM select_tab where 31 between 31 AND (year_test) ; +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) mysql 8.0 > insert into select_tab (pk , year_test) values(7,2014); Query OK, 1 row affected (0.21 sec) mysql 8.0 > select count(*) FROM select_tab where 31 between 31 AND (year_test); +----------+ | count(*) | +----------+ | 0 | +----------+ 1 row in set (0.00 sec) mysql 8.0 >