summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_loaddata.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2014-05-20 19:57:11 +0300
committerAndrey Hristov <andrey@php.net>2014-05-20 19:57:11 +0300
commit5d57e17a15cf89bf8b20d718ce5070b42ee446e0 (patch)
tree63ffe65e89412e6e37e267d3889a28d0823d3672 /ext/mysqlnd/mysqlnd_loaddata.c
parent2312af04a7ca7a43166a7a1be20067e632ff917a (diff)
downloadphp-git-5d57e17a15cf89bf8b20d718ce5070b42ee446e0.tar.gz
First set of phpng changes for mysqlnd
Diffstat (limited to 'ext/mysqlnd/mysqlnd_loaddata.c')
-rw-r--r--ext/mysqlnd/mysqlnd_loaddata.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c
index 94d69a4008..ab7a1ae9eb 100644
--- a/ext/mysqlnd/mysqlnd_loaddata.c
+++ b/ext/mysqlnd/mysqlnd_loaddata.c
@@ -27,7 +27,7 @@
/* {{{ mysqlnd_local_infile_init */
static
-int mysqlnd_local_infile_init(void ** ptr, char * filename, void ** userdata TSRMLS_DC)
+int mysqlnd_local_infile_init(void ** ptr, const char * const filename TSRMLS_DC)
{
MYSQLND_INFILE_INFO *info;
php_stream_context *context = NULL;
@@ -73,7 +73,7 @@ int mysqlnd_local_infile_read(void * ptr, zend_uchar * buf, unsigned int buf_len
DBG_ENTER("mysqlnd_local_infile_read");
- count = (int)php_stream_read(info->fd, (char *) buf, buf_len);
+ count = (int) php_stream_read(info->fd, (char *) buf, buf_len);
if (count < 0) {
strcpy(info->error_msg, "Error reading file");
@@ -125,7 +125,7 @@ void mysqlnd_local_infile_end(void * ptr TSRMLS_DC)
/* {{{ mysqlnd_local_infile_default */
-PHPAPI void
+void
mysqlnd_local_infile_default(MYSQLND_CONN_DATA * conn)
{
conn->infile.local_infile_init = mysqlnd_local_infile_init;
@@ -136,20 +136,6 @@ mysqlnd_local_infile_default(MYSQLND_CONN_DATA * conn)
/* }}} */
-/* {{{ mysqlnd_set_local_infile_handler */
-PHPAPI void
-mysqlnd_set_local_infile_handler(MYSQLND_CONN_DATA * const conn, const char * const funcname)
-{
- if (!conn->infile.callback) {
- MAKE_STD_ZVAL(conn->infile.callback);
- } else {
- zval_dtor(conn->infile.callback);
- }
- ZVAL_STRING(conn->infile.callback, (char*) funcname, 1);
-}
-/* }}} */
-
-
static const char *lost_conn = "Lost connection to MySQL server during LOAD DATA of local file";
@@ -184,7 +170,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
*is_warning = FALSE;
/* init handler: allocate read buffer and open file */
- if (infile.local_infile_init(&info, (char *)filename, conn->infile.userdata TSRMLS_CC)) {
+ if (infile.local_infile_init(&info, (char *)filename TSRMLS_CC)) {
char tmp_buf[sizeof(conn->error_info->error)];
int tmp_error_no;
*is_warning = TRUE;