Commit 0d72e544 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Portability fixes

parent c55cde7c
Loading
Loading
Loading
Loading
+35 −32
Original line number Diff line number Diff line
@@ -2033,9 +2033,9 @@ mysql_query(MYSQL *mysql, const char *query)
  return mysql_real_query(mysql,query, (uint) strlen(query));
}


static MYSQL* spawn_init(MYSQL* parent, const char* host,
					   unsigned int port,
					   const char* user,
			 unsigned int port, const char* user,
			 const char* passwd)
{
  MYSQL* child;
@@ -2045,11 +2045,13 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
  child->options.user = my_strdup((user) ? user :
				  (parent->user ? parent->user :
				   parent->options.user), MYF(0));
  child->options.password = my_strdup((passwd) ? passwd : (parent->passwd ?
  child->options.password = my_strdup((passwd) ? passwd :
				      (parent->passwd ?
				       parent->passwd :
				       parent->options.password), MYF(0));
  child->options.port = port;
  child->options.host = my_strdup((host) ? host : (parent->host ?
  child->options.host = my_strdup((host) ? host :
				  (parent->host ?
				   parent->host :
				   parent->options.host), MYF(0));
  if (parent->db)
@@ -2065,8 +2067,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,

int
STDCALL mysql_set_master(MYSQL* mysql, const char* host,
					   unsigned int port,
					   const char* user,
			 unsigned int port, const char* user,
			 const char* passwd)
{
  if (mysql->master != mysql && !mysql->master->rpl_pivot)
@@ -2105,21 +2106,21 @@ mysql_send_query(MYSQL* mysql, const char* query, uint length)
{
  if (mysql->options.rpl_parse && mysql->rpl_pivot)
  {
    switch (mysql_rpl_query_type(query, length))
    {
    switch (mysql_rpl_query_type(query, length)) {
    case MYSQL_RPL_MASTER:
      return mysql_master_send_query(mysql, query, length);
    case MYSQL_RPL_SLAVE:
      return mysql_slave_send_query(mysql, query, length);
    case MYSQL_RPL_ADMIN: /*fall through */
    case MYSQL_RPL_ADMIN:
      break;					/* fall through */
    }
  }

  mysql->last_used_con = mysql;

  return simple_command(mysql, COM_QUERY, query, length, 1);
}


int STDCALL mysql_read_query_result(MYSQL *mysql)
{
  uchar *pos;
@@ -2173,6 +2174,7 @@ int STDCALL mysql_read_query_result(MYSQL *mysql)
  DBUG_RETURN(0);
}


int STDCALL
mysql_real_query(MYSQL *mysql, const char *query, uint length)
{
@@ -2185,6 +2187,7 @@ mysql_real_query(MYSQL *mysql, const char *query, uint length)
  DBUG_RETURN(mysql_read_query_result(mysql));
}


static int
send_file_to_server(MYSQL *mysql, const char *filename)
{
+3 −1
Original line number Diff line number Diff line
@@ -153,7 +153,9 @@ int do_boolean(ALL_IN_ONE *aio, uint nested __attribute__((unused)),

        if (selem->count==1) /* document's first match */
        {
          sptr->yes=sptr->no=sptr->doc.weight=0;
          sptr->yes=0;
	  sptr->no=0;
	  sptr->doc.weight=0;
          sptr->aio=aio;
          sptr->wno=0;
        }
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */

#include "ftdefs.h"
#include <getopt.h>

static void get_options(int argc,char *argv[]);
static void usage(char *argv[]);
+0 −1
Original line number Diff line number Diff line
@@ -937,7 +937,6 @@ THR_LOCK_DATA **ha_myisam::store_lock(THD *thd,

void ha_myisam::update_create_info(HA_CREATE_INFO *create_info)
{
  MI_ISAMINFO info;
  table->file->info(HA_STATUS_AUTO | HA_STATUS_CONST);
  if (!(create_info->used_fields & HA_CREATE_USED_AUTO))
  {
+2 −2
Original line number Diff line number Diff line
@@ -795,7 +795,7 @@ static int simple_raw_key_cmp(void* arg, byte* key1, byte* key2)

static int simple_str_key_cmp(void* arg, byte* key1, byte* key2)
{
  return my_sortcmp(key1, key2, *(uint*) arg);
  return my_sortcmp((char*) key1, (char*) key2, *(uint*) arg);
}

/*
@@ -832,7 +832,7 @@ int composite_key_cmp(void* arg, byte* key1, byte* key2)
int dump_leaf(byte* key, uint32 count __attribute__((unused)),
		     Item_sum_count_distinct* item)
{
  char* buf = item->table->record[0];
  byte* buf = item->table->record[0];
  int error;
  /*
    The first item->rec_offset bytes are taken care of with
Loading