Commit 5487d7a8 authored by monty@donna.mysql.fi's avatar monty@donna.mysql.fi
Browse files

Fixed bug in send in mysqltest

Removed usage of @r/result as this made life hard when testing different
table handlers.
Allow concurrent inserts if no update/binary log.
Don't remove key_cache at flush tables.
Fixed bug in SELECT DISTINCT SUM()...
parent 176147cd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -36147,6 +36147,10 @@ The temporary file will be deleted when the thread ends.
The @code{max_binlog_cache_size} can be used to restrict the total size used
to cache a multi-transaction query.
If you are using the update or binary log then concurrent inserts will
not work together with @code{CREATE ... INSERT} and @code{INSERT ... SELECT}.
This is to ensure that you can recreate an exact copy of your tables by
applying a the log on a backup.
@cindex slow query log
@cindex files, slow query log
@node Slow query log,  , Binary log, Log files
@@ -42399,6 +42403,9 @@ not yet 100 % confident in this code.
Fixed that one can't use database names with @code{.}.  This fixes a serious
security issue when @code{mysqld} is run as root.
@item
Don't free the key cache on @code{FLUSH TABLES} as this will cause problems
with temporary tables.
@item
Fixed a core-dump bug when using very complex query involving
@code{DISTINCT} and summary functions.
@item
@@ -42416,6 +42423,9 @@ Fixed a bug in @code{CONCAT_WS()} where it returned wrong results.
@item
Changed @code{CREATE ... INSERT} and @code{INSERT ... SELECT} to not
allow concurrent inserts as this could make the binary log hard to repeat.
(Concurrent inserts are enabled if you are not using the binary or update log).
@item
Changed some macros to be able to use fast mutex with glibc 2.2.
@end itemize
@node News-3.23.35, News-3.23.34a, News-3.23.36, News-3.23.x
+37 −15
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@

**********************************************************************/

#define MTEST_VERSION "1.7"
#define MTEST_VERSION "1.8"

#include <global.h>
#include <my_sys.h>
@@ -269,6 +269,7 @@ static void die(const char* fmt, ...)
    fprintf(stderr, "%s: ", my_progname);
    vfprintf(stderr, fmt, args);
    fprintf(stderr, "\n");
    fflush(stderr);
  }
  va_end(args);
  free_used_memory();
@@ -866,10 +867,9 @@ char* safe_get_param(char* str, char** arg, const char* msg)
  DBUG_ENTER("safe_get_param");
  while (*str && isspace(*str)) str++;
  *arg = str;
  while(*str && *str != ',' && *str != ')')
  for (; *str && *str != ',' && *str != ')' ; str++)
  {
    if (isspace(*str)) *str = 0;
      str++;
  }
  if (!*str)
    die(msg);
@@ -885,6 +885,7 @@ int do_connect(struct st_query* q)
    *con_db, *con_sock;
  char* p=q->first_argument;
  char buff[FN_REFLEN];
  int con_port;
  DBUG_ENTER("do_connect");
  DBUG_PRINT("enter",("connect: %s",p));

@@ -896,16 +897,27 @@ int do_connect(struct st_query* q)
  p = safe_get_param(p, &con_user, "missing connection user");
  p = safe_get_param(p, &con_pass, "missing connection password");
  p = safe_get_param(p, &con_db, "missing connection db");
  if (!*p || *p == ';')				/* Default port and sock */
  {
    con_port=port;
    con_sock=(char*) unix_sock;
  }
  else
  {
    p = safe_get_param(p, &con_port_str, "missing connection port");
    con_port=atoi(con_port_str);
    p = safe_get_param(p, &con_sock, "missing connection socket");
  }
  if (next_con == cons_end)
    die("Connection limit exhausted - increase MAX_CONS in mysqltest.c");

  if (!mysql_init(&next_con->mysql))
    die("Failed on mysql_init()");
  con_sock=fn_format(buff, con_sock, TMPDIR, "",0);
  if (!con_db[0])
    con_db=db;
  if (!mysql_real_connect(&next_con->mysql, con_host, con_user, con_pass,
			 con_db, atoi(con_port_str), con_sock, 0))
			 con_db, con_port, con_sock, 0))
    die("Could not open connection '%s': %s", con_name,
	mysql_error(&next_con->mysql));

@@ -1572,7 +1584,7 @@ int main(int argc, char** argv)
{
  int error = 0;
  struct st_query* q;
  my_bool require_file=0;
  my_bool require_file=0, q_send_flag=0;
  char save_file[FN_REFLEN];
  MY_INIT(argv[0]);

@@ -1639,6 +1651,11 @@ int main(int argc, char** argv)
				* read-result only ( reap) */
	if (q->type == Q_QUERY) /* for a full query, enable the send stage */
	  flags |= QUERY_SEND;
	if (q_send_flag)
	{
	  flags= QUERY_SEND;
	  q_send_flag=0;
	}
	if (save_file[0])
	{
	  strmov(q->record_file,save_file);
@@ -1649,9 +1666,14 @@ int main(int argc, char** argv)
	break;
      }
      case Q_SEND:
	if(q->query == q->query_buf) /* fix up query pointer if this is
				      * first iteration for this line
				      */
	if (!q->query[q->first_word_len])
	{
	  /* This happens when we use 'send' on it's own line */
	  q_send_flag=1;
	  break;
	}
	/* fix up query pointer if this is * first iteration for this line */
	if (q->query == q->query_buf)
	  q->query += q->first_word_len;
	error |= run_query(&cur_con->mysql, q, QUERY_SEND);
	/* run query can execute a query partially, depending on the flags
+1 −0
Original line number Diff line number Diff line
project_id	project_name	client_ptr	comments	total_budget
+4 −0
Original line number Diff line number Diff line
@@ -2,3 +2,7 @@ name age id
Andy	31	00000001
Jacob	2	00000002
Caleb	1	00000003
name	age	id
Andy	31	00000001
Jacob	2	00000002
Caleb	1	00000003
+2 −0
Original line number Diff line number Diff line
unix_timestamp(t)
200006
unix_timestamp(t)
200006
Loading