From a6c7fb455ae6114ae53be58c49d4ef7dbdcd5e3e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 07:18:42 +0400 Subject: Fix bug #9728 decreased functionality in "on duplicate key update" Remove changes made by bug fix #8147. They strips list of insert_table_list to only insert table, which results in error reported in bug #9728. Added flag to Item to resolve ambigous fields reported in bug #8147. sql/item.h: Fix bug#9728 decreased functionality in "on duplicate key update". sql/item.cc: Fix bug#9728 decreased functionality in "on duplicate key update" sql/sql_parse.cc: Fix bug#9728 decreased functionality in "on duplicate key update" sql/sql_base.cc: Fix bug#9728 decreased functionality in "on duplicate key update". sql/sql_yacc.yy: Fix bug#9728 decreased functionality in "on duplicate key update" mysql-test/t/insert_select.test: Test case for bug#9728 Decreased functionality in "on duplicate key update". mysql-test/r/insert_select.result: Test case for bug#9728 Decreased functionality in "on duplicate key update". --- sql/item.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sql/item.h') diff --git a/sql/item.h b/sql/item.h index 8de2adeb730..d9a40cbdfb6 100644 --- a/sql/item.h +++ b/sql/item.h @@ -107,6 +107,11 @@ public: typedef bool (Item::*Item_processor)(byte *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 &); @@ -142,6 +147,7 @@ public: my_bool with_sum_func; my_bool fixed; /* If item fixed with fix_fields */ DTCollation collation; + uint8 item_flags; /* Flags on how item should be processed */ // alloc & destruct is done as start of select using sql_alloc Item(); @@ -327,6 +333,11 @@ public: cleanup(); delete this; } + virtual bool set_flags_processor(byte *args) + { + this->item_flags|= *((uint8*)args); + return true; + } }; -- cgit v1.2.1 From 256c99fdb282512d87f5e6db59cc207024bd06c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 22:58:44 +0400 Subject: item.h: Fix for fix for bug#9728 decreased functionality in "on duplicate key update" Have to return false to set flag for whole expression. sql/item.h: Fix for fix for bug#9728 decreased functionality in "on duplicate key update" Have to return false to set flag for whole expression. --- sql/item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/item.h') diff --git a/sql/item.h b/sql/item.h index d9a40cbdfb6..82ab5a66cfb 100644 --- a/sql/item.h +++ b/sql/item.h @@ -336,7 +336,7 @@ public: virtual bool set_flags_processor(byte *args) { this->item_flags|= *((uint8*)args); - return true; + return false; } }; -- cgit v1.2.1