diff options
author | Sergei Golubchik <serg@mysql.com> | 2009-11-02 21:05:42 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mysql.com> | 2009-11-02 21:05:42 +0100 |
commit | 3d23068f3a1430d5849ede3f886e7356040bc146 (patch) | |
tree | 7a2815b63cb90a92052843088062861e585a181d /sql/replication.h | |
parent | 2cb9f48bab2c7a7ee921917890ddce6ced58f312 (diff) | |
download | mariadb-git-3d23068f3a1430d5849ede3f886e7356040bc146.tar.gz |
WL#4903 Plugin Service API part I
(mysql-next-mr backport)
Diffstat (limited to 'sql/replication.h')
-rw-r--r-- | sql/replication.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/sql/replication.h b/sql/replication.h index 6b7be58a5b1..eea77ef9f8e 100644 --- a/sql/replication.h +++ b/sql/replication.h @@ -16,6 +16,8 @@ #ifndef REPLICATION_H #define REPLICATION_H +typedef struct st_mysql MYSQL; + #ifdef __cplusplus extern "C" { #endif @@ -483,6 +485,64 @@ const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond, */ void thd_exit_cond(MYSQL_THD thd, const char *old_msg); +/** + Get the value of user variable as an integer. + + This function will return the value of variable @a name as an + integer. If the original value of the variable is not an integer, + the value will be converted into an integer. + + @param name user variable name + @param value pointer to return the value + @param null_value if not NULL, the function will set it to true if + the value of variable is null, set to false if not + + @retval 0 Success + @retval 1 Variable not found +*/ +int get_user_var_int(const char *name, + long long int *value, int *null_value); + +/** + Get the value of user variable as a double precision float number. + + This function will return the value of variable @a name as real + number. If the original value of the variable is not a real number, + the value will be converted into a real number. + + @param name user variable name + @param value pointer to return the value + @param null_value if not NULL, the function will set it to true if + the value of variable is null, set to false if not + + @retval 0 Success + @retval 1 Variable not found +*/ +int get_user_var_real(const char *name, + double *value, int *null_value); + +/** + Get the value of user variable as a string. + + This function will return the value of variable @a name as + string. If the original value of the variable is not a string, + the value will be converted into a string. + + @param name user variable name + @param value pointer to the value buffer + @param len length of the value buffer + @param precision precision of the value if it is a float number + @param null_value if not NULL, the function will set it to true if + the value of variable is null, set to false if not + + @retval 0 Success + @retval 1 Variable not found +*/ +int get_user_var_str(const char *name, + char *value, unsigned long len, + unsigned int precision, int *null_value); + + #ifdef __cplusplus } |