MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:August 20 2010 12:20pm
Subject:bzr commit into mysql-5.5-bugfixing branch (alik:3119) Bug#27480
View as plain text  
#At file:///mnt/raid/alik/MySQL/bzr/00/bug27480/mysql-5.5-runtime-bug27480.2/ based on revid:alik@stripped

 3119 Alexander Nozdrin	2010-08-20
      Bug#27480 (Extend CREATE TEMPORARY TABLES privilege
      to allow temp table operations) -- prerequisite patch #3:
          
      rename open_temporary_table() to open_temporary_table_from_disk().
      open_temporary_table() will be introduced in following patches
      to open temporary tables.

    modified:
      sql/sql_base.cc
      sql/sql_base.h
      sql/sql_table.cc
      sql/sql_truncate.cc
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2010-08-19 17:51:24 +0000
+++ b/sql/sql_base.cc	2010-08-20 12:20:19 +0000
@@ -5745,10 +5745,11 @@ void close_tables_for_reopen(THD *thd, T
 
 
 /*
-  Open a single table without table caching and don't set it in open_list
+  Open a single table from disk without table caching and don't set it in
+  open_list.
 
   SYNPOSIS
-    open_temporary_table()
+    open_temporary_table_from_disk()
     thd		  Thread object
     path	  Path (without .frm)
     db		  database
@@ -5764,15 +5765,16 @@ void close_tables_for_reopen(THD *thd, T
    #  TABLE object
 */
 
-TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
-			    const char *table_name, bool link_in_list)
+TABLE *open_temporary_table_from_disk(THD *thd, const char *path,
+                                      const char *db, const char *table_name,
+                                      bool link_in_list)
 {
   TABLE *tmp_table;
   TABLE_SHARE *share;
   char cache_key[MAX_DBKEY_LENGTH], *saved_cache_key, *tmp_path;
   uint key_length;
   TABLE_LIST table_list;
-  DBUG_ENTER("open_temporary_table");
+  DBUG_ENTER("open_temporary_table_from_disk");
   DBUG_PRINT("enter",
              ("table: '%s'.'%s'  path: '%s'  server_id: %u  "
               "pseudo_thread_id: %lu",

=== modified file 'sql/sql_base.h'
--- a/sql/sql_base.h	2010-08-19 17:51:24 +0000
+++ b/sql/sql_base.h	2010-08-20 12:20:19 +0000
@@ -142,7 +142,7 @@ bool open_new_frm(THD *thd, TABLE_SHARE 
 
 bool get_key_map_from_key_list(key_map *map, TABLE *table,
                                List<String> *index_list);
-TABLE *open_temporary_table(THD *thd, const char *path, const char *db,
+TABLE *open_temporary_table_from_disk(THD *thd, const char *path, const char *db,
 			    const char *table_name, bool link_in_list);
 TABLE *find_locked_table(TABLE *list, const char *db, const char *table_name);
 TABLE *find_write_locked_table(TABLE *list, const char *db,

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2010-08-18 11:55:37 +0000
+++ b/sql/sql_table.cc	2010-08-20 12:20:19 +0000
@@ -22,7 +22,7 @@
 #include "sql_rename.h" // do_rename
 #include "sql_parse.h"                        // test_if_data_home_dir
 #include "sql_cache.h"                          // query_cache_*
-#include "sql_base.h"   // open_temporary_table, lock_table_names
+#include "sql_base.h"   // open_temporary_table_from_disk, lock_table_names
 #include "lock.h"       // wait_if_global_read_lock
                         // start_waiting_global_read_lock,
                         // mysql_unlock_tables
@@ -4176,7 +4176,7 @@ bool mysql_create_table_no_lock(THD *thd
   if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
   {
     /* Open table and put in temporary table list */
-    if (!(open_temporary_table(thd, path, db, table_name, 1)))
+    if (!(open_temporary_table_from_disk(thd, path, db, table_name, TRUE)))
     {
       (void) rm_temporary_table(create_info->db_type, path);
       goto err;
@@ -6246,7 +6246,8 @@ bool mysql_alter_table(THD *thd,char *ne
       build_table_filename(path, sizeof(path) - 1, new_db, tmp_name, "",
                            FN_IS_TMP);
       /* Open our intermediate table */
-      new_table= open_temporary_table(thd, path, new_db, tmp_name, 1);
+      new_table= open_temporary_table_from_disk(thd, path, new_db,
+                                                tmp_name, TRUE);
     }
     if (!new_table)
       goto err_new_table_cleanup;
@@ -6586,7 +6587,7 @@ bool mysql_alter_table(THD *thd,char *ne
     char path[FN_REFLEN];
     TABLE *t_table;
     build_table_filename(path + 1, sizeof(path) - 1, new_db, table_name, "", 0);
-    t_table= open_temporary_table(thd, path, new_db, tmp_name, 0);
+    t_table= open_temporary_table_from_disk(thd, path, new_db, tmp_name, FALSE);
     if (t_table)
     {
       intern_close_table(t_table);

=== modified file 'sql/sql_truncate.cc'
--- a/sql/sql_truncate.cc	2010-08-18 11:29:04 +0000
+++ b/sql/sql_truncate.cc	2010-08-20 12:20:19 +0000
@@ -208,8 +208,8 @@ static bool recreate_temporary_table(THD
   ha_create_table(thd, share->normalized_path.str, share->db.str,
                   share->table_name.str, &create_info, 1);
 
-  if (open_temporary_table(thd, share->path.str, share->db.str,
-                           share->table_name.str, 1))
+  if (open_temporary_table_from_disk(thd, share->path.str, share->db.str,
+                                     share->table_name.str, 1))
   {
     error= FALSE;
     thd->thread_specific_used= TRUE;


Attachment: [text/bzr-bundle] bzr/alik@sun.com-20100820122019-8l30321zve8uli1k.bundle
Thread
bzr commit into mysql-5.5-bugfixing branch (alik:3119) Bug#27480Alexander Nozdrin20 Aug