mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.1-25422-d client/mysqldump.c: Auto merged mysql-test/r/log_state.result: Auto merged mysql-test/r/show_check.result: Auto merged mysql-test/t/show_check.test: Auto merged sql/mysql_priv.h: Auto merged sql/share/errmsg.txt: Auto merged sql/sp.cc: Auto merged
This commit is contained in:
@ -3744,11 +3744,12 @@ static int dump_all_tables_in_db(char *database)
|
||||
{
|
||||
DYNAMIC_STRING query;
|
||||
init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024);
|
||||
for (numrows= 0 ; (table= getTableName(1)) ; numrows++)
|
||||
for (numrows= 0 ; (table= getTableName(1)) ; )
|
||||
{
|
||||
char *end= strmov(afterdot, table);
|
||||
if (include_table(hash_key,end - hash_key))
|
||||
{
|
||||
numrows++;
|
||||
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
|
||||
dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
|
||||
}
|
||||
@ -3822,6 +3823,11 @@ static my_bool dump_all_views_in_db(char *database)
|
||||
char *table;
|
||||
uint numrows;
|
||||
char table_buff[NAME_LEN*2+3];
|
||||
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
|
||||
char *afterdot;
|
||||
|
||||
afterdot= strmov(hash_key, database);
|
||||
*afterdot++= '.';
|
||||
|
||||
if (init_dumping(database, init_dumping_views))
|
||||
return 1;
|
||||
@ -3831,10 +3837,15 @@ static my_bool dump_all_views_in_db(char *database)
|
||||
{
|
||||
DYNAMIC_STRING query;
|
||||
init_dynamic_string_checked(&query, "LOCK TABLES ", 256, 1024);
|
||||
for (numrows= 0 ; (table= getTableName(1)); numrows++)
|
||||
for (numrows= 0 ; (table= getTableName(1)); )
|
||||
{
|
||||
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
|
||||
dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
|
||||
char *end= strmov(afterdot, table);
|
||||
if (include_table(hash_key,end - hash_key))
|
||||
{
|
||||
numrows++;
|
||||
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
|
||||
dynstr_append_checked(&query, " READ /*!32311 LOCAL */,");
|
||||
}
|
||||
}
|
||||
if (numrows && mysql_real_query(mysql, query.str, query.length-1))
|
||||
DB_error(mysql, "when using LOCK TABLES");
|
||||
@ -3848,7 +3859,11 @@ static my_bool dump_all_views_in_db(char *database)
|
||||
/* We shall continue here, if --force was given */
|
||||
}
|
||||
while ((table= getTableName(0)))
|
||||
get_view_structure(table, database);
|
||||
{
|
||||
char *end= strmov(afterdot, table);
|
||||
if (include_table(hash_key, end - hash_key))
|
||||
get_view_structure(table, database);
|
||||
}
|
||||
if (opt_xml)
|
||||
{
|
||||
fputs("</database>\n", md_result_file);
|
||||
|
Reference in New Issue
Block a user