[Commits] Rev 3218: Merge in file:///home/igor/maria/maria-5.5/

Igor Babaev igor at askmonty.org
Wed Jan 18 10:38:13 EET 2012


At file:///home/igor/maria/maria-5.5/

------------------------------------------------------------
revno: 3218 [merge]
revision-id: igor at askmonty.org-20120118083813-8ey87os6x8r52hzx
parent: igor at askmonty.org-20120118074249-b0htie8dkn2vvx58
parent: sergii at pisem.net-20120117095527-rk7irw8e4qmq3isx
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5
timestamp: Wed 2012-01-18 00:38:13 -0800
message:
  Merge
modified:
  client/CMakeLists.txt          sp1f-cmakelists.txt-20060831175236-tdyayhfqw2zme3vhwbn6l2lno4em3u3t
  include/typelib.h              sp1f-typelib.h-20030118013555-bfjqizvdcv577l5p3yvn3uknuand67u2
  libmysql/get_password.c        sp1f-get_password.c-19700101030959-fsg3kc7kxzvr5ut6f7q3tzsunfn3jvlz
  mysql-test/suite/sys_vars/r/optimizer_switch_basic.result optimizer_switch_bas-20091218142501-e2u3nlswh5t0zxw3-35
  mysql-test/suite/sys_vars/t/optimizer_switch_basic.test optimizer_switch_bas-20091218142509-7v4mjqsbsr728g1f-35
  mysys/typelib.c                sp1f-typelib.c-19700101030959-yks6u7xso4ru4dpd6v7uq7ynmxg6wsgt
  sql/sql_partition.cc           sp1f-sql_partition.cc-20050718113038-57h5bzswps6cel2y7k7qideue3ghbg3u
  sql/sql_trigger.cc             sp1f-sql_trigger.cc-20040907122911-35k3wamrp6g7qsupxe7hisftpobcwin5
  vio/viosocket.c                sp1f-viotcpip.c-20010520120437-u3pbzbt3fdfbclbmusalnzmuqh2y4nav
-------------- next part --------------
=== modified file 'client/CMakeLists.txt'
--- a/client/CMakeLists.txt	2012-01-13 14:50:02 +0000
+++ b/client/CMakeLists.txt	2012-01-17 08:11:20 +0000
@@ -31,7 +31,7 @@
 TARGET_LINK_LIBRARIES(mysql mysqlclient)
 IF(UNIX)
   TARGET_LINK_LIBRARIES(mysql ${MY_READLINE_LIBRARY})
-  SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -rdynamic")
+  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
 ENDIF(UNIX)
 
 MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)

=== modified file 'include/typelib.h'
--- a/include/typelib.h	2011-10-19 19:45:18 +0000
+++ b/include/typelib.h	2012-01-17 09:55:27 +0000
@@ -35,10 +35,10 @@
 /** makes @c find_type() require the whole name, no prefix */
 #define FIND_TYPE_NO_PREFIX      (1 << 0)
 /** always implicitely on, so unused, but old code may pass it */
-#define FIND_TYPE_NO_OVERWRITE   (1 << 1)
-/** makes @c find_type() accept a number */
-#define FIND_TYPE_ALLOW_NUMBER   (1 << 2)
-/** makes @c find_type() treat ',' as terminator */
+#define FIND_TYPE_NO_OVERWRITE   0
+/** makes @c find_type() accept a number. Not used either */
+#define FIND_TYPE_ALLOW_NUMBER   0
+/** makes @c find_type() treat ',' and '=' as terminators */
 #define FIND_TYPE_COMMA_TERM     (1 << 3)
 
 extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);

=== modified file 'libmysql/get_password.c'
--- a/libmysql/get_password.c	2012-01-13 14:50:02 +0000
+++ b/libmysql/get_password.c	2012-01-17 08:11:20 +0000
@@ -157,7 +157,7 @@
   passbuff = getpass(opt_message ? opt_message : "Enter password: ");
 
   /* copy the password to buff and clear original (static) buffer */
-  strnmov(buff, passbuff, buflen - 1);
+  strncpy(buff, passbuff, buflen - 1);
 #ifdef _PASSWORD_LEN
   memset(passbuff, 0, _PASSWORD_LEN);
 #endif

