summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <ramil/ram@ramil.myoffice.izhnet.ru>2007-03-29 09:38:46 +0500
committerunknown <ramil/ram@ramil.myoffice.izhnet.ru>2007-03-29 09:38:46 +0500
commit77924c56e01f060f628e7bcf9265d89b667d5882 (patch)
treeabad879904dff40d4b3c38b77d9a16805f8d0522 /mysql-test/t
parent7cdd99c129e4b206b7bf63fc8f1ed455a1f20d84 (diff)
parent86010101e294559d83d0c99def8160eddcf4ce55 (diff)
downloadmariadb-git-77924c56e01f060f628e7bcf9265d89b667d5882.tar.gz
Merge mysql.com:/home/ram/work/b26359/b26359.5.0
into mysql.com:/home/ram/work/b26359/b26359.5.1 mysql-test/r/strict.result: Auto merged mysql-test/t/strict.test: Auto merged mysql-test/r/type_date.result: merging sql/field.cc: merging sql/field.h: merging
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/strict.test50
-rw-r--r--mysql-test/t/type_year.test10
2 files changed, 59 insertions, 1 deletions
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 402208d02cc..3ff84c35f16 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -1200,3 +1200,53 @@ create table t1 (i int)
comment '123456789*123456789*123456789*123456789*123456789*123456789*';
show create table t1;
drop table t1;
+
+#
+# Bug #26359: Strings becoming truncated and converted to numbers under STRICT mode
+#
+set sql_mode= 'traditional';
+create table t1(col1 tinyint, col2 tinyint unsigned,
+ col3 smallint, col4 smallint unsigned,
+ col5 mediumint, col6 mediumint unsigned,
+ col7 int, col8 int unsigned,
+ col9 bigint, col10 bigint unsigned);
+--error 1366
+insert into t1(col1) values('-');
+--error 1366
+insert into t1(col2) values('+');
+--error 1366
+insert into t1(col3) values('-');
+--error 1366
+insert into t1(col4) values('+');
+--error 1366
+insert into t1(col5) values('-');
+--error 1366
+insert into t1(col6) values('+');
+--error 1366
+insert into t1(col7) values('-');
+--error 1366
+insert into t1(col8) values('+');
+--error 1366
+insert into t1(col9) values('-');
+--error 1366
+insert into t1(col10) values('+');
+drop table t1;
+
+#
+# Bug #27176: Assigning a string to an year column has unexpected results
+#
+set sql_mode='traditional';
+create table t1(a year);
+--error 1366
+insert into t1 values ('-');
+--error 1366
+insert into t1 values ('+');
+--error 1366
+insert into t1 values ('');
+--error 1265
+insert into t1 values ('2000a');
+--error 1265
+insert into t1 values ('2E3x');
+drop table t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index 9744da24c02..0e174a556d6 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -21,4 +21,12 @@ insert into t1 values (now());
select if(y = now(), 1, 0) from t1;
drop table t1;
-# End of 4.1 tests
+#
+# Bug #27176: Assigning a string to an year column has unexpected results
+#
+create table t1(a year);
+insert into t1 values (2000.5), ('2000.5'), ('2001a'), ('2.001E3');
+select * from t1;
+drop table t1;
+
+--echo End of 5.0 tests