diff options
author | unknown <bar@bar.mysql.r18.ru> | 2003-09-17 16:22:58 +0500 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2003-09-17 16:22:58 +0500 |
commit | 34fc9b2b568ee9cac49f208d6b046f60907ec544 (patch) | |
tree | 298ca40ac1fef653ffff869aec7c52ecfd043b43 /extra/comp_err.c | |
parent | abd0afa368e259da0d63d13bfdc6c0ded1f3edd5 (diff) | |
download | mariadb-git-34fc9b2b568ee9cac49f208d6b046f60907ec544.tar.gz |
Charset number is now stored into error.sys by comp_err and loaded by mysqld.
Diffstat (limited to 'extra/comp_err.c')
-rw-r--r-- | extra/comp_err.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c index 175dc246f5f..2ec4240392f 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -42,11 +42,12 @@ static int copy_rows(FILE *to); int main(int argc,char *argv[]) { + uint csnum= 0; int i,error,files,length; uchar head[32]; FILE *from,*to; MY_INIT(argv[0]); - + get_options(&argc,&argv); error=1; row_count=files=0; @@ -70,6 +71,13 @@ int main(int argc,char *argv[]) goto end; } + if (!(csnum= get_charset_number(charset_name, MY_CS_PRIMARY))) + { + fprintf(stderr,"Unknown character '%s' in '%s'\n",charset_name, *argv); + fclose(from); + goto end; + } + if (remember_rows(from,'}') < 0) /* Remember rows */ { fprintf(stderr,"Can't find textrows in '%s'\n",*argv); @@ -100,7 +108,8 @@ int main(int argc,char *argv[]) { int2store(head+10+i+i,file_row_pos[i]); } - + head[30]= csnum; + fseek(to,0l,0); if (fwrite(head,1,32,to) != 32) goto end; @@ -144,7 +153,6 @@ static void get_options(register int *argc,register char **argv[]) printf("%s (Compile errormessage) Ver 1.3\n",progname); break; case 'C': - printf("pos=%s\n", pos+1); charsets_dir= pos+1; *(pos--)= '\0'; break; |