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
b58f2872
Commit
b58f2872
authored
Dec 12, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '5.5' into 10.0
parents
9eadef01
32b7d456
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
25 deletions
+36
-25
client/mysqltest.cc
client/mysqltest.cc
+26
-16
scripts/mytop.sh
scripts/mytop.sh
+10
-9
No files found.
client/mysqltest.cc
View file @
b58f2872
...
...
@@ -6577,8 +6577,6 @@ static inline bool is_escape_char(char c, char in_string)
SYNOPSIS
read_line
buf buffer for the read line
size size of the buffer i.e max size to read
DESCRIPTION
This function actually reads several lines and adds them to the
...
...
@@ -6596,10 +6594,15 @@ static inline bool is_escape_char(char c, char in_string)
*/
int
read_line
(
char
*
buf
,
int
size
)
static
char
*
read_command_buf
=
NULL
;
static
size_t
read_command_buflen
=
0
;
static
const
size_t
max_multibyte_length
=
6
;
int
read_line
()
{
char
c
,
last_quote
=
0
,
last_char
=
0
;
char
*
p
=
buf
,
*
buf_end
=
buf
+
size
-
1
;
char
*
p
=
read_command_buf
;
char
*
buf_end
=
read_command_buf
+
read_command_buflen
-
max_multibyte_length
;
int
skip_char
=
0
;
my_bool
have_slash
=
FALSE
;
...
...
@@ -6607,10 +6610,21 @@ int read_line(char *buf, int size)
R_COMMENT
,
R_LINE_START
}
state
=
R_LINE_START
;
DBUG_ENTER
(
"read_line"
);
*
p
=
0
;
start_lineno
=
cur_file
->
lineno
;
DBUG_PRINT
(
"info"
,
(
"Starting to read at lineno: %d"
,
start_lineno
));
for
(;
p
<
buf_end
;)
while
(
1
)
{
if
(
p
>=
buf_end
)
{
my_ptrdiff_t
off
=
p
-
read_command_buf
;
read_command_buf
=
(
char
*
)
my_realloc
(
read_command_buf
,
read_command_buflen
*
2
,
MYF
(
MY_FAE
));
p
=
read_command_buf
+
off
;
read_command_buflen
*=
2
;
buf_end
=
read_command_buf
+
read_command_buflen
-
max_multibyte_length
;
}
skip_char
=
0
;
c
=
my_getc
(
cur_file
->
file
);
if
(
feof
(
cur_file
->
file
))
...
...
@@ -6646,7 +6660,7 @@ int read_line(char *buf, int size)
cur_file
->
lineno
++
;
/* Convert cr/lf to lf */
if
(
p
!=
buf
&&
*
(
p
-
1
)
==
'\r'
)
if
(
p
!=
read_command_
buf
&&
*
(
p
-
1
)
==
'\r'
)
p
--
;
}
...
...
@@ -6661,9 +6675,9 @@ int read_line(char *buf, int size)
}
else
if
((
c
==
'{'
&&
(
!
my_strnncoll_simple
(
charset_info
,
(
const
uchar
*
)
"while"
,
5
,
(
uchar
*
)
buf
,
MY_MIN
(
5
,
p
-
buf
),
0
)
||
(
uchar
*
)
read_command_buf
,
MY_MIN
(
5
,
p
-
read_command_
buf
),
0
)
||
!
my_strnncoll_simple
(
charset_info
,
(
const
uchar
*
)
"if"
,
2
,
(
uchar
*
)
buf
,
MY_MIN
(
2
,
p
-
buf
),
0
))))
(
uchar
*
)
read_command_buf
,
MY_MIN
(
2
,
p
-
read_command_
buf
),
0
))))
{
/* Only if and while commands can be terminated by { */
*
p
++=
c
;
...
...
@@ -6797,8 +6811,6 @@ int read_line(char *buf, int size)
*
p
++=
c
;
}
}
die
(
"The input buffer is too small for this query.x
\n
"
\
"check your query or increase MAX_QUERY and recompile"
);
DBUG_RETURN
(
0
);
}
...
...
@@ -6943,12 +6955,8 @@ bool is_delimiter(const char* p)
terminated by new line '\n' regardless how many "delimiter" it contain.
*/
#define MAX_QUERY (256*1024*2)
/* 256K -- a test in sp-big is >128K */
static
char
read_command_buf
[
MAX_QUERY
];
int
read_command
(
struct
st_command
**
command_ptr
)
{
char
*
p
=
read_command_buf
;
struct
st_command
*
command
;
DBUG_ENTER
(
"read_command"
);
...
...
@@ -6964,8 +6972,7 @@ int read_command(struct st_command** command_ptr)
die
(
"Out of memory"
);
command
->
type
=
Q_UNKNOWN
;
read_command_buf
[
0
]
=
0
;
if
(
read_line
(
read_command_buf
,
sizeof
(
read_command_buf
)))
if
(
read_line
())
{
check_eol_junk
(
read_command_buf
);
DBUG_RETURN
(
1
);
...
...
@@ -6974,6 +6981,7 @@ int read_command(struct st_command** command_ptr)
if
(
opt_result_format_version
==
1
)
convert_to_format_v1
(
read_command_buf
);
char
*
p
=
read_command_buf
;
DBUG_PRINT
(
"info"
,
(
"query: '%s'"
,
read_command_buf
));
if
(
*
p
==
'#'
)
{
...
...
@@ -9126,6 +9134,8 @@ int main(int argc, char **argv)
init_win_path_patterns
();
#endif
read_command_buf
=
(
char
*
)
my_malloc
(
read_command_buflen
=
65536
,
MYF
(
MY_FAE
));
init_dynamic_string
(
&
ds_res
,
""
,
2048
,
2048
);
init_alloc_root
(
&
require_file_root
,
1024
,
1024
,
MYF
(
0
));
...
...
scripts/mytop.sh
View file @
b58f2872
...
...
@@ -1119,6 +1119,7 @@ sub GetData()
}
}
print "
Replication
";
print "
Master:
$data
->
{
Master_Host
}
";
print "
IO:
$data
->
{
Slave_IO_Running
}
";
print "
SQL:
$data
->
{
Slave_SQL_Running
}
";
print RESET() if (
$HAS_COLOR
);
...
...
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