mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug10213 mysqldump crashes when dumping VIEWs
- Added testcase for this bug
- Check if compact view format can be used
- Clean up mysqld_show_create
mysql-test/r/mysqldump.result:
Updated test result
mysql-test/t/mysqldump.test:
Added testcase
sql/item.cc:
Check if compact format can be used
sql/sql_select.cc:
Check if compact format can be used
sql/sql_show.cc:
Cleanup of mysqld_show_create
-remove extra invocation of view_store_create_info
-Remove unused vars
-Remove unused codes
Check if compact show view format can be used
- if user has db of this view as current db
- if this view only references table inside it's own db
sql/table.h:
Add variable for compact_view_format indicator
This commit is contained in:
@@ -13673,13 +13673,20 @@ void st_table_list::print(THD *thd, String *str)
|
||||
const char *cmp_name; // Name to compare with alias
|
||||
if (view_name.str)
|
||||
{
|
||||
append_identifier(thd, str, view_db.str, view_db.length);
|
||||
str->append('.');
|
||||
// A view
|
||||
|
||||
if (!(belong_to_view &&
|
||||
belong_to_view->compact_view_format))
|
||||
{
|
||||
append_identifier(thd, str, view_db.str, view_db.length);
|
||||
str->append('.');
|
||||
}
|
||||
append_identifier(thd, str, view_name.str, view_name.length);
|
||||
cmp_name= view_name.str;
|
||||
}
|
||||
else if (derived)
|
||||
{
|
||||
// A derived table
|
||||
str->append('(');
|
||||
derived->print(str);
|
||||
str->append(')');
|
||||
@@ -13687,8 +13694,14 @@ void st_table_list::print(THD *thd, String *str)
|
||||
}
|
||||
else
|
||||
{
|
||||
append_identifier(thd, str, db, db_length);
|
||||
str->append('.');
|
||||
// A normal table
|
||||
|
||||
if (!(belong_to_view &&
|
||||
belong_to_view->compact_view_format))
|
||||
{
|
||||
append_identifier(thd, str, db, db_length);
|
||||
str->append('.');
|
||||
}
|
||||
if (schema_table)
|
||||
{
|
||||
append_identifier(thd, str, schema_table_name,
|
||||
|
||||
Reference in New Issue
Block a user