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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
98dd1328
Commit
98dd1328
authored
Feb 10, 2006
by
unknown
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-utf-bug
parents
c467e94a
0f8f0b44
Changes
4
Hide 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 @
98dd1328
...
...
@@ -3,22 +3,22 @@ instance_name status
mysqld1 online
mysqld2 offline
SHOW INSTANCE STATUS mysqld1;
instance_name status version
mysqld1 online VERSION
instance_name status version
_number version
mysqld1 online VERSION
_NUMBER VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name status version
mysqld2 offline VERSION
instance_name status version
_number version
mysqld2 offline VERSION
_NUMBER VERSION
START INSTANCE mysqld2;
SHOW INSTANCES;
instance_name status
mysqld1 online
mysqld2 online
SHOW INSTANCE STATUS mysqld1;
instance_name status version
mysqld1 online VERSION
instance_name status version
_number version
mysqld1 online VERSION
_NUMBER VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name status version
mysqld2 online VERSION
instance_name status version
_number version
mysqld2 online VERSION
_NUMBER VERSION
SHOW VARIABLES LIKE 'port';
Variable_name Value
port IM_MYSQLD1_PORT
...
...
@@ -28,11 +28,11 @@ instance_name status
mysqld1 online
mysqld2 offline
SHOW INSTANCE STATUS mysqld1;
instance_name status version
mysqld1 online VERSION
instance_name status version
_number version
mysqld1 online VERSION
_NUMBER VERSION
SHOW INSTANCE STATUS mysqld2;
instance_name status version
mysqld2 offline VERSION
instance_name status version
_number version
mysqld2 offline VERSION
_NUMBER VERSION
START INSTANCE mysqld3;
ERROR HY000: Bad instance name. Check that the instance with such a name exists
START INSTANCE mysqld1;
...
...
mysql-test/t/im_life_cycle.imtest
View file @
98dd1328
...
...
@@ -18,9 +18,9 @@
###########################################################################
SHOW INSTANCES;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld2;
###########################################################################
...
...
@@ -38,9 +38,9 @@ START INSTANCE mysqld2;
--sleep 3
SHOW INSTANCES;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld2;
--connect (mysql_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
...
...
@@ -66,9 +66,9 @@ STOP INSTANCE mysqld2;
--sleep 3
SHOW INSTANCES;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld1;
--replace_column 3 VERSION
--replace_column 3 VERSION
_NUMBER 4 VERSION
SHOW INSTANCE STATUS mysqld2;
###########################################################################
...
...
server-tools/instance-manager/commands.cc
View file @
98dd1328
...
...
@@ -25,6 +25,7 @@
#include "options.h"
#include <m_string.h>
#include <m_ctype.h>
#include <mysql.h>
#include <my_dir.h>
...
...
@@ -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: */
...
...
@@ -174,9 +200,10 @@ int Show_instance_status::execute(struct st_net *net,
{
enum
{
MAX_VERSION_LENGTH
=
40
};
Buffer
send_buff
;
/* buffer for packets */
LIST
name
,
status
,
version
;
LIST
name
,
status
,
version
,
version_number
;
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
;
if
(
!
instance_name
)
...
...
@@ -192,7 +219,11 @@ int Show_instance_status::execute(struct st_net *net,
version_field
.
name
=
(
char
*
)
"version"
;
version_field
.
length
=
MAX_VERSION_LENGTH
;
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
(
field_list
,
&
version_number
);
field_list
=
list_add
(
field_list
,
&
status
);
field_list
=
list_add
(
field_list
,
&
name
);
...
...
@@ -210,10 +241,21 @@ int Show_instance_status::execute(struct st_net *net,
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"offline"
,
&
position
);
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
,
&
position
);
}
else
{
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"unknown"
,
&
position
);
store_to_protocol_packet
(
&
send_buff
,
(
char
*
)
"unknown"
,
&
position
);
}
if
(
send_buff
.
is_error
()
||
...
...
server-tools/instance-manager/instance_options.cc
View file @
98dd1328
...
...
@@ -138,9 +138,14 @@ int Instance_options::fill_instance_version()
if
(
*
result
!=
'\0'
)
{
char
*
start
;
/* chop the newline from the end of the version string */
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:
return
rc
;
...
...
@@ -167,8 +172,6 @@ int Instance_options::fill_instance_version()
int
Instance_options
::
fill_log_options
()
{
Buffer
buff
;
uint
position
=
0
;
char
**
tmp_argv
=
argv
;
enum
{
MAX_LOG_OPTION_LENGTH
=
256
};
char
datadir
[
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