summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc4
-rw-r--r--sql/field.h1
-rw-r--r--sql/ha_berkeley.cc17
-rw-r--r--sql/ha_berkeley.h5
-rw-r--r--sql/item_sum.h3
-rw-r--r--sql/log.cc4
-rw-r--r--sql/log_event.h4
-rw-r--r--sql/mysqld.cc1
-rw-r--r--sql/net_serv.cc4
-rw-r--r--sql/sql_analyse.h15
-rw-r--r--sql/sql_class.h3
-rw-r--r--sql/sql_map.h4
-rw-r--r--sql/sql_repl.cc3
-rw-r--r--sql/sql_string.h7
-rw-r--r--sql/sql_table.cc1
15 files changed, 55 insertions, 21 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 225189a1098..55a98dde0ea 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4710,13 +4710,13 @@ create_field::create_field(Field *old_field,Field *orig_field)
orig_field)
{
char buff[MAX_FIELD_WIDTH],*pos;
- String tmp(buff,sizeof(buff)),*res;
+ String tmp(buff,sizeof(buff));
/* Get the value from record[2] (the default value row) */
my_ptrdiff_t diff= (my_ptrdiff_t) (orig_field->table->rec_buff_length*2);
orig_field->move_field(diff); // Points now at record[2]
bool is_null=orig_field->is_real_null();
- res=orig_field->val_str(&tmp,&tmp);
+ orig_field->val_str(&tmp,&tmp);
orig_field->move_field(-diff); // Back to record[0]
if (!is_null)
{
diff --git a/sql/field.h b/sql/field.h
index 21fd9ebffd9..09ce80db615 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -28,6 +28,7 @@
class Send_field;
struct st_cache_field;
+void field_conv(Field *to,Field *from);
class Field {
Field(const Item &); /* Prevent use of theese */
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 944b335016e..9f31064cc54 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -110,8 +110,6 @@ static void berkeley_noticecall(DB_ENV *db_env, db_notices notice);
bool berkeley_init(void)
{
- char buff[1024],*config[10], **conf_pos, *str_pos;
- conf_pos=config; str_pos=buff;
DBUG_ENTER("berkeley_init");
if (!berkeley_tmpdir)
@@ -387,6 +385,7 @@ berkeley_cmp_packed_key(DB *file, const DBT *new_key, const DBT *saved_key)
/* The following is not yet used; Should be used for fixed length keys */
+#ifdef NOT_YET
static int
berkeley_cmp_fix_length_key(DB *file, const DBT *new_key, const DBT *saved_key)
{
@@ -407,7 +406,7 @@ berkeley_cmp_fix_length_key(DB *file, const DBT *new_key, const DBT *saved_key)
}
return key->handler.bdb_return_if_eq;
}
-
+#endif
/* Compare key against row */
@@ -1901,7 +1900,6 @@ longlong ha_berkeley::get_auto_increment()
{
DBT row,old_key;
bzero((char*) &row,sizeof(row));
- uint key_len;
KEY *key_info= &table->key_info[active_index];
/* Reading next available number for a sub key */
@@ -1947,6 +1945,7 @@ longlong ha_berkeley::get_auto_increment()
Analyzing, checking, and optimizing tables
****************************************************************************/
+#ifdef NOT_YET
static void print_msg(THD *thd, const char *table_name, const char *op_name,
const char *msg_type, const char *fmt, ...)
{
@@ -1970,7 +1969,7 @@ static void print_msg(THD *thd, const char *table_name, const char *op_name,
thd->packet.length()))
thd->killed=1;
}
-
+#endif
int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
{
@@ -2025,14 +2024,14 @@ int ha_berkeley::optimize(THD* thd, HA_CHECK_OPT* check_opt)
int ha_berkeley::check(THD* thd, HA_CHECK_OPT* check_opt)
{
- char name_buff[FN_REFLEN];
- int error;
- DB *tmp_file;
DBUG_ENTER("ha_berkeley::check");
DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
#ifdef NOT_YET
+ char name_buff[FN_REFLEN];
+ int error;
+ DB *tmp_file;
/*
To get this to work we need to ensure that no running transaction is
using the table. We also need to create a new environment without
@@ -2242,7 +2241,6 @@ void ha_berkeley::get_status()
static int write_status(DB *status_block, char *buff, uint length)
{
- DB_TXN *trans;
DBT row,key;
int error;
const char *key_buff="status";
@@ -2285,7 +2283,6 @@ static void update_status(BDB_SHARE *share, TABLE *table)
}
{
char rec_buff[4+MAX_KEY*4], *pos=rec_buff;
- const char *key_buff="status";
int4store(pos,share->rows); pos+=4;
for (uint i=0 ; i < table->keys ; i++)
{
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index 12879383261..94d12dd2a56 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -64,7 +64,7 @@ class ha_berkeley: public handler
ulong max_row_length(const byte *buf);
int pack_row(DBT *row,const byte *record, bool new_row);
void unpack_row(char *record, DBT *row);
- void ha_berkeley::unpack_key(char *record, DBT *key, uint index);
+ void unpack_key(char *record, DBT *key, uint index);
DBT *create_key(DBT *key, uint keynr, char *buff, const byte *record,
int key_length = MAX_KEY_LENGTH);
DBT *pack_key(DBT *key, uint keynr, char *buff, const byte *key_ptr,
@@ -156,13 +156,12 @@ class ha_berkeley: public handler
void get_status();
inline void get_auto_primary_key(byte *to)
{
- ulonglong tmp;
pthread_mutex_lock(&share->mutex);
share->auto_ident++;
int5store(to,share->auto_ident);
pthread_mutex_unlock(&share->mutex);
}
- longlong ha_berkeley::get_auto_increment();
+ longlong get_auto_increment();
};
extern bool berkeley_skip, berkeley_shared_data;
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 66231040747..8cb09c85623 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -166,6 +166,8 @@ class Item_sum_count_distinct :public Item_sum_int
/* Item to get the value of a stored sum function */
+class Item_sum_avg;
+
class Item_avg_field :public Item_result_field
{
public:
@@ -200,6 +202,7 @@ class Item_sum_avg :public Item_sum_num
const char *func_name() const { return "avg"; }
};
+class Item_sum_std;
class Item_std_field :public Item_result_field
{
diff --git a/sql/log.cc b/sql/log.cc
index 80001acacd2..1ff86ed4b67 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -18,6 +18,10 @@
/* logging of commands */
/* TODO: Abort logging when we get an error in reading or writing log files */
+#ifdef __EMX__
+#include <io.h>
+#endif
+
#include "mysql_priv.h"
#include "sql_acl.h"
#include "sql_repl.h"
diff --git a/sql/log_event.h b/sql/log_event.h
index 3ee1776fde3..8a22048bba4 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -18,6 +18,10 @@
#ifndef _LOG_EVENT_H
#define _LOG_EVENT_H
+#ifdef __EMX__
+#undef write // remove pthread.h macro definition, conflict with write() class member
+#endif
+
#if defined(__GNUC__) && !defined(MYSQL_CLIENT)
#pragma interface /* gcc class implementation */
#endif
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 0033c795f0f..414965b96ea 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1048,7 +1048,6 @@ static void init_signals(void)
#elif defined(__EMX__)
static void sig_reload(int signo)
{
- //reload_acl_and_cache(~0); // Flush everything
reload_acl_and_cache((THD*) 0,~0, (TABLE_LIST*) 0); // Flush everything
signal(signo, SIG_ACK);
}
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 5e7abd5d9a7..4c4642034e1 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -271,7 +271,7 @@ net_real_write(NET *net,const char *packet,ulong len)
int length;
char *pos,*end;
thr_alarm_t alarmed;
-#if !defined(__WIN__) && !defined(__EMX__)
+#if !defined(__WIN__)
ALARM alarm_buff;
#endif
uint retry_count=0;
@@ -426,7 +426,7 @@ static void my_net_skip_rest(NET *net, ulong remain, thr_alarm_t *alarmed)
if ((int) (length=vio_read(net->vio,(char*) net->buff,remain)) <= 0L)
{
my_bool interrupted = vio_should_retry(net->vio);
- if (!thr_got_alarm(&alarmed) && interrupted)
+ if (!thr_got_alarm(alarmed) && interrupted)
{ /* Probably in MIT threads */
if (retry_count++ < RETRY_COUNT)
continue;
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index e1cab3d5949..ce5c0af6a96 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -88,6 +88,9 @@ public:
};
+int collect_string(String *element, element_count count,
+ TREE_INFO *info);
+
class field_str :public field_info
{
String min_arg, max_arg;
@@ -130,6 +133,9 @@ public:
{ return (String*) 0; }
};
+
+int collect_real(double *element, element_count count, TREE_INFO *info);
+
class field_real: public field_info
{
double min_arg, max_arg;
@@ -174,6 +180,9 @@ public:
{ return (tree_walk_action) collect_real;}
};
+int collect_longlong(longlong *element, element_count count,
+ TREE_INFO *info);
+
class field_longlong: public field_info
{
longlong min_arg, max_arg;
@@ -216,6 +225,8 @@ public:
{ return (tree_walk_action) collect_longlong;}
};
+int collect_ulonglong(ulonglong *element, element_count count,
+ TREE_INFO *info);
class field_ulonglong: public field_info
{
@@ -261,6 +272,10 @@ public:
};
+Procedure *proc_analyse_init(THD *thd, ORDER *param,
+ select_result *result,
+ List<Item> &field_list);
+
class analyse: public Procedure
{
protected:
diff --git a/sql/sql_class.h b/sql/sql_class.h
index ef42eaf594c..cc5095397b6 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -102,6 +102,9 @@ public:
/* character conversion tables */
+class CONVERT;
+CONVERT *get_convert_set(const char *name_ptr);
+
class CONVERT
{
const uchar *from_map,*to_map;
diff --git a/sql/sql_map.h b/sql/sql_map.h
index e9093672fef..34f2f755b43 100644
--- a/sql/sql_map.h
+++ b/sql/sql_map.h
@@ -21,6 +21,10 @@
#pragma interface /* gcc class implementation */
#endif
+class mapped_files;
+mapped_files *map_file(const my_string name,byte *magic,uint magic_length);
+void unmap_file(mapped_files *map);
+
class mapped_files :public ilink {
byte *map;
ha_rows size;
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 4f0112bac26..590d25e3661 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -26,8 +26,7 @@
extern const char* any_db;
extern pthread_handler_decl(handle_slave,arg);
-static int fake_rotate_event(NET* net, String* packet,
- const char* log_file_name);
+
static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
const char**errmsg)
diff --git a/sql/sql_string.h b/sql/sql_string.h
index f327618ffdd..31dea9991cc 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -25,6 +25,13 @@
#define NOT_FIXED_DEC 31
#endif
+class String;
+int sortcmp(const String *a,const String *b);
+int stringcmp(const String *a,const String *b);
+String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
+int wild_case_compare(String &match,String &wild,char escape);
+int wild_compare(String &match,String &wild,char escape);
+
class String
{
char *Ptr;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index a666fa26545..954a1f8efd7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -798,7 +798,6 @@ static int send_check_errmsg(THD* thd, TABLE_LIST* table,
static int prepare_for_restore(THD* thd, TABLE_LIST* table)
{
- String *packet = &thd->packet;
DBUG_ENTER("prepare_for_restore");
if (table->table) // do not overwrite existing tables on restore