Commit 06d99235 authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0

into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  Auto merged
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
storage/ndb/test/ndbapi/testBlobs.cpp:
  Auto merged
parents cee6d8bb c0918af2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -48,8 +48,8 @@ enum enum_server_command
  COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
  COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
  COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
  COM_PREPARE, COM_EXECUTE, COM_LONG_DATA, COM_CLOSE_STMT,
  COM_RESET_STMT, COM_SET_OPTION, COM_FETCH,
  COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
  COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH,
  /* don't forget to update const char *command_name[] in sql_parse.cc */

  /* Must be last */
+14 −13
Original line number Diff line number Diff line
@@ -1736,7 +1736,7 @@ myodbc_remove_escape(MYSQL *mysql,char *name)

/******************* Declarations ***********************************/

/* Default number of rows fetched per one COM_FETCH command. */
/* Default number of rows fetched per one COM_STMT_FETCH command. */

#define DEFAULT_PREFETCH_ROWS (ulong) 1

@@ -1887,7 +1887,7 @@ void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode,
}

/*
  Read and unpack server reply to COM_PREPARE command (sent from
  Read and unpack server reply to COM_STMT_PREPARE command (sent from
  mysql_stmt_prepare).

  SYNOPSIS
@@ -2082,7 +2082,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
      mysql_use_result it won't be freed in mysql_stmt_free_result and
      we should get 'Commands out of sync' here.
    */
    if (simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1))
    if (simple_command(mysql, COM_STMT_CLOSE, buff, 4, 1))
    {
      set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
                      mysql->net.sqlstate);
@@ -2091,7 +2091,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
    stmt->state= MYSQL_STMT_INIT_DONE;
  }

  if (simple_command(mysql, COM_PREPARE, query, length, 1))
  if (simple_command(mysql, COM_STMT_PREPARE, query, length, 1))
  {
    set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
                    mysql->net.sqlstate);
@@ -2175,7 +2175,7 @@ static unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)

/*
  Update result set columns metadata if it was sent again in
  reply to COM_EXECUTE.
  reply to COM_STMT_EXECUTE.
*/

static void update_stmt_fields(MYSQL_STMT *stmt)
@@ -2490,7 +2490,7 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)


/*
  Auxilary function to send COM_EXECUTE packet to server and read reply.
  Auxilary function to send COM_STMT_EXECUTE packet to server and read reply.
  Used from cli_stmt_execute, which is in turn used by mysql_stmt_execute.
*/

