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
f3d73e8c
Commit
f3d73e8c
authored
Feb 10, 2006
by
petr@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/cps/mysql/devel/5.1-im-fixes
parents
5bb07f7e
84884985
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
23 deletions
+68
-23
mysql-test/r/im_life_cycle.result
mysql-test/r/im_life_cycle.result
+12
-12
mysql-test/t/im_life_cycle.imtest
mysql-test/t/im_life_cycle.imtest
+6
-6
server-tools/instance-manager/commands.cc
server-tools/instance-manager/commands.cc
+44
-2
server-tools/instance-manager/instance_options.cc
server-tools/instance-manager/instance_options.cc
+6
-3
No files found.
mysql-test/r/im_life_cycle.result
View file @
f3d73e8c
...
@@ -3,22 +3,22 @@ instance_name status
...
@@ -3,22 +3,22 @@ instance_name status
mysqld1 online
mysqld1 online
mysqld2 offline
mysqld2 offline
SHOW INSTANCE STATUS mysqld1;
SHOW INSTANCE STATUS mysqld1;
instance_name status version
instance_name status version
_number version
mysqld1 online VERSION
mysqld1 online VERSION
_NUMBER VERSION
SHOW INSTANCE STATUS mysqld2;
SHOW INSTANCE STATUS mysqld2;
instance_name status version
instance_name status version
_number version
mysqld2 offline VERSION
mysqld2 offline VERSION
_NUMBER VERSION
START INSTANCE mysqld2;
START INSTANCE mysqld2;
SHOW INSTANCES;
SHOW INSTANCES;
instance_name status
instance_name status
mysqld1 online
mysqld1 online
mysqld2 online
mysqld2 online
SHOW INSTANCE STATUS mysqld1;
SHOW INSTANCE STATUS mysqld1;
instance_name status version
instance_name status version
_number version
mysqld1 online VERSION
mysqld1 online VERSION
_NUMBER VERSION
SHOW INSTANCE STATUS mysqld2;
SHOW INSTANCE STATUS mysqld2;
instance_name status version
instance_name status version
_number version
mysqld2 online VERSION
mysqld2 online VERSION
_NUMBER VERSION
SHOW VARIABLES LIKE 'port';
SHOW VARIABLES LIKE 'port';
Variable_name Value
Variable_name Value
port IM_MYSQLD1_PORT
port IM_MYSQLD1_PORT
...
@@ -28,11 +28,11 @@ instance_name status
...
@@ -28,11 +28,11 @@ instance_name status
mysqld1 online
mysqld1 online
mysqld2 offline
mysqld2 offline
SHOW INSTANCE STATUS mysqld1;
SHOW INSTANCE STATUS mysqld1;
instance_name status version
instance_name status version
_number version
mysqld1 online VERSION
mysqld1 online VERSION
_NUMBER VERSION
SHOW INSTANCE STATUS mysqld2;
SHOW INSTANCE STATUS mysqld2;
instance_name status version
instance_name status version
_number version
mysqld2 offline VERSION
mysqld2 offline VERSION
_NUMBER VERSION
START INSTANCE mysqld3;
START INSTANCE mysqld3;
ERROR HY000: Bad instance name. Check that the instance with such a name exists
ERROR HY000: Bad instance name. Check that the instance with such a name exists
START INSTANCE mysqld1;
START INSTANCE mysqld1;
...
...
mysql-test/t/im_life_cycle.imtest
View file @
f3d73e8c
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
###########################################################################
###########################################################################
SHOW INSTANCES;
SHOW INSTANCES;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
SHOW INSTANCE STATUS mysqld1;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld2;
SHOW INSTANCE STATUS mysqld2;
###########################################################################
###########################################################################
...
@@ -38,9 +38,9 @@ START INSTANCE mysqld2;
...
@@ -38,9 +38,9 @@ START INSTANCE mysqld2;
--sleep 3
--sleep 3
SHOW INSTANCES;
SHOW INSTANCES;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
SHOW INSTANCE STATUS mysqld1;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld2;
SHOW INSTANCE STATUS mysqld2;
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
...
@@ -66,9 +66,9 @@ STOP INSTANCE mysqld2;
...
@@ -66,9 +66,9 @@ STOP INSTANCE mysqld2;
--sleep 3
--sleep 3
SHOW INSTANCES;
SHOW INSTANCES;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
SHOW INSTANCE STATUS mysqld1;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld2;
SHOW INSTANCE STATUS mysqld2;
###########################################################################
###########################################################################
...
...
server-tools/instance-manager/commands.cc
View file @
f3d73e8c
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#include "options.h"
#include "options.h"
#include <m_string.h>
#include <m_string.h>
#include <m_ctype.h>
#include <mysql.h>
#include <mysql.h>
#include <my_dir.h>
#include <my_dir.h>
...
@@ -62,6 +63,31 @@ static inline int put_to_buff(Buffer *buff, const char *str, uint *position)
...
@@ -62,6 +63,31 @@ static inline int put_to_buff(Buffer *buff, const char *str, uint *position)
}
}
static
int
parse_version_number
(
const
char
*
version_str
,
char
*
version
,
uint
version_size
)
{
const
char
*
start
=
version_str
;
const
char
*
end
;
// skip garbage
while
(
!
my_isdigit
(
default_charset_info
,
*
start
))
start
++
;
end
=
start
;
// skip digits and dots
while
(
my_isdigit
(
default_charset_info
,
*
end
)
||
*
end
==
'.'
)
end
++
;
if
((
uint
)(
end
-
start
)
>=
version_size
)
return
-
1
;
strncpy
(
version
,
start
,
end
-
start
);
version
[
end
-
start
]
=
'\0'
;
return
0
;
}
/* implementation for Show_instances: */
/* implementation for Show_instances: */
...
@@ -174,9 +200,10 @@ int Show_instance_status::execute(struct st_net *net,
...
@@ -174,9 +200,10 @@ int Show_instance_status::execute(struct st_net *net,
{
{
enum
{
MAX_VERSION_LENGTH
=
40
};
enum
{
MAX_VERSION_LENGTH
=
40
};
Buffer
send_buff
;
/* buffer for packets */
Buffer
send_buff
;
/* buffer for packets */
LIST
name
,
status
,
version
;
LIST
name
,
status
,
version
,
version_number
;
LIST
*
field_list
;
LIST
*
field_list
;
NAME_WITH_LENGTH
name_field
,
status_field
,
version_field
;
NAME_WITH_LENGTH
name_field
,
status_field
,
version_field
,
version_number_field
;
uint
position
=
0
;
uint
position
=
0
;
if
(
!
instance_name
)
if
(
!
instance_name
)
...
@@ -192,7 +219,11 @@ int Show_instance_status::execute(struct st_net *net,
...
@@ -192,7 +219,11 @@ int Show_instance_status::execute(struct st_net *net,
version_field
.
name
=
(
char
*
)
"version"
;
version_field
.
name
=
(
char
*
)
"version"
;
version_field
.
length
=
MAX_VERSION_LENGTH
;
version_field
.
length
=
MAX_VERSION_LENGTH
;
version
.
data
=
&
version_field
;
version
.
data
=
&
version_field
;
version_number_field
.
name
=
(
char
*
)
"version_number"
;
version_number_field
.
length
=
MAX_VERSION_LENGTH
;
version_number
.
data
=
&
version_number_field
;
field_list
=
list_add
(
NULL
,
&
version
);
field_list
=
list_add
(
NULL
,
&
version
);
field_list
=
list_add
(
field_list
,
&
version_number
);
field_list
=
list_add
(
field_list
,
&
status
);
field_list
=
list_add
(
field_list
,
&
status
);
field_list
=
list_add
(
field_list
,
&
name
);
field_list
=
list_add
(
field_list
,
&
name
);
...
@@ -210,10 +241,21 @@ int Show_instance_status::execute(struct st_net *net,
...
@@ -210,10 +241,21 @@ int Show_instance_status::execute(struct st_net *net,
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"offline"
,
&
position
);
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"offline"
,
&
position
);
if
(
instance
->
options
.
mysqld_version
)
if
(
instance
->
options
.
mysqld_version
)
{
char
parsed_version
[
MAX_VERSION_LENGTH
];
parse_version_number
(
instance
->
options
.
mysqld_version
,
parsed_version
,
sizeof
(
parsed_version
));
store_to_protocol_packet
(
&
send_buff
,
parsed_version
,
&
position
);
store_to_protocol_packet
(
&
send_buff
,
instance
->
options
.
mysqld_version
,
store_to_protocol_packet
(
&
send_buff
,
instance
->
options
.
mysqld_version
,
&
position
);
&
position
);
}
else
else
{
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"unknown"
,
&
position
);
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"unknown"
,
&
position
);
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"unknown"
,
&
position
);
}
if
(
send_buff
.
is_error
()
||
if
(
send_buff
.
is_error
()
||
...
...
server-tools/instance-manager/instance_options.cc
View file @
f3d73e8c
...
@@ -138,9 +138,14 @@ int Instance_options::fill_instance_version()
...
@@ -138,9 +138,14 @@ int Instance_options::fill_instance_version()
if
(
*
result
!=
'\0'
)
if
(
*
result
!=
'\0'
)
{
{
char
*
start
;
/* chop the newline from the end of the version string */
/* chop the newline from the end of the version string */
result
[
strlen
(
result
)
-
NEWLINE_LEN
]
=
'\0'
;
result
[
strlen
(
result
)
-
NEWLINE_LEN
]
=
'\0'
;
mysqld_version
=
strdup_root
(
&
alloc
,
result
);
/* trim leading whitespaces */
start
=
result
;
while
(
my_isspace
(
default_charset_info
,
*
start
))
++
start
;
mysqld_version
=
strdup_root
(
&
alloc
,
start
);
}
}
err:
err:
return
rc
;
return
rc
;
...
@@ -167,8 +172,6 @@ err:
...
@@ -167,8 +172,6 @@ err:
int
Instance_options
::
fill_log_options
()
int
Instance_options
::
fill_log_options
()
{
{
Buffer
buff
;
Buffer
buff
;
uint
position
=
0
;
char
**
tmp_argv
=
argv
;
enum
{
MAX_LOG_OPTION_LENGTH
=
256
};
enum
{
MAX_LOG_OPTION_LENGTH
=
256
};
char
datadir
[
MAX_LOG_OPTION_LENGTH
];
char
datadir
[
MAX_LOG_OPTION_LENGTH
];
char
hostname
[
MAX_LOG_OPTION_LENGTH
];
char
hostname
[
MAX_LOG_OPTION_LENGTH
];
...
...
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