List:Internals« Previous MessageNext Message »
From:monty Date:May 13 2005 1:04pm
Subject:bk commit into 4.1 tree (monty:1.2268)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of monty. When monty 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.2268 05/05/13 14:04:32 monty@stripped +5 -0
  Fixes during review

  strings/ctype-ucs2.c
    1.40 05/05/13 14:04:27 monty@stripped +5 -3
    Cast pointer differencess

  sql/sql_yacc.yy
    1.385 05/05/13 14:04:27 monty@stripped +10 -19
    Combine code (and get a better error message)

  sql/hostname.cc
    1.29 05/05/13 14:04:27 monty@stripped +2 -2
    Join identical code

  mysql-test/t/select.test
    1.37 05/05/13 14:04:27 monty@stripped +2 -2
    Better error message

  mysql-test/r/select.result
    1.53 05/05/13 14:04:27 monty@stripped +2 -2
    Better error message

# 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:	monty
# Host:	narttu.mysql.com
# Root:	/home/my/mysql-4.1

--- 1.28/sql/hostname.cc	2005-05-06 12:18:10 +03:00
+++ 1.29/sql/hostname.cc	2005-05-13 14:04:27 +03:00
@@ -209,8 +209,8 @@
     DBUG_PRINT("error",("gethostbyaddr returned %d",errno));
 
     if (errno == HOST_NOT_FOUND || errno == NO_DATA)
-	add_wrong_ip(in); /* only cache negative responses, not failures */
-
+      goto add_wrong_ip_and_return;
+    /* Failure, don't cache responce */
     DBUG_RETURN(0);
   }
   if (!hp->h_name[0])				// Don't allow empty hostnames

--- 1.384/sql/sql_yacc.yy	2005-05-09 16:50:49 +03:00
+++ 1.385/sql/sql_yacc.yy	2005-05-13 14:04:27 +03:00
@@ -2467,7 +2467,14 @@
 
 select_options:
 	/* empty*/
-	| select_option_list;
+	| select_option_list
+	  {
+	    if (test_all_bits(Select->options, SELECT_ALL | SELECT_DISTINCT))
+	    {
+	      net_printf(Lex->thd, ER_WRONG_USAGE, "ALL", "DISTINCT");
+              YYABORT;
+	    }
+          }
 
 select_option_list:
 	select_option_list select_option
@@ -2481,15 +2488,7 @@
 	      YYABORT;
 	    Lex->lock_option= TL_READ_HIGH_PRIORITY;
 	  }
-	| DISTINCT
-	  {
-            if (Select->options & SELECT_ALL)
-            {
-              yyerror(ER(ER_SYNTAX_ERROR));
-              YYABORT;
-            }
-            Select->options|= SELECT_DISTINCT; 
-	  }
+	| DISTINCT         { Select->options|= SELECT_DISTINCT; }
 	| SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
 	| SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; }
 	| SQL_BUFFER_RESULT
@@ -2509,15 +2508,7 @@
 	  {
 	    Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
 	  }
-	| ALL
-	  {
-            if (Select->options & SELECT_DISTINCT)
-            {
-              yyerror(ER(ER_SYNTAX_ERROR));
-              YYABORT;
-            }
-            Select->options|= SELECT_ALL; 
-	  }
+	| ALL		    { Select->options|= SELECT_ALL; }
 	;
 
 select_lock_type:

--- 1.39/strings/ctype-ucs2.c	2005-05-10 12:13:54 +03:00
+++ 1.40/strings/ctype-ucs2.c	2005-05-13 14:04:27 +03:00
@@ -1251,7 +1251,7 @@
 uint my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
 		      const char *b, const char *e)
 {
-  return (e-b)/2;
+  return (uint) (e-b)/2;
 }
 
 
@@ -1261,7 +1261,8 @@
 		     const char *e  __attribute__((unused)),
 		     uint pos)
 {
-  return pos > e - b ? e - b + 2 : pos * 2;
+  uint string_length= (uint) (e - b);
+  return pos > string_length ? string_length + 2 : pos * 2;
 }
 
 
@@ -1270,7 +1271,8 @@
                              const char *b, const char *e,
                              uint nchars, int *error)
 {
-  uint nbytes= (e-b) & ~ (uint)1;
+  /* Ensure string length is dividable with 2 */
+  uint nbytes= ((uint) (e-b)) & ~(uint) 1;
   *error= 0;
   nchars*= 2;
   return min(nbytes, nchars);

--- 1.52/mysql-test/r/select.result	2005-05-09 16:31:30 +03:00
+++ 1.53/mysql-test/r/select.result	2005-05-13 14:04:27 +03:00
@@ -2451,7 +2451,7 @@
 select distinct distinct * from t1;
 a
 select all distinct * from t1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'distinct * from t1' at line 1
+ERROR HY000: Incorrect usage of ALL and DISTINCT
 select distinct all * from t1;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'all * from t1' at line 1
+ERROR HY000: Incorrect usage of ALL and DISTINCT
 drop table t1;

--- 1.36/mysql-test/t/select.test	2005-05-09 16:31:31 +03:00
+++ 1.37/mysql-test/t/select.test	2005-05-13 14:04:27 +03:00
@@ -1987,9 +1987,9 @@
 create table t1 (a int(11));
 select all all * from t1;
 select distinct distinct * from t1;
---error 1064
+--error 1221
 select all distinct * from t1;
---error 1064
+--error 1221
 select distinct all * from t1;
 drop table t1;
 
Thread
bk commit into 4.1 tree (monty:1.2268)monty13 May