Skip to content

Commit 97d7e30

Browse files
committed
mark
1 parent 5f6d01c commit 97d7e30

File tree

3 files changed

+24
-133
lines changed

3 files changed

+24
-133
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
11
mysql-image-plugin
22
==================
3+
4+
Build
5+
-----
6+
gcc -I/usr/include/mysql -I./ -fPIC -shared -o mysql_image.so image.c
7+
sudo mv mysql_image.so /usr/lib/mysql/plugin/
8+
9+
Setup
10+
-----
11+
mysql> create function image_check returns string soname 'mysql_image.so';
12+
Query OK, 0 rows affected (0.44 sec)
13+
14+
Test
15+
----
16+
mysql> select image_check('/www/images/logo.png');

src/image.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Author: netkiller<netkiller@msn.com>
88
#include <stdio.h>
99
#include <stdlib.h>
1010

11-
#include "images.h"
11+
#include "image.h"
1212

1313
/* ------------------------ image_check ----------------------------- */
1414

@@ -59,7 +59,6 @@ my_bool image_move_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
5959
return 1;
6060
}
6161

62-
get_safenet_env();
6362
args->arg_type[0]= STRING_RESULT;
6463

6564
return 0;
@@ -88,8 +87,6 @@ void image_move_deinit(UDF_INIT *initid)
8887

8988
my_bool image_remove_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
9089
{
91-
92-
get_safenet_env();
9390
return 0;
9491
}
9592

src/image.h

Lines changed: 9 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,11 @@
1-
/* src/image.h. Generated from image.h.in by configure. */
2-
/* src/image.h.in. Generated from configure.ac by autoheader. */
1+
my_bool image_check_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
2+
char *image_check(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error);
3+
void image_check_deinit(UDF_INIT *initid);
34

4-
/* Define to 1 if you have the <dlfcn.h> header file. */
5-
#define HAVE_DLFCN_H 1
5+
my_bool image_move_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
6+
char *image_move(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error);
7+
void image_move_deinit(UDF_INIT *initid);
68

7-
/* Define to 1 if you have the <inttypes.h> header file. */
8-
#define HAVE_INTTYPES_H 1
9-
10-
/* Define to 1 if you have a functional curl library. */
11-
#define HAVE_LIBCURL 1
12-
13-
/* Define to 1 if you have the <limits.h> header file. */
14-
#define HAVE_LIMITS_H 1
15-
16-
/* Define to 1 if you have the <memory.h> header file. */
17-
#define HAVE_MEMORY_H 1
18-
19-
/* Define to 1 if you have the <stdint.h> header file. */
20-
#define HAVE_STDINT_H 1
21-
22-
/* Define to 1 if you have the <stdlib.h> header file. */
23-
#define HAVE_STDLIB_H 1
24-
25-
/* Define to 1 if you have the <strings.h> header file. */
26-
#define HAVE_STRINGS_H 1
27-
28-
/* Define to 1 if you have the <string.h> header file. */
29-
#define HAVE_STRING_H 1
30-
31-
/* Define to 1 if you have the <syslimits.h> header file. */
32-
/* #undef HAVE_SYSLIMITS_H */
33-
34-
/* Define to 1 if you have the <sys/stat.h> header file. */
35-
#define HAVE_SYS_STAT_H 1
36-
37-
/* Define to 1 if you have the <sys/types.h> header file. */
38-
#define HAVE_SYS_TYPES_H 1
39-
40-
/* Define to 1 if you have the <unistd.h> header file. */
41-
#define HAVE_UNISTD_H 1
42-
43-
/* Defined if libcurl supports AsynchDNS */
44-
#define LIBCURL_FEATURE_ASYNCHDNS 1
45-
46-
/* Defined if libcurl supports IDN */
47-
#define LIBCURL_FEATURE_IDN 1
48-
49-
/* Defined if libcurl supports IPv6 */
50-
#define LIBCURL_FEATURE_IPV6 1
51-
52-
/* Defined if libcurl supports KRB4 */
53-
/* #undef LIBCURL_FEATURE_KRB4 */
54-
55-
/* Defined if libcurl supports libz */
56-
#define LIBCURL_FEATURE_LIBZ 1
57-
58-
/* Defined if libcurl supports NTLM */
59-
#define LIBCURL_FEATURE_NTLM 1
60-
61-
/* Defined if libcurl supports SSL */
62-
#define LIBCURL_FEATURE_SSL 1
63-
64-
/* Defined if libcurl supports SSPI */
65-
/* #undef LIBCURL_FEATURE_SSPI */
66-
67-
/* Defined if libcurl supports DICT */
68-
#define LIBCURL_PROTOCOL_DICT 1
69-
70-
/* Defined if libcurl supports FILE */
71-
#define LIBCURL_PROTOCOL_FILE 1
72-
73-
/* Defined if libcurl supports FTP */
74-
#define LIBCURL_PROTOCOL_FTP 1
75-
76-
/* Defined if libcurl supports FTPS */
77-
#define LIBCURL_PROTOCOL_FTPS 1
78-
79-
/* Defined if libcurl supports HTTP */
80-
#define LIBCURL_PROTOCOL_HTTP 1
81-
82-
/* Defined if libcurl supports HTTPS */
83-
#define LIBCURL_PROTOCOL_HTTPS 1
84-
85-
/* Defined if libcurl supports LDAP */
86-
#define LIBCURL_PROTOCOL_LDAP 1
87-
88-
/* Defined if libcurl supports TELNET */
89-
#define LIBCURL_PROTOCOL_TELNET 1
90-
91-
/* Defined if libcurl supports TFTP */
92-
#define LIBCURL_PROTOCOL_TFTP 1
93-
94-
/* Enables MySQL */
95-
#define MYSQL_ENABLED 1
96-
97-
/* Name of package */
98-
#define PACKAGE "image"
99-
100-
/* Define to the address where bug reports for this package should be sent. */
101-
#define PACKAGE_BUGREPORT ""
102-
103-
/* Define to the full name of this package. */
104-
#define PACKAGE_NAME ""
105-
106-
/* Define to the full name and version of this package. */
107-
#define PACKAGE_STRING ""
108-
109-
/* Define to the one symbol short name of this package. */
110-
#define PACKAGE_TARNAME ""
111-
112-
/* Define to the home page for this package. */
113-
#define PACKAGE_URL ""
114-
115-
/* Define to the version of this package. */
116-
#define PACKAGE_VERSION ""
117-
118-
/* Define to 1 if you have the ANSI C header files. */
119-
#define STDC_HEADERS 1
120-
121-
/* Version number of package */
122-
#define VERSION "1.0"
123-
124-
/* Define to empty if `const' does not conform to ANSI C. */
125-
/* #undef const */
126-
127-
/* Define curl_free() as free() if our version of curl lacks curl_free. */
128-
/* #undef curl_free */
129-
130-
/* Define to `unsigned int' if <sys/types.h> does not define. */
131-
/* #undef size_t */
9+
my_bool image_remove_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
10+
char *image_remove(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error);
11+
void image_remove_deinit(UDF_INIT *initid);

0 commit comments

Comments
 (0)