Skip to content

Commit 4cbe91f

Browse files
committed
Bug#15878828: REMOVE OLD/UNUSED DEFINES
This patch removes usage of the following #ifdefs __alpha__ __amiga__ USE_HALLOC TO_BE_REMOVED NOT_YET_IMPLEMENTED WILL_BE_DELETED_LATER TO_BE_DONE_LATER_IN_4_1 CANT_BE_USED_AS_MEMORY_IS_FREED I_AM_PARANOID DONT_ALLOW_USER_CHANGE DONT_USE_MYSQL_PWD
1 parent bca831e commit 4cbe91f

26 files changed

+4
-195
lines changed

client/mysql.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1739,10 +1739,8 @@ static struct my_option my_long_options[] =
17391739
"Does not work in batch mode. Disable with --disable-tee. "
17401740
"This option is disabled by default.",
17411741
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1742-
#ifndef DONT_ALLOW_USER_CHANGE
17431742
{"user", 'u', "User for login if not current user.", &current_user,
17441743
&current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
1745-
#endif
17461744
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
17471745
&safe_updates, &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
17481746
0, 0, 0, 0},

client/mysqladmin.cc

-2
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,8 @@ static struct my_option my_long_options[] =
195195
&interval, &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
196196
0, 0},
197197
#include <sslopt-longopts.h>
198-
#ifndef DONT_ALLOW_USER_CHANGE
199198
{"user", 'u', "User for login if not current user.", &user,
200199
&user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
201-
#endif
202200
{"verbose", 'v', "Write more information.", &opt_verbose,
203201
&opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
204202
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,

client/mysqlcheck.c

-2
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,8 @@ static struct my_option my_long_options[] =
185185
"When used with REPAIR, get table structure from .frm file, so the table can be repaired even if .MYI header is corrupted.",
186186
&opt_frm, &opt_frm, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
187187
0},
188-
#ifndef DONT_ALLOW_USER_CHANGE
189188
{"user", 'u', "User for login if not current user.", &current_user,
190189
&current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
191-
#endif
192190
{"verbose", 'v', "Print info about the various stages.", 0, 0, 0, GET_NO_ARG,
193191
NO_ARG, 0, 0, 0, 0, 0, 0},
194192
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,

client/mysqldump.c

-2
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,9 @@ static struct my_option my_long_options[] =
525525
{"tz-utc", OPT_TZ_UTC,
526526
"SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones.",
527527
&opt_tz_utc, &opt_tz_utc, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
528-
#ifndef DONT_ALLOW_USER_CHANGE
529528
{"user", 'u', "User for login if not current user.",
530529
&current_user, &current_user, 0, GET_STR, REQUIRED_ARG,
531530
0, 0, 0, 0, 0, 0},
532-
#endif
533531
{"verbose", 'v', "Print info about the various stages.",
534532
&verbose, &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
535533
{"version",'V', "Output version information and exit.", 0, 0, 0,

client/mysqlimport.c

-2
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,8 @@ static struct my_option my_long_options[] =
177177
"of threads to use for loading data.",
178178
&opt_use_threads, &opt_use_threads, 0,
179179
GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
180-
#ifndef DONT_ALLOW_USER_CHANGE
181180
{"user", 'u', "User for login if not current user.", &current_user,
182181
&current_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
183-
#endif
184182
{"verbose", 'v', "Print info about the various stages.", &verbose,
185183
&verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
186184
{"version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG,

client/mysqlshow.c

-2
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,8 @@ static struct my_option my_long_options[] =
257257
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
258258
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
259259
#include <sslopt-longopts.h>
260-
#ifndef DONT_ALLOW_USER_CHANGE
261260
{"user", 'u', "User for login if not current user.", &user,
262261
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
263-
#endif
264262
{"verbose", 'v',
265263
"More verbose output; you can use this multiple times to get even more "
266264
"verbose output.",

client/mysqlslap.c

-2
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,8 @@ static struct my_option my_long_options[] =
697697
&opt_mysql_unix_port, &opt_mysql_unix_port, 0, GET_STR,
698698
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
699699
#include <sslopt-longopts.h>
700-
#ifndef DONT_ALLOW_USER_CHANGE
701700
{"user", 'u', "User for login if not current user.", &user,
702701
&user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
703-
#endif
704702
{"verbose", 'v',
705703
"More verbose output; you can use this multiple times to get even more "
706704
"verbose output.", &verbose, &verbose, 0, GET_NO_ARG, NO_ARG,

client/sql_string.cc

-15
Original file line numberDiff line numberDiff line change
@@ -434,21 +434,6 @@ bool String::append(const char *s,uint32 arg_length, const CHARSET_INFO *cs)
434434
}
435435

436436

437-
#ifdef TO_BE_REMOVED
438-
bool String::append(FILE* file, uint32 arg_length, myf my_flags)
439-
{
440-
if (realloc(str_length+arg_length))
441-
return TRUE;
442-
if (my_fread(file, (uchar*) Ptr + str_length, arg_length, my_flags))
443-
{
444-
shrink(str_length);
445-
return TRUE;
446-
}
447-
str_length+=arg_length;
448-
return FALSE;
449-
}
450-
#endif
451-
452437
bool String::append(IO_CACHE* file, uint32 arg_length)
453438
{
454439
if (realloc(str_length+arg_length))

extra/yassl/taocrypt/include/types.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ typedef unsigned int word32;
6767
#endif
6868

6969

70-
#if defined(HAVE_64_MULTIPLY) && (defined(__alpha__) || defined(__ia64__) \
70+
#if defined(HAVE_64_MULTIPLY) && (defined(__ia64__) \
7171
|| defined(_ARCH_PPC64) || defined(__mips64) || defined(__x86_64__) \
7272
|| defined(_M_X64) || defined(_M_IA64))
7373
// These platforms have 64-bit CPU registers. Unfortunately most C++ compilers

extra/yassl/taocrypt/src/integer.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,6 @@ DWord() {}
161161
#elif defined(_M_X64) || defined(_M_IA64)
162162
r.halfs_.low = _umul128(a, b, &r.halfs_.high);
163163

164-
#elif defined(__alpha__)
165-
r.halfs_.low = a*b;
166-
#ifdef __GNUC__
167-
__asm__("umulh %1,%2,%0" : "=r" (r.halfs_.high)
168-
: "r" (a), "r" (b));
169-
#elif defined(__DECCXX)
170-
r.halfs_.high = asm("umulh %a0, %a1, %v0", a, b);
171-
#else
172-
#error unknown alpha compiler
173-
#endif
174-
175164
#elif defined(__ia64__)
176165
r.halfs_.low = a*b;
177166
__asm__("xmpy.hu %0=%1,%2" : "=f" (r.halfs_.high)

include/my_global.h

-6
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,6 @@ extern "C" int madvise(void *addr, size_t len, int behav);
409409
#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
410410
#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
411411

412-
/* Paranoid settings. Define I_AM_PARANOID if you are paranoid */
413-
#ifdef I_AM_PARANOID
414-
#define DONT_ALLOW_USER_CHANGE 1
415-
#define DONT_USE_MYSQL_PWD 1
416-
#endif
417-
418412
/* Does the system remember a signal handler after a signal ? */
419413
#if !defined(HAVE_BSD_SIGNALS) && !defined(HAVE_SIGACTION)
420414
#define SIGNAL_HANDLER_RESET_ON_DELIVERY

include/my_nosys.h

-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count,
3939
myf myFlags);
4040
extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count);
4141

42-
#if defined(USE_HALLOC)
43-
#define my_malloc(a,b) halloc(a,1)
44-
#define my_no_flags_free(a) hfree(a)
45-
#endif
46-
4742
#endif /* __MY_NOSYS__ */
4843

4944
#ifdef __cplusplus

include/my_stacktrace.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#include <my_global.h>
2020

2121
#ifdef TARGET_OS_LINUX
22-
#if defined (__x86_64__) || defined (__i386__) || \
23-
(defined(__alpha__) && defined(__GNUC__))
22+
#if defined (__x86_64__) || defined (__i386__)
2423
#define HAVE_STACKTRACE 1
2524
#endif
2625
#elif defined(__WIN__) || defined(HAVE_PRINTSTACK)

include/my_sys.h

-4
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,6 @@ typedef struct st_io_cache_share
381381
int running_threads; /* threads not in lock. */
382382
int total_threads; /* threads sharing the cache. */
383383
int error; /* Last error. */
384-
#ifdef NOT_YET_IMPLEMENTED
385-
/* whether the structure should be free'd */
386-
my_bool alloced;
387-
#endif
388384
} IO_CACHE_SHARE;
389385

390386
typedef struct st_io_cache /* Used when cacheing files */

libmysqld/libmysqld.c

-2
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
130130
if (!passwd)
131131
{
132132
passwd=mysql->options.password;
133-
#if !defined(DONT_USE_MYSQL_PWD)
134133
if (!passwd)
135134
passwd=getenv("MYSQL_PWD"); /* get it from environment */
136-
#endif
137135
}
138136
mysql->passwd= passwd ? my_strdup(passwd,MYF(0)) : NULL;
139137
#endif /*!NO_EMBEDDED_ACCESS_CHECKS*/

mysys/my_lib.c

-4
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
107107
#endif
108108

109109
dirp = opendir(directory_file_name(tmp_path,(char *) path));
110-
#if defined(__amiga__)
111-
if ((dirp->dd_fd) < 0) /* Directory doesn't exists */
112-
goto error;
113-
#endif
114110
if (dirp == NULL ||
115111
! (buffer= my_malloc(ALIGN_SIZE(sizeof(MY_DIR)) +
116112
ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)) +

mysys/my_malloc.c

-11
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags)
8484
goto end;);
8585
if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
8686
DBUG_RETURN(my_malloc(size, my_flags));
87-
#ifdef USE_HALLOC
88-
point= malloc(size);
89-
#else
9087
point= realloc(oldpoint, size);
91-
#endif
9288
#ifndef DBUG_OFF
9389
end:
9490
#endif
@@ -104,13 +100,6 @@ void *my_realloc(void *oldpoint, size_t size, myf my_flags)
104100
DBUG_EXECUTE_IF("simulate_out_of_memory",
105101
DBUG_SET("-d,simulate_out_of_memory"););
106102
}
107-
#ifdef USE_HALLOC
108-
else
109-
{
110-
memcpy(point,oldpoint,size);
111-
free(oldpoint);
112-
}
113-
#endif
114103
DBUG_PRINT("exit",("ptr: %p", point));
115104
DBUG_RETURN(point);
116105
}

mysys/stacktrace.c

-85
Original file line numberDiff line numberDiff line change
@@ -249,53 +249,10 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack)
249249
#define SIGRETURN_FRAME_OFFSET 23
250250
#endif
251251

252-
#if defined(__alpha__) && defined(__GNUC__)
253-
/*
254-
The only way to backtrace without a symbol table on alpha
255-
is to find stq fp,N(sp), and the first byte
256-
of the instruction opcode will give us the value of N. From this
257-
we can find where the old value of fp is stored
258-
*/
259-
260-
#define MAX_INSTR_IN_FUNC 10000
261-
262-
inline uchar** find_prev_fp(uint32* pc, uchar** fp)
263-
{
264-
int i;
265-
for (i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc)
266-
{
267-
uchar* p = (uchar*)pc;
268-
if (p[2] == 222 && p[3] == 35)
269-
{
270-
return (uchar**)((uchar*)fp - *(short int*)p);
271-
}
272-
}
273-
return 0;
274-
}
275-
276-
inline uint32* find_prev_pc(uint32* pc, uchar** fp)
277-
{
278-
int i;
279-
for (i = 0; i < MAX_INSTR_IN_FUNC; ++i,--pc)
280-
{
281-
char* p = (char*)pc;
282-
if (p[1] == 0 && p[2] == 94 && p[3] == -73)
283-
{
284-
uint32* prev_pc = (uint32*)*((fp+p[0]/sizeof(fp)));
285-
return prev_pc;
286-
}
287-
}
288-
return 0;
289-
}
290-
#endif /* defined(__alpha__) && defined(__GNUC__) */
291-
292252
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack)
293253
{
294254
uchar** fp;
295255
uint frame_count = 0, sigreturn_frame_count;
296-
#if defined(__alpha__) && defined(__GNUC__)
297-
uint32* pc;
298-
#endif
299256
LINT_INIT(fp);
300257

301258

@@ -308,11 +265,6 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack)
308265
__asm __volatile__ ("movq %%rbp,%0"
309266
:"=r"(fp)
310267
:"r"(fp));
311-
#endif
312-
#if defined(__alpha__) && defined(__GNUC__)
313-
__asm __volatile__ ("mov $30,%0"
314-
:"=r"(fp)
315-
:"r"(fp));
316268
#endif
317269
if (!fp)
318270
{
@@ -342,17 +294,6 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack)
342294

343295
my_safe_printf_stderr("%s",
344296
"Stack range sanity check OK, backtrace follows:\n");
345-
#if defined(__alpha__) && defined(__GNUC__)
346-
my_safe_printf_stderr("%s",
347-
"Warning: Alpha stacks are difficult -"
348-
"will be taking some wild guesses, stack trace may be incorrect or "
349-
"terminate abruptly\n");
350-
351-
/* On Alpha, we need to get pc */
352-
__asm __volatile__ ("bsr %0, do_next; do_next: "
353-
:"=r"(pc)
354-
:"r"(pc));
355-
#endif /* __alpha__ */
356297

357298
/* We are 1 frame above signal frame with NPTL and 2 frames above with LT */
358299
sigreturn_frame_count = thd_lib_detected == THD_LIB_LT ? 2 : 1;
@@ -366,32 +307,6 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack)
366307
*(fp + SIGRETURN_FRAME_OFFSET) : *(fp + 1));
367308
#endif /* defined(__386__) || defined(__x86_64__) */
368309

369-
#if defined(__alpha__) && defined(__GNUC__)
370-
uchar** new_fp = find_prev_fp(pc, fp);
371-
if (frame_count == sigreturn_frame_count - 1)
372-
{
373-
new_fp += 90;
374-
}
375-
376-
if (fp && pc)
377-
{
378-
pc = find_prev_pc(pc, fp);
379-
if (pc)
380-
my_safe_printf_stderr("%p\n", pc);
381-
else
382-
{
383-
my_safe_printf_stderr("%s",
384-
"Not smart enough to deal with the rest of this stack\n");
385-
goto end;
386-
}
387-
}
388-
else
389-
{
390-
my_safe_printf_stderr("%s",
391-
"Not smart enough to deal with the rest of this stack\n");
392-
goto end;
393-
}
394-
#endif /* defined(__alpha__) && defined(__GNUC__) */
395310
if (new_fp <= fp )
396311
{
397312
my_safe_printf_stderr("New value of fp=%p failed sanity check, "

sql-common/client.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3171,7 +3171,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
31713171
if (!passwd)
31723172
{
31733173
passwd=mysql->options.password;
3174-
#if !defined(DONT_USE_MYSQL_PWD) && !defined(MYSQL_SERVER)
3174+
#if !defined(MYSQL_SERVER)
31753175
if (!passwd)
31763176
passwd=getenv("MYSQL_PWD"); /* get it from environment */
31773177
#endif

sql/handler.cc

-2
Original file line numberDiff line numberDiff line change
@@ -1828,15 +1828,13 @@ int ha_recover(HASH *commit_list)
18281828
if (info.commit_list)
18291829
sql_print_information("Starting crash recovery...");
18301830

1831-
#ifndef WILL_BE_DELETED_LATER
18321831
/*
18331832
for now, only InnoDB supports 2pc. It means we can always safely
18341833
rollback all pending transactions, without risking inconsistent data
18351834
*/
18361835
DBUG_ASSERT(total_ha_2pc == (ulong) opt_bin_log+1); // only InnoDB and binlog
18371836
tc_heuristic_recover= TC_HEURISTIC_RECOVER_ROLLBACK; // forcing ROLLBACK
18381837
info.dry_run=FALSE;
1839-
#endif
18401838

18411839
for (info.len= MAX_XID_LIST_SIZE ;
18421840
info.list==0 && info.len > MIN_XID_LIST_SIZE; info.len/=2)

sql/item.cc

-8
Original file line numberDiff line numberDiff line change
@@ -827,14 +827,6 @@ Item_ident::Item_ident(THD *thd, Item_ident *item)
827827
void Item_ident::cleanup()
828828
{
829829
DBUG_ENTER("Item_ident::cleanup");
830-
#ifdef CANT_BE_USED_AS_MEMORY_IS_FREED
831-
db_name ? db_name : "(null)",
832-
orig_db_name ? orig_db_name : "(null)",
833-
table_name ? table_name : "(null)",
834-
orig_table_name ? orig_table_name : "(null)",
835-
field_name ? field_name : "(null)",
836-
orig_field_name ? orig_field_name : "(null)"));
837-
#endif
838830
Item::cleanup();
839831
db_name= orig_db_name;
840832
table_name= orig_table_name;

sql/mysqld.cc

-4
Original file line numberDiff line numberDiff line change
@@ -2908,11 +2908,7 @@ void my_init_signals(void)
29082908
#ifdef HAVE_STACKTRACE
29092909
my_init_stacktrace();
29102910
#endif
2911-
#if defined(__amiga__)
2912-
sa.sa_handler=(void(*)())handle_fatal_signal;
2913-
#else
29142911
sa.sa_handler=handle_fatal_signal;
2915-
#endif
29162912
sigaction(SIGSEGV, &sa, NULL);
29172913
sigaction(SIGABRT, &sa, NULL);
29182914
#ifdef SIGBUS

0 commit comments

Comments
 (0)