Commit f3a3e052 authored by unknown's avatar unknown
Browse files

Bug #9728 fix merge


mysql-test/r/insert_select.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_base.cc:
  Manual merge
sql/sql_parse.cc:
  Manual merge
sql/sql_yacc.yy:
  Manual merge
parents bbc02113 285e348c
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -2,8 +2,17 @@ This directory contains a test suite for mysql daemon. To run
the currently existing test cases, simply execute ./mysql-test-run in
this directory. It will fire up the newly built mysqld and test it.

If you want to run the test with a running MySQL server use the --external
option to mysql-test-run.
If you want to run a test with a running MySQL server use the --extern
option to mysql-test-run. Please note that in this mode the test suite
expects user to specify test names to run. Otherwise it falls back to the
normal "non-extern" behaviour. The reason is that some tests
could not run with external server. Here is the sample command
to test "alias" and "analyze" tests on external server:

mysql-test-run --extern alias analyze

To match your setup you might also need to provide --socket, --user and
other relevant options.

Note that you do not have to have to do make install, and you could
actually have a co-existing MySQL installation - the tests will not
+15 −0
Original line number Diff line number Diff line
@@ -634,3 +634,18 @@ ff1 ff2
1	2
2	1
drop table t1, t2;
create table t1 (a int unique);
create table t2 (a int, b int);
insert into t1 values (1),(2);
insert into t2 values (1,2);
select * from t1;
a
1
2
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
select * from t1;
a
2
3
drop table t1;
drop table t2;
+14 −0
Original line number Diff line number Diff line
@@ -173,3 +173,17 @@ insert into t1 values (1),(1),(2);
insert into t2(ff1) select f1 from t1 on duplicate key update ff2=ff2+1;
select * from t2;
drop table t1, t2;
#
# BUGS #9728 - 'Decreased functionality in "on duplicate key update"' 
#      #8147 - 'a column proclaimed ambigous in INSERT ... SELECT .. ON
#      DUPLICATE'
#
create table t1 (a int unique);
create table t2 (a int, b int);
insert into t1 values (1),(2);
insert into t2 values (1,2);
select * from t1;
insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
select * from t1;
drop table t1;
drop table t2; 
+3 −1
Original line number Diff line number Diff line
@@ -338,6 +338,7 @@ Item::Item():
	place == IN_HAVING)
      thd->lex->current_select->select_n_having_items++;
  }
  item_flags= 0;
}

/*
@@ -358,7 +359,8 @@ Item::Item(THD *thd, Item *item):
  unsigned_flag(item->unsigned_flag),
  with_sum_func(item->with_sum_func),
  fixed(item->fixed),
  collation(item->collation)
  collation(item->collation),
  item_flags(item->item_flags)
{
  next= thd->free_list;				// Put in free list
  thd->free_list= this;
+11 −0
Original line number Diff line number Diff line
@@ -225,6 +225,11 @@ typedef Item* (Item::*Item_transformer) (byte *arg);

typedef void (*Cond_traverser) (const Item *item, void *arg);

/*
 See comments for sql_yacc.yy: insert_update_elem rule
 */
#define MY_ITEM_PREFER_1ST_TABLE 1

class Item {
  Item(const Item &);			/* Prevent use of these */
  void operator=(Item &);
@@ -272,6 +277,7 @@ class Item {
  my_bool is_autogenerated_name;        /* indicate was name of this Item
                                           autogenerated or set by user */
  DTCollation collation;
  uint8 item_flags;		/* Flags on how item should be processed */

  // alloc & destruct is done as start of select using sql_alloc
  Item();
@@ -584,6 +590,11 @@ class Item {
    cleanup();
    delete this;
  }
  virtual bool set_flags_processor(byte *args)
  {
    this->item_flags|= *((uint8*)args);
    return false;
  }

  virtual bool is_splocal() { return 0; } /* Needed for error checking */
};
Loading