summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorhf@deer.(none) <>2004-05-19 10:28:24 +0500
committerhf@deer.(none) <>2004-05-19 10:28:24 +0500
commitaf39bd412535c1d9f34573f69745deb0cb3fef38 (patch)
treef3d591abdb5354baa14cc13c25ecf689f19519fd /sql
parent3a7e3f061233cdc206e6d3fe797f7bcbfee209e1 (diff)
parent332f124bc62d2a63cfb566b50e2784c357ef6b8e (diff)
downloadmariadb-git-af39bd412535c1d9f34573f69745deb0cb3fef38.tar.gz
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.ps
Diffstat (limited to 'sql')
-rw-r--r--sql/examples/ha_example.h6
-rw-r--r--sql/handler.cc7
-rw-r--r--sql/sql_insert.cc4
-rw-r--r--sql/sql_parse.cc2
4 files changed, 9 insertions, 10 deletions
diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h
index ffc4f5b941c..2228f04284a 100644
--- a/sql/examples/ha_example.h
+++ b/sql/examples/ha_example.h
@@ -114,10 +114,8 @@ public:
int reset(void);
int external_lock(THD *thd, int lock_type);
int delete_all_rows(void);
- ha_rows records_in_range(int inx, const byte *start_key,uint start_key_len,
- enum ha_rkey_function start_search_flag,
- const byte *end_key,uint end_key_len,
- enum ha_rkey_function end_search_flag);
+ ha_rows records_in_range(uint inx, key_range *min_key,
+ key_range *max_key);
int delete_table(const char *from);
int rename_table(const char * from, const char * to);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
diff --git a/sql/handler.cc b/sql/handler.cc
index f8eca1b93ef..9acd55db0b1 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -103,15 +103,16 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
enum db_type ha_resolve_by_name(const char *name, uint namelen)
{
- if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
- return(enum db_type) current_thd->variables.table_type;
+ THD *thd=current_thd;
+ if (thd && !my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
+ return (enum db_type) thd->variables.table_type;
}
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (!my_strcasecmp(&my_charset_latin1, name, types->type))
- return(enum db_type)types->db_type;
+ return (enum db_type) types->db_type;
}
return DB_TYPE_UNKNOWN;
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 1bf95b8bded..3aa0e9511a7 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -411,7 +411,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
+ (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
::send_ok(thd,info.copied+info.deleted+info.updated,(ulonglong)id,buff);
}
free_underlaid_joins(thd, &thd->lex->select_lex);
@@ -1582,7 +1582,7 @@ bool select_insert::send_eof()
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
+ (ulong) (info.deleted+info.updated), (ulong) thd->cuted_fields);
::send_ok(thd,info.copied+info.deleted+info.updated,last_insert_id,buff);
DBUG_RETURN(0);
}
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0c178f05cc0..373f3c82ff3 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4613,7 +4613,7 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
mysql_bin_log.new_file(1);
mysql_slow_log.new_file(1);
#ifdef HAVE_REPLICATION
- if (expire_logs_days)
+ if (mysql_bin_log.is_open() && expire_logs_days)
{
long purge_time= time(0) - expire_logs_days*24*60*60;
if (purge_time >= 0)