diff options
author | unknown <jani@ua141d10.elisa.omakaista.fi> | 2005-10-27 23:43:20 +0300 |
---|---|---|
committer | unknown <jani@ua141d10.elisa.omakaista.fi> | 2005-10-27 23:43:20 +0300 |
commit | 7911c50718fa27c2fa56e99d765b54267481a8d2 (patch) | |
tree | ff71298ae3c57caff8ca7c70666d60292290e366 /strings/conf_to_src.c | |
parent | 6196a746116b4de60414f717eabcc243a7a3beb6 (diff) | |
parent | 987c33a97501ccd064ee2e68df44ad1d1e4618e6 (diff) | |
download | mariadb-git-7911c50718fa27c2fa56e99d765b54267481a8d2.tar.gz |
Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
heap/_check.c:
Auto merged
heap/hp_create.c:
Auto merged
include/config-netware.h:
Auto merged
include/my_base.h:
Auto merged
include/my_handler.h:
Auto merged
include/myisam.h:
Auto merged
innobase/include/Makefile.am:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_delete.c:
Auto merged
myisam/mi_rnext_same.c:
Auto merged
myisam/mi_search.c:
Auto merged
myisam/mi_write.c:
Auto merged
myisam/myisamdef.h:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/update.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
mysql-test/t/select.test:
Auto merged
mysql-test/t/update.test:
Auto merged
mysys/my_getopt.c:
Auto merged
mysys/my_handler.c:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/records.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/structs.h:
Auto merged
strings/conf_to_src.c:
Auto merged
strings/ctype-win1250ch.c:
Auto merged
Makefile.am:
Merged from 4.1
myisam/myisamchk.c:
Merged from 4.1
mysql-test/mysql-test-run.pl:
Merged from 4.1
mysql-test/r/insert_select.result:
Merged from 4.1
mysql-test/r/myisam.result:
Merged from 4.1
mysql-test/r/select.result:
Merged from 4.1
mysql-test/t/insert_select.test:
Merged from 4.1
mysql-test/t/myisam.test:
Merged from 4.1
netware/mysql_test_run.c:
Merged from 4.1
sql/item.cc:
Merged from 4.1
sql/mysqld.cc:
Merged from 4.1
sql/sql_update.cc:
Merged from 4.1
tests/mysql_client_test.c:
Merged from 4.1
Diffstat (limited to 'strings/conf_to_src.c')
-rw-r--r-- | strings/conf_to_src.c | 79 |
1 files changed, 51 insertions, 28 deletions
diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 5a6adb398da..9ec2224ab62 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -171,50 +171,68 @@ static int my_read_charset_file(const char *filename) return FALSE; } +static int +is_case_sensitive(CHARSET_INFO *cs) +{ + return (cs->sort_order && + cs->sort_order['A'] < cs->sort_order['a'] && + cs->sort_order['a'] < cs->sort_order['B']) ? 1 : 0; +} + void dispcset(FILE *f,CHARSET_INFO *cs) { fprintf(f,"{\n"); fprintf(f," %d,%d,%d,\n",cs->number,0,0); - fprintf(f," MY_CS_COMPILED%s%s,\n", + fprintf(f," MY_CS_COMPILED%s%s%s,\n", cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "", - cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : ""); + cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "", + is_case_sensitive(cs) ? "|MY_CS_CSSORT" : ""); if (cs->name) { - fprintf(f," \"%s\",\n",cs->csname); - fprintf(f," \"%s\",\n",cs->name); - fprintf(f," \"\",\n"); - fprintf(f," ctype_%s,\n",cs->name); - fprintf(f," to_lower_%s,\n",cs->name); - fprintf(f," to_upper_%s,\n",cs->name); + fprintf(f," \"%s\", /* cset name */\n",cs->csname); + fprintf(f," \"%s\", /* coll name */\n",cs->name); + fprintf(f," \"\", /* comment */\n"); + fprintf(f," NULL, /* tailoring */\n"); + fprintf(f," ctype_%s, /* ctype */\n",cs->name); + fprintf(f," to_lower_%s, /* lower */\n",cs->name); + fprintf(f," to_upper_%s, /* upper */\n",cs->name); if (cs->sort_order) - fprintf(f," sort_order_%s,\n",cs->name); + fprintf(f," sort_order_%s, /* sort_order */\n",cs->name); else - fprintf(f," NULL,\n"); - fprintf(f," to_uni_%s,\n",cs->name); - fprintf(f," from_uni_%s,\n",cs->name); + fprintf(f," NULL, /* sort_order */\n"); + fprintf(f," NULL, /* contractions */\n"); + fprintf(f," NULL, /* sort_order_big*/\n"); + fprintf(f," to_uni_%s, /* to_uni */\n",cs->name); } else { - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); - fprintf(f," NULL,\n"); + fprintf(f," NULL, /* cset name */\n"); + fprintf(f," NULL, /* coll name */\n"); + fprintf(f," NULL, /* comment */\n"); + fprintf(f," NULL, /* tailoging */\n"); + fprintf(f," NULL, /* ctype */\n"); + fprintf(f," NULL, /* lower */\n"); + fprintf(f," NULL, /* upper */\n"); + fprintf(f," NULL, /* sort order */\n"); + fprintf(f," NULL, /* contractions */\n"); + fprintf(f," NULL, /* sort_order_big*/\n"); + fprintf(f," NULL, /* to_uni */\n"); } - - fprintf(f," \"\",\n"); - fprintf(f," \"\",\n"); - fprintf(f," 0,\n"); - fprintf(f," 0,\n"); - fprintf(f," 0,\n"); + + fprintf(f," NULL, /* from_uni */\n"); + fprintf(f," NULL, /* state map */\n"); + fprintf(f," NULL, /* ident map */\n"); + fprintf(f," 1, /* strxfrm_multiply*/\n"); + fprintf(f," 1, /* mbminlen */\n"); + fprintf(f," 1, /* mbmaxlen */\n"); + fprintf(f," 0, /* min_sort_char */\n"); + fprintf(f," 255, /* max_sort_char */\n"); + fprintf(f," 0, /* escape_with_backslash_is_dangerous */\n"); + fprintf(f," &my_charset_8bit_handler,\n"); if (cs->state & MY_CS_BINSORT) - fprintf(f," &my_collation_bin_handler,\n"); + fprintf(f," &my_collation_8bit_bin_handler,\n"); else fprintf(f," &my_collation_8bit_simple_ci_handler,\n"); fprintf(f,"}\n"); @@ -253,6 +271,11 @@ main(int argc, char **argv __attribute__((unused))) } } + + fprintf(f,"#include <my_global.h>\n"); + fprintf(f,"#include <m_ctype.h>\n\n"); + + for (cs=all_charsets; cs < all_charsets+256; cs++) { if (simple_cs_is_full(cs)) |