List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:September 17 2005 2:26am
Subject:bk commit into 5.0 tree (jimw:1.1974) BUG#13071
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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
  1.1974 05/09/16 17:26:40 jimw@stripped +1 -0
  Fail when two messages exist for the same language for an error in the
  server error messages file. (Bug #13071)

  extra/comp_err.c
    1.21 05/09/16 17:26:37 jimw@stripped +13 -4
    Fail when two messages for the same language are given for an error

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-13071

--- 1.20/extra/comp_err.c	2005-09-10 10:31:26 -07:00
+++ 1.21/extra/comp_err.c	2005-09-16 17:26:37 -07:00
@@ -131,7 +131,8 @@
 static struct errors *parse_error_string(char *ptr, int er_count);
 static struct message *parse_message_string(struct message *new_message,
 					    char *str);
-static struct message *find_message(struct errors *err, const char *lang);
+static struct message *find_message(struct errors *err, const char *lang,
+                                    my_bool no_default);
 static int parse_input_file(const char *file_name, struct errors **top_error,
 			    struct languages **top_language);
 static int get_options(int *argc, char ***argv);
@@ -305,7 +306,7 @@
     for (tmp_error= error_head; tmp_error; tmp_error= tmp_error->next_error)
     {
       /* dealing with messages */
-      tmp= find_message(tmp_error, tmp_lang->lang_short_name);
+      tmp= find_message(tmp_error, tmp_lang->lang_short_name, FALSE);
 
       if (!tmp)
       {
@@ -450,6 +451,13 @@
 		current_error->er_name);
 	DBUG_RETURN(0);
       }
+      if (find_message(current_error, current_message.lang_short_name, TRUE))
+      {
+	fprintf(stderr, "Duplicate message string for error '%s'"
+                        " in language '%s'\n",
+		current_error->er_name, current_message.lang_short_name);
+	DBUG_RETURN(0);
+      }
       if (insert_dynamic(&current_error->msg, (byte *) & current_message))
 	DBUG_RETURN(0);
       continue;
@@ -560,7 +568,8 @@
   returns english.
 */
 
-static struct message *find_message(struct errors *err, const char *lang)
+static struct message *find_message(struct errors *err, const char *lang,
+                                    my_bool no_default)
 {
   struct message *tmp, *return_val= 0;
   uint i, count;
@@ -579,7 +588,7 @@
       return_val= tmp;
     }
   }
-  DBUG_RETURN(return_val);
+  DBUG_RETURN(no_default ? NULL : return_val);
 }
 
 
Thread
bk commit into 5.0 tree (jimw:1.1974) BUG#13071Jim Winstead17 Sep