summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorbar@bar.mysql.r18.ru <>2003-09-22 11:11:36 +0500
committerbar@bar.mysql.r18.ru <>2003-09-22 11:11:36 +0500
commit99e2a821682e355a43dd7f00f173fb5f0e2746b8 (patch)
treea1d98e6177658118fdb465426699d462b11aeaa3 /sql
parentb201d49631637a3c55f25591a3ae40e8f77d2f71 (diff)
downloadmariadb-git-99e2a821682e355a43dd7f00f173fb5f0e2746b8.tar.gz
Bug 1350 fix
Diffstat (limited to 'sql')
-rw-r--r--sql/derror.cc18
-rw-r--r--sql/sql_show.cc14
2 files changed, 22 insertions, 10 deletions
diff --git a/sql/derror.cc b/sql/derror.cc
index 1a98b9ce371..a35893be4fc 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -67,10 +67,18 @@ static void read_texts(const char *file_name,const char ***point,
goto err; /* purecov: inspected */
textcount=head[4];
+ if (!head[30])
+ {
+ sql_print_error("No character set information in '%s'. \
+You probably haven't reinstalled the latest file version.",name);
+ goto err1;
+ }
+
if (!(cset= get_charset(head[30],MYF(MY_WME))))
{
- funktpos= 3;
- goto err;
+ sql_print_error("Character set #%d is not supported for messagefile '%s'",
+ (int)head[30],name);
+ goto err1;
}
length=uint2korr(head+6); count=uint2korr(head+8);
@@ -112,9 +120,6 @@ Check that the above file is the right version for this program!",
err:
switch (funktpos) {
- case 3:
- buff="Character set is not supported for messagefile '%s'";
- break;
case 2:
buff="Not enough memory for messagefile '%s'";
break;
@@ -125,9 +130,10 @@ err:
buff="Can't find messagefile '%s'";
break;
}
+ sql_print_error(buff,name);
+err1:
if (file != FERR)
VOID(my_close(file,MYF(MY_WME)));
- sql_print_error(buff,name);
unireg_abort(1);
} /* read_texts */
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 8ea78e702e5..8ed4d6d7324 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1497,11 +1497,15 @@ int mysqld_show_collations(THD *thd, const char *wild)
for ( cs= all_charsets ; cs < all_charsets+255 ; cs++ )
{
CHARSET_INFO **cl;
+ if (!cs[0] || !(cs[0]->state & MY_CS_AVAILABLE) ||
+ !(cs[0]->state & MY_CS_PRIMARY))
+ continue;
for ( cl= all_charsets; cl < all_charsets+255 ;cl ++)
{
- if (!cs[0] || !cl[0] || !my_charset_same(cs[0],cl[0]) || !(cs[0]->state & MY_CS_PRIMARY))
+ if (!cl[0] || !(cl[0]->state & MY_CS_AVAILABLE) ||
+ !my_charset_same(cs[0],cl[0]))
continue;
- if (cs[0] && !(wild && wild[0] &&
+ if (!(wild && wild[0] &&
wild_case_compare(system_charset_info,cl[0]->name,wild)))
{
if (write_collation(protocol, cl[0]))
@@ -1545,8 +1549,10 @@ int mysqld_show_charsets(THD *thd, const char *wild)
for ( cs= all_charsets ; cs < all_charsets+255 ; cs++ )
{
- if (cs[0] && (cs[0]->state & MY_CS_PRIMARY) && !(wild && wild[0] &&
- wild_case_compare(system_charset_info,cs[0]->name,wild)))
+ if (cs[0] && (cs[0]->state & MY_CS_PRIMARY) &&
+ (cs[0]->state & MY_CS_AVAILABLE) &&
+ !(wild && wild[0] &&
+ wild_case_compare(system_charset_info,cs[0]->csname,wild)))
{
if (write_charset(protocol, cs[0]))
goto err;