summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-01-21 21:07:59 +0200
committermonty@mashka.mysql.fi <>2003-01-21 21:07:59 +0200
commit25c393a12ea7264f265f958027d6e0a1735acc77 (patch)
treeb3f7b07e6d74a88c6ef0b3e8f43bc27b784bb24d /client
parent6522ee6c9845cf61903592e9a36c78dc4f69f569 (diff)
downloadmariadb-git-25c393a12ea7264f265f958027d6e0a1735acc77.tar.gz
Portability fixes (for windows)
Some changes to the prepared statement protocol to make it easier to use and faster.
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc6
-rw-r--r--client/mysqlbinlog.cc15
2 files changed, 9 insertions, 12 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index b8a98566cbd..8724cb539f6 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2002 MySQL AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -80,8 +80,6 @@ extern "C" {
#if defined( __WIN__) || defined(OS2)
#include <conio.h>
#else
-// readline 4.2 has own __P
-#undef __P
#include <readline/readline.h>
#define HAVE_READLINE
#endif
@@ -1443,7 +1441,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (result)
{
- int num_rows= mysql_num_rows(result);
+ ulonglong num_rows= mysql_num_rows(result);
if (num_rows == 1)
{
if (!(cur= mysql_fetch_row(result)))
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 6dbd79e9053..fff7224afd6 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -67,7 +67,8 @@ static void dump_remote_table(NET* net, const char* db, const char* table);
static void die(const char* fmt, ...);
static MYSQL* safe_connect();
-class Load_log_processor {
+class Load_log_processor
+{
char target_dir_name[MY_NFILE];
int target_dir_name_len;
DYNAMIC_ARRAY file_names;
@@ -103,12 +104,10 @@ class Load_log_processor {
void append_to_file(const char* fname, int flags,
gptr data, uint size)
{
- FILE *file;
- if(!(file= my_fopen(fname,flags,MYF(MY_WME))))
- exit(1);
- if (my_fwrite(file,data,size,MYF(MY_WME|MY_NABP)))
- exit(1);
- if (my_fclose(file,MYF(MY_WME)))
+ File file;
+ if ((file= my_open(fname,flags,MYF(MY_WME)) < 0) ||
+ my_write(file,(byte*) data,size,MYF(MY_WME|MY_NABP)) ||
+ my_close(file,MYF(MY_WME)))
exit(1);
}
@@ -176,7 +175,7 @@ public:
void process(Create_file_log_event *ce)
{
const char *fname= create_file(ce);
- append_to_file (fname,O_CREAT|O_BINARY,ce->block,ce->block_len);
+ append_to_file(fname,O_CREAT|O_BINARY,ce->block,ce->block_len);
}
void process(Append_block_log_event *ae)
{