mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#14117025: UNABLE TO RESTORE DUMP
Problem: When a view, with a specific character set and collation, is created on another view with a different character set and collation the dump restoration results in an illegal mix of collations error. SOLUTION: To avoid this confusion of collations, the create table datatype being used is hardcoded as "tinyint NOT NULL". This will not matter as the table created will be dropped at runtime and specifically tinyint is used to avoid hitting the row size conflicts.
This commit is contained in:
@ -2635,14 +2635,19 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
|||||||
|
|
||||||
row= mysql_fetch_row(result);
|
row= mysql_fetch_row(result);
|
||||||
|
|
||||||
fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0),
|
/*
|
||||||
row[1]);
|
The actual column type doesn't matter anyway, since the table will
|
||||||
|
be dropped at run time.
|
||||||
|
We do tinyint to avoid hitting the row size limit.
|
||||||
|
*/
|
||||||
|
fprintf(sql_file, " %s tinyint NOT NULL",
|
||||||
|
quote_name(row[0], name_buff, 0));
|
||||||
|
|
||||||
while((row= mysql_fetch_row(result)))
|
while((row= mysql_fetch_row(result)))
|
||||||
{
|
{
|
||||||
/* col name, col type */
|
/* col name, col type */
|
||||||
fprintf(sql_file, ",\n %s %s",
|
fprintf(sql_file, ",\n %s tinyint NOT NULL",
|
||||||
quote_name(row[0], name_buff, 0), row[1]);
|
quote_name(row[0], name_buff, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1988,7 +1988,7 @@ DROP TABLE IF EXISTS `v2`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v2` (
|
/*!50001 CREATE TABLE `v2` (
|
||||||
`a` varchar(30)
|
`a` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||||
@ -2082,7 +2082,7 @@ DROP TABLE IF EXISTS `v1`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v1` (
|
/*!50001 CREATE TABLE `v1` (
|
||||||
`a` int(11)
|
`a` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||||
@ -2156,7 +2156,7 @@ DROP TABLE IF EXISTS `v2`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v2` (
|
/*!50001 CREATE TABLE `v2` (
|
||||||
`a` varchar(30)
|
`a` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||||
@ -2270,9 +2270,9 @@ DROP TABLE IF EXISTS `v1`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v1` (
|
/*!50001 CREATE TABLE `v1` (
|
||||||
`a` int(11),
|
`a` tinyint NOT NULL,
|
||||||
`b` int(11),
|
`b` tinyint NOT NULL,
|
||||||
`c` varchar(30)
|
`c` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
DROP TABLE IF EXISTS `v2`;
|
DROP TABLE IF EXISTS `v2`;
|
||||||
@ -2280,7 +2280,7 @@ DROP TABLE IF EXISTS `v2`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v2` (
|
/*!50001 CREATE TABLE `v2` (
|
||||||
`a` int(11)
|
`a` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
DROP TABLE IF EXISTS `v3`;
|
DROP TABLE IF EXISTS `v3`;
|
||||||
@ -2288,9 +2288,9 @@ DROP TABLE IF EXISTS `v3`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v3` (
|
/*!50001 CREATE TABLE `v3` (
|
||||||
`a` int(11),
|
`a` tinyint NOT NULL,
|
||||||
`b` int(11),
|
`b` tinyint NOT NULL,
|
||||||
`c` varchar(30)
|
`c` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||||
@ -3027,9 +3027,9 @@ DROP TABLE IF EXISTS `v0`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v0` (
|
/*!50001 CREATE TABLE `v0` (
|
||||||
`a` int(11),
|
`a` tinyint NOT NULL,
|
||||||
`b` varchar(32),
|
`b` tinyint NOT NULL,
|
||||||
`c` varchar(32)
|
`c` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
DROP TABLE IF EXISTS `v1`;
|
DROP TABLE IF EXISTS `v1`;
|
||||||
@ -3037,9 +3037,9 @@ DROP TABLE IF EXISTS `v1`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v1` (
|
/*!50001 CREATE TABLE `v1` (
|
||||||
`a` int(11),
|
`a` tinyint NOT NULL,
|
||||||
`b` varchar(32),
|
`b` tinyint NOT NULL,
|
||||||
`c` varchar(32)
|
`c` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
DROP TABLE IF EXISTS `v2`;
|
DROP TABLE IF EXISTS `v2`;
|
||||||
@ -3047,9 +3047,9 @@ DROP TABLE IF EXISTS `v2`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v2` (
|
/*!50001 CREATE TABLE `v2` (
|
||||||
`a` int(11),
|
`a` tinyint NOT NULL,
|
||||||
`b` varchar(32),
|
`b` tinyint NOT NULL,
|
||||||
`c` varchar(32)
|
`c` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
|
|
||||||
@ -3429,7 +3429,7 @@ DROP TABLE IF EXISTS `v1`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v1` (
|
/*!50001 CREATE TABLE `v1` (
|
||||||
`id` int(11)
|
`id` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
|
|
||||||
@ -3489,7 +3489,7 @@ USE `mysqldump_views`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `nasishnasifu` (
|
/*!50001 CREATE TABLE `nasishnasifu` (
|
||||||
`id` bigint(20) unsigned
|
`id` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
|
|
||||||
@ -3882,7 +3882,7 @@ DROP TABLE IF EXISTS `v2`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v2` (
|
/*!50001 CREATE TABLE `v2` (
|
||||||
`c` int(11)
|
`c` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||||
@ -4299,7 +4299,7 @@ DROP TABLE IF EXISTS `v1`;
|
|||||||
SET @saved_cs_client = @@character_set_client;
|
SET @saved_cs_client = @@character_set_client;
|
||||||
SET character_set_client = utf8;
|
SET character_set_client = utf8;
|
||||||
/*!50001 CREATE TABLE `v1` (
|
/*!50001 CREATE TABLE `v1` (
|
||||||
`id` int(11)
|
`id` tinyint NOT NULL
|
||||||
) ENGINE=MyISAM */;
|
) ENGINE=MyISAM */;
|
||||||
SET character_set_client = @saved_cs_client;
|
SET character_set_client = @saved_cs_client;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user