List:Commits« Previous MessageNext Message »
From:tim Date:April 28 2007 10:54am
Subject:bk commit into 5.0 tree (tsmith:1.2463) BUG#27653
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tsmith. When tsmith 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-04-28 10:54:20+02:00, tsmith@stripped +7 -0
  Bug #27653: Temp table can't be created if lower_case_table_names=1 and tmpdir has
uppercase
  
  Fix: don't convert mysql_tmpdir to lower case when building the path to a temporary
table

  mysql-test/include/have_lowercase1.inc@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +4 -0
    BitKeeper file
/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50/mysql-test/include/have_lowercase1.inc

  mysql-test/include/have_lowercase1.inc@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +0 -0

  mysql-test/r/lowercase1.require@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +2 -0
    BitKeeper file
/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50/mysql-test/r/lowercase1.require

  mysql-test/r/lowercase1.require@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +0 -0

  mysql-test/r/lowercase_mixed_tmpdir.result@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +6 -0
    BitKeeper file
/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50/mysql-test/r/lowercase_mixed_tmpdir.result

  mysql-test/r/lowercase_mixed_tmpdir.result@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +0 -0

  mysql-test/t/lowercase_mixed_tmpdir-master.opt@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +2 -0
    BitKeeper file
/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50/mysql-test/t/lowercase_mixed_tmpdir-master.opt

  mysql-test/t/lowercase_mixed_tmpdir-master.opt@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +0 -0

  mysql-test/t/lowercase_mixed_tmpdir-master.sh@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +5 -0
    BitKeeper file
/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50/mysql-test/t/lowercase_mixed_tmpdir-master.sh

  mysql-test/t/lowercase_mixed_tmpdir-master.sh@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +0 -0

  mysql-test/t/lowercase_mixed_tmpdir.test@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +12 -0
    BitKeeper file
/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50/mysql-test/t/lowercase_mixed_tmpdir.test

  mysql-test/t/lowercase_mixed_tmpdir.test@stripped, 2007-04-28 10:50:51+02:00,
tsmith@stripped +0 -0

  sql/sql_table.cc@stripped, 2007-04-28 10:46:25+02:00, tsmith@stripped +13 -10
    When building the path for a temporary table file, do not
    convert mysql_tmpdir to lower case; lower_case_table_names
    should not apply to mysql_tmpdir.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tsmith
# Host:	quadxeon.mysql.com
# Root:	/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50

--- 1.341/sql/sql_table.cc	2007-04-25 12:08:10 +02:00
+++ 1.342/sql/sql_table.cc	2007-04-28 10:46:25 +02:00
@@ -42,6 +42,7 @@ static int copy_data_between_tables(TABL
 static bool prepare_blob_field(THD *thd, create_field *sql_field);
 static bool check_engine(THD *thd, const char *table_name,
                          enum db_type *new_engine);                             
+static void set_temporary_table_path(char *buf, size_t bufsize, THD *thd);
 
 
 /*
@@ -1681,11 +1682,7 @@ bool mysql_create_table(THD *thd,const c
       /* Check if table exists */
   if (create_info->options & HA_LEX_CREATE_TMP_TABLE)
   {
-    my_snprintf(path, sizeof(path), "%s%s%lx_%lx_%x%s",
-		mysql_tmpdir, tmp_file_prefix, current_pid, thd->thread_id,
-		thd->tmp_table++, reg_ext);
-    if (lower_case_table_names)
-      my_casedn_str(files_charset_info, path);
+    set_temporary_table_path(path, sizeof(path), thd);
     create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
   }
   else  
@@ -2801,11 +2798,7 @@ bool mysql_create_like_table(THD* thd, T
   {
     if (find_temporary_table(thd, db, table_name))
       goto table_exists;
-    my_snprintf(dst_path, sizeof(dst_path), "%s%s%lx_%lx_%x%s",
-		mysql_tmpdir, tmp_file_prefix, current_pid,
-		thd->thread_id, thd->tmp_table++, reg_ext);
-    if (lower_case_table_names)
-      my_casedn_str(files_charset_info, dst_path);
+    set_temporary_table_path(dst_path, sizeof(dst_path), thd);
     create_info->table_options|= HA_CREATE_DELAY_KEY_WRITE;
   }
   else
@@ -4318,4 +4311,14 @@ static bool check_engine(THD *thd, const
                        table_name);
   }
   return FALSE;
+}
+
+static void set_temporary_table_path(char *buf, size_t bufsize, THD *thd)
+{
+  char *p= strnmov(buf, mysql_tmpdir, bufsize);
+  my_snprintf(p, bufsize - (p - buf), "%s%lx_%lx_%x%s",
+              tmp_file_prefix, current_pid,
+              thd->thread_id, thd->tmp_table++, reg_ext);
+  if (lower_case_table_names)
+    my_casedn_str(files_charset_info, p);  /* Don't lower-case tmpdir */
 }
--- New file ---
+++ mysql-test/include/have_lowercase1.inc	07/04/28 10:50:51
--require r/lowercase1.require
--disable_query_log
show variables like 'lower_case_table_names';
--enable_query_log

--- New file ---
+++ mysql-test/r/lowercase1.require	07/04/28 10:50:51
Variable_name	Value
lower_case_table_names	1

--- New file ---
+++ mysql-test/r/lowercase_mixed_tmpdir.result	07/04/28 10:50:51
drop table if exists t1;
create table t1 (id int) engine=myisam;
insert into t1 values (1);
create temporary table t2 select * from t1;
drop temporary table t2;
drop table t1;

--- New file ---
+++ mysql-test/t/lowercase_mixed_tmpdir-master.opt	07/04/28 10:50:51
--lower-case-table-names=1
--tmpdir=$MYSQLTEST_VARDIR/tmp/MixedCase

--- New file ---
+++ mysql-test/t/lowercase_mixed_tmpdir-master.sh	07/04/28 10:50:51
# This test requires a non-lowercase tmpdir directory on a case-sensitive
# filesystem.

mkdir "$MYSQLTEST_VARDIR/tmp/MixedCase"
rm -f dummy "$MYSQLTEST_VARDIR/tmp/MixedCase"/*

--- New file ---
+++ mysql-test/t/lowercase_mixed_tmpdir.test	07/04/28 10:50:51
--source include/have_case_sensitive_file_system.inc
--source include/have_lowercase1.inc

--disable_warnings
drop table if exists t1;
--enable_warnings

create table t1 (id int) engine=myisam;
insert into t1 values (1);
create temporary table t2 select * from t1;
drop temporary table t2;
drop table t1;

Thread
bk commit into 5.0 tree (tsmith:1.2463) BUG#27653tim28 Apr