Commit 87fb862e authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

Preparing to support character set in error messages

parent 7facccf3
...@@ -24,11 +24,13 @@ ...@@ -24,11 +24,13 @@
#define MAXLENGTH 1000 #define MAXLENGTH 1000
#define MAX_ROWS 1000 #define MAX_ROWS 1000
#define MAX_FILES 10 #define MAX_FILES 10
#define MAX_CHARSET_NAME 64
int row_count; int row_count;
uint file_pos[MAX_ROWS],file_row_pos[MAX_FILES]; uint file_pos[MAX_ROWS],file_row_pos[MAX_FILES];
my_string saved_row[MAX_ROWS]; my_string saved_row[MAX_ROWS];
uchar file_head[]= { 254,254,2,1 }; uchar file_head[]= { 254,254,2,1 };
char charset_name[MAX_CHARSET_NAME];
static void get_options(int *argc,char **argv[]); static void get_options(int *argc,char **argv[]);
static int count_rows(FILE *from,pchar c, pchar c2); static int count_rows(FILE *from,pchar c, pchar c2);
...@@ -61,6 +63,13 @@ int main(int argc,char *argv[]) ...@@ -61,6 +63,13 @@ int main(int argc,char *argv[])
} }
VOID(count_rows(from,'"','}')); /* Calculate start-info */ VOID(count_rows(from,'"','}')); /* Calculate start-info */
if (!charset_name[0])
{
fprintf(stderr,"Character set is not specified in '%s'\n",*argv);
fclose(from);
goto end;
}
if (remember_rows(from,'}') < 0) /* Remember rows */ if (remember_rows(from,'}') < 0) /* Remember rows */
{ {
fprintf(stderr,"Can't find textrows in '%s'\n",*argv); fprintf(stderr,"Can't find textrows in '%s'\n",*argv);
...@@ -134,6 +143,11 @@ static void get_options(register int *argc,register char **argv[]) ...@@ -134,6 +143,11 @@ static void get_options(register int *argc,register char **argv[])
case 'V': case 'V':
printf("%s (Compile errormessage) Ver 1.3\n",progname); printf("%s (Compile errormessage) Ver 1.3\n",progname);
break; break;
case 'C':
printf("pos=%s\n", pos+1);
charsets_dir= pos+1;
*(pos--)= '\0';
break;
case 'I': case 'I':
case '?': case '?':
printf(" %s (Compile errormessage) Ver 1.3\n",progname); printf(" %s (Compile errormessage) Ver 1.3\n",progname);
...@@ -168,8 +182,19 @@ static int count_rows(FILE *from, pchar c, pchar c2) ...@@ -168,8 +182,19 @@ static int count_rows(FILE *from, pchar c, pchar c2)
DBUG_ENTER("count_rows"); DBUG_ENTER("count_rows");
pos=ftell(from); count=0; pos=ftell(from); count=0;
charset_name[0]= '\0';
while (fgets(rad,MAXLENGTH,from) != NULL) while (fgets(rad,MAXLENGTH,from) != NULL)
{ {
if (!strncmp(rad,"character-set=",14))
{
char *b= rad+14, *e;
for (e=b ; e[0] && e-b < MAX_CHARSET_NAME &&
e[0] != ' ' && e[0] != '\r' &&
e[0] != '\n' && e[0] != '\t' ; e++);
e[0]= '\0';
strcpy(charset_name, b);
}
if (rad[0] == c || rad[0] == c2) if (rad[0] == c || rad[0] == c2)
break; break;
count++; count++;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
Thu Nov 30 14:02:52 MET 2000 podle 3.23.28 Thu Nov 30 14:02:52 MET 2000 podle 3.23.28
*/ */
character-set=latin2
"hashchk", "hashchk",
"isamchk", "isamchk",
"NE", "NE",
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
/* Knud Riishøjgård knudriis@post.tele.dk 99 && /* Knud Riishøjgård knudriis@post.tele.dk 99 &&
Carsten H. Pedersen, carsten.pedersen@bitbybit.dk oct. 1999 / aug. 2001. */ Carsten H. Pedersen, carsten.pedersen@bitbybit.dk oct. 1999 / aug. 2001. */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NEJ", "NEJ",
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
Translated new error messages. Translated new error messages.
*/ */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NEE", "NEE",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NO", "NO",
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
*/ */
character-set=latin7
"hashchk", "hashchk",
"isamchk", "isamchk",
"EI", "EI",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NON", "NON",
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
2002-12-11 2002-12-11
*/ */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"Nein", "Nein",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
character-set=greek
"hashchk", "hashchk",
"isamchk", "isamchk",
"", "",
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
Updated May, 2000 Updated May, 2000
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin2
"hashchk", "hashchk",
"isamchk", "isamchk",
"NEM", "NEM",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NO", "NO",
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
3.22.10-beta euc-japanese (ujis) text 3.22.10-beta euc-japanese (ujis) text
*/ */
character-set=ujis
"hashchk", "hashchk",
"isamchk", "isamchk",
"NO", "NO",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This 화일 is public domain and comes with NO WARRANTY of any kind */ This 화일 is public domain and comes with NO WARRANTY of any kind */
character-set=euckr
"hashchk", "hashchk",
"isamchk", "isamchk",
"아니오", "아니오",
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
/* Roy-Magne Mo rmo@www.hivolda.no 97 */ /* Roy-Magne Mo rmo@www.hivolda.no 97 */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NEI", "NEI",
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
/* Roy-Magne Mo rmo@www.hivolda.no 97 */ /* Roy-Magne Mo rmo@www.hivolda.no 97 */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NEI", "NEI",
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
Charset ISO-8859-2 Charset ISO-8859-2
*/ */
character-set=latin2
"hashchk", "hashchk",
"isamchk", "isamchk",
"NIE", "NIE",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
/* Updated by Thiago Delgado Pinto - thiagodp@ieg.com.br - 06.07.2002 */ /* Updated by Thiago Delgado Pinto - thiagodp@ieg.com.br - 06.07.2002 */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NÃO", "NÃO",
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
e-mail: tzoompy@cs.washington.edu e-mail: tzoompy@cs.washington.edu
*/ */
character-set=latin2
"hashchk", "hashchk",
"isamchk", "isamchk",
"NU", "NU",
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
/* charset: KOI8-R */ /* charset: KOI8-R */
character-set=koi8r
"hashchk", "hashchk",
"isamchk", "isamchk",
"", "",
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
Charset: cp1250 Charset: cp1250
*/ */
character-set=cp1250
"hashchk", "hashchk",
"isamchk", "isamchk",
"NE", "NE",
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
Date: Streda 11. November 1998 20:58:15 Date: Streda 11. November 1998 20:58:15
*/ */
character-set=latin2
"hashchk", "hashchk",
"isamchk", "isamchk",
"NIE", "NIE",
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
This file is public domain and comes with NO WARRANTY of any kind This file is public domain and comes with NO WARRANTY of any kind
Traduccion por Miguel Angel Fernandez Roiz -- LoboCom Sistemas, s.l. Traduccion por Miguel Angel Fernandez Roiz -- LoboCom Sistemas, s.l.
From June 28, 2001 translated by Miguel Solorzano miguel@mysql.com */ From June 28, 2001 translated by Miguel Solorzano miguel@mysql.com */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NO", "NO",
......
/* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB /* Copyright Abandoned 1997 TCX DataKonsult AB & Monty Program KB & Detron HB
This file is public domain and comes with NO WARRANTY of any kind */ This file is public domain and comes with NO WARRANTY of any kind */
character-set=latin1
"hashchk", "hashchk",
"isamchk", "isamchk",
"NO", "NO",
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Version: 13/09/2001 mysql-3.23.41 * Version: 13/09/2001 mysql-3.23.41
*/ */
character-set=koi8u
"hashchk", "hashchk",
"isamchk", "isamchk",
"", "",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment