summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/my_bitmap.h22
-rw-r--r--mysys/checksum.c7
-rw-r--r--mysys/my_bitmap.c186
-rw-r--r--mysys/rijndael.c16
-rw-r--r--mysys/test_charset.c10
-rw-r--r--mysys/thr_alarm.c5
-rw-r--r--regex/regcomp.c60
-rw-r--r--regex/regcomp.ih5
-rw-r--r--sql/field.cc55
-rw-r--r--sql/ha_partition.cc18
-rw-r--r--sql/ha_partition.h3
-rw-r--r--sql/handler.cc9
-rw-r--r--sql/nt_servc.cc23
-rw-r--r--sql/protocol.cc33
-rw-r--r--sql/repl_failsafe.cc96
-rw-r--r--sql/slave.cc11
-rw-r--r--sql/sql_class.cc65
-rw-r--r--sql/sql_parse.cc22
-rw-r--r--sql/sql_plugin.cc58
-rw-r--r--sql/sql_select.cc59
-rw-r--r--sql/sql_show.cc46
-rw-r--r--storage/heap/hp_test2.c5
-rw-r--r--storage/myisam/mi_dynrec.c14
-rw-r--r--storage/myisam/myisamdef.h4
-rw-r--r--storage/myisam/rt_test.c43
-rw-r--r--storage/myisam/sp_test.c69
-rw-r--r--strings/ctype-simple.c108
-rw-r--r--strings/ctype-ucs2.c20
-rw-r--r--tests/mysql_client_test.c209
29 files changed, 8 insertions, 1273 deletions
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index 0caf2da12d0..548eec14d6e 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -69,28 +69,6 @@ extern void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2);
extern uint bitmap_lock_set_next(MY_BITMAP *map);
extern void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit);
-#ifdef NOT_USED
-extern uint bitmap_lock_bits_set(const MY_BITMAP *map);
-extern my_bool bitmap_lock_is_set_all(const MY_BITMAP *map);
-extern uint bitmap_lock_get_first(const MY_BITMAP *map);
-extern uint bitmap_lock_get_first_set(const MY_BITMAP *map);
-extern my_bool bitmap_lock_is_subset(const MY_BITMAP *map1,
- const MY_BITMAP *map2);
-extern my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size);
-extern my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit);
-extern my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map);
-extern my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2);
-extern void bitmap_lock_set_all(MY_BITMAP *map);
-extern void bitmap_lock_clear_all(MY_BITMAP *map);
-extern void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit);
-extern void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit);
-extern void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size);
-extern void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_xor(MY_BITMAP *map, const MY_BITMAP *map2);
-extern void bitmap_lock_invert(MY_BITMAP *map);
-#endif
/* Fast, not thread safe, bitmap functions */
#define bitmap_buffer_size(bits) (((bits)+31)/32)*4
#define no_bytes_in_map(map) (((map)->n_bits + 7)/8)
diff --git a/mysys/checksum.c b/mysys/checksum.c
index 1c7c9358d53..a96ea31ea0e 100644
--- a/mysys/checksum.c
+++ b/mysys/checksum.c
@@ -30,13 +30,6 @@
ha_checksum my_checksum(ha_checksum crc, const uchar *pos, size_t length)
{
-#ifdef NOT_USED
- const uchar *end=pos+length;
- for ( ; pos != end ; pos++)
- crc=((crc << 8) + *((uchar*) pos)) + (crc >> (8*sizeof(ha_checksum)-8));
- return crc;
-#else
return (ha_checksum)crc32((uint)crc, pos, (uint)length);
-#endif
}
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index 3de05fa8664..3401c7301e9 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -566,192 +566,6 @@ void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit)
bitmap_unlock(map);
}
-
-#ifdef NOT_USED
-my_bool bitmap_lock_is_prefix(const MY_BITMAP *map, uint prefix_size)
-{
- my_bool res;
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_prefix(map, prefix_size);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-void bitmap_lock_set_all(MY_BITMAP *map)
-{
- bitmap_lock(map);
- bitmap_set_all(map);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_clear_all(MY_BITMAP *map)
-{
- bitmap_lock(map);
- bitmap_clear_all(map);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_set_prefix(MY_BITMAP *map, uint prefix_size)
-{
- bitmap_lock(map);
- bitmap_set_prefix(map, prefix_size);
- bitmap_unlock(map);
-}
-
-
-my_bool bitmap_lock_is_clear_all(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_clear_all(map);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-my_bool bitmap_lock_is_set_all(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_set_all(map);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-my_bool bitmap_lock_is_set(const MY_BITMAP *map, uint bitmap_bit)
-{
- my_bool res;
- DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
- bitmap_lock((MY_BITMAP *)map);
- res= bitmap_is_set(map, bitmap_bit);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-my_bool bitmap_lock_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map1);
- bitmap_lock((MY_BITMAP *)map2);
- res= bitmap_is_subset(map1, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock((MY_BITMAP *)map1);
- return res;
-}
-
-
-my_bool bitmap_lock_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
-{
- uint res;
-
- DBUG_ASSERT(map1->bitmap && map2->bitmap &&
- map1->n_bits==map2->n_bits);
- bitmap_lock((MY_BITMAP *)map1);
- bitmap_lock((MY_BITMAP *)map2);
- res= bitmap_cmp(map1, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock((MY_BITMAP *)map1);
- return res;
-}
-
-
-void bitmap_lock_intersect(MY_BITMAP *map, const MY_BITMAP *map2)
-{
- bitmap_lock(map);
- bitmap_lock((MY_BITMAP *)map2);
- bitmap_intersect(map, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_subtract(MY_BITMAP *map, const MY_BITMAP *map2)
-{
- bitmap_lock(map);
- bitmap_lock((MY_BITMAP *)map2);
- bitmap_subtract(map, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_union(MY_BITMAP *map, const MY_BITMAP *map2)
-{
- bitmap_lock(map);
- bitmap_lock((MY_BITMAP *)map2);
- bitmap_union(map, map2);
- bitmap_unlock((MY_BITMAP *)map2);
- bitmap_unlock(map);
-}
-
-
-/*
- SYNOPSIS
- bitmap_bits_set()
- map
- RETURN
- Number of set bits in the bitmap.
-*/
-uint bitmap_lock_bits_set(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP *)map);
- DBUG_ASSERT(map->bitmap);
- res= bitmap_bits_set(map);
- bitmap_unlock((MY_BITMAP *)map);
- return res;
-}
-
-
-/*
- SYNOPSIS
- bitmap_get_first()
- map
- RETURN
- Number of first unset bit in the bitmap or MY_BIT_NONE if all bits are set.
-*/
-uint bitmap_lock_get_first(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP*)map);
- res= bitmap_get_first(map);
- bitmap_unlock((MY_BITMAP*)map);
- return res;
-}
-
-
-uint bitmap_lock_get_first_set(const MY_BITMAP *map)
-{
- uint res;
- bitmap_lock((MY_BITMAP*)map);
- res= bitmap_get_first_set(map);
- bitmap_unlock((MY_BITMAP*)map);
- return res;
-}
-
-
-void bitmap_lock_set_bit(MY_BITMAP *map, uint bitmap_bit)
-{
- DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
- bitmap_lock(map);
- bitmap_set_bit(map, bitmap_bit);
- bitmap_unlock(map);
-}
-
-
-void bitmap_lock_flip_bit(MY_BITMAP *map, uint bitmap_bit)
-{
- DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
- bitmap_lock(map);
- bitmap_flip_bit(map, bitmap_bit);
- bitmap_unlock(map);
-}
-#endif
#ifdef MAIN
uint get_rand_bit(uint bitsize)
diff --git a/mysys/rijndael.c b/mysys/rijndael.c
index 2b12753c4e5..2d622efad82 100644
--- a/mysys/rijndael.c
+++ b/mysys/rijndael.c
@@ -32,22 +32,6 @@
#define FULL_UNROLL
*/
-
-#ifdef NOT_USED
-Te0[x] = S [x].[02, 01, 01, 03];
-Te1[x] = S [x].[03, 02, 01, 01];
-Te2[x] = S [x].[01, 03, 02, 01];
-Te3[x] = S [x].[01, 01, 03, 02];
-Te4[x] = S [x].[01, 01, 01, 01];
-
-Td0[x] = Si[x].[0e, 09, 0d, 0b];
-Td1[x] = Si[x].[0b, 0e, 09, 0d];
-Td2[x] = Si[x].[0d, 0b, 0e, 09];
-Td3[x] = Si[x].[09, 0d, 0b, 0e];
-Td4[x] = Si[x].[01, 01, 01, 01];
-#endif
-
-
static const uint32 Te0[256]=
{
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
diff --git a/mysys/test_charset.c b/mysys/test_charset.c
index 5b399071d11..39df1b02d7b 100644
--- a/mysys/test_charset.c
+++ b/mysys/test_charset.c
@@ -77,15 +77,5 @@ int main(int argc, char **argv) {
_print_csinfo(cs);
fflush(stdout);
-#ifdef NOT_USED_ANYMORE
- cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG));
- printf("LIST OF CHARSETS (compiled + *.conf):\n%s\n", cs_list);
- my_free(cs_list);
-
- cs_list = list_charsets(MYF(MY_CS_INDEX | MY_CS_LOADED));
- printf("LIST OF CHARSETS (index + loaded):\n%s\n", cs_list);
- my_free(cs_list);
-#endif
-
return 0;
}
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 9ca18eeaf1b..54eef693558 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -903,11 +903,6 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
sigaddset(&set,THR_SERVER_ALARM);
sigdelset(&set, thr_client_alarm);
(void) pthread_sigmask(SIG_SETMASK,&set,NULL);
-#ifdef NOT_USED
- sigemptyset(&set);
- sigaddset(&set, thr_client_alarm);
- pthread_sigmask(SIG_UNBLOCK, &set, (sigset_t*) 0);
-#endif
pthread_attr_init(&thr_attr);
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_PROCESS);
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 81c435ed552..812cdd115d1 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -1228,66 +1228,6 @@ register char *cp;
}
#endif
-#ifdef NOT_USED
-/*
- - mcsub - subtract a collating element from a cset
- == static void mcsub(register cset *cs, register char *cp);
- */
-static void
-mcsub(cs, cp)
-register cset *cs;
-register char *cp;
-{
- register char *fp = mcfind(cs, cp);
- register size_t len = strlen(fp);
-
- assert(fp != NULL);
- (void) memmove(fp, fp + len + 1,
- cs->smultis - (fp + len + 1 - cs->multis));
- cs->smultis -= len;
-
- if (cs->smultis == 0) {
- free(cs->multis);
- cs->multis = NULL;
- return;
- }
-
- cs->multis = realloc(cs->multis, cs->smultis);
- assert(cs->multis != NULL);
-}
-
-/*
- - mcin - is a collating element in a cset?
- == static int mcin(register cset *cs, register char *cp);
- */
-static int
-mcin(cs, cp)
-register cset *cs;
-register char *cp;
-{
- return(mcfind(cs, cp) != NULL);
-}
-
-/*
- - mcfind - find a collating element in a cset
- == static char *mcfind(register cset *cs, register char *cp);
- */
-static char *
-mcfind(cs, cp)
-register cset *cs;
-register char *cp;
-{
- register char *p;
-
- if (cs->multis == NULL)
- return(NULL);
- for (p = cs->multis; *p != '\0'; p += strlen(p) + 1)
- if (strcmp(cp, p) == 0)
- return(p);
- return(NULL);
-}
-#endif
-
/*
- mcinvert - invert the list of collating elements in a cset
== static void mcinvert(register struct parse *p, register cset *cs);
diff --git a/regex/regcomp.ih b/regex/regcomp.ih
index 5deba89217a..cb93286e32f 100644
--- a/regex/regcomp.ih
+++ b/regex/regcomp.ih
@@ -30,11 +30,6 @@ static int nch(register struct parse *p, register cset *cs);
#ifdef USE_ORIG_REGEX_CODE
static void mcadd(register struct parse *p, register cset *cs, register char *cp);
#endif
-#ifdef NOT_USED
-static void mcsub(register cset *cs, register char *cp);
-static int mcin(register cset *cs, register char *cp);
-static char *mcfind(register cset *cs, register char *cp);
-#endif
static void mcinvert(register struct parse *p, register cset *cs);
static void mccase(register struct parse *p, register cset *cs);
static int isinsets(register struct re_guts *g, int c);
diff --git a/sql/field.cc b/sql/field.cc
index 56d60ff5b28..b62277afa2a 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -1277,61 +1277,6 @@ int Field::warn_if_overflow(int op_result)
}
-#ifdef NOT_USED
-static bool test_if_real(const char *str,int length, CHARSET_INFO *cs)
-{
- cs= system_charset_info; // QQ move test_if_real into CHARSET_INFO struct
-
- while (length && my_isspace(cs,*str))
- { // Allow start space
- length--; str++;
- }
- if (!length)
- return 0;
- if (*str == '+' || *str == '-')
- {
- length--; str++;
- if (!length || !(my_isdigit(cs,*str) || *str == '.'))
- return 0;
- }
- while (length && my_isdigit(cs,*str))
- {
- length--; str++;
- }
- if (!length)
- return 1;
- if (*str == '.')
- {
- length--; str++;
- while (length && my_isdigit(cs,*str))
- {
- length--; str++;
- }
- }
- if (!length)
- return 1;
- if (*str == 'E' || *str == 'e')
- {
- if (length < 3 || (str[1] != '+' && str[1] != '-') ||
- !my_isdigit(cs,str[2]))
- return 0;
- length-=3;
- str+=3;
- while (length && my_isdigit(cs,*str))
- {
- length--; str++;
- }
- }
- for (; length ; length--, str++)
- { // Allow end space
- if (!my_isspace(cs,*str))
- return 0;
- }
- return 1;
-}
-#endif
-
-
/**
Interpret field value as an integer but return the result as a string.
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index bd3cd780bc5..7891f658f45 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -64,10 +64,6 @@
#include "debug_sync.h"
static const char *ha_par_ext= ".par";
-#ifdef NOT_USED
-static int free_share(PARTITION_SHARE * share);
-static PARTITION_SHARE *get_share(const char *table_name, TABLE * table);
-#endif
/****************************************************************************
MODULE create/delete handler object
@@ -1129,13 +1125,6 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
part= i * num_subparts + j;
DBUG_PRINT("info", ("Optimize subpartition %u (%s)",
part, sub_elem->partition_name));
-#ifdef NOT_USED
- if (print_admin_msg(thd, "note", table_share->db.str, table->alias,
- opt_op_name[flag],
- "Start to operate on subpartition %s",
- sub_elem->partition_name))
- DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
-#endif
if ((error= handle_opt_part(thd, check_opt, m_file[part], flag)))
{
/* print a line which partition the error belongs to */
@@ -1162,13 +1151,6 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
{
DBUG_PRINT("info", ("Optimize partition %u (%s)", i,
part_elem->partition_name));
-#ifdef NOT_USED
- if (print_admin_msg(thd, "note", table_share->db.str, table->alias,
- opt_op_name[flag],
- "Start to operate on partition %s",
- part_elem->partition_name))
- DBUG_RETURN(HA_ADMIN_INTERNAL_ERROR);
-#endif
if ((error= handle_opt_part(thd, check_opt, m_file[i], flag)))
{
/* print a line which partition the error belongs to */
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index cdbfb2163c7..cfab2dde394 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -143,9 +143,6 @@ private:
Variables for lock structures.
*/
THR_LOCK_DATA lock; /* MySQL lock */
-#ifdef NOT_USED
- PARTITION_SHARE *share; /* Shared lock info */
-#endif
/*
TRUE <=> this object was created with ha_partition::clone and doesn't
diff --git a/sql/handler.cc b/sql/handler.cc
index b42840c7b1b..06f869d4dff 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -190,15 +190,6 @@ plugin_ref ha_lock_engine(THD *thd, const handlerton *hton)
}
-#ifdef NOT_USED
-static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root)
-{
- handlerton *hton= ha_default_handlerton(current_thd);
- return (hton && hton->create) ? hton->create(hton, table, mem_root) : NULL;
-}
-#endif
-
-
handlerton *ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type)
{
plugin_ref plugin;
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index 76dc2846ed0..1f1b7f0c20f 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -375,29 +375,6 @@ void NTService::ServiceCtrlHandler(DWORD ctrlCode)
dwState=pService->dwState; // get current state
switch(ctrlCode) {
-
-#ifdef NOT_USED /* do we need this ? */
- case SERVICE_CONTROL_PAUSE:
- if (pService->bRunning && ! pService->bPause)
- {
- dwState = SERVICE_PAUSED;
- pService->SetStatus(SERVICE_PAUSE_PENDING,NO_ERROR, 0, 1,
- pService->nPauseTimeOut);
- pService->PauseService();
- }
- break;
-
- case SERVICE_CONTROL_CONTINUE:
- if (pService->bRunning && pService->bPause)
- {
- dwState = SERVICE_RUNNING;
- pService->SetStatus(SERVICE_CONTINUE_PENDING,NO_ERROR, 0, 1,
- pService->nResumeTimeOut);
- pService->ResumeService();
- }
- break;
-#endif
-
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP:
dwState = SERVICE_STOP_PENDING;
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 3f957dcc2de..87a54eaf10d 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -790,31 +790,14 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
local_packet->realloc(local_packet->length()+10))
goto err;
pos= (char*) local_packet->ptr()+local_packet->length();
-
-#ifdef TO_BE_DELETED_IN_6
- if (!(thd->client_capabilities & CLIENT_LONG_FLAG))
- {
- pos[0]=3;
- int3store(pos+1,field.length);
- pos[4]=1;
- pos[5]=field.type;
- pos[6]=2;
- pos[7]= (char) field.flags;
- pos[8]= (char) field.decimals;
- pos+= 9;
- }
- else
-#endif
- {
- pos[0]=3;
- int3store(pos+1,field.length);
- pos[4]=1;
- pos[5]=field.type;
- pos[6]=3;
- int2store(pos+7,field.flags);
- pos[9]= (char) field.decimals;
- pos+= 10;
- }
+ pos[0]=3;
+ int3store(pos+1,field.length);
+ pos[4]=1;
+ pos[5]=field.type;
+ pos[6]=3;
+ int2store(pos+7,field.flags);
+ pos[9]= (char) field.decimals;
+ pos+= 10;
}
local_packet->length((uint) (pos - local_packet->ptr()));
if (flags & SEND_DEFAULTS)
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 9a1f7fb826b..18a5303bf96 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -71,42 +71,6 @@ static Slave_log_event* find_slave_event(IO_CACHE* log,
functions like register_slave()) are working.
*/
-#if NOT_USED
-static int init_failsafe_rpl_thread(THD* thd)
-{
- DBUG_ENTER("init_failsafe_rpl_thread");
- thd->system_thread = SYSTEM_THREAD_DELAYED_INSERT;
- /*
- thd->bootstrap is to report errors barely to stderr; if this code is
- enable again one day, one should check if bootstrap is still needed (maybe
- this thread has no other error reporting method).
- */
- thd->bootstrap = 1;
- thd->security_ctx->skip_grants();
- my_net_init(&thd->net, 0);
- thd->net.read_timeout = slave_net_timeout;
- thd->max_client_packet_length=thd->net.max_packet;
- mysql_mutex_lock(&LOCK_thread_count);
- thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
- mysql_mutex_unlock(&LOCK_thread_count);
-
- if (init_thr_lock() || thd->store_globals())
- {
- /* purecov: begin inspected */
- close_connection(thd, ER_OUT_OF_RESOURCES, 1); // is this needed?
- statistic_increment(aborted_connects,&LOCK_status);
- one_thread_per_connection_end(thd,0);
- DBUG_RETURN(-1);
- /* purecov: end */
- }
-
- thd->mem_root->free= thd->mem_root->used= 0;
- thd_proc_info(thd, "Thread initialized");
- thd->set_time();
- DBUG_RETURN(0);
-}
-#endif
-
void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
{
mysql_mutex_lock(&LOCK_rpl_status);
@@ -623,66 +587,6 @@ err:
}
-#if NOT_USED
-int find_recovery_captain(THD* thd, MYSQL* mysql)
-{
- return 0;
-}
-#endif
-
-#if NOT_USED
-pthread_handler_t handle_failsafe_rpl(void *arg)
-{
- DBUG_ENTER("handle_failsafe_rpl");
- THD *thd = new THD;
- thd->thread_stack = (char*)&thd;
- MYSQL* recovery_captain = 0;
- const char* msg;
-
- pthread_detach_this_thread();
- if (init_failsafe_rpl_thread(thd) || !(recovery_captain=mysql_init(0)))
- {
- sql_print_error("Could not initialize failsafe replication thread");
- goto err;
- }
- mysql_mutex_lock(&LOCK_rpl_status);
- msg= thd->enter_cond(&COND_rpl_status,
- &LOCK_rpl_status, "Waiting for request");
- while (!thd->killed && !abort_loop)
- {
- bool break_req_chain = 0;
- mysql_cond_wait(&COND_rpl_status, &LOCK_rpl_status);
- thd_proc_info(thd, "Processing request");
- while (!break_req_chain)
- {
- switch (rpl_status) {
- case RPL_LOST_SOLDIER:
- if (find_recovery_captain(thd, recovery_captain))
- rpl_status=RPL_TROOP_SOLDIER;
- else
- rpl_status=RPL_RECOVERY_CAPTAIN;
- break_req_chain=1; /* for now until other states are implemented */
- break;
- default:
- break_req_chain=1;
- break;
- }
- }
- }
- thd->exit_cond(msg);
-err:
- if (recovery_captain)
- mysql_close(recovery_captain);
- delete thd;
-
- DBUG_LEAVE; // Must match DBUG_ENTER()
- my_thread_end();
- pthread_exit(0);
- return 0; // Avoid compiler warnings
-}
-#endif
-
-
/**
Execute a SHOW SLAVE HOSTS statement.
diff --git a/sql/slave.cc b/sql/slave.cc
index d41d0479dde..dc0f7286d5c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -798,17 +798,6 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start,
}
-#ifdef NOT_USED_YET
-static int end_slave_on_walk(Master_info* mi, uchar* /*unused*/)
-{
- DBUG_ENTER("end_slave_on_walk");
-
- end_master_info(mi);
- DBUG_RETURN(0);
-}
-#endif
-
-
/*
Release slave threads at time of executing shutdown.
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index eb4d353db81..1bec02afa96 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4171,71 +4171,6 @@ THD::binlog_prepare_pending_rows_event(TABLE*, uint32, MY_BITMAP const*,
Update_rows_log_event *);
#endif
-#ifdef NOT_USED
-static char const*
-field_type_name(enum_field_types type)
-{
- switch (type) {
- case MYSQL_TYPE_DECIMAL:
- return "MYSQL_TYPE_DECIMAL";
- case MYSQL_TYPE_TINY:
- return "MYSQL_TYPE_TINY";
- case MYSQL_TYPE_SHORT:
- return "MYSQL_TYPE_SHORT";
- case MYSQL_TYPE_LONG:
- return "MYSQL_TYPE_LONG";
- case MYSQL_TYPE_FLOAT:
- return "MYSQL_TYPE_FLOAT";
- case MYSQL_TYPE_DOUBLE:
- return "MYSQL_TYPE_DOUBLE";
- case MYSQL_TYPE_NULL:
- return "MYSQL_TYPE_NULL";
- case MYSQL_TYPE_TIMESTAMP:
- return "MYSQL_TYPE_TIMESTAMP";
- case MYSQL_TYPE_LONGLONG:
- return "MYSQL_TYPE_LONGLONG";
- case MYSQL_TYPE_INT24:
- return "MYSQL_TYPE_INT24";
- case MYSQL_TYPE_DATE:
- return "MYSQL_TYPE_DATE";
- case MYSQL_TYPE_TIME:
- return "MYSQL_TYPE_TIME";
- case MYSQL_TYPE_DATETIME:
- return "MYSQL_TYPE_DATETIME";
- case MYSQL_TYPE_YEAR:
- return "MYSQL_TYPE_YEAR";
- case MYSQL_TYPE_NEWDATE:
- return "MYSQL_TYPE_NEWDATE";
- case MYSQL_TYPE_VARCHAR:
- return "MYSQL_TYPE_VARCHAR";
- case MYSQL_TYPE_BIT:
- return "MYSQL_TYPE_BIT";
- case MYSQL_TYPE_NEWDECIMAL:
- return "MYSQL_TYPE_NEWDECIMAL";
- case MYSQL_TYPE_ENUM:
- return "MYSQL_TYPE_ENUM";
- case MYSQL_TYPE_SET:
- return "MYSQL_TYPE_SET";
- case MYSQL_TYPE_TINY_BLOB:
- return "MYSQL_TYPE_TINY_BLOB";
- case MYSQL_TYPE_MEDIUM_BLOB:
- return "MYSQL_TYPE_MEDIUM_BLOB";
- case MYSQL_TYPE_LONG_BLOB:
- return "MYSQL_TYPE_LONG_BLOB";
- case MYSQL_TYPE_BLOB:
- return "MYSQL_TYPE_BLOB";
- case MYSQL_TYPE_VAR_STRING:
- return "MYSQL_TYPE_VAR_STRING";
- case MYSQL_TYPE_STRING:
- return "MYSQL_TYPE_STRING";
- case MYSQL_TYPE_GEOMETRY:
- return "MYSQL_TYPE_GEOMETRY";
- }
- return "Unknown";
-}
-#endif
-
-
/* Declare in unnamed namespace. */
CPP_UNNAMED_NS_START
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 28a867cfcd8..bfae3d9c199 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -7536,28 +7536,6 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
if (select_lex->item_list.elements)
{
/* Check permissions for used tables in CREATE TABLE ... SELECT */
-
-#ifdef NOT_NECESSARY_TO_CHECK_CREATE_TABLE_EXIST_WHEN_PREPARING_STATEMENT
- /* This code throws an ill error for CREATE TABLE t1 SELECT * FROM t1 */
- /*
- Only do the check for PS, because we on execute we have to check that
- against the opened tables to ensure we don't use a table that is part
- of the view (which can only be done after the table has been opened).
- */
- if (thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
- {
- /*
- For temporary tables we don't have to check if the created table exists
- */
- if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) &&
- find_table_in_global_list(tables, create_table->db,
- create_table->table_name))
- {
- error= FALSE;
- goto err;
- }
- }
-#endif
if (tables && check_table_access(thd, SELECT_ACL, tables, FALSE,
UINT_MAX, FALSE))
goto err;
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 2b6be403fc6..3a0945faa49 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -901,19 +901,6 @@ static void plugin_del(struct st_plugin_int *plugin)
DBUG_VOID_RETURN;
}
-#ifdef NOT_USED
-
-static void plugin_del(const LEX_STRING *name)
-{
- struct st_plugin_int *plugin;
- DBUG_ENTER("plugin_del(name)");
- if ((plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)))
- plugin_del(plugin);
- DBUG_VOID_RETURN;
-}
-
-#endif
-
static void reap_plugins(void)
{
uint count, idx;
@@ -1394,51 +1381,6 @@ static bool register_builtin(struct st_mysql_plugin *plugin,
DBUG_RETURN(0);
}
-#ifdef NOT_USED_YET
-/*
- Register a plugin at run time. (note, this doesn't initialize a plugin)
- Will be useful for embedded applications.
-
- SYNOPSIS
- plugin_register_builtin()
- thd current thread (used to store scratch data in mem_root)
- plugin static plugin to install
-
- RETURN
- false - plugin registered successfully
-*/
-bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
-{
- struct st_plugin_int tmp, *ptr;
- bool result= true;
- int dummy_argc= 0;
- DBUG_ENTER("plugin_register_builtin");
-
- bzero(&tmp, sizeof(tmp));
- tmp.plugin= plugin;
- tmp.name.str= (char *)plugin->name;
- tmp.name.length= strlen(plugin->name);
-
- mysql_mutex_lock(&LOCK_plugin);
- mysql_rwlock_wrlock(&LOCK_system_variables_hash);
-
- if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL))
- goto end;
- tmp.state= PLUGIN_IS_UNINITIALIZED;
- if ((result= register_builtin(plugin, &tmp, &ptr)))
- {
- mysql_del_sys_var_chain(tmp.system_vars);
- restore_pluginvar_names(tmp.system_vars);
- }
-
-end:
- mysql_rwlock_unlock(&LOCK_system_variables_hash);
- mysql_mutex_unlock(&LOCK_plugin);
-
- DBUG_RETURN(result);;
-}
-#endif /* NOT_USED_YET */
-
/*
called only by plugin_init()
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 74d05780f81..e18486d718a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -12480,11 +12480,6 @@ join_ft_read_first(JOIN_TAB *tab)
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key, 1);
-#if NOT_USED_YET
- /* as ft-key doesn't use store_key's, see also FT_SELECT::init() */
- if (cp_buffer_from_ref(tab->join->thd, table, &tab->ref))
- return -1;
-#endif
table->file->ft_init();
if ((error= table->file->ft_read(table->record[0])))
@@ -12774,22 +12769,6 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
{
copy_fields(&join->tmp_table_param);
copy_funcs(join->tmp_table_param.items_to_copy);
-#ifdef TO_BE_DELETED
- if (!table->uniques) // If not unique handling
- {
- /* Copy null values from group to row */
- ORDER *group;
- for (group=table->group ; group ; group=group->next)
- {
- Item *item= *group->item;
- if (item->maybe_null)
- {
- Field *field=item->get_tmp_table_field();
- field->ptr[-1]= (uchar) (field->is_null() ? 1 : 0);
- }
- }
- }
-#endif
if (!join->having || join->having->val_int())
{
int error;
@@ -13997,44 +13976,6 @@ err:
DBUG_RETURN(-1);
}
-#ifdef NOT_YET
-/**
- Add the HAVING criteria to table->select.
-*/
-
-static bool fix_having(JOIN *join, Item **having)
-{
- (*having)->update_used_tables(); // Some tables may have been const
- JOIN_TAB *table=&join->join_tab[join->const_tables];
- table_map used_tables= join->const_table_map | table->table->map;
-
- DBUG_EXECUTE("where",print_where(*having,"having", QT_ORDINARY););
- Item* sort_table_cond=make_cond_for_table(*having,used_tables,used_tables);
- if (sort_table_cond)
- {
- if (!table->select)
- if (!(table->select=new SQL_SELECT))
- return 1;
- if (!table->select->cond)
- table->select->cond=sort_table_cond;
- else // This should never happen
- if (!(table->select->cond= new Item_cond_and(table->select->cond,
- sort_table_cond)) ||
- table->select->cond->fix_fields(join->thd, &table->select->cond))
- return 1;
- table->select_cond=table->select->cond;
- table->select_cond->top_level_item();
- DBUG_EXECUTE("where",print_where(table->select_cond,
- "select and having",
- QT_ORDINARY););
- *having=make_cond_for_table(*having,~ (table_map) 0,~used_tables);
- DBUG_EXECUTE("where",
- print_where(*having,"having after make_cond", QT_ORDINARY););
- }
- return 0;
-}
-#endif
-
/*****************************************************************************
Remove duplicates from tmp table
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index a8ae5832a2a..78508df2c9e 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -5700,52 +5700,6 @@ static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables,
}
-#ifdef NOT_USED
-static interval_type get_real_interval_type(interval_type i_type)
-{
- switch (i_type) {
- case INTERVAL_YEAR:
- return INTERVAL_YEAR;
-
- case INTERVAL_QUARTER:
- case INTERVAL_YEAR_MONTH:
- case INTERVAL_MONTH:
- return INTERVAL_MONTH;
-
- case INTERVAL_WEEK:
- case INTERVAL_DAY:
- return INTERVAL_DAY;
-
- case INTERVAL_DAY_HOUR:
- case INTERVAL_HOUR:
- return INTERVAL_HOUR;
-
- case INTERVAL_DAY_MINUTE:
- case INTERVAL_HOUR_MINUTE:
- case INTERVAL_MINUTE:
- return INTERVAL_MINUTE;
-
- case INTERVAL_DAY_SECOND:
- case INTERVAL_HOUR_SECOND:
- case INTERVAL_MINUTE_SECOND:
- case INTERVAL_SECOND:
- return INTERVAL_SECOND;
-
- case INTERVAL_DAY_MICROSECOND:
- case INTERVAL_HOUR_MICROSECOND:
- case INTERVAL_MINUTE_MICROSECOND:
- case INTERVAL_SECOND_MICROSECOND:
- case INTERVAL_MICROSECOND:
- return INTERVAL_MICROSECOND;
- case INTERVAL_LAST:
- DBUG_ASSERT(0);
- }
- DBUG_ASSERT(0);
- return INTERVAL_SECOND;
-}
-
-#endif
-
#ifdef HAVE_EVENT_SCHEDULER
/*
Loads an event from mysql.event and copies it's data to a row of
diff --git a/storage/heap/hp_test2.c b/storage/heap/hp_test2.c
index 1571fc98402..3ee903be7ed 100644
--- a/storage/heap/hp_test2.c
+++ b/storage/heap/hp_test2.c
@@ -179,11 +179,6 @@ int main(int argc, char *argv[])
printf("can't find key1: \"%s\"\n",(char*) key);
goto err;
}
-#ifdef NOT_USED
- if (file->current_ptr == hp_find_block(&file->s->block,0) ||
- file->current_ptr == hp_find_block(&file->s->block,1))
- continue; /* Don't remove 2 first records */
-#endif
if (heap_delete(file,record))
{
printf("error: %d; can't delete record: \"%s\"\n", my_errno,(char*) record);
diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c
index 59b895b5e64..37c5c34658e 100644
--- a/storage/myisam/mi_dynrec.c
+++ b/storage/myisam/mi_dynrec.c
@@ -283,13 +283,6 @@ int _mi_write_blob_record(MI_INFO *info, const uchar *record)
MI_DYN_DELETE_BLOCK_HEADER+1);
reclength= (info->s->base.pack_reclength +
_my_calc_total_blob_length(info,record)+ extra);
-#ifdef NOT_USED /* We now support big rows */
- if (reclength > MI_DYN_MAX_ROW_LENGTH)
- {
- my_errno=HA_ERR_TO_BIG_ROW;
- return -1;
- }
-#endif
if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
@@ -317,13 +310,6 @@ int _mi_update_blob_record(MI_INFO *info, my_off_t pos, const uchar *record)
MI_DYN_DELETE_BLOCK_HEADER);
reclength= (info->s->base.pack_reclength+
_my_calc_total_blob_length(info,record)+ extra);
-#ifdef NOT_USED /* We now support big rows */
- if (reclength > MI_DYN_MAX_ROW_LENGTH)
- {
- my_errno=HA_ERR_TO_BIG_ROW;
- return -1;
- }
-#endif
if (!(rec_buff=(uchar*) my_alloca(reclength)))
{
my_errno= HA_ERR_OUT_OF_MEM; /* purecov: inspected */
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 130a96bc9e0..7312500abbd 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -544,10 +544,6 @@ void _mi_store_static_key(MI_KEYDEF *keyinfo, uchar *key_pos,
MI_KEY_PARAM *s_temp);
void _mi_store_var_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos,
MI_KEY_PARAM *s_temp);
-#ifdef NOT_USED
-void _mi_store_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos,
- MI_KEY_PARAM *s_temp);
-#endif
void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo, uchar *key_pos,
MI_KEY_PARAM *s_temp);
diff --git a/storage/myisam/rt_test.c b/storage/myisam/rt_test.c
index 4a9b61605d9..7233300c539 100644
--- a/storage/myisam/rt_test.c
+++ b/storage/myisam/rt_test.c
@@ -366,25 +366,6 @@ static int read_with_pos (MI_INFO * file,int silent)
}
-#ifdef NOT_USED
-static void bprint_record(char * record,
- my_off_t offs __attribute__((unused)),
- const char * tail)
-{
- int i;
- char * pos;
- i=(unsigned char)record[0];
- printf("%02X ",i);
-
- for( pos=record+1, i=0; i<32; i++,pos++){
- int b=(unsigned char)*pos;
- printf("%02X",b);
- }
- printf("%s",tail);
-}
-#endif
-
-
static void print_record(uchar * record,
my_off_t offs __attribute__((unused)),
const char * tail)
@@ -424,30 +405,6 @@ static void create_record1(uchar *record,uint rownr)
}
}
-#ifdef NOT_USED
-
-static void create_record0(uchar *record,uint rownr)
-{
- int i;
- char * pos;
- double c=rownr+10;
- double c0=0;
-
- bzero((char*) record,MAX_REC_LENGTH);
- record[0]=0x01; /* DEL marker */
-
- for ( pos=record+1, i=0; i<ndims; i++)
- {
- memcpy(pos,&c0,sizeof(c0));
- float8store(pos,c0);
- pos+=sizeof(c0);
- memcpy(pos,&c,sizeof(c));
- float8store(pos,c);
- pos+=sizeof(c);
- }
-}
-
-#endif
static void create_record(uchar *record,uint rownr)
{
diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c
index 069f43c320d..7358b138a67 100644
--- a/storage/myisam/sp_test.c
+++ b/storage/myisam/sp_test.c
@@ -299,26 +299,6 @@ static int read_with_pos (MI_INFO * file,int silent)
}
-#ifdef NOT_USED
-static void bprint_record(uchar * record,
- my_off_t offs __attribute__((unused)),
- const char * tail)
-{
- int i;
- char * pos;
- i=(unsigned char)record[0];
- printf("%02X ",i);
-
- for( pos=record+1, i=0; i<32; i++,pos++)
- {
- int b=(unsigned char)*pos;
- printf("%02X",b);
- }
- printf("%s",tail);
-}
-#endif
-
-
static void print_record(uchar * record, my_off_t offs,const char * tail)
{
uchar *pos;
@@ -340,34 +320,6 @@ static void print_record(uchar * record, my_off_t offs,const char * tail)
}
-#ifdef NOT_USED
-static void create_point(uchar *record,uint rownr)
-{
- uint tmp;
- char *ptr;
- char *pos=record;
- double x[200];
- int i;
-
- for(i=0;i<SPDIMS;i++)
- x[i]=rownr;
-
- bzero((char*) record,MAX_REC_LENGTH);
- *pos=0x01; /* DEL marker */
- pos++;
-
- memset(blob_key,0,sizeof(blob_key));
- tmp=rtree_CreatePointWKB(x,SPDIMS,blob_key);
-
- int4store(pos,tmp);
- pos+=4;
-
- ptr=blob_key;
- memcpy_fixed(pos,&ptr,sizeof(char*));
-}
-#endif
-
-
static void create_linestring(uchar *record,uint rownr)
{
uint tmp;
@@ -426,27 +378,6 @@ static void print_key(const uchar *key,const char * tail)
}
-#ifdef NOT_USED
-
-static int rtree_CreatePointWKB(double *ords, uint n_dims, uchar *wkb)
-{
- uint i;
-
- *wkb = wkbXDR;
- ++wkb;
- int4store(wkb, wkbPoint);
- wkb += 4;
-
- for (i=0; i < n_dims; ++i)
- {
- float8store(wkb, ords[i]);
- wkb += 8;
- }
- return 5 + n_dims * 8;
-}
-#endif
-
-
static int rtree_CreateLineStringWKB(double *ords, uint n_dims, uint n_points,
uchar *wkb)
{
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 8a3d3d7425c..2e5f78a30bf 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -335,10 +335,6 @@ long my_strntol_8bit(CHARSET_INFO *cs,
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -364,29 +360,6 @@ long my_strntol_8bit(CHARSET_INFO *cs,
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = ((uint32)~0L) / (uint32) base;
cutlim = (uint) (((uint32)~0L) % (uint32) base);
@@ -458,10 +431,6 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -486,29 +455,6 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = ((uint32)~0L) / (uint32) base;
cutlim = (uint) (((uint32)~0L) % (uint32) base);
@@ -571,10 +517,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -599,29 +541,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X'|| s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = (~(ulonglong) 0) / (unsigned long int) base;
@@ -694,10 +613,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
int overflow;
*err= 0; /* Initialize error indicator */
-#ifdef NOT_USED
- if (base < 0 || base == 1 || base > 36)
- base = 10;
-#endif
s = nptr;
e = nptr+l;
@@ -722,29 +637,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
else
negative = 0;
-#ifdef NOT_USED
- if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x'))
- s += 2;
-#endif
-
-#ifdef NOT_USED
- if (base == 0)
- {
- if (*s == '0')
- {
- if (s[1]=='X' || s[1]=='x')
- {
- s += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
-#endif
-
save = s;
cutoff = (~(ulonglong) 0) / (unsigned long int) base;
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index 3946f6a83b4..d3b0b93a939 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -134,11 +134,6 @@ my_strntol_mb2_or_mb4(CHARSET_INFO *cs,
bs:
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
-
overflow= 0;
res= 0;
save= s;
@@ -250,11 +245,6 @@ my_strntoul_mb2_or_mb4(CHARSET_INFO *cs,
bs:
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
-
overflow= 0;
res= 0;
save= s;
@@ -359,11 +349,6 @@ my_strntoll_mb2_or_mb4(CHARSET_INFO *cs,
bs:
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
-
overflow = 0;
res = 0;
save = s;
@@ -474,11 +459,6 @@ my_strntoull_mb2_or_mb4(CHARSET_INFO *cs,
} while (1);
bs:
-
-#ifdef NOT_USED
- if (base <= 0 || base == 1 || base > 36)
- base = 10;
-#endif
overflow = 0;
res = 0;
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index a3640077889..61f9d4881cb 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -5775,215 +5775,6 @@ static void test_set_variable()
mysql_stmt_close(stmt1);
}
-#if NOT_USED
-
-/* Insert meta info .. */
-
-static void test_insert_meta()
-{
- MYSQL_STMT *stmt;
- int rc;
- MYSQL_RES *result;
- MYSQL_FIELD *field;
-
- myheader("test_insert_meta");
-
- rc= mysql_autocommit(mysql, TRUE);
- myquery(rc);
-
- rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_insert");
- myquery(rc);
-
- rc= mysql_query(mysql, "CREATE TABLE test_prep_insert(col1 tinyint, \
- col2 varchar(50), col3 varchar(30))");
- myquery(rc);
-
- strmov(query, "INSERT INTO test_prep_insert VALUES(10, 'venu1', 'test')");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 0);
-
- result= mysql_param_result(stmt);
- mytest_r(result);
-
- mysql_stmt_close(stmt);
-
- strmov(query, "INSERT INTO test_prep_insert VALUES(?, 'venu', ?)");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 2);
-
- result= mysql_param_result(stmt);
- mytest(result);
-
- my_print_result_metadata(result);
-
- mysql_field_seek(result, 0);
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1");
- DIE_UNLESS(strcmp(field->name, "col1") == 0);
-
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3");
- DIE_UNLESS(strcmp(field->name, "col3") == 0);
-
- field= mysql_fetch_field(result);
- mytest_r(field);
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-}
-
-
-/* Update meta info .. */
-
-static void test_update_meta()
-{
- MYSQL_STMT *stmt;
- int rc;
- MYSQL_RES *result;
- MYSQL_FIELD *field;
-
- myheader("test_update_meta");
-
- rc= mysql_autocommit(mysql, TRUE);
- myquery(rc);
-
- rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_update");
- myquery(rc);
-
- rc= mysql_query(mysql, "CREATE TABLE test_prep_update(col1 tinyint, \
- col2 varchar(50), col3 varchar(30))");
- myquery(rc);
-
- strmov(query, "UPDATE test_prep_update SET col1=10, col2='venu1' WHERE col3='test'");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 0);
-
- result= mysql_param_result(stmt);
- mytest_r(result);
-
- mysql_stmt_close(stmt);
-
- strmov(query, "UPDATE test_prep_update SET col1=?, col2='venu' WHERE col3=?");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 2);
-
- result= mysql_param_result(stmt);
- mytest(result);
-
- my_print_result_metadata(result);
-
- mysql_field_seek(result, 0);
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update");
- }
- DIE_UNLESS(strcmp(field->name, "col1") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0);
-
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update");
- }
- DIE_UNLESS(strcmp(field->name, "col3") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0);
-
- field= mysql_fetch_field(result);
- mytest_r(field);
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-}
-
-
-/* Select meta info .. */
-
-static void test_select_meta()
-{
- MYSQL_STMT *stmt;
- int rc;
- MYSQL_RES *result;
- MYSQL_FIELD *field;
-
- myheader("test_select_meta");
-
- rc= mysql_autocommit(mysql, TRUE);
- myquery(rc);
-
- rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prep_select");
- myquery(rc);
-
- rc= mysql_query(mysql, "CREATE TABLE test_prep_select(col1 tinyint, \
- col2 varchar(50), col3 varchar(30))");
- myquery(rc);
-
- strmov(query, "SELECT * FROM test_prep_select WHERE col1=10");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 0);
-
- result= mysql_param_result(stmt);
- mytest_r(result);
-
- strmov(query, "SELECT col1, col3 from test_prep_select WHERE col1=? AND col3='test' AND col2= ?");
- stmt= mysql_simple_prepare(mysql, query);
- check_stmt(stmt);
-
- verify_param_count(stmt, 2);
-
- result= mysql_param_result(stmt);
- mytest(result);
-
- my_print_result_metadata(result);
-
- mysql_field_seek(result, 0);
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select");
- }
- DIE_UNLESS(strcmp(field->name, "col1") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0);
-
- field= mysql_fetch_field(result);
- mytest(field);
- if (!opt_silent)
- {
- fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2");
- fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select");
- }
- DIE_UNLESS(strcmp(field->name, "col2") == 0);
- DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0);
-
- field= mysql_fetch_field(result);
- mytest_r(field);
-
- mysql_free_result(result);
- mysql_stmt_close(stmt);
-}
-#endif
-
-
/* Test FUNCTION field info / DATE_FORMAT() table_name . */
static void test_func_fields()