summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/varbinary.result31
-rw-r--r--mysql-test/t/varbinary.test28
2 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result
index 6d39d8301c5..271d7a0fe8d 100644
--- a/mysql-test/r/varbinary.result
+++ b/mysql-test/r/varbinary.result
@@ -95,3 +95,34 @@ table_28127_b CREATE TABLE `table_28127_b` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table table_28127_a;
drop table table_28127_b;
+select 0b01000001;
+0b01000001
+A
+select 0x41;
+0x41
+A
+select b'01000001';
+b'01000001'
+A
+select x'41', 0+x'41';
+x'41' 0+x'41'
+A 65
+select N'abc', length(N'abc');
+abc length(N'abc')
+abc 3
+select N'', length(N'');
+ length(N'')
+ 0
+select '', length('');
+ length('')
+ 0
+select b'', 0+b'';
+b'' 0+b''
+ 0
+select x'', 0+x'';
+x'' 0+x''
+ 0
+select 0x;
+ERROR 42S22: Unknown column '0x' in 'field list'
+select 0b;
+ERROR 42S22: Unknown column '0b' in 'field list'
diff --git a/mysql-test/t/varbinary.test b/mysql-test/t/varbinary.test
index 9ccbac7cdda..1db561183a7 100644
--- a/mysql-test/t/varbinary.test
+++ b/mysql-test/t/varbinary.test
@@ -104,3 +104,31 @@ show create table table_28127_b;
drop table table_28127_a;
drop table table_28127_b;
+#
+# Bug#35658 (An empty binary value leads to mysqld crash)
+#
+
+select 0b01000001;
+
+select 0x41;
+
+select b'01000001';
+
+select x'41', 0+x'41';
+
+select N'abc', length(N'abc');
+
+select N'', length(N'');
+
+select '', length('');
+
+select b'', 0+b'';
+
+select x'', 0+x'';
+
+--error ER_BAD_FIELD_ERROR
+select 0x;
+
+--error ER_BAD_FIELD_ERROR
+select 0b;
+