List:Commits« Previous MessageNext Message »
From:Ramil Kalimullin Date:December 9 2010 10:50am
Subject:bzr push into mysql-5.5-bugteam branch (ramil:3179 to 3180)
View as plain text  
 3180 Ramil Kalimullin	2010-12-09 [merge]
      Manual merge with mysql-5.1-bugteam.

    modified:
      include/mysys_err.h
      mysys/errors.c
      mysys/my_seek.c
      mysys/my_symlink.c
 3179 Georgi Kodinov	2010-12-08
      Bug #57954: BIT_AND function returns incorrect results 
       when semijoin=on
      
      When setting the aggregate function as having no rows to report
      the function no_rows_in_result() was calling Item_sum::reset().
      However this function in addition to cleaning up the aggregate 
      value by calling aggregator_clear() was also adding the current
      value to the aggregate value by calling aggregator_add().
      Fixed by making no_rows_in_result() to call aggregator_clear()
      directly.
      Renamed Item_sum::reset to Item_sum::reset_and_add() to
      and added a comment to avoid misinterpretation of what the
      function does.

    modified:
      mysql-test/r/func_group_innodb.result
      mysql-test/t/func_group_innodb.test
      sql/item_sum.cc
      sql/item_sum.h
      sql/opt_range.cc
      sql/opt_sum.cc
      sql/sql_select.cc
=== modified file 'include/mysys_err.h'
--- a/include/mysys_err.h	2010-07-20 19:30:10 +0000
+++ b/include/mysys_err.h	2010-12-09 10:49:11 +0000
@@ -65,7 +65,8 @@ extern const char *globerrs[];  /* my_er
 #define EE_FILE_NOT_CLOSED	30
 #define EE_CHANGE_OWNERSHIP     31
 #define EE_CHANGE_PERMISSIONS   32
-#define EE_ERROR_LAST           32 /* Copy last error nr */
+#define EE_CANT_SEEK            33
+#define EE_ERROR_LAST           33 /* Copy last error nr */
 /* Add error numbers before EE_ERROR_LAST and change it accordingly. */
 
   /* exit codes for all MySQL programs */

=== modified file 'mysys/errors.c'
--- a/mysys/errors.c	2010-07-20 19:30:10 +0000
+++ b/mysys/errors.c	2010-12-09 10:49:11 +0000
@@ -52,6 +52,7 @@ const char *globerrs[GLOBERRS]=
   "File '%s' (fileno: %d) was not closed",
   "Can't change ownership of the file '%s' (Errcode: %d)",
   "Can't change permissions of the file '%s' (Errcode: %d)",
+  "Can't seek in file '%s' (Errcode: %d)"
 };
 
 void init_glob_errs(void)
@@ -94,6 +95,7 @@ void init_glob_errs()
   EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
   EE(EE_CHANGE_OWNERSHIP)   = "Can't change ownership of the file '%s' (Errcode: %d)";
   EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)";
+  EE(EE_CANT_SEEK)      = "Can't seek in file '%s' (Errcode: %d)";
 }
 #endif
 

=== modified file 'mysys/my_seek.c'
--- a/mysys/my_seek.c	2009-09-11 20:26:35 +0000
+++ b/mysys/my_seek.c	2010-12-09 10:49:11 +0000
@@ -14,6 +14,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 #include "mysys_priv.h"
+#include "mysys_err.h"
 
 /* 
   Seek to a position in a file.
@@ -42,8 +43,7 @@
                        actual error.
 */
 
-my_off_t my_seek(File fd, my_off_t pos, int whence,
-		 myf MyFlags __attribute__((unused)))
+my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags)
 {
   os_off_t newpos= -1;
   DBUG_ENTER("my_seek");
@@ -63,7 +63,9 @@ my_off_t my_seek(File fd, my_off_t pos, 
   if (newpos == (os_off_t) -1)
   {
     my_errno= errno;
-    DBUG_PRINT("error",("lseek: %llu  errno: %d", (ulonglong) newpos,errno));
+    if (MyFlags & MY_WME)
+      my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
+    DBUG_PRINT("error", ("lseek: %llu  errno: %d", (ulonglong) newpos, errno));
     DBUG_RETURN(MY_FILEPOS_ERROR);
   }
   if ((my_off_t) newpos != pos)
@@ -77,7 +79,7 @@ my_off_t my_seek(File fd, my_off_t pos, 
 	/* Tell current position of file */
 	/* ARGSUSED */
 
-my_off_t my_tell(File fd, myf MyFlags __attribute__((unused)))
+my_off_t my_tell(File fd, myf MyFlags)
 {
   os_off_t pos;
   DBUG_ENTER("my_tell");
@@ -89,7 +91,12 @@ my_off_t my_tell(File fd, myf MyFlags __
   pos= my_seek(fd, 0L, MY_SEEK_CUR,0);
 #endif
   if (pos == (os_off_t) -1)
+  {
     my_errno= errno;
+    if (MyFlags & MY_WME)
+      my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno);
+    DBUG_PRINT("error", ("tell: %llu  errno: %d", (ulonglong) pos, my_errno));
+  }
   DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos));
   DBUG_RETURN((my_off_t) pos);
 } /* my_tell */

=== modified file 'mysys/my_symlink.c'
--- a/mysys/my_symlink.c	2010-10-17 11:00:13 +0000
+++ b/mysys/my_symlink.c	2010-12-09 09:59:12 +0000
@@ -118,8 +118,7 @@ int my_is_symlink(const char *filename _
   'to' may be equal to 'filename'
 */
 
-int my_realpath(char *to, const char *filename,
-		myf MyFlags __attribute__((unused)))
+int my_realpath(char *to, const char *filename, myf MyFlags)
 {
 #if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH)
   int result=0;

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-bugteam branch (ramil:3179 to 3180) Ramil Kalimullin9 Dec