diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-06-27 20:56:41 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-06-27 20:56:41 +0500 |
commit | b83b4697d229c78d85954b219cfed5caf428b20e (patch) | |
tree | 4583c35b2f4ba5f73996dc2dde6b0bccfe9c80e5 /mysql-test/r/varbinary.result | |
parent | 49417ad7c8e45792f5baafb9514b10684daba527 (diff) | |
download | mariadb-git-b83b4697d229c78d85954b219cfed5caf428b20e.tar.gz |
backport 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.result | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/varbinary.result b/mysql-test/r/varbinary.result index a41885a257d..f584c22f98a 100644 --- a/mysql-test/r/varbinary.result +++ b/mysql-test/r/varbinary.result @@ -78,3 +78,34 @@ alter table t1 modify a varchar(255); select length(a) from t1; length(a) 6 +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' |