mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
removed DBUG_ENTER/RETURN tags
This commit is contained in:
131
sql/handler.cc
131
sql/handler.cc
@@ -72,16 +72,14 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
|
||||
|
||||
enum db_type ha_checktype(enum db_type database_type)
|
||||
{
|
||||
DBUG_ENTER("ha_checktype");
|
||||
|
||||
switch (database_type) {
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
case DB_TYPE_BERKELEY_DB:
|
||||
DBUG_RETURN((berkeley_skip ? DB_TYPE_MYISAM : database_type));
|
||||
return(berkeley_skip ? DB_TYPE_MYISAM : database_type);
|
||||
#endif
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
case DB_TYPE_INNODB:
|
||||
DBUG_RETURN((innodb_skip ? DB_TYPE_MYISAM : database_type));
|
||||
return(innodb_skip ? DB_TYPE_MYISAM : database_type);
|
||||
#endif
|
||||
#ifndef NO_HASH
|
||||
case DB_TYPE_HASH:
|
||||
@@ -93,57 +91,52 @@ enum db_type ha_checktype(enum db_type database_type)
|
||||
case DB_TYPE_HEAP:
|
||||
case DB_TYPE_MYISAM:
|
||||
case DB_TYPE_MRG_MYISAM:
|
||||
DBUG_RETURN((database_type)); /* Database exists on system */
|
||||
return (database_type); /* Database exists on system */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
DBUG_RETURN((DB_TYPE_MYISAM)); /* Use this as default */
|
||||
return(DB_TYPE_MYISAM); /* Use this as default */
|
||||
} /* ha_checktype */
|
||||
|
||||
|
||||
handler *get_new_handler(TABLE *table, enum db_type db_type)
|
||||
{
|
||||
DBUG_ENTER("*get_new_handler");
|
||||
|
||||
switch (db_type) {
|
||||
#ifndef NO_HASH
|
||||
DBUG_RETURN(new ha_hash(table));
|
||||
return new ha_hash(table);
|
||||
#endif
|
||||
#ifdef HAVE_ISAM
|
||||
case DB_TYPE_MRG_ISAM:
|
||||
DBUG_RETURN(new ha_isammrg(table));
|
||||
return new ha_isammrg(table);
|
||||
case DB_TYPE_ISAM:
|
||||
DBUG_RETURN(new ha_isam(table));
|
||||
return new ha_isam(table);
|
||||
#endif
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
case DB_TYPE_BERKELEY_DB:
|
||||
DBUG_RETURN(new ha_berkeley(table));
|
||||
return new ha_berkeley(table);
|
||||
#endif
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
case DB_TYPE_INNODB:
|
||||
DBUG_RETURN(new ha_innobase(table));
|
||||
return new ha_innobase(table);
|
||||
#endif
|
||||
case DB_TYPE_HEAP:
|
||||
DBUG_RETURN(new ha_heap(table));
|
||||
return new ha_heap(table);
|
||||
case DB_TYPE_MYISAM:
|
||||
default: // should never happen
|
||||
DBUG_RETURN(new ha_myisam(table));
|
||||
return new ha_myisam(table);
|
||||
case DB_TYPE_MRG_MYISAM:
|
||||
DBUG_RETURN(new ha_myisammrg(table));
|
||||
return new ha_myisammrg(table);
|
||||
}
|
||||
DBUG_RETURN(NULL); // impossible
|
||||
}
|
||||
|
||||
int ha_init()
|
||||
{
|
||||
DBUG_ENTER("ha_init");
|
||||
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
if (!berkeley_skip)
|
||||
{
|
||||
int error;
|
||||
if ((error=berkeley_init()))
|
||||
DBUG_RETURN(error);
|
||||
return error;
|
||||
if (!berkeley_skip) // If we couldn't use handler
|
||||
opt_using_transactions=1;
|
||||
else
|
||||
@@ -154,14 +147,14 @@ int ha_init()
|
||||
if (!innodb_skip)
|
||||
{
|
||||
if (innobase_init())
|
||||
DBUG_RETURN(-1);
|
||||
return -1;
|
||||
if (!innodb_skip) // If we couldn't use handler
|
||||
opt_using_transactions=1;
|
||||
else
|
||||
have_innodb=SHOW_OPTION_DISABLED;
|
||||
}
|
||||
#endif
|
||||
DBUG_RETURN(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* close, flush or restart databases */
|
||||
@@ -170,8 +163,6 @@ int ha_init()
|
||||
int ha_panic(enum ha_panic_function flag)
|
||||
{
|
||||
int error=0;
|
||||
DBUG_ENTER("ha_panic");
|
||||
|
||||
#ifndef NO_HASH
|
||||
error|=h_panic(flag); /* fix hash */
|
||||
#endif
|
||||
@@ -190,29 +181,23 @@ int ha_panic(enum ha_panic_function flag)
|
||||
if (!innodb_skip)
|
||||
error|=innobase_end();
|
||||
#endif
|
||||
DBUG_RETURN(error);
|
||||
return error;
|
||||
} /* ha_panic */
|
||||
|
||||
void ha_drop_database(char* path)
|
||||
{
|
||||
DBUG_ENTER("ha_drop_database");
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
if (!innodb_skip)
|
||||
innobase_drop_database(path);
|
||||
#endif
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void ha_close_connection(THD* thd)
|
||||
{
|
||||
DBUG_ENTER("ha_close_connection");
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
if (!innodb_skip)
|
||||
innobase_close_connection(thd);
|
||||
#endif
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -262,8 +247,6 @@ int ha_report_binlog_offset_and_commit(THD *thd,
|
||||
my_off_t end_offset)
|
||||
{
|
||||
int error= 0;
|
||||
DBUG_ENTER("ha_report_binlog_offset_and_commit");
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
THD_TRANS *trans;
|
||||
trans = &thd->transaction.all;
|
||||
@@ -280,7 +263,7 @@ int ha_report_binlog_offset_and_commit(THD *thd,
|
||||
trans->innodb_active_trans=0;
|
||||
}
|
||||
#endif
|
||||
DBUG_RETURN(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
int ha_commit_trans(THD *thd, THD_TRANS* trans)
|
||||
@@ -398,8 +381,6 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
|
||||
bool ha_flush_logs()
|
||||
{
|
||||
bool result=0;
|
||||
DBUG_ENTER("ha_flush_logs");
|
||||
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
if (!berkeley_skip && berkeley_flush_logs())
|
||||
result=1;
|
||||
@@ -408,7 +389,7 @@ bool ha_flush_logs()
|
||||
if (!innodb_skip && innobase_flush_logs())
|
||||
result=1;
|
||||
#endif
|
||||
DBUG_RETURN(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -419,19 +400,15 @@ bool ha_flush_logs()
|
||||
int ha_delete_table(enum db_type table_type, const char *path)
|
||||
{
|
||||
handler *file=get_new_handler((TABLE*) 0, table_type);
|
||||
DBUG_ENTER("ha_delete_table");
|
||||
|
||||
if (!file)
|
||||
DBUG_RETURN(ENOENT);
|
||||
return ENOENT;
|
||||
int error=file->delete_table(path);
|
||||
delete file;
|
||||
DBUG_RETURN(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos)
|
||||
{
|
||||
DBUG_ENTER("ha_store_ptr");
|
||||
|
||||
switch (pack_length) {
|
||||
#if SIZEOF_OFF_T > 4
|
||||
case 8: mi_int8store(buff,pos); break;
|
||||
@@ -444,14 +421,12 @@ void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos)
|
||||
case 2: mi_int2store(buff,(uint) pos); break;
|
||||
case 1: buff[0]= (uchar) pos; break;
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
return;
|
||||
}
|
||||
|
||||
my_off_t ha_get_ptr(byte *ptr, uint pack_length)
|
||||
{
|
||||
my_off_t pos;
|
||||
DBUG_ENTER("ha_get_ptr");
|
||||
|
||||
switch (pack_length) {
|
||||
#if SIZEOF_OFF_T > 4
|
||||
case 8:
|
||||
@@ -483,7 +458,7 @@ my_off_t ha_get_ptr(byte *ptr, uint pack_length)
|
||||
pos=0; // Impossible
|
||||
break;
|
||||
}
|
||||
DBUG_RETURN(pos);
|
||||
return pos;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -537,44 +512,32 @@ int handler::ha_open(const char *name, int mode, int test_if_locked)
|
||||
|
||||
int handler::check(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
DBUG_ENTER("handler::check");
|
||||
|
||||
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::backup(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
DBUG_ENTER("handler::backup");
|
||||
|
||||
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::restore(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
DBUG_ENTER("handler::restore");
|
||||
|
||||
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::repair(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
DBUG_ENTER("handler::repair");
|
||||
|
||||
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::optimize(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
DBUG_ENTER("handler::optimize");
|
||||
|
||||
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
int handler::analyze(THD* thd, HA_CHECK_OPT* check_opt)
|
||||
{
|
||||
DBUG_ENTER("handler::analyze");
|
||||
|
||||
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
|
||||
return HA_ADMIN_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -619,9 +582,7 @@ int handler::read_first_row(byte * buf, uint primary_key)
|
||||
|
||||
int handler::restart_rnd_next(byte *buf, byte *pos)
|
||||
{
|
||||
DBUG_ENTER("handler::restart_rnd_next");
|
||||
|
||||
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
|
||||
return HA_ERR_WRONG_COMMAND;
|
||||
}
|
||||
|
||||
|
||||
@@ -630,8 +591,6 @@ int handler::restart_rnd_next(byte *buf, byte *pos)
|
||||
void handler::update_timestamp(byte *record)
|
||||
{
|
||||
long skr= (long) current_thd->query_start();
|
||||
DBUG_ENTER("handler::update_timestamp");
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
if (table->db_low_byte_first)
|
||||
{
|
||||
@@ -640,7 +599,7 @@ void handler::update_timestamp(byte *record)
|
||||
else
|
||||
#endif
|
||||
longstore(record,skr);
|
||||
DBUG_VOID_RETURN;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -674,7 +633,6 @@ longlong handler::get_auto_increment()
|
||||
{
|
||||
longlong nr;
|
||||
int error;
|
||||
DBUG_ENTER("handler::get_auto_increment");
|
||||
|
||||
(void) extra(HA_EXTRA_KEYREAD);
|
||||
index_init(table->next_number_index);
|
||||
@@ -698,7 +656,7 @@ longlong handler::get_auto_increment()
|
||||
val_int_offset(table->rec_buff_length)+1;
|
||||
index_end();
|
||||
(void) extra(HA_EXTRA_NO_KEYREAD);
|
||||
DBUG_RETURN(nr);
|
||||
return nr;
|
||||
}
|
||||
|
||||
/* Print error that we got from handler function */
|
||||
@@ -820,8 +778,6 @@ uint handler::get_dup_key(int error)
|
||||
int handler::delete_table(const char *name)
|
||||
{
|
||||
int error=0;
|
||||
DBUG_ENTER("handler::delete_table");
|
||||
|
||||
for (const char **ext=bas_ext(); *ext ; ext++)
|
||||
{
|
||||
if (delete_file(name,*ext,2))
|
||||
@@ -830,7 +786,7 @@ int handler::delete_table(const char *name)
|
||||
break;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -851,16 +807,14 @@ int handler::rename_table(const char * from, const char * to)
|
||||
int ha_recovery_logging(THD *thd, bool on)
|
||||
{
|
||||
int error=0;
|
||||
DBUG_ENTER("ha_recovery_logging");
|
||||
|
||||
DBUG_ENTER("ha_recovery_logging");
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
int handler::index_next_same(byte *buf, const byte *key, uint keylen)
|
||||
{
|
||||
int error;
|
||||
DBUG_ENTER("handler::index_next_same");
|
||||
|
||||
if (!(error=index_next(buf)))
|
||||
{
|
||||
if (key_cmp(table, key, active_index, keylen))
|
||||
@@ -869,7 +823,7 @@ int handler::index_next_same(byte *buf, const byte *key, uint keylen)
|
||||
error=HA_ERR_END_OF_FILE;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -882,9 +836,7 @@ int handler::index_next_same(byte *buf, const byte *key, uint keylen)
|
||||
|
||||
int handler::delete_all_rows()
|
||||
{
|
||||
DBUG_ENTER("handler::delete_all_rows");
|
||||
|
||||
DBUG_RETURN((my_errno=HA_ERR_WRONG_COMMAND));
|
||||
return (my_errno=HA_ERR_WRONG_COMMAND);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -930,37 +882,26 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
|
||||
|
||||
void ha_key_cache(void)
|
||||
{
|
||||
DBUG_ENTER("ha_key_cache");
|
||||
|
||||
if (keybuff_size)
|
||||
(void) init_key_cache(keybuff_size);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
void ha_resize_key_cache(void)
|
||||
{
|
||||
DBUG_ENTER("ha_resize_key_cache");
|
||||
|
||||
(void) resize_key_cache(keybuff_size);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
static int NEAR_F delete_file(const char *name,const char *ext,int extflag)
|
||||
{
|
||||
char buff[FN_REFLEN];
|
||||
DBUG_ENTER("delete_file");
|
||||
|
||||
VOID(fn_format(buff,name,"",ext,extflag | 4));
|
||||
DBUG_RETURN((my_delete_with_symlink(buff,MYF(MY_WME))));
|
||||
return(my_delete_with_symlink(buff,MYF(MY_WME)));
|
||||
}
|
||||
|
||||
void st_ha_check_opt::init()
|
||||
{
|
||||
DBUG_ENTER("st_ha_check_opt::init");
|
||||
|
||||
flags= sql_flags= 0;
|
||||
sort_buffer_size = current_thd->variables.myisam_sort_buff_size;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
Reference in New Issue
Block a user