@@ -2507,7 +2507,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
  int4store(buff, stmt->stmt_id);		/* Send stmt id to server */
  buff[4]= (char) stmt->flags;
  int4store(buff+5, 1);                         /* iteration count */
  if (cli_advanced_command(mysql, COM_EXECUTE, buff, sizeof(buff),
  if (cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
                           packet, length, 1) ||
      (*mysql->methods->read_query_result)(mysql))
  {
@@ -2720,7 +2720,7 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
    /* Send row request to the server */
    int4store(buff, stmt->stmt_id);
    int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */
    if (cli_advanced_command(mysql, COM_FETCH, buff, sizeof(buff),
    if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
                             NullS, 0, 1))
    {
      set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
@@ -2910,7 +2910,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
        - if data dictionary changed between prepare and execute, for
          example a table used in the query was altered.
        Note, that now (4.1.3) we always send metadata in reply to
        COM_EXECUTE (even if it is not necessary), so either this or
        COM_STMT_EXECUTE (even if it is not necessary), so either this or
        previous branch always works.
        TODO: send metadata only when it's really necessary and add a warning
        'Metadata changed' when it's sent twice.
@@ -3380,8 +3380,9 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
      Note that we don't get any ok packet from the server in this case
      This is intentional to save bandwidth.
    */
    if ((*mysql->methods->advanced_command)(mysql, COM_LONG_DATA, buff,
					    sizeof(buff), data, length, 1))
    if ((*mysql->methods->advanced_command)(mysql, COM_STMT_SEND_LONG_DATA,
                                            buff, sizeof(buff), data,
                                            length, 1))
    {
      set_stmt_errmsg(stmt, mysql->net.last_error,
		      mysql->net.last_errno, mysql->net.sqlstate);
@@ -4930,7 +4931,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
        */
        char buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
        int4store(buff, stmt->stmt_id);
        if ((*mysql->methods->advanced_command)(mysql, COM_RESET_STMT, buff,
        if ((*mysql->methods->advanced_command)(mysql, COM_STMT_RESET, buff,
                                                sizeof(buff), 0, 0, 0))
        {
          set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
@@ -5004,7 +5005,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
        mysql->status= MYSQL_STATUS_READY;
      }
      int4store(buff, stmt->stmt_id);
      if ((rc= simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1)))
      if ((rc= simple_command(mysql, COM_STMT_CLOSE, buff, 4, 1)))
      {
        set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
                        mysql->net.sqlstate);
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
  THD *thd= (THD*)stmt->mysql->thd;
  thd->client_param_count= stmt->param_count;
  thd->client_params= stmt->params;
  if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0,
  if (emb_advanced_command(stmt->mysql, COM_STMT_EXECUTE,0,0,
                           header, sizeof(header), 1) ||
      emb_mysql_read_query_result(stmt->mysql))
  {
+17 −17
Original line number Diff line number Diff line
@@ -1496,62 +1496,62 @@ class Item_copy_string :public Item
};


class Item_buff :public Sql_alloc
class Cached_item :public Sql_alloc
{
public:
  my_bool null_value;
  Item_buff() :null_value(0) {}
  Cached_item() :null_value(0) {}
  virtual bool cmp(void)=0;
  virtual ~Item_buff(); /*line -e1509 */
  virtual ~Cached_item(); /*line -e1509 */
};

class Item_str_buff :public Item_buff
class Cached_item_str :public Cached_item
{
  Item *item;
  String value,tmp_value;
public:
  Item_str_buff(THD *thd, Item *arg);
  Cached_item_str(THD *thd, Item *arg);
  bool cmp(void);
  ~Item_str_buff();				// Deallocate String:s
  ~Cached_item_str();                           // Deallocate String:s
};


class Item_real_buff :public Item_buff
class Cached_item_real :public Cached_item
{
  Item *item;
  double value;
public:
  Item_real_buff(Item *item_par) :item(item_par),value(0.0) {}
  Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
  bool cmp(void);
};

class Item_int_buff :public Item_buff
class Cached_item_int :public Cached_item
{
  Item *item;
  longlong value;
public:
  Item_int_buff(Item *item_par) :item(item_par),value(0) {}
  Cached_item_int(Item *item_par) :item(item_par),value(0) {}
  bool cmp(void);
};


class Item_decimal_buff :public Item_buff
class Cached_item_decimal :public Cached_item
{
  Item *item;
  my_decimal value;
public:
  Item_decimal_buff(Item *item_par);
  Cached_item_decimal(Item *item_par);
  bool cmp(void);
};

class Item_field_buff :public Item_buff
class Cached_item_field :public Cached_item
{
  char *buff;
  Field *field;
  uint length;

public:
  Item_field_buff(Item_field *item)
  Cached_item_field(Item_field *item)
  {
    field=item->field;
    buff= (char*) sql_calloc(length=field->pack_length());
@@ -1879,7 +1879,7 @@ void mark_select_range_as_dependent(THD *thd,
                                    Field *found_field, Item *found_item,
                                    Item_ident *resolved_item);

extern Item_buff *new_Item_buff(THD *thd, Item *item);
extern Cached_item *new_Cached_item(THD *thd, Item *item);
extern Item_result item_cmp_type(Item_result a,Item_result b);
extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item);
extern bool field_is_equal_to_item(Field *field,Item *item);
+18 −18
Original line number Diff line number Diff line
@@ -20,23 +20,23 @@
#include "mysql_priv.h"

/*
** Create right type of item_buffer for an item
** Create right type of Cached_item for an item
*/

Item_buff *new_Item_buff(THD *thd, Item *item)
Cached_item *new_Cached_item(THD *thd, Item *item)
{
  if (item->type() == Item::FIELD_ITEM &&
      !(((Item_field *) item)->field->flags & BLOB_FLAG))
    return new Item_field_buff((Item_field *) item);
    return new Cached_item_field((Item_field *) item);
  switch (item->result_type()) {
  case STRING_RESULT:
    return new Item_str_buff(thd, (Item_field *) item);
    return new Cached_item_str(thd, (Item_field *) item);
  case INT_RESULT:
    return new Item_int_buff((Item_field *) item);
    return new Cached_item_int((Item_field *) item);
  case REAL_RESULT:
    return new Item_real_buff(item);
    return new Cached_item_real(item);
  case DECIMAL_RESULT:
    return new Item_decimal_buff(item);
    return new Cached_item_decimal(item);
  case ROW_RESULT:
  default:
    DBUG_ASSERT(0);
@@ -44,18 +44,18 @@ Item_buff *new_Item_buff(THD *thd, Item *item)
  }
}

Item_buff::~Item_buff() {}
Cached_item::~Cached_item() {}

/*
** Compare with old value and replace value with new value
** Return true if values have changed
*/

Item_str_buff::Item_str_buff(THD *thd, Item *arg)
Cached_item_str::Cached_item_str(THD *thd, Item *arg)
  :item(arg), value(min(arg->max_length, thd->variables.max_sort_length))
{}

bool Item_str_buff::cmp(void)
bool Cached_item_str::cmp(void)
{
  String *res;
  bool tmp;
@@ -77,12 +77,12 @@ bool Item_str_buff::cmp(void)
  return tmp;
}

Item_str_buff::~Item_str_buff()
Cached_item_str::~Cached_item_str()
{
  item=0;					// Safety
}

bool Item_real_buff::cmp(void)
bool Cached_item_real::cmp(void)
{
  double nr= item->val_real();
  if (null_value != item->null_value || nr != value)
@@ -94,7 +94,7 @@ bool Item_real_buff::cmp(void)
  return FALSE;
}

bool Item_int_buff::cmp(void)
bool Cached_item_int::cmp(void)
{
  longlong nr=item->val_int();
  if (null_value != item->null_value || nr != value)
@@ -107,7 +107,7 @@ bool Item_int_buff::cmp(void)
}


bool Item_field_buff::cmp(void)
bool Cached_item_field::cmp(void)
{
  bool tmp= field->cmp(buff) != 0;		// This is not a blob!
  if (tmp)
@@ -121,14 +121,14 @@ bool Item_field_buff::cmp(void)
}


Item_decimal_buff::Item_decimal_buff(Item *it)
Cached_item_decimal::Cached_item_decimal(Item *it)
  :item(it)
{
  my_decimal_set_zero(&value);
}


bool Item_decimal_buff::cmp()
bool Cached_item_decimal::cmp()
{
  my_decimal tmp;
  my_decimal *ptmp= item->val_decimal(&tmp);
@@ -147,6 +147,6 @@ bool Item_decimal_buff::cmp()
*****************************************************************************/

#ifdef __GNUC__
template class List<Item_buff>;
template class List_iterator<Item_buff>;
template class List<Cached_item>;
template class List_iterator<Cached_item>;
#endif
Loading