Skip to content

Commit d89d706

Browse files
committed
Bug#16792349: YET MORE UNUSED #IFDEFS
Additional patch mysql#2, remove the following #ifdefs: __bsdi__ __EMX__ __IBMC__ __IBMCPP__ __LCC__ __OpenBSD__ __STDC_EXT__ _CUSTOMSTARTUPCONFIG_ CANT_OPEN_FILES_TWICE CHECK_KEYS COMPILE_STOPWORDS_IN DEAD_CODE DONT_USE_RW_LOCKS FAST FORCE_PRIMARY_KEY N_MAXKEY NEW_HASH_FUNCTION NOT_ANYMORE NOT_REALLY_USED_YET NOT_YET_READY_FOR_8_BYTE_POINTERS UNSAFE_LOCKING USE_RELOC USING_SECOND_APPROACH XXX_SUPERCEDED_BY_WL2952
1 parent 1dc4769 commit d89d706

26 files changed

+4
-400
lines changed

client/mysqldump.c

-9
Original file line numberDiff line numberDiff line change
@@ -2997,10 +2997,6 @@ static uint get_table_structure(char *table, char *db, char *table_type,
29972997
if (atoi(row[3]) == 1)
29982998
{
29992999
keynr++;
3000-
#ifdef FORCE_PRIMARY_KEY
3001-
if (atoi(row[1]) == 0 && primary_key == INT_MAX)
3002-
primary_key=keynr;
3003-
#endif
30043000
if (!strcmp(row[2],"PRIMARY"))
30053001
{
30063002
primary_key=keynr;
@@ -5535,11 +5531,6 @@ static my_bool get_view_structure(char *table, char* db)
55355531

55365532
verbose_msg("-- Retrieving view structure for table %s...\n", table);
55375533

5538-
#ifdef NOT_REALLY_USED_YET
5539-
sprintf(insert_pat,"SET SQL_QUOTE_SHOW_CREATE=%d",
5540-
(opt_quoted || opt_keywords));
5541-
#endif
5542-
55435534
result_table= quote_name(table, table_buff, 1);
55445535
opt_quoted_table= quote_name(table, table_buff2, 0);
55455536

include/my_global.h

-3
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@
141141
#endif
142142

143143
#define __EXTENSIONS__ 1 /* We want some extension */
144-
#ifndef __STDC_EXT__
145-
#define __STDC_EXT__ 1 /* To get large file support on hpux */
146-
#endif
147144

148145
/*
149146
Solaris 9 include file <sys/feature_tests.h> refers to X/Open document

include/mysql.h

-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ extern "C" {
3434
#ifndef MYSQL_ABI_CHECK
3535
#include <sys/types.h>
3636
#endif
37-
#ifdef __LCC__
38-
#include <winsock2.h> /* For windows */
39-
#endif
4037
typedef char my_bool;
4138
#if !defined(_WIN32)
4239
#define STDCALL

mysys/my_access.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ my_bool is_filename_allowed(const char *name __attribute__((unused)),
216216
} /* is_filename_allowed */
217217
#endif /* _WIN32 */
218218

219-
#if defined(_WIN32) || defined(__EMX__)
219+
#if defined(_WIN32)
220220

221221

222222
/*
@@ -262,4 +262,4 @@ int check_if_legal_filename(const char *path)
262262
DBUG_RETURN(0);
263263
}
264264

265-
#endif /* defined(_WIN32) || defined(__EMX__) */
265+
#endif /* defined(_WIN32) */

mysys/my_thr_init.c

-3
Original file line numberDiff line numberDiff line change
@@ -401,10 +401,7 @@ void my_thread_end(void)
401401
tmp->dbug=0;
402402
}
403403
#endif
404-
#if !defined(__bsdi__) && !defined(__OpenBSD__)
405-
/* bsdi and openbsd 3.5 dumps core here */
406404
mysql_cond_destroy(&tmp->suspend);
407-
#endif
408405
mysql_mutex_destroy(&tmp->mutex);
409406
free(tmp);
410407

mysys/thr_alarm.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
273273
if (thd_lib_detected == THD_LIB_LT &&
274274
!pthread_equal(pthread_self(),alarm_thread))
275275
{
276-
#if defined(MAIN) && !defined(__bsdi__)
276+
#if defined(MAIN)
277277
printf("thread_alarm in process_alarm\n"); fflush(stdout);
278278
#endif
279279
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
@@ -307,7 +307,7 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
307307
DBUG_ENTER("process_alarm");
308308
DBUG_PRINT("info",("sig: %d active alarms: %d",sig,alarm_queue.elements));
309309

310-
#if defined(MAIN) && !defined(__bsdi__)
310+
#if defined(MAIN)
311311
printf("process_alarm\n"); fflush(stdout);
312312
#endif
313313
if (alarm_queue.elements)
@@ -359,9 +359,6 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
359359
}
360360
if (alarm_queue.elements)
361361
{
362-
#ifdef __bsdi__
363-
alarm(0); /* Remove old alarm */
364-
#endif
365362
alarm((uint) (alarm_data->expire_time-now));
366363
next_alarm_expire_time= alarm_data->expire_time;
367364
}

mysys/thr_lock.c

-2
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_INFO *owner,
10641064
void
10651065
thr_lock_merge_status(THR_LOCK_DATA **data, uint count)
10661066
{
1067-
#if !defined(DONT_USE_RW_LOCKS)
10681067
THR_LOCK_DATA **pos= data;
10691068
THR_LOCK_DATA **end= data + count;
10701069
if (count > 1)
@@ -1107,7 +1106,6 @@ thr_lock_merge_status(THR_LOCK_DATA **data, uint count)
11071106
last_lock=(*pos);
11081107
} while (pos != data);
11091108
}
1110-
#endif
11111109
}
11121110

