diff options
author | unknown <georg@beethoven.local> | 2004-05-07 14:50:10 +0200 |
---|---|---|
committer | unknown <georg@beethoven.local> | 2004-05-07 14:50:10 +0200 |
commit | c6bc3cfb8457332b4519efcd10339c2632626acb (patch) | |
tree | 8cb43a4e180fbb542e232223ea3d1cb006361dd7 /libmysql/libmysql.c | |
parent | c207325aaf0cbb3781d72891c9ae95e18c6ea355 (diff) | |
download | mariadb-git-c6bc3cfb8457332b4519efcd10339c2632626acb.tar.gz |
Added additional parameter userdata for mysql_set_local_infile_handler
to allow binding of userland functions in PHP.
include/mysql.h:
added new last parameter (void *) for mysql_set_local_infile_handler
st_mysql_options:
added void *local_infile_userdata
added last parameter (void *) for local_infile_init function pointer
libmysql/libmysql.c:
added parameter userdata in mysql_set_local_infile_handler
added parameter (void *userdata __attribute__ ((unused))) in mysql_local_infile_init
passed additional parameter userdata to init function in handle_local_infile
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4ecc1bd0584..a467b7fc9fd 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -831,7 +831,8 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) } /* initialize local infile (open file, usually) */ - if ((*options->local_infile_init)(&li_ptr, net_filename)) + if ((*options->local_infile_init)(&li_ptr, net_filename, + options->local_infile_userdata)) { my_net_write(net,"",0); /* Server needs one packet */ net_flush(net); @@ -915,7 +916,8 @@ typedef struct st_default_local_infile 1 error */ -static int default_local_infile_init(void **ptr, const char *filename) +static int default_local_infile_init(void **ptr, const char *filename, + void *userdata __attribute__ ((unused))) { default_local_infile_data *data; char tmp_name[FN_REFLEN]; @@ -1025,15 +1027,18 @@ default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len) void mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *), + int (*local_infile_init)(void **, const char *, + void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), - int (*local_infile_error)(void *, char *, uint)) + int (*local_infile_error)(void *, char *, uint), + void *userdata) { mysql->options.local_infile_init= local_infile_init; mysql->options.local_infile_read= local_infile_read; mysql->options.local_infile_end= local_infile_end; mysql->options.local_infile_error= local_infile_error; + mysql->options.local_infile_userdata = userdata; } |