国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

mysql的udf編程之非阻塞超時重傳

2024-07-24 12:47:37
字體:
來源:轉載
供稿:網友

MySQL的UDF(User Defined Function)類似于一種API, 用戶根據一定的規范用C/C++(或采用C調用規范的語言)編寫一組函數(UDF),然后編譯成動態鏈接庫,通過DROP FUNCTION語句來加載和卸載UDF。UDF被加載后可以像調用MySQL的內置函數一樣來調用它,并且服務器在啟動時會自動加載原來存在的UDF。

復制代碼 代碼如下:

#ifdef STANDARD/* STANDARD is defined, don't use any mysql functions */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef __WIN__
typedef unsigned __int64 ulonglong;    /* Microsofts 64 bit types */
typedef __int64 longlong;
#else
typedef unsigned long long ulonglong;
typedef long long longlong;
#endif /*__WIN__*/
#else
#include <my_global.h>
#include <my_sys.h>
#if defined(MYSQL_SERVER)
#include <m_string.h>        /* To get strmov() */
#else
/* when compiled as standalone */
#include <string.h>
#endif
#endif
#include <mysql.h>
#include <m_ctype.h>
#include <m_string.h>
#include <stdlib.h>
#include <errno.h>
#include <netdb.h>
#include <unistd.h>
#include<fcntl.h>
#include<sys time.h="">
#include<sys ioctl.h="">
#include <sys types.h="">
#include <netinet in.h="">
#include <sys socket.h="">
#include <sys wait.h="">
#include<arpa inet.h="">
#include<unistd.h>
#include <mysql.h>
#include <ctype.h>
#ifdef HAVE_DLOPEN

my_bool http_post_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
void http_post_deinit(UDF_INIT *initid);
longlong http_post(UDF_INIT *initid, UDF_ARGS *args, char *is_null,char *error);
/*************************************************************************
** Example of init function
** Arguments:
** initid                        Points to a structure that the init function should fill.
**            char *ptr;            A pointer that the function can use.
** message                        Error message
**RETURN                        This function should return 1 if something goes wrong. In this case
**************************************************************************/
my_bool http_post_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
{
if (args->arg_count < 3 )
{
    strcpy(message,"Wrong arguments to http_post; ");
    return 1;
}

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 长泰县| 乌兰县| 长治县| 额敏县| 沁水县| 张家口市| 阿拉善盟| 鱼台县| 马山县| 米泉市| 金门县| 锡林郭勒盟| 阿城市| 漠河县| 雷波县| 利辛县| 金山区| 延川县| 蛟河市| 菏泽市| 无棣县| 个旧市| 揭西县| 新安县| 临猗县| 喜德县| 休宁县| 滨海县| 连城县| 青铜峡市| 浙江省| 油尖旺区| 怀安县| 图们市| 吉林省| 江孜县| 区。| 赣州市| 凭祥市| 吴桥县| 太和县|