summaryrefslogtreecommitdiff
path: root/mysql-test/r/varbinary.result
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2008-06-27 15:23:40 +0500
committerGleb Shchepa <gshchepa@mysql.com>2008-06-27 15:23:40 +0500
commitcb72f09cfaa0c2c4b782e3e0fd86791f58f36b4f (patch)
treeedd619529fdbfc8d4564df803572d87d1ca2fe8d /mysql-test/r/varbinary.result
parente72132a5b0c878cf242e9db6158b4e0c8371a586 (diff)
downloadmariadb-git-cb72f09cfaa0c2c4b782e3e0fd86791f58f36b4f.tar.gz
backport to 5.1 from 6.0
Bug#35658 (An empty binary value leads to mysqld crash) Before this fix, the following token b'' caused the parser to crash when reading the binary value from the empty string. The crash was caused by: ptr+= max_length - 1; because max_length is unsigned and was 0, causing an overflow. With this fix, an empty binary literal b'' is parsed as a binary value 0, in Item_bin_string. mysql-test/r/varbinary.result: Bug#35658 (An empty binary value leads to mysqld crash) mysql-test/t/varbinary.test: Bug#35658 (An empty binary value leads to mysqld crash) sql/item.cc: Bug#35658 (An empty binary value leads to mysqld crash)
Diffstat (limited to 'mysql-test/r/varbinary.result')
-rw-r--r--mysql-test/r/varbinary.result31
1 files changed, 31 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'