11131111
/* free all locks */

sql/mdl.h

-9
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@
1515
along with this program; if not, write to the Free Software Foundation,
1616
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
1717

18-
#if defined(__IBMC__) || defined(__IBMCPP__)
19-
/* Further down, "next_in_lock" and "next_in_context" have the same type,
20-
and in "sql_plist.h" this leads to an identical signature, which causes
21-
problems in function overloading.
22-
*/
23-
#pragma namemangling(v5)
24-
#endif
25-
26-
2718
#include "sql_plist.h"
2819
#include <my_sys.h>
2920
#include <m_string.h>

sql/mysqld.cc

-10
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,6 @@ static void close_connections(void)
14211421
sql_print_information("Forcefully disconnecting %d remaining clients",
14221422
static_cast<int>(get_thread_count()));
14231423

1424-
#ifndef __bsdi__ // Bug in BSDI kernel
14251424
DBUG_PRINT("quit", ("Locking LOCK_thread_count"));
14261425
mysql_mutex_lock(&LOCK_thread_count);
14271426
for (it= global_thread_list->begin(); it != global_thread_list->end(); ++it)
@@ -1439,7 +1438,6 @@ static void close_connections(void)
14391438
}
14401439
DBUG_PRINT("quit",("Unlocking LOCK_thread_count"));
14411440
mysql_mutex_unlock(&LOCK_thread_count);
1442-
#endif // Bug in BSDI kernel
14431441

