1- /* Copyright (C) 2005 MySQL AB
1+ /* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
22
33 This program is free software; you can redistribute it and/or modify
44 it under the terms of the GNU General Public License as published by
1616#ifndef _my_plugin_h
1717#define _my_plugin_h
1818
19- /* size_t */
20- #include < stdlib.h>
21-
22- typedef struct st_mysql MYSQL;
23-
24-
2519/*
2620 On Windows, exports from DLL need to be declared
2721*/
@@ -39,15 +33,7 @@ class Item;
3933#define MYSQL_THD void *
4034#endif
4135
42- #ifndef _m_string_h
43- /* This definition must match the one given in m_string.h */
44- struct st_mysql_lex_string
45- {
46- char *str;
47- unsigned int length;
48- };
49- #endif /* _m_string_h */
50- typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
36+ #include < mysql/services.h>
5137
5238#define MYSQL_XIDDATASIZE 128
5339/* *
@@ -70,7 +56,7 @@ typedef struct st_mysql_xid MYSQL_XID;
7056 Plugin API. Common for all plugin types.
7157*/
7258
73- #define MYSQL_PLUGIN_INTERFACE_VERSION 0x0100
59+ #define MYSQL_PLUGIN_INTERFACE_VERSION 0x0101
7460
7561/*
7662 The allowable types of plugins
@@ -126,7 +112,8 @@ enum enum_mysql_show_type
126112{
127113 SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
128114 SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
129- SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
115+ SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
116+ SHOW_always_last
130117};
131118
132119struct st_mysql_show_var {
@@ -750,54 +737,6 @@ int thd_killed(const MYSQL_THD thd);
750737*/
751738unsigned long thd_get_thread_id (const MYSQL_THD thd);
752739
753-
754- /* *
755- Allocate memory in the connection's local memory pool
756-
757- @details
758- When properly used in place of @c my_malloc(), this can significantly
759- improve concurrency. Don't use this or related functions to allocate
760- large chunks of memory. Use for temporary storage only. The memory
761- will be freed automatically at the end of the statement; no explicit
762- code is required to prevent memory leaks.
763-
764- @see alloc_root()
765- */
766- void *thd_alloc (MYSQL_THD thd, unsigned int size);
767- /* *
768- @see thd_alloc()
769- */
770- void *thd_calloc (MYSQL_THD thd, unsigned int size);
771- /* *
772- @see thd_alloc()
773- */
774- char *thd_strdup (MYSQL_THD thd, const char *str);
775- /* *
776- @see thd_alloc()
777- */
778- char *thd_strmake (MYSQL_THD thd, const char *str, unsigned int size);
779- /* *
780- @see thd_alloc()
781- */
782- void *thd_memdup (MYSQL_THD thd, const void * str, unsigned int size);
783-
784- /* *
785- Create a LEX_STRING in this connection's local memory pool
786-
787- @param thd user thread connection handle
788- @param lex_str pointer to LEX_STRING object to be initialized
789- @param str initializer to be copied into lex_str
790- @param size length of str, in bytes
791- @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
792- instead of using lex_str value
793- @return NULL on failure, or pointer to the LEX_STRING object
794-
795- @see thd_alloc()
796- */
797- MYSQL_LEX_STRING *thd_make_lex_string (MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
798- const char *str, unsigned int size,
799- int allocate_lex_string);
800-
801740/* *
802741 Get the XID for this connection's transaction
803742
@@ -818,64 +757,6 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd,
818757 const char *key, unsigned int key_length,
819758 int using_trx);
820759
821- /* *
822- Get the value of user variable as an integer.
823-
824- This function will return the value of variable @a name as an
825- integer. If the original value of the variable is not an integer,
826- the value will be converted into an integer.
827-
828- @param name user variable name
829- @param value pointer to return the value
830- @param null_value if not NULL, the function will set it to true if
831- the value of variable is null, set to false if not
832-
833- @retval 0 Success
834- @retval 1 Variable not found
835- */
836- int get_user_var_int (const char *name,
837- long long int *value, int *null_value);
838-
839- /* *
840- Get the value of user variable as a double precision float number.
841-
842- This function will return the value of variable @a name as real
843- number. If the original value of the variable is not a real number,
844- the value will be converted into a real number.
845-
846- @param name user variable name
847- @param value pointer to return the value
848- @param null_value if not NULL, the function will set it to true if
849- the value of variable is null, set to false if not
850-
851- @retval 0 Success
852- @retval 1 Variable not found
853- */
854- int get_user_var_real (const char *name,
855- double *value, int *null_value);
856-
857- /* *
858- Get the value of user variable as a string.
859-
860- This function will return the value of variable @a name as
861- string. If the original value of the variable is not a string,
862- the value will be converted into a string.
863-
864- @param name user variable name
865- @param value pointer to the value buffer
866- @param len length of the value buffer
867- @param precision precision of the value if it is a float number
868- @param null_value if not NULL, the function will set it to true if
869- the value of variable is null, set to false if not
870-
871- @retval 0 Success
872- @retval 1 Variable not found
873- */
874- int get_user_var_str (const char *name,
875- char *value, unsigned long len,
876- unsigned int precision, int *null_value);
877-
878-
879760#ifdef __cplusplus
880761}
881762#endif
0 commit comments