MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:holyfoot Date:November 29 2007 10:52am
Subject:bk commit into 4.1 tree (holyfoot:1.2698) BUG#29085
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of hf. When hf 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-11-29 14:52:36+04:00, holyfoot@stripped +1 -0
  Bug #29085 A small double precision number becomes zero.
  
  Denormalized DOUBLE-s can't be properly handled by old MIPS processors.
  So we need to enable specific mode for them so IRIX will do use
  software round to handle such numbers. 

  sql/mysqld.cc@stripped, 2007-11-29 14:52:36+04:00, holyfoot@stripped +17 -3
    Bug #29085 A small double precision number becomes zero.
    
    reset_floating_point_exeption() renamed as set_proper_floating_point_mode()
    #ifdef __sgi code added to enable denormalized DOUBLE-s on IRIX

diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc	2007-03-24 16:03:25 +04:00
+++ b/sql/mysqld.cc	2007-11-29 14:52:36 +04:00
@@ -193,7 +193,7 @@ typedef fp_except fp_except_t;
      this on freebsd
   */
 
-inline void reset_floating_point_exceptions()
+inline void set_proper_floating_point_mode()
 {
   /* Don't fall for overflow, underflow,divide-by-zero or loss of precision */
 #if defined(__i386__)
@@ -204,8 +204,22 @@ inline void reset_floating_point_excepti
 	     FP_X_IMP));
 #endif
 }
+#elif defined(__sgi)
+/* for IRIX to use set_fpc_csr() */
+#include <sys/fpu.h>
+
+inline void set_proper_floating_point_mode()
+{
+  /* Enable denormalized DOUBLE values support for IRIX */
+  {
+    union fpc_csr n;
+    n.fc_word = get_fpc_csr();
+    n.fc_struct.flush = 0;
+    set_fpc_csr(n.fc_word);
+  }
+}
 #else
-#define reset_floating_point_exceptions()
+#define set_proper_floating_point_mode()
 #endif /* __FreeBSD__ && HAVE_IEEEFP_H */
 
 } /* cplusplus */
@@ -2876,7 +2890,7 @@ static int init_server_components()
   query_cache_init();
   query_cache_resize(query_cache_size);
   randominit(&sql_rand,(ulong) start_time,(ulong) start_time/2);
-  reset_floating_point_exceptions();
+  set_proper_floating_point_mode();
   init_thr_lock();
 #ifdef HAVE_REPLICATION
   init_slave_list();
Thread
bk commit into 4.1 tree (holyfoot:1.2698) BUG#29085holyfoot29 Nov