14441442
/*
14451443
All threads have now been aborted. Stop event scheduler thread
@@ -5183,14 +5181,6 @@ int mysqld_main(int argc, char **argv)
51835181
exit (ho_error);
51845182
}
51855183

5186-
#ifdef _CUSTOMSTARTUPCONFIG_
5187-
if (_cust_check_startup())
5188-
{
5189-
/ * _cust_check_startup will report startup failure error * /
5190-
exit(1);
5191-
}
5192-
#endif
5193-
51945184
if (init_common_variables())
51955185
unireg_abort(1); // Will do exit
51965186

storage/archive/ha_archive.cc

-45
Original file line numberDiff line numberDiff line change
@@ -989,51 +989,6 @@ int ha_archive::write_row(uchar *buf)
989989
rc= HA_ERR_FOUND_DUPP_KEY;
990990
goto error;
991991
}
992-
#ifdef DEAD_CODE
993-
/*
994-
Bad news, this will cause a search for the unique value which is very
995-
expensive since we will have to do a table scan which will lock up
996-
all other writers during this period. This could perhaps be optimized
997-
in the future.
998-
*/
999-
{
1000-
/*
1001-
First we create a buffer that we can use for reading rows, and can pass
1002-
to get_row().
1003-
*/
1004-
if (!(read_buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME))))
1005-
{
1006-
rc= HA_ERR_OUT_OF_MEM;
1007-
goto error;
1008-
}
1009-
/*
1010-
All of the buffer must be written out or we won't see all of the
1011-
data
1012-
*/
1013-
azflush(&(share->archive_write), Z_SYNC_FLUSH);
1014-
/*
1015-
Set the position of the local read thread to the beginning position.
1016-
*/
1017-
if (read_data_header(&archive))
1018-
{
1019-
rc= HA_ERR_CRASHED_ON_USAGE;
1020-
goto error;
1021-
}
1022-
1023-
Field *mfield= table->next_number_field;
1024-
1025-
while (!(get_row(&archive, read_buf)))
1026-
{
1027-
if (!memcmp(read_buf + mfield->offset(record),
1028-
table->next_number_field->ptr,
1029-
mfield->max_display_length()))
1030-
{
1031-
rc= HA_ERR_FOUND_DUPP_KEY;
1032-
goto error;
1033-
}
1034-
}
1035-
}
1036-
#endif
1037992
else
1038993
{
1039994
if (temp_auto > share->archive_write.auto_increment)

storage/federated/ha_federated.cc

-57
Original file line numberDiff line numberDiff line change
@@ -3283,63 +3283,6 @@ int ha_federated::external_lock(THD *thd, int lock_type)
32833283
/*
32843284
Support for transactions disabled until WL#2952 fixes it.
32853285
*/
3286-
#ifdef XXX_SUPERCEDED_BY_WL2952
3287-
if (lock_type != F_UNLCK)
3288-
{
3289-
ha_federated *trx= (ha_federated *)thd_get_ha_data(thd, ht);
3290-
3291-
DBUG_PRINT("info",("federated not lock F_UNLCK"));
3292-
if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
3293-
{
3294-
DBUG_PRINT("info",("federated autocommit"));
3295-
/*
3296-
This means we are doing an autocommit
3297-
*/
3298-
error= connection_autocommit(TRUE);
3299-
if (error)
3300-
{
3301-
DBUG_PRINT("info", ("error setting autocommit TRUE: %d", error));
3302-
DBUG_RETURN(error);
3303-
}
3304-
trans_register_ha(thd, FALSE, ht);
3305-
}
3306-
else
3307-
{
3308-
DBUG_PRINT("info",("not autocommit"));
3309-
if (!trx)
3310-
{
3311-
/*
3312-
This is where a transaction gets its start
3313-
*/
3314-
error= connection_autocommit(FALSE);
3315-
if (error)
3316-
{
3317-
DBUG_PRINT("info", ("error setting autocommit FALSE: %d", error));
3318-
DBUG_RETURN(error);
3319-
}
3320-
thd_set_ha_data(thd, ht, this);
3321-
trans_register_ha(thd, TRUE, ht);
3322-
/*
3323-
Send a lock table to the remote end.
3324-
We do not support this at the moment
3325-
*/
3326-
if (thd->options & (OPTION_TABLE_LOCK))
3327-
{
3328-
DBUG_PRINT("info", ("We do not support lock table yet"));
3329-
}
3330-
}
3331-
else
3332-
{
3333-
ha_federated *ptr;
3334-
for (ptr= trx; ptr; ptr= ptr->trx_next)
3335-
if (ptr == this)
3336-
break;
3337-
else if (!ptr->trx_next)
3338-
ptr->trx_next= this;
3339-
}
3340-
}
3341-
}
3342-
#endif /* XXX_SUPERCEDED_BY_WL2952 */
33433286
DBUG_RETURN(error);
33443287
}
33453288

0 commit comments

Comments
 (0)