maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #08407
[GSoC 2015] patch.
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index a7a048a..0789350 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -329,20 +329,20 @@ static my_bool type_and_offset_store_num(uchar
*place, size_t offset_size,
case 1:
if (offset >= 0x1f) /* all 1 value is reserved */
return TRUE;
- place[0]= (uchar)val;
+ int1store(place,val);
break;
case 2:
- if (offset >= 0x1fff) /* all 1 value is reserved */
+ if (offset >= 0x1fff) /* all 2 values are reserved */
return TRUE;
int2store(place, val);
break;
case 3:
- if (offset >= 0x1fffff) /* all 1 value is reserved */
+ if (offset >= 0x1fffff) /* all 3 values are reserved */
return TRUE;
int3store(place, val);
break;
case 4:
- if (offset >= 0x1fffffff) /* all 1 value is reserved */
+ if (offset >= 0x1fffffff) /* all 4 values are reserved */
return TRUE;
int4store(place, val);
break;
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index 4ea6d08..962dc5a 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -16,6 +16,10 @@
#include <my_global.h>
#include <my_sys.h>
+#define int1store(T,A) do { uint def_temp= (uint) (A) ;\
+ *((uchar*) (T))= (uchar)(def_temp);\
+ }while(0)
+
#ifdef USE_SYSTEM_WRAPPERS
#include "system_wrappers.h"
#endif
Follow ups