MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:October 10 2007 1:50am
Subject:bk commit into 5.0 tree (tnurnberg:1.2530) BUG#31379
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tnurnberg. When tnurnberg 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-10-10 03:50:20+02:00, tnurnberg@stripped +3 -0
  Bug#31379: Incorrect error ERROR 1114 (HY000): The table '' is full
  
  Table alias could be empty for tempory tables, making the error message
  look broken. We now print the path to the table in such cases.

  mysql-test/r/error_simulation.result@stripped, 2007-10-10 03:50:16+02:00, tnurnberg@stripped +1 -1
    error message contains a (in our test: normalised) table path now.

  mysql-test/t/error_simulation.test@stripped, 2007-10-10 03:50:16+02:00, tnurnberg@stripped +1 -0
    ER_DUP_KEY message now contains temp table path. Make sure
    it's non-empty, but throw away the actual ("random") value.

  sql/handler.cc@stripped, 2007-10-10 03:50:16+02:00, tnurnberg@stripped +15 -9
    If (temp) table has no alias, use its path in error-messages.

diff -Nrup a/mysql-test/r/error_simulation.result b/mysql-test/r/error_simulation.result
--- a/mysql-test/r/error_simulation.result	2007-06-07 09:59:06 +02:00
+++ b/mysql-test/r/error_simulation.result	2007-10-10 03:50:16 +02:00
@@ -14,6 +14,6 @@ INSERT INTO t1 VALUES
 ('AAAAAAAAAJ','AAAAAAAAAJ'), ('AAAAAAAAAK','AAAAAAAAAK');
 set tmp_table_size=1024;
 SELECT MAX(a) FROM t1 GROUP BY a,b;
-ERROR 23000: Can't write; duplicate key in table ''
+ERROR 23000: Can't write; duplicate key in table <temp table>
 set tmp_table_size=default;
 DROP TABLE t1;
diff -Nrup a/mysql-test/t/error_simulation.test b/mysql-test/t/error_simulation.test
--- a/mysql-test/t/error_simulation.test	2007-06-07 09:59:06 +02:00
+++ b/mysql-test/t/error_simulation.test	2007-10-10 03:50:16 +02:00
@@ -21,6 +21,7 @@ INSERT INTO t1 VALUES
 
 set tmp_table_size=1024;
 
+--replace_regex / '.+'/ <temp table>/
 --error ER_DUP_KEY
 SELECT MAX(a) FROM t1 GROUP BY a,b;
 
diff -Nrup a/sql/handler.cc b/sql/handler.cc
--- a/sql/handler.cc	2007-08-15 09:23:42 +02:00
+++ b/sql/handler.cc	2007-10-10 03:50:16 +02:00
@@ -1735,15 +1735,15 @@ ulonglong handler::get_auto_increment()
 }
 
 
-/*
-  Print error that we got from handler function
+/**
+  @brief Print error that we got from handler function
 
-  NOTE
-   In case of delete table it's only safe to use the following parts of
-   the 'table' structure:
-     table->s->path
-     table->alias
-*/
+  @details In case of delete table it's only safe to use the following
+    parts of the 'table' structure: table->s->path table->alias
+
+  @param[in]  error    the error-code we'll signal to the user
+  @param[in]  errflag  flags for my_error()
+ */
 
 void handler::print_error(int error, myf errflag)
 {
@@ -1919,7 +1919,13 @@ void handler::print_error(int error, myf
       DBUG_VOID_RETURN;
     }
   }
-  my_error(textno, errflag, table->alias, error);
+  /*
+    if table->alias is empty (""), we'll print the path to the (temp)
+    table since table->s->table_name is not guaranteed to be valid while
+    deleting.
+  */
+  my_error(textno, errflag, ((table->alias != NULL) && (*table->alias))
+           ? table->alias : table->s->path, error);
   DBUG_VOID_RETURN;
 }
 
Thread
bk commit into 5.0 tree (tnurnberg:1.2530) BUG#31379Tatjana A Nuernberg10 Oct
Re: bk commit into 5.0 tree (tnurnberg:1.2530) BUG#31379Tatjana Azundris Nurnberg18 Oct