Commit c56697f0 authored by unknown's avatar unknown
Browse files

Merge bk-internal:/home/bk/mysql-4.0/

into serg.mylan:/usr/home/serg/Abk/mysql-4.0

parents 88267ae5 6b465557
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -861,18 +861,22 @@ int do_exec(struct st_query* q)
  char buf[1024];
  FILE *res_file;
  char *cmd= q->first_argument;
  DBUG_ENTER("do_exec");

  while (*cmd && my_isspace(charset_info, *cmd))
    cmd++;
  if (!*cmd)
    die("Missing argument in exec\n");

  if (disable_result_log)
  {
  DBUG_PRINT("info", ("Executing '%s'", cmd));

  if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
    die("popen() failed\n");
    while (fgets(buf, sizeof(buf), res_file));
    pclose(res_file);

  if (disable_result_log)
  {
    while (fgets(buf, sizeof(buf), res_file))
    {}
  }
  else
  {
@@ -884,11 +888,8 @@ int do_exec(struct st_query* q)
    else
      ds= &ds_res;

    if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
      die("popen() failed\n");
    while (fgets(buf, sizeof(buf), res_file))
      replace_dynstr_append_mem(ds, buf, strlen(buf));
    pclose(res_file);
  
    if (glob_replace)
      free_replace();
@@ -907,8 +908,9 @@ int do_exec(struct st_query* q)
    if (ds == &ds_tmp)
      dynstr_free(&ds_tmp);
  }
  pclose(res_file);
  
  return error;
  DBUG_RETURN(error);
}

int var_query_set(VAR* v, const char* p, const char** p_end)
@@ -1043,7 +1045,7 @@ int do_system(struct st_query* q)
  eval_expr(&v, p, 0); /* NULL terminated */
  if (v.str_val_len)
  {
    char expr_buf[512];
    char expr_buf[1024];
    if ((uint)v.str_val_len > sizeof(expr_buf) - 1)
      v.str_val_len = sizeof(expr_buf) - 1;
    memcpy(expr_buf, v.str_val, v.str_val_len);
@@ -1774,11 +1776,12 @@ int read_query(struct st_query** q_ptr)
  char *p = read_query_buf, * p1 ;
  int expected_errno;
  struct st_query* q;
  DBUG_ENTER("read_query_buf");

  if (parser.current_line < parser.read_lines)
  {
    get_dynamic(&q_lines, (gptr) q_ptr, parser.current_line) ;
    return 0;
    DBUG_RETURN(0);
  }
  if (!(*q_ptr=q=(struct st_query*) my_malloc(sizeof(*q), MYF(MY_WME))) ||
      insert_dynamic(&q_lines, (gptr) &q))
@@ -1797,7 +1800,7 @@ int read_query(struct st_query** q_ptr)
  q->type = Q_UNKNOWN;
  q->query_buf=q->query=0;
  if (read_line(read_query_buf, sizeof(read_query_buf)))
    return 1;
    DBUG_RETURN(1);

  if (*p == '#')
  {
@@ -1851,7 +1854,7 @@ int read_query(struct st_query** q_ptr)
  q->first_argument=p;
  q->end = strend(q->query);
  parser.read_lines++;
  return 0;
  DBUG_RETURN(0);
}


@@ -2306,10 +2309,12 @@ void get_query_type(struct st_query* q)
{
  char save;
  uint type;
  DBUG_ENTER("get_query_type");

  if (*q->query == '}')
  {
    q->type = Q_END_BLOCK;
    return;
    DBUG_VOID_RETURN;
  }
  if (q->type != Q_COMMENT_WITH_COMMAND)
    q->type = Q_QUERY;
@@ -2320,8 +2325,10 @@ void get_query_type(struct st_query* q)
  q->query[q->first_word_len]=save;
  if (type > 0)
    q->type=(enum enum_commands) type;		/* Found command */
  DBUG_VOID_RETURN;
}


static byte *get_var_key(const byte* var, uint* len,
			 my_bool __attribute__((unused)) t)
{
+1 −0
Original line number Diff line number Diff line
@@ -63,4 +63,5 @@ extern const char *client_errors[]; /* Error messages */
#define CR_PROBE_MASTER_CONNECT 2025
#define CR_SSL_CONNECTION_ERROR 2026
#define CR_MALFORMED_PACKET     2027
#define CR_WRONG_LICENSE	2028
+3 −1
Original line number Diff line number Diff line
@@ -20,7 +20,9 @@
extern "C" {
#endif

#define MAX_TREE_HIGHT	40	/* = max 1048576 leafs in tree */
/* Worst case tree is half full. This gives use 2^(MAX_TREE_HIGHT/2) leafs */
#define MAX_TREE_HIGHT	64

#define ELEMENT_KEY(tree,element)\
(tree->offset_to_key ? (void*)((byte*) element+tree->offset_to_key) :\
			*((void**) (element+1)))
+5 −0
Original line number Diff line number Diff line
@@ -26,4 +26,9 @@
#define MYSQL_CHARSET			"@default_charset@"
#endif /* MYSQL_CHARSET */
#endif /* _CUSTOMCONFIG_ */

#ifndef LICENSE
#define LICENSE "GPL"
#endif /* LICENSE */

#endif /* _mysql_version_h */
+4 −4
Original line number Diff line number Diff line
@@ -668,15 +668,15 @@ does nothing! */
void
que_thr_handle_error(
/*=================*/
	que_thr_t*	thr __attribute((unused)),
	que_thr_t*	thr __attribute__((unused)),
				/* in: query thread */
	ulint		err_no __attribute((unused)),
	ulint		err_no __attribute__((unused)),
				/* in: error number */
	byte*		err_str __attribute((unused)),
	byte*		err_str __attribute__((unused)),
				/* in, own: error string or NULL; NOTE: the
				function will take care of freeing of the
				string! */
	ulint		err_len __attribute((unused)))
	ulint		err_len __attribute__((unused)))
				/* in: error string length */	
{
	/* Does nothing */
Loading