summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorramil/ram@mysql.com/myoffice.izhnet.ru <>2006-12-06 16:32:12 +0400
committerramil/ram@mysql.com/myoffice.izhnet.ru <>2006-12-06 16:32:12 +0400
commit0b5696b82b8c60ebdb70fd267f32479d0bb96ab5 (patch)
tree62042f84389ad435847995118b308b36d661ab43 /mysql-test
parentd4595f3c57ae97e9251ee3b1680ad9fd6ddb218f (diff)
downloadmariadb-git-0b5696b82b8c60ebdb70fd267f32479d0bb96ab5.tar.gz
Fix for bug #22533: Traditional: Too-long bit value not rejected.
Problem: storing >=8 byte hexadecimal values we don't check data. Fix: check if the data fits the {u}longlong range.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/select.result17
-rw-r--r--mysql-test/t/range.test4
-rw-r--r--mysql-test/t/select.test13
3 files changed, 31 insertions, 3 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index f09143fcaa6..6dc971a953c 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2819,3 +2819,20 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
0.37619999051094
DROP TABLE t1,t2;
+create table t1(a bigint unsigned, b bigint);
+insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
+(0x10000000000000000, 0x10000000000000000),
+(0x8fffffffffffffff, 0x8fffffffffffffff);
+Warnings:
+Warning 1264 Data truncated; out of range for column 'a' at row 1
+Warning 1264 Data truncated; out of range for column 'b' at row 1
+Warning 1264 Data truncated; out of range for column 'a' at row 2
+Warning 1264 Data truncated; out of range for column 'b' at row 2
+Warning 1264 Data truncated; out of range for column 'b' at row 3
+select hex(a), hex(b) from t1;
+hex(a) hex(b)
+FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
+FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
+8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
+drop table t1;
+End of 4.1 tests
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 245178d7d4a..6d3b2fb52ee 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -400,8 +400,8 @@ select count(*) from t1 where x = 18446744073709551601;
create table t2 (x bigint not null);
-insert into t2(x) values (0xfffffffffffffff0);
-insert into t2(x) values (0xfffffffffffffff1);
+insert into t2(x) values (-16);
+insert into t2(x) values (-15);
select * from t2;
select count(*) from t2 where x>0;
select count(*) from t2 where x=0;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 3f9fb59d26f..0dc179e9b4b 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2342,4 +2342,15 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
DROP TABLE t1,t2;
--enable_ps_protocol
-# End of 4.1 tests
+#
+# Bug #22533: storing large hex strings
+#
+
+create table t1(a bigint unsigned, b bigint);
+insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
+ (0x10000000000000000, 0x10000000000000000),
+ (0x8fffffffffffffff, 0x8fffffffffffffff);
+select hex(a), hex(b) from t1;
+drop table t1;
+
+--echo End of 4.1 tests