diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-05-21 15:23:48 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-05-21 15:23:48 +0400 |
commit | 779e2a968632a5e73c660307892ca6a868399dfc (patch) | |
tree | 393cb5d35a1dc953f8e9fee7b6c06737b675ba9c /mysql-test | |
parent | f512cb4eaf0fbbf8cfa0444189da94f0215d8c5c (diff) | |
download | mariadb-git-779e2a968632a5e73c660307892ca6a868399dfc.tar.gz |
Bug #42064: low memory crash when importing hex strings, in
Item_hex_string::Item_hex_string
The status of memory allocation in the Lex_input_stream (called
from the Parser_state constructor) was not checked which led to
a parser crash in case of the out-of-memory error.
The solution is to introduce new init() member function in
Parser_state and Lex_input_stream so that status of memory
allocation can be returned to the caller.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/error_simulation.result | 9 | ||||
-rw-r--r-- | mysql-test/t/error_simulation.test | 14 |
2 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result index 27e51a33112..fc58687cc86 100644 --- a/mysql-test/r/error_simulation.result +++ b/mysql-test/r/error_simulation.result @@ -39,5 +39,14 @@ a 2 DROP TABLE t1; # +# Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string +# +CREATE TABLE t1(a BLOB); +SET SESSION debug="+d,bug42064_simulate_oom"; +INSERT INTO t1 VALUES(""); +Got one of the listed errors +SET SESSION debug=DEFAULT; +DROP TABLE t1; +# # End of 5.1 tests # diff --git a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test index 7cd16a6bc5a..7a48a2e3231 100644 --- a/mysql-test/t/error_simulation.test +++ b/mysql-test/t/error_simulation.test @@ -47,5 +47,19 @@ DROP TABLE t1; --echo # +--echo # Bug#42064: low memory crash when importing hex strings, in Item_hex_string::Item_hex_string +--echo # + +CREATE TABLE t1(a BLOB); + +SET SESSION debug="+d,bug42064_simulate_oom"; +# May fail with either ER_OUT_OF_RESOURCES or EE_OUTOFMEMORY +--error ER_OUT_OF_RESOURCES, 5 +INSERT INTO t1 VALUES(""); +SET SESSION debug=DEFAULT; + +DROP TABLE t1; + +--echo # --echo # End of 5.1 tests --echo # |