Skip to content

Commit a0507f9

Browse files
author
wax@kishkin.ru
committed
merge
1 parent dca227b commit a0507f9

File tree

4 files changed

+308
-148
lines changed

4 files changed

+308
-148
lines changed

mysql-test/my_create_tables.c

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
9696
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
9797
"PRIMARY KEY Host (Host,Db,User),"
9898
"KEY User (User))"
99+
"engine=MyISAM "
100+
"CHARACTER SET utf8 COLLATE utf8_bin "
99101
"comment='Database privileges';\n");
100102

101103
if (test)
@@ -126,10 +128,12 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
126128
"Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
127129
"Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
128130
"PRIMARY KEY Host (Host,Db))"
129-
"comment='Host privileges;"
130-
" Merged with database privileges';\n");
131+
"engine=MyISAM "
132+
"CHARACTER SET utf8 COLLATE utf8_bin "
133+
"comment='Host privileges; Merged with database privileges';\n");
131134
}
132135

136+
133137
if (test_sys_file(mdata,"mysql/user.frm"))
134138
{
135139
#ifdef __WIN__
@@ -184,7 +188,10 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
184188
"max_updates int(11) unsigned DEFAULT 0 NOT NULL,"
185189
"max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
186190
"PRIMARY KEY Host (Host,User)"
187-
") comment='Users and global privileges';\n");
191+
") engine=MyISAM "
192+
"CHARACTER SET utf8 COLLATE utf8_bin "
193+
"comment='Users and global privileges';\n");
194+
188195

189196
if (test)
190197
{
@@ -238,7 +245,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
238245
"dl char(128) DEFAULT '' NOT NULL,"
239246
"type enum ('function','aggregate') NOT NULL,"
240247
"PRIMARY KEY (name)"
241-
") comment='User defined functions';\n");
248+
") engine=MyISAM "
249+
"CHARACTER SET utf8 COLLATE utf8_bin "
250+
"comment='User defined functions';\n");
242251
}
243252

244253
if (test_sys_file(mdata,"mysql/tables_priv.frm"))
@@ -258,7 +267,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
258267
" DEFAULT '' NOT NULL,"
259268
"PRIMARY KEY (Host,Db,User,Table_name),"
260269
"KEY Grantor (Grantor)"
261-
") comment='Table privileges';\n");
270+
") engine=MyISAM "
271+
"CHARACTER SET utf8 COLLATE utf8_bin "
272+
"comment='Table privileges';\n");
262273
}
263274

264275
if (test_sys_file(mdata,"mysql/columns_priv.frm"))
@@ -274,7 +285,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
274285
"Column_priv set('Select','Insert','Update','References')"
275286
" DEFAULT '' NOT NULL,"
276287
"PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
277-
") comment='Column privileges';\n");
288+
") engine=MyISAM "
289+
"CHARACTER SET utf8 COLLATE utf8_bin "
290+
"comment='Column privileges';\n");
278291
}
279292

280293
if (test_sys_file(mdata,"mysql/help_topic.frm"))
@@ -289,7 +302,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
289302
"url varchar(128) not null,"
290303
"primary key (help_topic_id),"
291304
"unique index (name)"
292-
") comment='help topics';\n");
305+
") engine=MyISAM "
306+
"CHARACTER SET utf8 "
307+
"comment='help topics';\n");
293308
}
294309

295310
if (test_sys_file(mdata,"mysql/help_category.frm"))
@@ -302,7 +317,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
302317
"url varchar(128) not null,"
303318
"primary key (help_category_id),"
304319
"unique index (name)"
305-
") comment='help categories';\n");
320+
") engine=MyISAM "
321+
"CHARACTER SET utf8 "
322+
"comment='help categories';\n");
306323
}
307324

308325
if (test_sys_file(mdata,"mysql/help_keyword.frm"))
@@ -313,7 +330,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
313330
"name varchar(64) not null,"
314331
"primary key (help_keyword_id),"
315332
"unique index (name)"
316-
") comment='help keywords';\n");
333+
") engine=MyISAM "
334+
"CHARACTER SET utf8 "
335+
"comment='help keywords';\n");
317336
}
318337

319338
if (test_sys_file(mdata,"mysql/help_relation.frm"))
@@ -323,7 +342,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
323342
"help_topic_id int unsigned not null references help_topic,"
324343
"help_keyword_id int unsigned not null references help_keyword,"
325344
"primary key (help_keyword_id, help_topic_id)"
326-
") comment='keyword-topic relation';\n");
345+
") engine=MyISAM "
346+
"CHARACTER SET utf8 "
347+
"comment='keyword-topic relation';\n");
327348
}
328349

