summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-11-16 02:38:50 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-11-16 02:38:50 +0000
commitd81b9c1b32437b9073bbade7f60c1b6c0d825808 (patch)
treea0202281f7526b3fa0ad29eded49be0eb6dd1ff7
parentImported from /home/gentoo/distfiles/mysql-extras-20070916.tar.bz2. (diff)
downloadmysql-extras-d81b9c1b32437b9073bbade7f60c1b6c0d825808.tar.gz
mysql-extras-d81b9c1b32437b9073bbade7f60c1b6c0d825808.tar.bz2
mysql-extras-d81b9c1b32437b9073bbade7f60c1b6c0d825808.zip
Imported from /home/gentoo/distfiles/mysql-extras-20071115.tar.bz2.mysql-extras-20071115
-rw-r--r--000_index.txt36
-rw-r--r--709_all_innodb_spatial_crash_mybug_32125-5.1.patch90
-rw-r--r--709_all_innodb_spatial_crash_mybug_32125_5.0.patch112
-rw-r--r--710_all_respect_tmpdir_filesort_mybug_30287_5.0.patch128
-rw-r--r--710_all_respect_tmpdir_filesort_mybug_30287_5.1.patch131
5 files changed, 493 insertions, 4 deletions
diff --git a/000_index.txt b/000_index.txt
index f2b651f..0a1d3eb 100644
--- a/000_index.txt
+++ b/000_index.txt
@@ -287,14 +287,14 @@
@patch 703_all_test-rpl_rotate_logs-5.0.21.patch
@ver 5.00.26.00 to 5.00.99.99
@ver 5.01.00.00 to 5.01.15.99
-@ver 5.02.00.00 to 5.02.09.99
+@ver 5.02.00.00 to 5.02.99.99
@pn mysql
@pn mysql-community
@pn mysql-slotted
@patch 704_all_disable_mybug_9735_test.patch
@ver 5.00.26.00 to 5.00.99.99
-@ver 5.01.00.00 to 5.02.09.99
+@ver 5.01.00.00 to 5.02.99.99
@pn mysql
@pn mysql-community
@pn mysql-slotted
@@ -313,7 +313,7 @@
@patch 706_all_fix-nullpointer-dos.patch
@ver 5.00.26.00 to 5.00.39.99
@ver 5.01.00.00 to 5.01.15.99
-@ver 5.02.00.00 to 5.02.09.99
+@ver 5.02.00.00 to 5.02.99.99
@pn mysql
@pn mysql-community
@pn mysql-slotted
@@ -322,7 +322,7 @@
@patch 707_all_fix-nullpointer-dos-testcase.patch
@ver 5.00.26.00 to 5.00.39.99
@ver 5.01.00.00 to 5.01.15.99
-@ver 5.02.00.00 to 5.02.09.99
+@ver 5.02.00.00 to 5.02.99.99
@pn mysql
@pn mysql-community
@pn mysql-slotted
@@ -336,3 +336,31 @@
@pn mysql-community
@pn mysql-slotted
@@ Fix for pointer aliasing that breaks mysql_client_test (upstream bug #27393)
+
+@patch 709_all_innodb_spatial_crash_mybug_32125_5.0.patch
+@ver 5.00.42.00 to 5.00.99.99
+@pn mysql
+@pn mysql-community
+@pn mysql-slotted
+@@ Fix for InnoDB 'CONTAINS' DoS (gentoo bug #198988, upstream bug #32125)
+
+@patch 709_all_innodb_spatial_crash_mybug_32125_5.1.patch
+@ver 5.01.22.00 to 5.01.99.99
+@pn mysql
+@pn mysql-community
+@pn mysql-slotted
+@@ Fix for InnoDB 'CONTAINS' DoS (gentoo bug #198988, upstream bug #32125)
+
+@patch 710_all_respect_tmpdir_filesort_mybug_30287_5.0.patch
+@ver 5.00.44.00 to 5.00.47.99
+@pn mysql
+@pn mysql-community
+@pn mysql-slotted
+@@ Fix for TMPDIR not being used during filesot (upstream bug #30287)
+
+@patch 710_all_respect_tmpdir_filesort_mybug_30287_5.1.patch
+@ver 5.01.20.00 to 5.01.22.00
+@pn mysql
+@pn mysql-community
+@pn mysql-slotted
+@@ Fix for TMPDIR not being used during filesot (upstream bug #30287)
diff --git a/709_all_innodb_spatial_crash_mybug_32125-5.1.patch b/709_all_innodb_spatial_crash_mybug_32125-5.1.patch
new file mode 100644
index 0000000..a5fff56
--- /dev/null
+++ b/709_all_innodb_spatial_crash_mybug_32125-5.1.patch
@@ -0,0 +1,90 @@
+diff -ur innobase.orig/handler/ha_innodb.cc innobase/handler/ha_innodb.cc
+--- innobase.orig/handler/ha_innodb.cc 2007-10-11 14:41:50.000000000 +0300
++++ innobase/handler/ha_innodb.cc 2007-11-14 14:43:52.000000000 +0200
+@@ -678,6 +678,9 @@
+ return(HA_ERR_RECORD_FILE_FULL);
+ #endif
+
++ } else if (error == DB_UNSUPPORTED) {
++
++ return(HA_ERR_UNSUPPORTED);
+ } else {
+ return(-1); // Unknown error
+ }
+@@ -3974,11 +3977,21 @@
+ and comparison of non-latin1 char type fields in
+ innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
+ work correctly. */
+-
+- default: assert(0);
++ case HA_READ_MBR_CONTAIN:
++ case HA_READ_MBR_INTERSECT:
++ case HA_READ_MBR_WITHIN:
++ case HA_READ_MBR_DISJOINT:
++ my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
++ return(PAGE_CUR_UNSUPP);
++ /* do not use "default:" in order to produce a gcc warning:
++ enumeration value '...' not handled in switch
++ (if -Wswitch or -Wall is used)
++ */
+ }
+
+- return(0);
++ my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
++
++ return(PAGE_CUR_UNSUPP);
+ }
+
+ /*
+@@ -4106,11 +4119,18 @@
+
+ last_match_mode = (uint) match_mode;
+
+- innodb_srv_conc_enter_innodb(prebuilt->trx);
++ if (mode != PAGE_CUR_UNSUPP) {
+
+- ret = row_search_for_mysql((byte*) buf, mode, prebuilt, match_mode, 0);
++ innodb_srv_conc_enter_innodb(prebuilt->trx);
+
+- innodb_srv_conc_exit_innodb(prebuilt->trx);
++ ret = row_search_for_mysql((byte*) buf, mode, prebuilt,
++ match_mode, 0);
++
++ innodb_srv_conc_exit_innodb(prebuilt->trx);
++ } else {
++
++ ret = DB_UNSUPPORTED;
++ }
+
+ if (ret == DB_SUCCESS) {
+ error = 0;
+@@ -5460,8 +5480,16 @@
+ mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
+ HA_READ_KEY_EXACT);
+
+- n_rows = btr_estimate_n_rows_in_range(index, range_start,
+- mode1, range_end, mode2);
++ if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) {
++
++ n_rows = btr_estimate_n_rows_in_range(index, range_start,
++ mode1, range_end,
++ mode2);
++ } else {
++
++ n_rows = 0;
++ }
++
+ dtuple_free_for_mysql(heap1);
+ dtuple_free_for_mysql(heap2);
+
+diff -ur innobase.orig/include/page0cur.h innobase/include/page0cur.h
+--- innobase.orig/include/page0cur.h 2007-06-22 10:31:32.000000000 +0300
++++ innobase/include/page0cur.h 2007-11-14 14:43:52.000000000 +0200
+@@ -22,6 +22,7 @@
+
+ /* Page cursor search modes; the values must be in this order! */
+
++#define PAGE_CUR_UNSUPP 0
+ #define PAGE_CUR_G 1
+ #define PAGE_CUR_GE 2
+ #define PAGE_CUR_L 3
diff --git a/709_all_innodb_spatial_crash_mybug_32125_5.0.patch b/709_all_innodb_spatial_crash_mybug_32125_5.0.patch
new file mode 100644
index 0000000..7897039
--- /dev/null
+++ b/709_all_innodb_spatial_crash_mybug_32125_5.0.patch
@@ -0,0 +1,112 @@
+diff -ru innobase/include/db0err.h.orig innobase/include/db0err.h
+--- innobase/include/db0err.h.orig 2007-07-04 16:06:59.000000000 +0300
++++ innobase/include/db0err.h 2007-11-15 10:23:51.000000000 +0200
+@@ -57,6 +57,18 @@
+ buffer pool (for big transactions,
+ InnoDB stores the lock structs in the
+ buffer pool) */
++#define DB_FOREIGN_DUPLICATE_KEY 46 /* foreign key constraints
++ activated by the operation would
++ lead to a duplicate key in some
++ table */
++#define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the
++ preconfigured undo slots, this can
++ only happen when there are too many
++ concurrent transactions */
++#define DB_UNSUPPORTED 48 /* when InnoDB sees any artefact or
++ a feature that it can't recoginize or
++ work with e.g., FT indexes created by
++ a later version of the engine. */
+
+ /* The following are partial failure codes */
+ #define DB_FAIL 1000
+diff -ru innobase/include/page0cur.h.orig innobase/include/page0cur.h
+--- innobase/include/page0cur.h.orig 2007-07-04 16:06:10.000000000 +0300
++++ innobase/include/page0cur.h 2007-11-15 10:23:51.000000000 +0200
+@@ -22,6 +22,7 @@
+
+ /* Page cursor search modes; the values must be in this order! */
+
++#define PAGE_CUR_UNSUPP 0
+ #define PAGE_CUR_G 1
+ #define PAGE_CUR_GE 2
+ #define PAGE_CUR_L 3
+diff -ru sql/ha_innodb.cc.orig sql/ha_innodb.cc
+--- sql/ha_innodb.cc.orig 2007-07-04 16:06:48.000000000 +0300
++++ sql/ha_innodb.cc 2007-11-15 10:25:55.000000000 +0200
+@@ -526,6 +526,9 @@
+ }
+
+ return(HA_ERR_LOCK_TABLE_FULL);
++ } else if (error == DB_UNSUPPORTED) {
++
++ return(HA_ERR_UNSUPPORTED);
+ } else {
+ return(-1); // Unknown error
+ }
+@@ -3689,11 +3692,21 @@
+ and comparison of non-latin1 char type fields in
+ innobase_mysql_cmp() to get PAGE_CUR_LE_OR_EXTENDS to
+ work correctly. */
+-
+- default: assert(0);
++ case HA_READ_MBR_CONTAIN:
++ case HA_READ_MBR_INTERSECT:
++ case HA_READ_MBR_WITHIN:
++ case HA_READ_MBR_DISJOINT:
++ my_error(ER_TABLE_CANT_HANDLE_SPKEYS, MYF(0));
++ return(PAGE_CUR_UNSUPP);
++ /* do not use "default:" in order to produce a gcc warning:
++ enumeration value '...' not handled in switch
++ (if -Wswitch or -Wall is used)
++ */
+ }
+
+- return(0);
++ my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "this functionality");
++
++ return(PAGE_CUR_UNSUPP);
+ }
+
+ /*
+@@ -3831,11 +3844,18 @@
+
+ last_match_mode = (uint) match_mode;
+
+- innodb_srv_conc_enter_innodb(prebuilt->trx);
++ if (mode != PAGE_CUR_UNSUPP) {
+
+- ret = row_search_for_mysql((byte*) buf, mode, prebuilt, match_mode, 0);
++ innodb_srv_conc_enter_innodb(prebuilt->trx);
+
+- innodb_srv_conc_exit_innodb(prebuilt->trx);
++ ret = row_search_for_mysql((byte*) buf, mode, prebuilt,
++ match_mode, 0);
++
++ innodb_srv_conc_exit_innodb(prebuilt->trx);
++ } else {
++
++ ret = DB_UNSUPPORTED;
++ }
+
+ if (ret == DB_SUCCESS) {
+ error = 0;
+@@ -5150,8 +5170,16 @@
+ mode2 = convert_search_mode_to_innobase(max_key ? max_key->flag :
+ HA_READ_KEY_EXACT);
+
+- n_rows = btr_estimate_n_rows_in_range(index, range_start,
+- mode1, range_end, mode2);
++ if (mode1 != PAGE_CUR_UNSUPP && mode2 != PAGE_CUR_UNSUPP) {
++
++ n_rows = btr_estimate_n_rows_in_range(index, range_start,
++ mode1, range_end,
++ mode2);
++ } else {
++
++ n_rows = 0;
++ }
++
+ dtuple_free_for_mysql(heap1);
+ dtuple_free_for_mysql(heap2);
+
diff --git a/710_all_respect_tmpdir_filesort_mybug_30287_5.0.patch b/710_all_respect_tmpdir_filesort_mybug_30287_5.0.patch
new file mode 100644
index 0000000..154d22f
--- /dev/null
+++ b/710_all_respect_tmpdir_filesort_mybug_30287_5.0.patch
@@ -0,0 +1,128 @@
+From: &lt;gshchepaDate: August 20 2007 10:39pm
+Subject: bk commit into 5.0 tree (gshchepa:1.2496) BUG#30287
+
+Below is the list of changes that have just been committed into a local
+5.0 repository of uchum. When uchum does a push these changes will
+be propagated to the main repository and, within 24 hours after the
+push, to the public repository.
+For information on how to access the public repository
+see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
+
+ChangeSet@stripped, 2007-08-21 01:39:39+05:00, gshchepa@stripped +3 -0
+ Fixed bug #30287.
+ The server created temporary tables for filesort in the working directory
+ instead of the specified tmpdir directory.
+
+ sql/item.cc@stripped, 2007-08-21 01:09:20+05:00, gshchepa@stripped +2 -0
+ Fixed bug #30287.
+ The Item_field::set_field method has been modified to reset the any_privileges
+ flag to false in case of system temporary table. This modification prevents the
+ server from unnecessary checking of user privileges to access system temporary
+ tables.
+
+ sql/sql_select.cc@stripped, 2007-08-21 01:09:43+05:00, gshchepa@stripped +8 -11
+ Fixed bug #30287.
+ Bugfix for #29015 has been removed: TABLE_SHARE::table_name of system
+ temporary tables contains full path to table file basename again.
+
+ sql/sql_view.cc@stripped, 2007-08-21 01:09:50+05:00, gshchepa@stripped +6 -0
+ Fixed bug #30287.
+ Commentary has been added.
+
+diff -Nrup a/sql/item.cc b/sql/item.cc
+--- a/sql/item.cc 2007-08-08 12:34:31 +05:00
++++ b/sql/item.cc 2007-08-21 01:09:20 +05:00
+@@ -1765,6 +1765,8 @@ void Item_field::set_field(Field *field_
+ unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
+ collation.set(field_par->charset(), field_par->derivation());
+ fixed= 1;
++ if (field->table->s->tmp_table == SYSTEM_TMP_TABLE)
++ any_privileges= 0;
+ }
+
+
+diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
+--- a/sql/sql_select.cc 2007-07-31 16:24:13 +05:00
++++ b/sql/sql_select.cc 2007-08-21 01:09:43 +05:00
+@@ -9169,7 +9169,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ bool using_unique_constraint= 0;
+ bool use_packed_rows= 0;
+ bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS);
+- char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1];
++ char *tmpname,path[FN_REFLEN];
+ byte *pos,*group_buff;
+ uchar *null_flags;
+ Field **reg_field, **from_field, **default_field;
+@@ -9192,12 +9192,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ temp_pool_slot = bitmap_set_next(&temp_pool);
+
+ if (temp_pool_slot != MY_BIT_NONE) // we got a slot
+- sprintf(table_name, "%s_%lx_%i", tmp_file_prefix,
++ sprintf(path, "%s_%lx_%i", tmp_file_prefix,
+ current_pid, temp_pool_slot);
+ else
+ {
+ /* if we run out of slots or we are not using tempool */
+- sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid,
++ sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid,
+ thd->thread_id, thd->tmp_table++);
+ }
+
+@@ -9205,8 +9205,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ No need to change table name to lower case as we are only creating
+ MyISAM or HEAP tables here
+ */
+- fn_format(path, table_name, mysql_tmpdir, "",
+- MY_REPLACE_EXT|MY_UNPACK_FILENAME);
++ fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
++
+
+ if (group)
+ {
+@@ -9251,8 +9251,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ sizeof(*key_part_info)*(param->group_parts+1),
+ &param->start_recinfo,
+ sizeof(*param->recinfo)*(field_count*2+4),
+- &tmppath, (uint) strlen(path)+1,
+- &tmpname, (uint) strlen(table_name)+1,
++ &tmpname, (uint) strlen(path)+1,
+ &group_buff, group && ! using_unique_constraint ?
+ param->group_length : 0,
+ NullS))
+@@ -9270,8 +9269,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ DBUG_RETURN(NULL); /* purecov: inspected */
+ }
+ param->items_to_copy= copy_func;
+- strmov(tmppath, path);
+- strmov(tmpname, table_name);
++ strmov(tmpname,path);
+ /* make table according to fields */
+
+ bzero((char*) table,sizeof(*table));
+@@ -9297,8 +9295,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+
+ table->s= &table->share_not_to_be_used;
+ table->s->blob_field= blob_field;
+- table->s->table_name= tmpname;
+- table->s->path= tmppath;
++ table->s->table_name= table->s->path= tmpname;
+ table->s->db= "";
+ table->s->blob_ptr_size= mi_portable_sizeof_char_ptr;
+ table->s->tmp_table= NON_TRANSACTIONAL_TMP_TABLE;
+diff -Nrup a/sql/sql_view.cc b/sql/sql_view.cc
+--- a/sql/sql_view.cc 2007-07-12 23:26:39 +05:00
++++ b/sql/sql_view.cc 2007-08-21 01:09:50 +05:00
+@@ -397,7 +397,13 @@ bool mysql_create_view(THD *thd, TABLE_L
+ {
+ Item_field *field;
+ if ((field= item->filed_for_view_update()))
++ {
++ /*
++ any_privileges may be reset later by the Item_field::set_field
++ method in case of a system temporary table.
++ */
+ field->any_privileges= 1;
++ }
+ }
+ }
+ #endif
diff --git a/710_all_respect_tmpdir_filesort_mybug_30287_5.1.patch b/710_all_respect_tmpdir_filesort_mybug_30287_5.1.patch
new file mode 100644
index 0000000..bcfc17d
--- /dev/null
+++ b/710_all_respect_tmpdir_filesort_mybug_30287_5.1.patch
@@ -0,0 +1,131 @@
+From: &lt;gshchepaDate: August 23 2007 10:54pm
+Subject: bk commit into 5.1 tree (gshchepa:1.2569) BUG#30287
+
+Below is the list of changes that have just been committed into a local
+5.1 repository of uchum. When uchum does a push these changes will
+be propagated to the main repository and, within 24 hours after the
+push, to the public repository.
+For information on how to access the public repository
+see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
+
+ChangeSet@stripped, 2007-08-24 01:54:18+05:00, gshchepa@stripped +3 -0
+ Fixed bug #30287.
+ Recommit to 5.1.22.
+ The server created temporary tables for filesort in the working directory
+ instead of the specified tmpdir directory.
+
+ sql/item.cc@stripped, 2007-08-24 01:52:11+05:00, gshchepa@stripped +2 -0
+ Fixed bug #30287.
+ Recommit to 5.1.22.
+ The Item_field::set_field method has been modified to reset the any_privileges
+ flag to false in case of system temporary table. This modification prevents the
+ server from unnecessary checking of user privileges to access system temporary
+ tables.
+
+ sql/sql_select.cc@stripped, 2007-08-24 01:52:15+05:00, gshchepa@stripped +8 -10
+ Fixed bug #30287.
+ Recommit to 5.1.22.
+ Bugfix for #29015 has been removed: TABLE_SHARE::table_name of system
+ temporary tables contains full path to table file basename again.
+
+ sql/sql_view.cc@stripped, 2007-08-24 01:52:16+05:00, gshchepa@stripped +6 -0
+ Fixed bug #30287.
+ Recommit to 5.1.22.
+ Commentary has been added.
+
+diff -Nrup a/sql/item.cc b/sql/item.cc
+--- a/sql/item.cc 2007-08-14 00:39:23 +05:00
++++ b/sql/item.cc 2007-08-24 01:52:11 +05:00
+@@ -1801,6 +1801,8 @@ void Item_field::set_field(Field *field_
+ unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
+ collation.set(field_par->charset(), field_par->derivation());
+ fixed= 1;
++ if (field->table->s->tmp_table == SYSTEM_TMP_TABLE)
++ any_privileges= 0;
+ }
+
+
+diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
+--- a/sql/sql_select.cc 2007-08-14 00:39:25 +05:00
++++ b/sql/sql_select.cc 2007-08-24 01:52:15 +05:00
+@@ -9417,7 +9417,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ bool using_unique_constraint= 0;
+ bool use_packed_rows= 0;
+ bool not_all_columns= !(select_options & TMP_TABLE_ALL_COLUMNS);
+- char *tmpname, *tmppath, path[FN_REFLEN], table_name[NAME_LEN+1];
++ char *tmpname,path[FN_REFLEN];
+ uchar *pos, *group_buff, *bitmaps;
+ uchar *null_flags;
+ Field **reg_field, **from_field, **default_field;
+@@ -9441,12 +9441,12 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ temp_pool_slot = bitmap_lock_set_next(&temp_pool);
+
+ if (temp_pool_slot != MY_BIT_NONE) // we got a slot
+- sprintf(table_name, "%s_%lx_%i", tmp_file_prefix,
++ sprintf(path, "%s_%lx_%i", tmp_file_prefix,
+ current_pid, temp_pool_slot);
+ else
+ {
+ /* if we run out of slots or we are not using tempool */
+- sprintf(table_name, "%s%lx_%lx_%x", tmp_file_prefix,current_pid,
++ sprintf(path,"%s%lx_%lx_%x", tmp_file_prefix,current_pid,
+ thd->thread_id, thd->tmp_table++);
+ }
+
+@@ -9454,8 +9454,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ No need to change table name to lower case as we are only creating
+ MyISAM or HEAP tables here
+ */
+- fn_format(path, table_name, mysql_tmpdir, "",
+- MY_REPLACE_EXT|MY_UNPACK_FILENAME);
++ fn_format(path, path, mysql_tmpdir, "", MY_REPLACE_EXT|MY_UNPACK_FILENAME);
++
+
+ if (group)
+ {
+@@ -9501,8 +9501,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ sizeof(*key_part_info)*(param->group_parts+1),
+ &param->start_recinfo,
+ sizeof(*param->recinfo)*(field_count*2+4),
+- &tmppath, (uint) strlen(path)+1,
+- &tmpname, (uint) strlen(table_name)+1,
++ &tmpname, (uint) strlen(path)+1,
+ &group_buff, (group && ! using_unique_constraint ?
+ param->group_length : 0),
+ &bitmaps, bitmap_buffer_size(field_count)*2,
+@@ -9521,8 +9520,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ DBUG_RETURN(NULL); /* purecov: inspected */
+ }
+ param->items_to_copy= copy_func;
+- strmov(tmppath, path);
+- strmov(tmpname, table_name);
++ strmov(tmpname,path);
+ /* make table according to fields */
+
+ bzero((char*) table,sizeof(*table));
+@@ -9547,7 +9545,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
+ table->keys_in_use_for_query.init();
+
+ table->s= share;
+- init_tmp_table_share(share, "", 0, tmpname, tmppath);
++ init_tmp_table_share(share, "", 0, tmpname, tmpname);
+ share->blob_field= blob_field;
+ share->blob_ptr_size= mi_portable_sizeof_char_ptr;
+ share->db_low_byte_first=1; // True for HEAP and MyISAM
+diff -Nrup a/sql/sql_view.cc b/sql/sql_view.cc
+--- a/sql/sql_view.cc 2007-07-17 00:02:46 +05:00
++++ b/sql/sql_view.cc 2007-08-24 01:52:16 +05:00
+@@ -397,7 +397,13 @@ bool mysql_create_view(THD *thd, TABLE_L
+ {
+ Item_field *field;
+ if ((field= item->filed_for_view_update()))
++ {
++ /*
++ any_privileges may be reset later by the Item_field::set_field
++ method in case of a system temporary table.
++ */
+ field->any_privileges= 1;
++ }
+ }
+ }
+ #endif