summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc20
-rw-r--r--client/mysql_upgrade.c2
-rw-r--r--client/mysqladmin.cc8
-rw-r--r--client/mysqlbinlog.cc4
-rw-r--r--client/mysqlcheck.c4
-rw-r--r--client/mysqldump.c12
-rw-r--r--client/mysqlslap.c10
-rw-r--r--client/mysqltest.c6
-rw-r--r--client/sql_string.cc6
9 files changed, 37 insertions, 35 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 45b049bc518..8e6a4dd99ae 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -196,6 +196,8 @@ void tee_putc(int c, FILE *file);
static void tee_print_sized_data(const char *, unsigned int, unsigned int, bool);
/* The names of functions that actually do the manipulation. */
static int get_options(int argc,char **argv);
+extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
+ char *argument);
static int com_quit(String *str,char*),
com_go(String *str,char*), com_ego(String *str,char*),
com_print(String *str,char*),
@@ -349,8 +351,8 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
-static sig_handler mysql_end(int sig);
-static sig_handler handle_sigint(int sig);
+extern "C" sig_handler mysql_end(int sig);
+extern "C" sig_handler handle_sigint(int sig);
int main(int argc,char *argv[])
{
@@ -814,7 +816,7 @@ and you are welcome to modify and redistribute it under the GPL license\n");
}
-static my_bool
+my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
@@ -1427,7 +1429,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
#ifdef HAVE_READLINE
static char *new_command_generator(const char *text, int);
-static char **new_mysql_completion (const char *text, int start, int end);
+extern "C" char **new_mysql_completion (const char *text, int start, int end);
/*
Tell the GNU Readline library how to complete. We want to try to complete
@@ -1436,9 +1438,9 @@ static char **new_mysql_completion (const char *text, int start, int end);
*/
#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
-char *no_completion(const char*,int)
+extern "C" char *no_completion(const char*,int)
#else
-char *no_completion()
+extern "C" char *no_completion()
#endif
{
return 0; /* No filename completion */
@@ -1540,9 +1542,9 @@ static void initialize_readline (char *name)
array of matches, or NULL if there aren't any.
*/
-static char **new_mysql_completion (const char *text,
- int start __attribute__((unused)),
- int end __attribute__((unused)))
+char **new_mysql_completion (const char *text,
+ int start __attribute__((unused)),
+ int end __attribute__((unused)))
{
if (!status.batch && !quick)
#if defined(USE_NEW_READLINE_INTERFACE)
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 5da0235c913..698cbeaaaa1 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -451,7 +451,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
MYF(MY_WME))) < 0)
die("Failed to create temporary file for defaults");
- if (my_write(fd, query, strlen(query),
+ if (my_write(fd, (uchar*) query, strlen(query),
MYF(MY_FNABP | MY_WME)))
die("Failed to write to '%s'", query_file_path);
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index ce48ad03d33..91fb7386916 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -71,10 +71,12 @@ static uint ex_var_count, max_var_length, max_val_length;
static void print_version(void);
static void usage(void);
+extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
+ char *argument);
static my_bool sql_connect(MYSQL *mysql, uint wait);
static int execute_commands(MYSQL *mysql,int argc, char **argv);
static int drop_db(MYSQL *mysql,const char *db);
-static sig_handler endprog(int signal_number);
+extern "C" sig_handler endprog(int signal_number);
static void nice_time(ulong sec,char *buff);
static void print_header(MYSQL_RES *result);
static void print_top(MYSQL_RES *result);
@@ -230,7 +232,7 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqladmin","client",0 };
-static my_bool
+my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
@@ -430,7 +432,7 @@ int main(int argc,char *argv[])
}
-static sig_handler endprog(int signal_number __attribute__((unused)))
+sig_handler endprog(int signal_number __attribute__((unused)))
{
interrupted=1;
}
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index bd045050484..12d1da39974 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1030,14 +1030,14 @@ static int dump_log_entries(const char* logname)
like CREATE PROCEDURE safely
*/
fprintf(result_file, "DELIMITER /*!*/;\n");
- strcpy(print_event_info.delimiter, "/*!*/;");
+ strmov(print_event_info.delimiter, "/*!*/;");
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
/* Set delimiter back to semicolon */
fprintf(result_file, "DELIMITER ;\n");
- strcpy(print_event_info.delimiter, ";");
+ strmov(print_event_info.delimiter, ";");
return rc;
}
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index ee8d5c0d6d3..316412d7df9 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -677,7 +677,7 @@ static void print_result()
*/
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
strcmp(row[3],"OK"))
- insert_dynamic(&tables4repair, prev);
+ insert_dynamic(&tables4repair, (uchar*) prev);
found_error=0;
if (opt_silent)
continue;
@@ -697,7 +697,7 @@ static void print_result()
}
/* add the last table to be repaired to the list */
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
- insert_dynamic(&tables4repair, prev);
+ insert_dynamic(&tables4repair, (uchar*) prev);
mysql_free_result(res);
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 3d2aec92dea..25c11b5e71d 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -3913,9 +3913,9 @@ static int init_dumping(char *database, int init_func(char*))
/* Return 1 if we should copy the table */
-my_bool include_table(const char* hash_key, uint len)
+my_bool include_table(const uchar *hash_key, size_t len)
{
- return !hash_search(&ignore_table, (uchar*) hash_key, len);
+ return !hash_search(&ignore_table, hash_key, len);
}
@@ -3943,7 +3943,7 @@ static int dump_all_tables_in_db(char *database)
for (numrows= 0 ; (table= getTableName(1)) ; )
{
char *end= strmov(afterdot, table);
- if (include_table(hash_key,end - hash_key))
+ if (include_table((uchar*) hash_key,end - hash_key))
{
numrows++;
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
@@ -3964,7 +3964,7 @@ static int dump_all_tables_in_db(char *database)
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
- if (include_table(hash_key, end - hash_key))
+ if (include_table((uchar*) hash_key, end - hash_key))
{
dump_table(table,database);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
@@ -4043,7 +4043,7 @@ static my_bool dump_all_views_in_db(char *database)
for (numrows= 0 ; (table= getTableName(1)); )
{
char *end= strmov(afterdot, table);
- if (include_table(hash_key,end - hash_key))
+ if (include_table((uchar*) hash_key,end - hash_key))
{
numrows++;
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
@@ -4064,7 +4064,7 @@ static my_bool dump_all_views_in_db(char *database)
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
- if (include_table(hash_key, end - hash_key))
+ if (include_table((uchar*) hash_key, end - hash_key))
get_view_structure(table, database);
}
if (opt_xml)
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index a550dcae260..78f9efe8bd2 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1354,7 +1354,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
parse_delimiter(tmp_string, &create_statements, delimiter[0]);
@@ -1381,7 +1381,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_query)
@@ -1412,7 +1412,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_pre_statements)
@@ -1443,7 +1443,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
- my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
+ my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_post_statements)
@@ -2076,7 +2076,7 @@ print_conclusions_csv(conclusions *con)
con->users, /* Children used */
con->avg_rows /* Queries run */
);
- my_write(csv_file, buffer, (uint)strlen(buffer), MYF(0));
+ my_write(csv_file, (uchar*) buffer, (uint)strlen(buffer), MYF(0));
}
void
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 7ba57f7515c..1c98ea3bf50 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -1514,7 +1514,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
void var_set_query_get_value(struct st_command *command, VAR *var)
{
- ulong row_no;
+ long row_no;
int col_no= -1;
MYSQL_RES* res;
MYSQL* mysql= &cur_con->mysql;
@@ -1591,7 +1591,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
while ((row= mysql_fetch_row(res)))
{
- if (++rows == row_no)
+ if (++rows == (ulong) row_no)
{
DBUG_PRINT("info", ("At row %ld, column %d is '%s'",
@@ -2584,7 +2584,7 @@ void do_send_quit(struct st_command *command)
DBUG_PRINT("info", ("con->name: %s", con->name));
if (!strcmp(con->name, name))
{
- simple_command(&con->mysql,COM_QUIT,NullS,0,1);
+ simple_command(&con->mysql,COM_QUIT,0,0,1);
DBUG_VOID_RETURN;
}
}
diff --git a/client/sql_string.cc b/client/sql_string.cc
index 57a5df7ce96..c41463999aa 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -805,10 +805,8 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
const uchar *from_end= (const uchar*) from+from_length;
char *to_start= to;
uchar *to_end= (uchar*) to+to_length;
- int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
- const uchar *) = from_cs->cset->mb_wc;
- int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
- to_cs->cset->wc_mb;
+ my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
+ my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
uint error_count= 0;
while (1)