Commit a00b3849 authored by Sergei Golubchik's avatar Sergei Golubchik

remove remnants of safemalloc and

very old halloca() support
parent 274e06a5
...@@ -39,11 +39,6 @@ extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count, ...@@ -39,11 +39,6 @@ extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,
myf myFlags); myf myFlags);
extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count); extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count);
#if defined(USE_HALLOC)
#define my_malloc(a,b) halloc(a,1)
#define my_no_flags_free(a) hfree(a)
#endif
#endif /* __MY_NOSYS__ */ #endif /* __MY_NOSYS__ */
#ifdef __cplusplus #ifdef __cplusplus
......
#
# Bug #46080: group_concat(... order by) crashes server when
# sort_buffer_size cannot allocate
#
call mtr.add_suppression("Out of memory at line .*, '.*my_alloc.c'");
call mtr.add_suppression("needed .* byte (.*k)., memory in use: .* bytes (.*k)");
CREATE TABLE t1(a CHAR(255));
INSERT INTO t1 VALUES ('a');
SET @@SESSION.sort_buffer_size=5*16*1000000;
SET @@SESSION.max_heap_table_size=5*1000000;
Warnings:
Warning 1292 Truncated incorrect max_heap_table_size value: '5000000'
# Must not crash.
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
DROP TABLE t1;
SET @@SESSION.sort_buffer_size=default;
SET @@SESSION.max_heap_table_size=default;
End of 5.0 tests
...@@ -257,8 +257,6 @@ update t1 set s1=2 where seq=1; ...@@ -257,8 +257,6 @@ update t1 set s1=2 where seq=1;
check table t1 extended; check table t1 extended;
drop table t1; drop table t1;
# Fix if we are using safemalloc
--replace_result 8388572 8388600
select lower(variable_name) as Variable_name, Variable_value as Value from information_schema.session_variables where variable_name like "aria%" and variable_name not like "aria_used_for_temp_tables" order by 1; select lower(variable_name) as Variable_name, Variable_value as Value from information_schema.session_variables where variable_name like "aria%" and variable_name not like "aria_used_for_temp_tables" order by 1;
--replace_column 2 # --replace_column 2 #
show status like 'aria%'; show status like 'aria%';
......
--loose-performance-schema=0 --skip-grant-tables --skip-name-resolve --loose-aria-pagecache-buffer-size=1M
--echo #
--echo # Bug #46080: group_concat(... order by) crashes server when
--echo # sort_buffer_size cannot allocate
--echo #
--source include/have_debug.inc
call mtr.add_suppression("Out of memory at line .*, '.*my_alloc.c'");
call mtr.add_suppression("needed .* byte (.*k)., memory in use: .* bytes (.*k)");
CREATE TABLE t1(a CHAR(255));
INSERT INTO t1 VALUES ('a');
SET @@SESSION.sort_buffer_size=5*16*1000000;
SET @@SESSION.max_heap_table_size=5*1000000;
--echo # Must not crash.
--disable_result_log
--error 0,5
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
--enable_result_log
DROP TABLE t1;
SET @@SESSION.sort_buffer_size=default;
SET @@SESSION.max_heap_table_size=default;
--echo End of 5.0 tests
...@@ -81,23 +81,6 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags) ...@@ -81,23 +81,6 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags)
DBUG_ASSERT(size > 0); DBUG_ASSERT(size > 0);
if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
DBUG_RETURN(my_malloc(size, my_flags)); DBUG_RETURN(my_malloc(size, my_flags));
#ifdef USE_HALLOC
if (!(point = malloc(size)))
{
if (my_flags & MY_FREE_ON_ERROR)
my_free(oldpoint);
if (my_flags & MY_HOLD_ON_ERROR)
DBUG_RETURN(oldpoint);
my_errno=errno;
if (my_flags & MY_FAE+MY_WME)
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size);
}
else
{
memcpy(point,oldpoint,size);
free(oldpoint);
}
#else
if ((point= realloc(oldpoint, size)) == NULL) if ((point= realloc(oldpoint, size)) == NULL)
{ {
if (my_flags & MY_FREE_ON_ERROR) if (my_flags & MY_FREE_ON_ERROR)
...@@ -108,7 +91,6 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags) ...@@ -108,7 +91,6 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags)
if (my_flags & (MY_FAE+MY_WME)) if (my_flags & (MY_FAE+MY_WME))
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size);
} }
#endif
DBUG_PRINT("exit",("ptr: %p", point)); DBUG_PRINT("exit",("ptr: %p", point));
DBUG_RETURN(point); DBUG_RETURN(point);
} }
......
...@@ -202,7 +202,7 @@ enum options_mc { ...@@ -202,7 +202,7 @@ enum options_mc {
OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN, OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN,
OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE, OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE,
OPT_MAX_RECORD_LENGTH, OPT_AUTO_CLOSE, OPT_STATS_METHOD, OPT_TRANSACTION_LOG, OPT_MAX_RECORD_LENGTH, OPT_AUTO_CLOSE, OPT_STATS_METHOD, OPT_TRANSACTION_LOG,
OPT_SKIP_SAFEMALLOC, OPT_ZEROFILL_KEEP_LSN, OPT_REQUIRE_CONTROL_FILE, OPT_ZEROFILL_KEEP_LSN, OPT_REQUIRE_CONTROL_FILE,
OPT_LOG_DIR, OPT_DATADIR, OPT_WARNING_FOR_WRONG_TRANSID OPT_LOG_DIR, OPT_DATADIR, OPT_WARNING_FOR_WRONG_TRANSID
}; };
...@@ -322,13 +322,6 @@ static struct my_option my_long_options[] = ...@@ -322,13 +322,6 @@ static struct my_option my_long_options[] =
{"silent", 's', {"silent", 's',
"Only print errors. One can use two -s to make aria_chk very silent.", "Only print errors. One can use two -s to make aria_chk very silent.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
#ifdef SAFEMALLOC
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
#endif
#endif
{"sort-index", 'S', {"sort-index", 'S',
"Sort index blocks. This speeds up 'read-next' in applications.", "Sort index blocks. This speeds up 'read-next' in applications.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
...@@ -774,11 +767,6 @@ get_one_option(int optid, ...@@ -774,11 +767,6 @@ get_one_option(int optid,
DBUG_SET_INITIAL(argument ? argument : "d:t:o,/tmp/aria_chk.trace"); DBUG_SET_INITIAL(argument ? argument : "d:t:o,/tmp/aria_chk.trace");
opt_debug= 1; opt_debug= 1;
break; break;
case OPT_SKIP_SAFEMALLOC:
#ifdef SAFEMALLOC
sf_malloc_quick=1;
#endif
break;
case 'V': case 'V':
print_version(); print_version();
exit(0); exit(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment