Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c745ae95
Commit
c745ae95
authored
May 07, 2004
by
georg@beethoven.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added additional parameter userdata for mysql_set_local_infile_handler
to allow binding of userland functions in PHP.
parent
5c4f83bb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
include/mysql.h
include/mysql.h
+6
-3
libmysql/libmysql.c
libmysql/libmysql.c
+9
-4
No files found.
BitKeeper/etc/logging_ok
View file @
c745ae95
...
@@ -33,6 +33,7 @@ dlenev@build.mysql.com
...
@@ -33,6 +33,7 @@ dlenev@build.mysql.com
dlenev@jabberwock.localdomain
dlenev@jabberwock.localdomain
dlenev@mysql.com
dlenev@mysql.com
ejonore@mc03.ndb.mysql.com
ejonore@mc03.ndb.mysql.com
georg@beethoven.local
gerberb@ou800.zenez.com
gerberb@ou800.zenez.com
gluh@gluh.(none)
gluh@gluh.(none)
gluh@gluh.mysql.r18.ru
gluh@gluh.mysql.r18.ru
...
...
include/mysql.h
View file @
c745ae95
...
@@ -188,10 +188,11 @@ struct st_mysql_options {
...
@@ -188,10 +188,11 @@ struct st_mysql_options {
my_bool
secure_auth
;
my_bool
secure_auth
;
/* function pointers for local infile support */
/* function pointers for local infile support */
int
(
*
local_infile_init
)(
void
**
,
const
char
*
);
int
(
*
local_infile_init
)(
void
**
,
const
char
*
,
void
*
);
int
(
*
local_infile_read
)(
void
*
,
char
*
,
unsigned
int
);
int
(
*
local_infile_read
)(
void
*
,
char
*
,
unsigned
int
);
void
(
*
local_infile_end
)(
void
*
);
void
(
*
local_infile_end
)(
void
*
);
int
(
*
local_infile_error
)(
void
*
,
char
*
,
unsigned
int
);
int
(
*
local_infile_error
)(
void
*
,
char
*
,
unsigned
int
);
void
*
local_infile_userdata
;
};
};
enum
mysql_status
enum
mysql_status
...
@@ -397,12 +398,14 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
...
@@ -397,12 +398,14 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
void
void
mysql_set_local_infile_handler
(
MYSQL
*
mysql
,
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
*
,
int
(
*
local_infile_read
)(
void
*
,
char
*
,
unsigned
int
),
unsigned
int
),
void
(
*
local_infile_end
)(
void
*
),
void
(
*
local_infile_end
)(
void
*
),
int
(
*
local_infile_error
)(
void
*
,
char
*
,
int
(
*
local_infile_error
)(
void
*
,
char
*
,
unsigned
int
));
unsigned
int
),
void
*
);
void
void
mysql_set_local_infile_default
(
MYSQL
*
mysql
);
mysql_set_local_infile_default
(
MYSQL
*
mysql
);
...
...
libmysql/libmysql.c
View file @
c745ae95
...
@@ -831,7 +831,8 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
...
@@ -831,7 +831,8 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
}
}
/* initialize local infile (open file, usually) */
/* 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 */
my_net_write
(
net
,
""
,
0
);
/* Server needs one packet */
net_flush
(
net
);
net_flush
(
net
);
...
@@ -915,7 +916,8 @@ typedef struct st_default_local_infile
...
@@ -915,7 +916,8 @@ typedef struct st_default_local_infile
1 error
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
;
default_local_infile_data
*
data
;
char
tmp_name
[
FN_REFLEN
];
char
tmp_name
[
FN_REFLEN
];
...
@@ -1025,15 +1027,18 @@ default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len)
...
@@ -1025,15 +1027,18 @@ default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len)
void
void
mysql_set_local_infile_handler
(
MYSQL
*
mysql
,
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
),
int
(
*
local_infile_read
)(
void
*
,
char
*
,
uint
),
void
(
*
local_infile_end
)(
void
*
),
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_init
=
local_infile_init
;
mysql
->
options
.
local_infile_read
=
local_infile_read
;
mysql
->
options
.
local_infile_read
=
local_infile_read
;
mysql
->
options
.
local_infile_end
=
local_infile_end
;
mysql
->
options
.
local_infile_end
=
local_infile_end
;
mysql
->
options
.
local_infile_error
=
local_infile_error
;
mysql
->
options
.
local_infile_error
=
local_infile_error
;
mysql
->
options
.
local_infile_userdata
=
userdata
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment