[ Pobierz całość w formacie PDF ]
.1.4 String Collating Support.Add the character set name to the CHARSETS_AVAILABLE andCOMPILED_CHARSETS lists in configure.in.Reconfigure, recompile, and test.The file `sql/share/charsets/README' includes some more instructions.If you want to have the character set included in the MySQLdistribution, mail a patch to internals@lists.mysql.com.10.1.3 The character definition arraysto_lower[] and to_upper[] are simple arrays that hold thelowercase and uppercase characters corresponding to each member of thecharacter set.For example:to_lower['A'] should contain 'a'to_upper['a'] should contain 'A'sort_order[] is a map indicating how characters should be ordered forcomparison and sorting purposes.For many character sets, this is the same asto_upper[] (which means sorting will be case insensitive).MySQL will sort characters based on the value ofsort_order[character].For more complicated sorting rules, seethe discussion of string collating below.See section 10.1.4 String Collating Support.ctype[] is an array of bit values, with one element for one character.(Note that to_lower[], to_upper[], and sort_order[]are indexed by character value, but ctype[] is indexed by charactervalue + 1.This is an old legacy to be able to handle EOF.)You can find the following bitmask definitions in `m_ctype.h':#define _U 01 /* Uppercase */#define _L 02 /* Lowercase */#define _N 04 /* Numeral (digit) */#define _S 010 /* Spacing character */#define _P 020 /* Punctuation */#define _C 040 /* Control character */#define _B 0100 /* Blank */#define _X 0200 /* heXadecimal digit */The ctype[] entry for each character should be the union of theapplicable bitmask values that describe the character.For example,'A' is an uppercase character (_U) as well as ahexadecimal digit (_X), so ctype['A'+1] should contain thevalue:_U + _X = 01 + 0200 = 020110.1.4 String Collating SupportIf the sorting rules for your language are too complex to be handledwith the simple sort_order[] table, you need to use the stringcollating functions.Right now the best documentation on this is the character sets that arealready implemented.Look at the big5, czech, gbk, sjis, and tis160character sets for examples.You must specify the strxfrm_multiply_MYSET=N value in thespecial comment at the top of the file.N should be set tothe maximum ratio the strings may grow during my_strxfrm_MYSET (itmust be a positive integer).10.1.5 Multi-byte Character SupportIf your want to add support for a new character set that includesmulti-byte characters, you need to use the multi-byte characterfunctions.Right now the best documentation on this is the character sets that arealready implemented.Look at the euc_kr, gb2312, gbk, sjis and ujischaracter sets for examples.These are implemented in thectype-'charset'.c files in the `strings' directory.You must specify the mbmaxlen_MYSET=N value in the specialcomment at the top of the source file.N should be set to thesize in bytes of the largest character in the set.10.2 How Big MySQL Tables Can BeMySQL Version 3.22 has a 4G limit on table size.With the newMyISAM in MySQL Version 3.23 the maximum table size ispushed up to 8 million terabytes (2 ^ 63 bytes).Note, however, that operating systems have their own file sizelimits.Here are some examples:Operating System File Size LimitLinux-Intel 32 bit 2G, 4G or more, depends on Linux versionLinux-Alpha 8T (?)Solaris 2.5.1 2G (possible 4G with patch)Solaris 2.6 4GSolaris 2.7 Intel 4GSolaris 2.7 ULTRA-SPARC 8T (?)On Linux 2.2 you can get bigger tables than 2G by using the LFS patch forthe ext2 file system.On Linux 2.4 there exists also patches for ReiserFSto get support for big files.This means that the table size for MySQL is normally limited bythe operating system.By default, MySQL tables have a maximum size of about 4G.You cancheck the maximum table size for a table with the SHOW TABLE STATUScommand or with the myisamchk -dv table_name.See section 7.28 SHOW Syntax.If you need bigger tables than 4G (and your operating system supportsthis), you should set the AVG_ROW_LENGTH and MAX_ROWSparameter when you create your table.See section 7.7 CREATE TABLE Syntax.You canalso set these later with ALTER TABLE.See section 7.8 ALTER TABLE Syntax.If your big table is going to be read-only, you could usemyisampack to merge and compress many tables to one.myisampack usually compresses a table by at least 50%, so you canhave, in effect, much bigger tables.See section 15.12 The MySQL Compressed Read-only Table Generator.You can go around the operating system file limit for MyISAM datafiles by using the RAID option.See section 7.7 CREATE TABLE Syntax.Another solution can be the included MERGE library, which allows you tohandle a collection of identical tables as one.See section 8.2 MERGE Tables.Go to the first, previous, next, last section, table of contents
[ Pobierz całość w formacie PDF ]