329350
if (test_sys_file(mdata,"mysql/time_zone_name.frm"))
@@ -333,15 +354,17 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
333354
"Name char(64) NOT NULL,"
334355
"Time_zone_id int unsigned NOT NULL,"
335356
"PRIMARY KEY Name (Name)"
336-
") DEFAULT CHARACTER SET latin1 "
357+
") engine=MyISAM CHARACTER SET utf8 "
337358
"comment='Time zone names';\n");
338359

339360
if (test)
340361
{
341362
fprintf(out,
342363
"INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES"
343364
"('MET', 1), ('UTC', 2), ('Universal', 2), "
344-
"('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n");
365+
"('Europe/Moscow',3), ('leap/Europe/Moscow',4),"
366+
"('Japan', 5);\n");
367+
345368
}
346369
}
347370

@@ -353,13 +376,13 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
353376
"Time_zone_id int unsigned NOT NULL auto_increment,"
354377
"Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
355378
"PRIMARY KEY TzId (Time_zone_id)"
356-
") DEFAULT CHARACTER SET latin1 "
379+
") engine=MyISAM CHARACTER SET utf8 "
357380
"comment='Time zones';\n");
358381

359382
if (test)
360383
{
361384
fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)"
362-
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n");
385+
"VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n");
363386
}
364387
}
365388

@@ -371,7 +394,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
371394
"Transition_time bigint signed NOT NULL,"
372395
"Transition_type_id int unsigned NOT NULL,"
373396
"PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
374-
") DEFAULT CHARACTER SET latin1 "
397+
") engine=MyISAM CHARACTER SET utf8 "
375398
"comment='Time zone transitions';\n");
376399

377400
if (test)
@@ -576,7 +599,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
576599
",(4, 2045689222, 8) ,(4, 2058390022, 9)"
577600
",(4, 2077138822, 8) ,(4, 2090444422, 9)"
578601
",(4, 2108588422, 8) ,(4, 2121894022, 9)"
579-
",(4, 2140038022, 8);\n");
602+
",(4, 2140038022, 8), (5, -1009875600, 1);\n");
603+
604+
580605
}
581606
}
582607

@@ -590,7 +615,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
590615
"Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
591616
"Abbreviation char(8) DEFAULT '' NOT NULL,"
592617
"PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
593-
") DEFAULT CHARACTER SET latin1 "
618+
") engine=MyISAM CHARACTER SET utf8 "
594619
"comment='Time zone transition types';\n");
595620

596621
if (test)
@@ -612,7 +637,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
612637
",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')"
613638
",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')"
614639
",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')"
615-
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n");
640+
",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')"
641+
",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n");
642+
616643
}
617644
}
618645

@@ -623,7 +650,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test)
623650
"Transition_time bigint signed NOT NULL,"
624651
"Correction int signed NOT NULL,"
625652
"PRIMARY KEY TranTime (Transition_time)"
626-
") DEFAULT CHARACTER SET latin1 "
653+
") engine=MyISAM CHARACTER SET utf8 "
627654
"comment='Leap seconds information for time zones';\n");
628655

629656
if (test)

mysql-test/my_manage.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void add_arg(arg_list_t *al, const char *format, ...)
122122
al->argv[al->argc]= malloc(strlen(temp)+1);
123123
ASSERT(al->argv[al->argc] != NULL);
124124
strcpy(al->argv[al->argc], temp);
125-
125+
126126
++(al->argc);
127127
}
128128
else
@@ -644,7 +644,7 @@ void del_tree(char *dir)
644644
if (lstat(entry->d_name, &st) == -1)
645645
{
646646
/* FIXME error */
647-
return;
647+
return;
648648
}
649649
if (S_ISDIR(st.st_mode))
650650
#else
@@ -800,9 +800,12 @@ int removef(const char *format, ...)
800800
#ifndef STRUCT_DIRENT_HAS_D_TYPE
801801
struct stat st;
802802

803-
if (lstat(entry->d_name, &st) == -1)
803+
/* create long name */
804+
snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name);
805+
806+
if (lstat(temp, &st) == -1)
804807
{
805-
return 1;
808+
return 1; /* Error couldn't lstat file */
806809
}
807810

808811
if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0))

0 commit comments

Comments
 (0)