diff options
author | Tatiana A. Nurnberg <azundris@mysql.com> | 2008-09-11 08:14:19 +0200 |
---|---|---|
committer | Tatiana A. Nurnberg <azundris@mysql.com> | 2008-09-11 08:14:19 +0200 |
commit | d49ee1933f46019197fa256a3f68cdea43472421 (patch) | |
tree | e5dfa680b5af0b0131e112aa26abf21dccf16841 /client/mysqldump.c | |
parent | 70e2f814a775c11b6cd453d5f26dd3114c7e6b6f (diff) | |
parent | 6e162ea9eb01a5e0509ab2b6a6dba31d8f4ba903 (diff) | |
download | mariadb-git-d49ee1933f46019197fa256a3f68cdea43472421.tar.gz |
Bug#31434 mysqldump dumps view as table
mysqldump creates stand-in tables before dumping the actual view.
Those tables were of the default type; if the view had more columns
than that (a pathological case, arguably), loading the dump would
fail. We now make the temporary stand-ins MyISAM tables to prevent
this.
client/mysqldump.c:
When creating a stand-in table, specify its type to
avoid defaulting to a type with a column-number limit
(like Inno). The type is always MyISAM as we know that
to be available.
mysql-test/r/mysqldump-max.result:
add test results for 31434
mysql-test/r/mysqldump.result:
mysqldump sets engine-type (MyISAM) for stand-in tables
for views now. Update test results.
mysql-test/t/mysqldump-max.test:
Show that mysqldump's stand-in tables for views explicitly
set engine-type to MyISAM to avoid falling back on an engine
that might support fewer columns than the final view requires
(here's lookin' at you, inno). Also show that this actually
has the desired effect by dumping and reloading a view that
has more columns than inno supports.
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 58959f56a89..c068b2ff16e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2396,8 +2396,15 @@ static uint get_table_structure(char *table, char *db, char *table_type, fprintf(sql_file, ",\n %s %s", quote_name(row[0], name_buff, 0), row[1]); } + + /* + Stand-in tables are always MyISAM tables as the default + engine might have a column-limit that's lower than the + number of columns in the view, and MyISAM support is + guaranteed to be in the server anyway. + */ fprintf(sql_file, - "\n) */;\n" + "\n) ENGINE=MyISAM */;\n" "SET character_set_client = @saved_cs_client;\n"); check_io(sql_file); |