Commit 64b075e6 authored by unknown's avatar unknown
Browse files

Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/50

into  siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/51


BUILD/check-cpu:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/Makefile.am:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~2f6eabb2f69cb33d:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/lib/mtr_process.pl:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/mysqladmin.test:
  Auto merged
mysql-test/t/rpl_rotate_logs.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
mysys/my_read.c:
  Auto merged
mysys/my_seek.c:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
scripts/mysqlbug.sh:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
Makefile.am:
  Use local
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Use local
sql/mysqld.cc:
  Use local
strings/ctype-extra.c:
  SCCS merged
parents 61430c77 9a765037
Loading
Loading
Loading
Loading
+31 −4
Original line number Diff line number Diff line
@@ -725,6 +725,20 @@ void close_connections()
}


void close_statements()
{
  struct st_connection *con;
  DBUG_ENTER("close_statements");
  for (con= connections; con < next_con; con++)
  {
    if (con->stmt)
      mysql_stmt_close(con->stmt);
    con->stmt= 0;
  }
  DBUG_VOID_RETURN;
}


void close_files()
{
  DBUG_ENTER("close_files");
@@ -2908,6 +2922,10 @@ void do_close_connection(struct st_command *command)
	}
      }
#endif
      if (next_con->stmt)
        mysql_stmt_close(next_con->stmt);
      next_con->stmt= 0;

      mysql_close(&con->mysql);
      if (con->util_mysql)
	mysql_close(con->util_mysql);
@@ -5112,6 +5130,14 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
    dynstr_free(&ds_execute_warnings);
  }


  /* Close the statement if - no reconnect, need new prepare */
  if (mysql->reconnect)
  {
    mysql_stmt_close(stmt);
    cur_con->stmt= NULL;
  }

  /*
    We save the return code (mysql_stmt_errno(stmt)) from the last call sent
    to the server into the mysqltest builtin variable $mysql_errno. This
@@ -5119,10 +5145,7 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
  */

  var_set_errno(mysql_stmt_errno(stmt));
#ifndef BUG15518_FIXED
  mysql_stmt_close(stmt);
  cur_con->stmt= NULL;
#endif

  DBUG_VOID_RETURN;
}

@@ -5909,6 +5932,8 @@ int main(int argc, char **argv)
	break;
      case Q_DISABLE_PS_PROTOCOL:
        ps_protocol_enabled= 0;
        /* Close any open statements */
        close_statements();
        break;
      case Q_ENABLE_PS_PROTOCOL:
        ps_protocol_enabled= ps_protocol;
@@ -5918,6 +5943,8 @@ int main(int argc, char **argv)
        break;
      case Q_ENABLE_RECONNECT:
        set_reconnect(&cur_con->mysql, 1);
        /* Close any open statements - no reconnect, need new prepare */
        close_statements();
        break;
      case Q_DISABLE_PARSING:
        if (parsing_disabled == 0)
+11 −3
Original line number Diff line number Diff line
@@ -2036,6 +2036,13 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
    DBUG_RETURN(1);
  }

  /*
    Reset the last error in any case: that would clear the statement
    if the previous prepare failed.
  */
  stmt->last_errno= 0;
  stmt->last_error[0]= '\0';

  if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
  {
    /* This is second prepare with another statement */
@@ -2049,23 +2056,24 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
    */
    stmt->bind_param_done= stmt->bind_result_done= FALSE;
    stmt->param_count= stmt->field_count= 0;
    stmt->last_errno= 0;
    stmt->last_error[0]= '\0';
    free_root(&stmt->mem_root, MYF(MY_KEEP_PREALLOC));

    int4store(buff, stmt->stmt_id);

    /*
      Close statement in server

      If there was a 'use' result from another statement, or from
      mysql_use_result it won't be freed in mysql_stmt_free_result and
      we should get 'Commands out of sync' here.
    */
    stmt->state= MYSQL_STMT_INIT_DONE;
    if (stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt))
    {
      set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
                      mysql->net.sqlstate);
      DBUG_RETURN(1);
    }
    stmt->state= MYSQL_STMT_INIT_DONE;
  }

  if (stmt_command(mysql, COM_STMT_PREPARE, query, length, stmt))
+14 −11
Original line number Diff line number Diff line
@@ -145,21 +145,24 @@ drop table t1;
#
# Bug #19216: Client crashes on long SELECT
#
--exec echo "select" > $MYSQLTEST_VARDIR/tmp/b19216.tmp
# 3400 * 20 makes 68000 columns that is more than the max number that can fit 
# in a 16 bit number.
let $i= 3400;
while ($i)
{
  --exec echo "'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a'," >> $MYSQLTEST_VARDIR/tmp/b19216.tmp
  dec $i;
}

--exec echo "'b';" >> $MYSQLTEST_VARDIR/tmp/b19216.tmp
# Create large SELECT
# - 3400 * 20 makes 68000 columns that is more than the
#   max number that can fit in a 16 bit number.

--perl
open(FILE,">","$ENV{'MYSQLTEST_VARDIR'}/tmp/b19216.tmp") or die;
print FILE "select\n";
print FILE "'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',\n" x 3400;
print FILE "'b';\n";
close FILE;
EOF

--disable_query_log
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/b19216.tmp >/dev/null
--enable_query_log

--remove_file $MYSQLTEST_VARDIR/tmp/b19216.tmp

#
# Bug #20103: Escaping with backslash does not work
#
+1 −5
Original line number Diff line number Diff line
@@ -343,11 +343,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
      if (info->type == READ_CACHE)
      {
	info->write_end=info->write_buffer+info->buffer_length;
        /*
          Trigger a new seek only if we have a valid
          file handle.
        */
        info->seek_not_done= (info->file >= 0);
	info->seek_not_done=1;
      }
      info->end_of_file = ~(my_off_t) 0;
    }
+1 −2
Original line number Diff line number Diff line
@@ -591,8 +591,7 @@ static void fill_quick_table(uint16 *table, uint bits, uint max_bits,
static uint copy_decode_table(uint16 *to_pos, uint offset,
			      uint16 *decode_table)
{
  uint prev_offset;
  prev_offset= offset;
  uint prev_offset= offset;
  DBUG_ENTER("copy_decode_table");

  /* Descent on the left side. */
Loading