summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2005-07-19 19:25:05 +0300
committerunknown <monty@mishka.local>2005-07-19 19:25:05 +0300
commit3a31f7b91f9aea5c6bab45157c3a661252720174 (patch)
tree98d1121d654b01cf2306965326d1355704fc1218 /include/my_global.h
parentddc3586495aa82f310b0e5c2127b77f28c711c27 (diff)
downloadmariadb-git-3a31f7b91f9aea5c6bab45157c3a661252720174.tar.gz
Simple fixes during review of new code
include/my_global.h: Added floatget() to read unaligned flaot mysql-test/r/select.result: Added test for found_rows() mysql-test/t/select.test: Added test for found_rows() sql/des_key_file.cc: Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition sql/field_conv.cc: Added optimizzed varsion of do_cut_string (for simple character sets) sql/item_func.cc: Simplify code (and ensure DBUG_ENTER is excuted before main code) sql/item_strfunc.cc: Safe calculation of max_length This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH) Remove init_des_key_file() as this is not initialized in mysqld.cc sql/item_timefunc.cc: Safe calculation of max_length This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH) sql/log_event.cc: Simplify code sql/mysql_priv.h: Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition sql/mysqld.cc: Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition Revert wrong patch of calling close_connection() in first close_connections() loop. (Bug #7403) Instead we now print a warning for closed connections only if mysqld is sarted with --warnings Added comments to make the close_connections() logic clearer sql/sql_prepare.cc: Use floatget() and doubleget() to protect against unaligned data sql/sql_select.cc: Fixed some cases unlikely cases where found_rows() would return wrong for queries that would return 0 or 1 rows
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/my_global.h b/include/my_global.h
index eab6050d2dc..be6e667057d 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -972,7 +972,8 @@ do { doubleget_union _tmp; \
#define float4get(V,M) do { *((long *) &(V)) = *((long*) (M)); } while(0)
#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
-#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V), sizeof(float))
+#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float))
+#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
#endif /* __i386__ */
@@ -1143,7 +1144,8 @@ do { doubleget_union _tmp; \
*(((char*)T)+1)=(((A) >> 16));\
*(((char*)T)+0)=(((A) >> 24)); } while(0)
-#define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float))
+#define floatget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(float))
+#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*)(&V),sizeof(float))
#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
@@ -1158,7 +1160,8 @@ do { doubleget_union _tmp; \
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V)
#ifndef floatstore
-#define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float))
+#define floatstore(T,V) memcpy_fixed((byte*) (T),(byte*) (&V),sizeof(float))
+#define floatget(V,M) memcpy_fixed((byte*) &V, (byte*) (M), sizeof(float))
#endif
#ifndef doubleget
#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))