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
74ec1c76
Commit
74ec1c76
authored
Dec 19, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
several init commands fix
parent
d0598c88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+19
-6
No files found.
libmysqld/libmysqld.c
View file @
74ec1c76
...
@@ -221,7 +221,7 @@ static TYPELIB option_types={array_elements(default_options)-1,
...
@@ -221,7 +221,7 @@ static TYPELIB option_types={array_elements(default_options)-1,
static
int
add_init_command
(
struct
st_mysql_options
*
options
,
const
char
*
cmd
)
static
int
add_init_command
(
struct
st_mysql_options
*
options
,
const
char
*
cmd
)
{
{
char
*
*
ptr
,
*
tmp
;
char
*
tmp
;
if
(
!
options
->
init_commands
)
if
(
!
options
->
init_commands
)
{
{
...
@@ -231,7 +231,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
...
@@ -231,7 +231,7 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
}
}
if
(
!
(
tmp
=
my_strdup
(
cmd
,
MYF
(
MY_WME
)))
||
if
(
!
(
tmp
=
my_strdup
(
cmd
,
MYF
(
MY_WME
)))
||
insert_dynamic
(
options
->
init_commands
,
&
tmp
))
insert_dynamic
(
options
->
init_commands
,
(
gptr
)
&
tmp
))
{
{
my_free
(
tmp
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
(
tmp
,
MYF
(
MY_ALLOW_ZERO_PTR
));
return
1
;
return
1
;
...
@@ -516,11 +516,24 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
...
@@ -516,11 +516,24 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
if
(
db
)
if
(
db
)
client_flag
|=
CLIENT_CONNECT_WITH_DB
;
client_flag
|=
CLIENT_CONNECT_WITH_DB
;
if
(
mysql
->
options
.
init_command
)
if
(
mysql
->
options
.
init_command
s
)
{
{
if
(
mysql_query
(
mysql
,
mysql
->
options
.
init_command
))
DYNAMIC_ARRAY
*
init_commands
=
mysql
->
options
.
init_commands
;
goto
error
;
char
**
ptr
=
(
char
**
)
init_commands
->
buffer
;
mysql_free_result
(
mysql_use_result
(
mysql
));
char
**
end
=
ptr
+
init_commands
->
elements
;
for
(;
ptr
<
end
;
ptr
++
)
{
MYSQL_RES
*
res
;
if
(
mysql_query
(
mysql
,
*
ptr
))
goto
error
;
if
(
mysql
->
fields
)
{
if
(
!
(
res
=
mysql_use_result
(
mysql
)))
goto
error
;
mysql_free_result
(
res
);
}
}
}
}
DBUG_PRINT
(
"exit"
,(
"Mysql handler: %lx"
,
mysql
));
DBUG_PRINT
(
"exit"
,(
"Mysql handler: %lx"
,
mysql
));
...
...
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