summaryrefslogtreecommitdiff
path: root/storage/myisam/fulltext.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam/fulltext.h')
-rw-r--r--storage/myisam/fulltext.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/myisam/fulltext.h b/storage/myisam/fulltext.h
index 856e93e034d..853eb6362e6 100644
--- a/storage/myisam/fulltext.h
+++ b/storage/myisam/fulltext.h
@@ -24,8 +24,23 @@
#define HA_FT_WLEN 4
#define FT_SEGS 2
+/**
+ Accessor methods for the weight and the number of subkeys in a buffer.
+
+ The weight is of float type and subkeys number is of integer type. Both
+ are stored in the same position of the buffer and the stored object is
+ identified by the sign (bit): the weight value is positive whilst the
+ number of subkeys is negative.
+
+ In light of C's strict-aliasing rules, which roughly state that an object
+ must not be accessed through incompatible types, these methods are used to
+ avoid any problems arising from the type duality inside the buffer. The
+ values are retrieved using a character type which can access any object.
+*/
#define ft_sintXkorr(A) mi_sint4korr(A)
#define ft_intXstore(T,A) mi_int4store(T,A)
+#define ft_floatXget(V,M) mi_float4get(V,M)
+
extern const HA_KEYSEG ft_keysegs[FT_SEGS];