summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2009-11-30 15:36:06 +0200
committerMichael Widenius <monty@askmonty.org>2009-11-30 15:36:06 +0200
commit0df8279c468235f4feaf9eb25aa2beb5032ee1dc (patch)
treed5878052823f9a1345068a3b20275d13e0a41e9e /include
parent5d9c3014ce6afdb3129d8d836b557507f7f7a643 (diff)
downloadmariadb-git-0df8279c468235f4feaf9eb25aa2beb5032ee1dc.tar.gz
Fixes after comments from last push:
- Removed some not needed casts - Change plugin.h to be 'binary compatible' with old versions - Added mysql_ft_size_t typedef to plugin.h to make it trivial to change string lengths to size_t on next ABI change - Made some fixes suggested by Kristian to make things more portable and future safe (when it comes to strict aliasing) include/ft_global.h: Introduced FT_WEIGTH, to handle fulltext weights in a slightly more portable manner include/mysql/plugin.h: Change plugin.h to be 'binary compatible' with old versions Added mysql_ft_size_t typedef to plugin.h to make it trivial to change string lengths to size_t on next ABI change Changed flags to unsigned (as flags should always be unsigned) mysql-test/t/information_schema.test: Fixed typo sql/sp_head.cc: Removed cast sql/sql_select.cc: Removed cast sql/table.cc: Removed cast storage/maria/ma_ft_boolean_search.c: Use mysql_ft_size_t instead of size_t for plugin.h code Changed some other string lengths to size_t storage/maria/ma_ft_nlq_search.c: Use FT_WEIGTH to make code more portable storage/maria/ma_ft_parser.c: Use mysql_ft_size_t instead of size_t for plugin.h code Changed some other string lengths to size_t storage/maria/ma_ftdefs.h: Changed some string lengths to size_t storage/maria/maria_ftdump.c: Use FT_WEIGTH to make code more portable storage/myisam/ft_boolean_search.c: Use mysql_ft_size_t instead of size_t for plugin.h code storage/myisam/ft_nlq_search.c: Use FT_WEIGTH to make code more portable storage/myisam/ft_parser.c: Use mysql_ft_size_t instead of size_t for plugin.h code storage/myisam/myisam_ftdump.c: Use FT_WEIGTH to make code more portable
Diffstat (limited to 'include')
-rw-r--r--include/ft_global.h2
-rw-r--r--include/mysql/plugin.h13
-rw-r--r--include/mysql/plugin.h.pp11
3 files changed, 16 insertions, 10 deletions
diff --git a/include/ft_global.h b/include/ft_global.h
index dba8a6e75e5..8fe5ee5c42e 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -76,6 +76,8 @@ my_bool ft_boolean_check_syntax_string(const uchar *);
extern const HA_KEYSEG ft_keysegs[FT_SEGS];
+typedef union {int32 i; float f;} FT_WEIGTH;
+
#ifdef __cplusplus
}
#endif
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 91e8a80b408..b33f5970110 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -564,19 +564,22 @@ typedef struct st_mysql_ftparser_boolean_info
nothing. See enum_ftparser_mode above.
*/
+/* TODO: Change the following int to size_t at next ABI update */
+typedef int mysql_ft_size_t;
+
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- const unsigned char *doc, size_t doc_len);
+ const unsigned char *doc, mysql_ft_size_t doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- const unsigned char *word, size_t word_len,
+ const unsigned char *word, mysql_ft_size_t word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
struct charset_info_st *cs;
- char *doc;
- int length;
- int flags;
+ const unsigned char *doc;
+ mysql_ft_size_t length;
+ unsigned int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
diff --git a/include/mysql/plugin.h.pp b/include/mysql/plugin.h.pp
index 22b1f647736..2f44870b479 100644
--- a/include/mysql/plugin.h.pp
+++ b/include/mysql/plugin.h.pp
@@ -70,19 +70,20 @@ typedef struct st_mysql_ftparser_boolean_info
char prev;
char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO;
+typedef int mysql_ft_size_t;
typedef struct st_mysql_ftparser_param
{
int (*mysql_parse)(struct st_mysql_ftparser_param *,
- const unsigned char *doc, size_t doc_len);
+ const unsigned char *doc, mysql_ft_size_t doc_len);
int (*mysql_add_word)(struct st_mysql_ftparser_param *,
- const unsigned char *word, size_t word_len,
+ const unsigned char *word, mysql_ft_size_t word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state;
void *mysql_ftparam;
struct charset_info_st *cs;
- char *doc;
- int length;
- int flags;
+ const unsigned char *doc;
+ mysql_ft_size_t length;
+ unsigned int flags;
enum enum_ftparser_mode mode;
} MYSQL_FTPARSER_PARAM;
struct st_mysql_ftparser