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
75a1d866
Commit
75a1d866
authored
Jan 27, 2016
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5273 Prepared statement doesn't return metadata after prepare.
SHOW SLAVE STATUS fixed.
parent
552d3309
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
252 additions
and
213 deletions
+252
-213
sql/slave.cc
sql/slave.cc
+212
-213
sql/slave.h
sql/slave.h
+2
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+31
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+7
-0
No files found.
sql/slave.cc
View file @
75a1d866
This diff is collapsed.
Click to expand it.
sql/slave.h
View file @
75a1d866
...
...
@@ -207,6 +207,8 @@ int mysql_table_dump(THD* thd, const char* db,
int
fetch_master_table
(
THD
*
thd
,
const
char
*
db_name
,
const
char
*
table_name
,
Master_info
*
mi
,
MYSQL
*
mysql
,
bool
overwrite
);
void
show_master_info_get_fields
(
THD
*
thd
,
List
<
Item
>
*
field_list
,
bool
full
,
size_t
gtid_pos_length
);
bool
show_master_info
(
THD
*
thd
,
Master_info
*
mi
,
bool
full
);
bool
show_all_master_info
(
THD
*
thd
);
bool
show_binlog_info
(
THD
*
thd
);
...
...
sql/sql_prepare.cc
View file @
75a1d866
...
...
@@ -104,6 +104,7 @@ When one supplies long data for a placeholder:
// mysql_handle_derived
#include "sql_cursor.h"
#include "sql_show.h"
#include "slave.h"
#include "sp_head.h"
#include "sp.h"
#include "sp_cache.h"
...
...
@@ -1892,6 +1893,29 @@ static bool mysql_test_show_grants(Prepared_statement *stmt)
}
/**
Validate and prepare for execution SHOW SLAVE STATUS statement.
@param stmt prepared statement
@retval
FALSE success
@retval
TRUE error, error message is set in THD
*/
static
bool
mysql_test_show_slave_status
(
Prepared_statement
*
stmt
)
{
DBUG_ENTER
(
"mysql_test_show_slave_status"
);
THD
*
thd
=
stmt
->
thd
;
List
<
Item
>
fields
;
show_master_info_get_fields
(
thd
,
&
fields
,
0
,
0
);
DBUG_RETURN
(
send_stmt_metadata
(
thd
,
stmt
,
&
fields
));
}
/**
@brief Validate and prepare for execution CREATE VIEW statement
...
...
@@ -2246,6 +2270,13 @@ static bool check_prepared_statement(Prepared_statement *stmt)
DBUG_RETURN
(
FALSE
);
}
break
;
case
SQLCOM_SHOW_SLAVE_STAT
:
if
(
!
(
res
=
mysql_test_show_slave_status
(
stmt
)))
{
/* Statement and field info has already been sent */
DBUG_RETURN
(
FALSE
);
}
break
;
case
SQLCOM_CREATE_VIEW
:
if
(
lex
->
create_view_mode
==
VIEW_ALTER
)
{
...
...
tests/mysql_client_test.c
View file @
75a1d866
...
...
@@ -443,6 +443,13 @@ static void test_prepare_simple()
DIE_UNLESS
(
mysql_stmt_field_count
(
stmt
)
==
1
);
mysql_stmt_close
(
stmt
);
/* show slave status */
strmov
(
query
,
"SHOW SLAVE STATUS"
);
stmt
=
mysql_simple_prepare
(
mysql
,
query
);
check_stmt
(
stmt
);
DIE_UNLESS
(
mysql_stmt_field_count
(
stmt
)
==
47
);
mysql_stmt_close
(
stmt
);
/* now fetch the results ..*/
rc
=
mysql_commit
(
mysql
);
myquery
(
rc
);
...
...
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