mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Removed some warnings reported by valgrind
After merge fixes. Now code compiles, but there is still some valgrind warnings that needs to be fixed myisam/mi_rnext_same.c: handle case where rtree_find_next() returns an error (assume this means that there was no more keys) myisam/rt_index.c: Code cleanup mysql-test/r/func_crypt.result: Update results mysql-test/r/func_group.result: Update results mysql-test/r/null_key.result: Update results mysql-test/r/order_by.result: Update results mysql-test/r/query_cache.result: Update results mysql-test/r/range.result: Update results mysql-test/r/rpl_trunc_binlog.result: Update results mysql-test/t/fulltext.test: Fix error numbers mysql-test/t/func_crypt.test: Fixed test for 4.1 mysql-test/t/range.test: Moved tests to be in sync with 4.0 mysys/test_charset.c: Removed acccess to non existing functions sql-common/client.c: Merge fix sql/item_strfunc.cc: Simple code cleanup Don't call ->c_ptr() when you don't need a 0 terminated string (Causes warnings from valgrind) sql/log_event.cc: After merge fixes sql/protocol.cc: Change default catalog name to 'def' sql/spatial.cc: Code cleanup sql/sql_class.cc: After merge fixes sql/time.cc: Ensure that time object is cleared on error sql/unireg.cc: Removed warning reported by valgrind
This commit is contained in:
@ -2645,46 +2645,46 @@ String *Item_func_compress::val_str(String *str)
|
||||
}
|
||||
|
||||
buffer.length((uint32)new_size + 4);
|
||||
|
||||
return &buffer;
|
||||
}
|
||||
|
||||
|
||||
String *Item_func_uncompress::val_str(String *str)
|
||||
{
|
||||
String *res= args[0]->val_str(str);
|
||||
if (!res)
|
||||
{
|
||||
null_value= 1;
|
||||
return 0;
|
||||
}
|
||||
if (res->is_empty()) return res;
|
||||
|
||||
ulong new_size= uint4korr(res->c_ptr()) & 0x3FFFFFFF;
|
||||
int err= Z_OK;
|
||||
ulong new_size;
|
||||
int err;
|
||||
uint code;
|
||||
|
||||
if (!res)
|
||||
goto err;
|
||||
if (res->is_empty())
|
||||
return res;
|
||||
|
||||
new_size= uint4korr(res->ptr()) & 0x3FFFFFFF;
|
||||
if (new_size > current_thd->variables.max_allowed_packet)
|
||||
{
|
||||
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
||||
ER_TOO_BIG_FOR_UNCOMPRESS,
|
||||
ER(ER_TOO_BIG_FOR_UNCOMPRESS),
|
||||
current_thd->variables.max_allowed_packet);
|
||||
null_value= 0;
|
||||
return 0;
|
||||
goto err;
|
||||
}
|
||||
if (buffer.realloc((uint32)new_size))
|
||||
goto err;
|
||||
|
||||
buffer.realloc((uint32)new_size);
|
||||
|
||||
if ((err= uncompress((Byte*)buffer.c_ptr(), &new_size,
|
||||
((const Bytef*)res->c_ptr())+4,res->length())) == Z_OK)
|
||||
if ((err= uncompress((Byte*)buffer.ptr(), &new_size,
|
||||
((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
|
||||
{
|
||||
buffer.length((uint32)new_size);
|
||||
buffer.length((uint32) new_size);
|
||||
return &buffer;
|
||||
}
|
||||
|
||||
code= err==Z_BUF_ERROR ? ER_ZLIB_Z_BUF_ERROR :
|
||||
err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_DATA_ERROR;
|
||||
code= ((err == Z_BUF_ERROR) ? ER_ZLIB_Z_BUF_ERROR :
|
||||
((err == Z_MEM_ERROR) ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_DATA_ERROR));
|
||||
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
|
||||
|
||||
err:
|
||||
null_value= 1;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user