Commit ba33d475 authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: type_year test formatting

parent 589479b3
drop table if exists t1;
create table t1 (y year,y2 year(2)); create table t1 (y year,y2 year(2));
Warnings: Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
...@@ -28,6 +27,9 @@ y y2 ...@@ -28,6 +27,9 @@ y y2
2001 01 2001 01
2069 69 2069 69
drop table t1; drop table t1;
#
# Bug 2335
#
create table t1 (y year); create table t1 (y year);
insert ignore into t1 values (now()); insert ignore into t1 values (now());
Warnings: Warnings:
...@@ -36,6 +38,9 @@ select if(y = now(), 1, 0) from t1; ...@@ -36,6 +38,9 @@ select if(y = now(), 1, 0) from t1;
if(y = now(), 1, 0) if(y = now(), 1, 0)
1 1
drop table t1; drop table t1;
#
# Bug #27176: Assigning a string to an year column has unexpected results
#
create table t1(a year); create table t1(a year);
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3'); insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
Warnings: Warnings:
...@@ -47,7 +52,9 @@ a ...@@ -47,7 +52,9 @@ a
2001 2001
2001 2001
drop table t1; drop table t1;
End of 5.0 tests #
# End of 5.0 tests
#
# #
# Bug #49480: WHERE using YEAR columns returns unexpected results # Bug #49480: WHERE using YEAR columns returns unexpected results
# #
...@@ -373,7 +380,8 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas ...@@ -373,7 +380,8 @@ Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Pleas
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE t1; DROP TABLE t1;
# #
End of 5.1 tests # End of 5.1 tests
#
create function y2k() returns int deterministic return 2000; create function y2k() returns int deterministic return 2000;
create table t1 (a year(2), b int); create table t1 (a year(2), b int);
Warnings: Warnings:
...@@ -456,9 +464,6 @@ DROP TABLE t1; ...@@ -456,9 +464,6 @@ DROP TABLE t1;
# End of 10.1 tests # End of 10.1 tests
# #
# #
# Start of 10.2 tests
#
#
# MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings
# #
CREATE TABLE t1 (a YEAR); CREATE TABLE t1 (a YEAR);
......
# #
# Test year # Test year
# #
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (y year,y2 year(2)); create table t1 (y year,y2 year(2));
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69); insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
...@@ -12,24 +9,27 @@ select * from t1 order by y; ...@@ -12,24 +9,27 @@ select * from t1 order by y;
select * from t1 order by y2; select * from t1 order by y2;
drop table t1; drop table t1;
# --echo #
# Bug 2335 --echo # Bug 2335
# --echo #
create table t1 (y year); create table t1 (y year);
insert ignore into t1 values (now()); insert ignore into t1 values (now());
select if(y = now(), 1, 0) from t1; select if(y = now(), 1, 0) from t1;
drop table t1; drop table t1;
# --echo #
# Bug #27176: Assigning a string to an year column has unexpected results --echo # Bug #27176: Assigning a string to an year column has unexpected results
# --echo #
create table t1(a year); create table t1(a year);
insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3'); insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
select * from t1; select * from t1;
drop table t1; drop table t1;
--echo End of 5.0 tests --echo #
--echo # End of 5.0 tests
--echo #
--echo # --echo #
--echo # Bug #49480: WHERE using YEAR columns returns unexpected results --echo # Bug #49480: WHERE using YEAR columns returns unexpected results
...@@ -168,9 +168,10 @@ CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4)); ...@@ -168,9 +168,10 @@ CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2); ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # End of 5.1 tests
--echo # --echo #
--echo End of 5.1 tests
# #
# fun with convert_const_to_int # fun with convert_const_to_int
# in some cases 00 is equal to 2000, in others it is not. # in some cases 00 is equal to 2000, in others it is not.
...@@ -229,10 +230,6 @@ DROP TABLE t1; ...@@ -229,10 +230,6 @@ DROP TABLE t1;
--echo # End of 10.1 tests --echo # End of 10.1 tests
--echo # --echo #
--echo #
--echo # Start of 10.2 tests
--echo #
--echo # --echo #
--echo # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings --echo # MDEV-9392 Copying from DECIMAL to YEAR is not consistent about warnings
--echo # --echo #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment