Commit 4eb26350 authored by unknown's avatar unknown
Browse files

merge


client/mysql.cc:
  Auto merged
libmysql/libmysql.c:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_bitmap.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents dab1b26b b08b3a15
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -1657,9 +1657,10 @@ int mysql_real_query_for_lazy(const char *buf, int length)
{
  for (uint retry=0;; retry++)
  {
    int error;
    if (!mysql_real_query(&mysql,buf,length))
      return 0;
    int error= put_error(&mysql);
    error= put_error(&mysql);
    if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 ||
        !opt_reconnect)
      return error;
@@ -2314,22 +2315,23 @@ print_table_data_vertically(MYSQL_RES *result)
  }
}


/* print_warnings should be called right after executing a statement */
static void
print_warnings()

static void print_warnings()
{
  char query[30];
  const char   *query;
  MYSQL_RES    *result;
  MYSQL_ROW    cur;
  my_ulonglong num_rows;

  /* Get the warnings */
  strmov(query,"show warnings");
  query= "show warnings";
  mysql_real_query_for_lazy(query, strlen(query));
  mysql_store_result_for_lazy(&result);

  /* Bail out when no warnings */
  my_ulonglong num_rows = mysql_num_rows(result);
  if (num_rows == 0) 
  if (!(num_rows= mysql_num_rows(result)))
  {
    mysql_free_result(result);
    return;
@@ -2343,13 +2345,12 @@ print_warnings()
  mysql_free_result(result);
}

static const char
*array_value(const char **array, char key)

static const char *array_value(const char **array, char key)
{
  int x;
  for (x= 0; array[x]; x+= 2)
    if (*array[x] == key)
      return array[x + 1];
  for (; *array; array+= 2)
    if (**array == key)
      return array[1];
  return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -1738,7 +1738,7 @@ myodbc_remove_escape(MYSQL *mysql,char *name)

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

#define DEFAULT_PREFETCH_ROWS 1UL
#define DEFAULT_PREFETCH_ROWS (ulong) 1

/*
  These functions are called by function pointer MYSQL_STMT::read_row_func.
+1 −1
Original line number Diff line number Diff line
@@ -887,7 +887,7 @@ report_stats () {

    found_error=0
    # Find errors
    for i in "^Warning:" "^Error:" "^==.* at 0x"
    for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning"
    do
      if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
      then
+21 −1
Original line number Diff line number Diff line
drop table if exists t1,t11,t12,t2;
drop table if exists t1,t2,t3,t11,t12;
CREATE TABLE t1 (a tinyint(3), b tinyint(5));
INSERT INTO t1 VALUES (1,1);
INSERT LOW_PRIORITY INTO t1 VALUES (1,2);
@@ -172,3 +172,23 @@ a
0
2
DROP TABLE t1;
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
insert into t1 values (1,1),(2,1),(1,3);
insert into t2 values (1,1),(2,2),(3,3);
insert into t3 values (1,1),(2,1),(1,3);
select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
a	b	a	b	a	b
1	1	1	1	1	1
2	1	2	2	2	1
1	3	1	1	1	3
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	
1	SIMPLE	t2	index	PRIMARY	PRIMARY	8	NULL	3	Using where; Using index
1	SIMPLE	t3	index	PRIMARY	PRIMARY	8	NULL	3	Using where; Using index
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
select * from t3;
a	b
drop table t1,t2,t3;
+1 −0
Original line number Diff line number Diff line
DROP TABLE IF EXISTS t0,t1,t2;
show variables where variable_name like "skip_show_database";
Variable_name	Value
skip_show_database	OFF
Loading