=== modified file 'mysql-test/suite/sys_vars/r/optimizer_switch_basic.result'
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result	2012-01-13 14:50:02 +0000
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result	2012-01-17 09:55:27 +0000
@@ -52,6 +52,10 @@
 select @@session.optimizer_switch;
 @@session.optimizer_switch
 index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off
+set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
+select @@optimizer_switch;
+@@optimizer_switch
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on
 set global optimizer_switch=1.1;
 ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
 set global optimizer_switch=1e1;

=== modified file 'mysql-test/suite/sys_vars/t/optimizer_switch_basic.test'
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test	2011-10-19 19:45:18 +0000
+++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test	2012-01-17 09:55:27 +0000
@@ -34,6 +34,9 @@
 set session optimizer_switch="default";
 select @@session.optimizer_switch;
 
+set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
+select @@optimizer_switch;
+
 #
 # incorrect assignments
 #

=== modified file 'mysys/typelib.c'
--- a/mysys/typelib.c	2012-01-13 14:50:02 +0000
+++ b/mysys/typelib.c	2012-01-17 09:55:27 +0000
@@ -20,7 +20,8 @@
 #include <m_ctype.h>
 
 
-#define is_field_separator(X) ((X) == ',' || (X) == '=')
+#define is_field_separator(F, X) \
+  ((F & FIND_TYPE_COMMA_TERM) && ((X) == ',' || (X) == '='))
 
 int find_type_with_warning(const char *x, TYPELIB *typelib, const char *option)
 {
@@ -58,14 +59,14 @@
 /**
   Search after a string in a list of strings. Endspace in x is not compared.
 
-  @param x              String to find
+  @param x              pointer to string to find
+                        (not necessarily zero-terminated).
+                        by return it'll be advanced to point to the terminator.
   @param typelib        TYPELIB (struct of pointer to values + count)
   @param flags          flags to tune behaviour: a combination of
                         FIND_TYPE_NO_PREFIX
-                        FIND_TYPE_ALLOW_NUMBER
                         FIND_TYPE_COMMA_TERM.
-                        FIND_TYPE_NO_OVERWRITE can be passed but is
-                        superfluous (is always implicitely on).
+  @param eol            a pointer to the end of the string.
 
   @retval
     -1  Too many matching values
@@ -76,17 +77,20 @@
 */
 
 
-int find_type(const char *x, const TYPELIB *typelib, uint flags)
+static int find_type_eol(const char **x, const TYPELIB *typelib, uint flags,
+                         const char *eol)
 {
   int find,pos;
   int UNINIT_VAR(findpos);                       /* guarded by find */
+  const char *UNINIT_VAR(termptr);
   const char *i;
   const char *j;
-  DBUG_ENTER("find_type");
-  DBUG_PRINT("enter",("x: '%s'  lib: 0x%lx", x, (long) typelib));
-
-  DBUG_ASSERT(!(flags & ~(FIND_TYPE_NO_PREFIX | FIND_TYPE_ALLOW_NUMBER |
-                          FIND_TYPE_NO_OVERWRITE | FIND_TYPE_COMMA_TERM)));
+  CHARSET_INFO *cs= &my_charset_latin1;
+  DBUG_ENTER("find_type_eol");
+  DBUG_PRINT("enter",("x: '%s'  lib: 0x%lx", *x, (long) typelib));
+
+  DBUG_ASSERT(!(flags & ~(FIND_TYPE_NO_PREFIX | FIND_TYPE_COMMA_TERM)));
+
   if (!typelib->count)
   {
     DBUG_PRINT("exit",("no count"));
@@ -95,42 +99,52 @@
   find=0;
   for (pos=0 ; (j=typelib->type_names[pos]) ; pos++)
   {
-    for (i=x ; 
-    	*i && (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i)) &&
-        my_toupper(&my_charset_latin1,*i) == 
-    		my_toupper(&my_charset_latin1,*j) ; i++, j++) ;
+    for (i=*x ; 
+         i < eol && !is_field_separator(flags, *i) &&
+         my_toupper(cs, *i) == my_toupper(cs, *j) ; i++, j++) ;
     if (! *j)
     {
-      while (*i == ' ')
+      while (i < eol && *i == ' ')
 	i++;					/* skip_end_space */
-      if (! *i || ((flags & FIND_TYPE_COMMA_TERM) && is_field_separator(*i)))
+      if (i >= eol || is_field_separator(flags, *i))
+      {
+        *x= i;
 	DBUG_RETURN(pos+1);
+      }
     }
-    if ((!*i &&
-         (!(flags & FIND_TYPE_COMMA_TERM) || !is_field_separator(*i))) &&
+    if ((i >= eol && !is_field_separator(flags, *i)) &&
         (!*j || !(flags & FIND_TYPE_NO_PREFIX)))
     {
       find++;
       findpos=pos;
+      termptr=i;
     }
   }
-  if (find == 0 && (flags & FIND_TYPE_ALLOW_NUMBER) && x[0] == '#' &&
-      strend(x)[-1] == '#' &&
-      (findpos=atoi(x+1)-1) >= 0 && (uint) findpos < typelib->count)
-    find=1;
-  else if (find == 0 || ! x[0])
+  if (find == 0 || *x == eol)
   {
     DBUG_PRINT("exit",("Couldn't find type"));
     DBUG_RETURN(0);
   }
   else if (find != 1 || (flags & FIND_TYPE_NO_PREFIX))
   {
-    DBUG_PRINT("exit",("Too many possybilities"));
+    DBUG_PRINT("exit",("Too many possibilities"));
     DBUG_RETURN(-1);
   }
+  *x= termptr;
   DBUG_RETURN(findpos+1);
-} /* find_type */
-
+} /* find_type_eol */
+
+
+/**
+  Search after a string in a list of strings. Endspace in x is not compared.
+
+  Same as find_type_eol, but for zero-terminated strings,
+  and without advancing the pointer.
+*/
+int find_type(const char *x, const TYPELIB *typelib, uint flags)
+{
+  return find_type_eol(&x, typelib, flags, x + strlen(x));
+}
 
 /**
   Get name of type nr
@@ -198,7 +212,7 @@
   {
     (*err)++;
     i= x;
-    while (*x && !is_field_separator(*x))
+    while (*x && *x != ',')
       x++;
     if (x[0] && x[1])      /* skip separator if found */
       x++;
@@ -283,12 +297,10 @@
     >0  Offset+1 in typelib for matched name
 */
 
-static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end)
+static uint parse_name(const TYPELIB *lib, const char **pos, const char *end)
 {
-  const char *pos= *strpos;
-  uint find= find_type(pos, lib, FIND_TYPE_COMMA_TERM);
-  for (; pos != end && *pos != '=' && *pos !=',' ; pos++);
-  *strpos= pos;
+  uint find= find_type_eol(pos, lib,
+                           FIND_TYPE_COMMA_TERM | FIND_TYPE_NO_PREFIX, end);
   return find;
 }
 

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2012-01-13 14:50:02 +0000
+++ b/sql/sql_partition.cc	2012-01-17 08:11:20 +0000
@@ -7348,7 +7348,7 @@
                                             PARTITION_ITERATOR *part_iter)
 {
   uint32 nparts;
-  get_col_endpoint_func  get_col_endpoint;
+  get_col_endpoint_func  UNINIT_VAR(get_col_endpoint);
   DBUG_ENTER("get_part_iter_for_interval_cols_via_map");
 
   if (part_info->part_type == RANGE_PARTITION)

=== modified file 'sql/sql_trigger.cc'
--- a/sql/sql_trigger.cc	2012-01-13 14:50:02 +0000
+++ b/sql/sql_trigger.cc	2012-01-17 08:11:20 +0000
@@ -1722,7 +1722,7 @@
   LEX *lex= thd->lex;
   char trn_path_buff[FN_REFLEN];
   LEX_STRING trn_path= { trn_path_buff, 0 };
-  LEX_STRING tbl_name;
+  LEX_STRING tbl_name= null_lex_str;
 
   DBUG_ENTER("add_table_for_trigger");
 

=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c	2012-01-13 14:50:02 +0000
+++ b/vio/viosocket.c	2012-01-17 08:11:20 +0000
@@ -692,9 +692,7 @@
 void vio_timeout(Vio *vio, uint which, uint timeout)
 {
 #if defined(SO_SNDTIMEO) && defined(SO_RCVTIMEO)
-#ifndef DBUG_OFF
   int r;
-#endif
   DBUG_ENTER("vio_timeout");
 
   {



More information about the commits mailing list