Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3d32b14d
Commit
3d32b14d
authored
Oct 23, 2002
by
peter@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/pz/mysql/mysql-4.1-root
into mysql.com:/home/pz/mysql/mysql-4.1
parents
ae7e164f
607c0c01
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
329 additions
and
27 deletions
+329
-27
include/m_ctype.h
include/m_ctype.h
+2
-0
libmysql/Makefile.shared
libmysql/Makefile.shared
+1
-1
sql/share/charsets/Index
sql/share/charsets/Index
+3
-0
sql/share/charsets/cp1256.conf
sql/share/charsets/cp1256.conf
+94
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+40
-23
strings/Makefile.am
strings/Makefile.am
+3
-3
strings/ctype-bin.c
strings/ctype-bin.c
+184
-0
strings/ctype.c
strings/ctype.c
+2
-0
No files found.
include/m_ctype.h
View file @
3d32b14d
...
...
@@ -48,6 +48,7 @@ typedef struct unicase_info_st {
#define MY_CS_CONFIG 2
/* sets that have a *.conf file */
#define MY_CS_INDEX 4
/* sets listed in the Index file */
#define MY_CS_LOADED 8
/* sets that are currently loaded */
#define MY_CS_BINSORT 16
/* if binary sort order */
#define MY_CHARSET_UNDEFINED 0
#define MY_CHARSET_CURRENT (default_charset_info->number)
...
...
@@ -116,6 +117,7 @@ typedef struct charset_info_st
}
CHARSET_INFO
;
extern
CHARSET_INFO
*
my_charset_bin
;
extern
CHARSET_INFO
*
default_charset_info
;
extern
CHARSET_INFO
*
system_charset_info
;
extern
CHARSET_INFO
*
all_charsets
[
256
];
...
...
libmysql/Makefile.shared
View file @
3d32b14d
...
...
@@ -38,7 +38,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strcend.lo bcmp.lo
\
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo
\
strtoull.lo strtoll.lo llstr.lo
\
ctype.lo ctype-simple.lo ctype-mb.lo
\
ctype.lo ctype-simple.lo ctype-
bin.lo ctype-
mb.lo
\
ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo
\
ctype-win1250ch.lo ctype-utf8.lo
\
ctype-gb2312.lo ctype-gbk.lo ctype-latin1_de.lo
\
...
...
sql/share/charsets/Index
View file @
3d32b14d
...
...
@@ -66,3 +66,6 @@ macromanbin 53
macromancias 54
macromanciai 55
macromancsas 56
cp1256 57
binary 63
sql/share/charsets/cp1256.conf
0 → 100644
View file @
3d32b14d
#
# Arabic, Persian, Pakistani, Urdu
#
# ctype array (must be 257 elements)
00
20
20
20
20
20
20
20
20
20
28
28
28
28
28
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
20
48
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
84
84
84
84
84
84
84
84
84
84
10
10
10
10
10
10
10
81
81
81
81
81
81
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
01
10
10
10
00
00
00
82
82
82
82
82
82
02
02
02
02
02
02
02
02
02
02
02
02
02
02
02
02
02
02
02
02
10
10
10
10
20
00
03
00
02
00
00
00
00
00
00
00
00
01
03
03
00
03
10
10
10
10
00
00
00
00
00
00
00
02
00
00
00
00
10
00
00
00
00
00
00
00
00
00
10
10
10
00
00
10
10
00
00
00
00
00
00
00
00
10
10
00
00
00
10
00
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
03
00
03
03
03
03
03
03
03
03
02
03
02
03
03
03
03
02
02
02
02
02
03
03
02
02
03
03
03
03
02
03
03
00
03
02
03
02
02
00
00
00
# to_lower array (must be 256 elements)
00
01
02
03
04
05
06
07
08
09
0
A
0
B
0
C
0
D
0
E
0
F
10
11
12
13
14
15
16
17
18
19
1
A
1
B
1
C
1
D
1
E
1
F
20
21
22
23
24
25
26
27
28
29
2
A
2
B
2
C
2
D
2
E
2
F
30
31
32
33
34
35
36
37
38
39
3
A
3
B
3
C
3
D
3
E
3
F
40
61
62
63
64
65
66
67
68
69
6
A
6
B
6
C
6
D
6
E
6
F
70
71
72
73
54
75
76
77
78
79
7
A
5
B
5
C
5
D
5
E
5
F
60
61
62
63
64
65
66
67
68
69
6
A
6
B
6
C
6
D
6
E
6
F
70
71
72
73
54
75
76
77
78
79
7
A
7
B
7
C
7
D
7
E
7
F
80
81
82
83
84
85
86
87
88
89
8
A
8
B
9
C
8
D
8
E
8
F
90
91
92
93
94
95
96
97
98
99
9
A
9
B
9
C
9
D
9
E
9
F
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
AA
AB
AC
AD
AE
AF
B0
B1
B2
B3
B4
B5
B6
B7
B8
B9
BA
BB
BC
BD
BE
BF
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9
FA
FB
FC
FD
FE
FF
# to_upper array (must be 256 elements)
00
01
02
03
04
05
06
07
08
09
0
A
0
B
0
C
0
D
0
E
0
F
10
11
12
13
14
15
16
17
18
19
1
A
1
B
1
C
1
D
1
E
1
F
20
21
22
23
24
25
26
27
28
29
2
A
2
B
2
C
2
D
2
E
2
F
30
31
32
33
34
35
36
37
38
39
3
A
3
B
3
C
3
D
3
E
3
F
40
41
42
43
44
45
46
47
48
49
4
A
4
B
4
C
4
D
4
E
4
F
50
51
52
53
74
55
56
57
58
59
5
A
5
B
5
C
5
F
5
E
5
F
60
41
42
43
44
45
46
47
48
49
4
A
4
B
4
C
4
D
4
E
4
F
50
51
52
53
74
55
56
57
58
59
5
A
7
B
7
C
7
F
7
E
7
F
80
81
82
83
84
85
86
87
88
89
8
A
8
B
8
C
8
D
8
E
8
F
90
91
92
93
94
95
96
97
98
99
9
A
9
B
8
C
9
D
9
E
9
F
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
AA
AB
AC
AD
AE
AF
B0
B1
B2
B3
B4
B5
B6
B7
B8
B9
BA
BB
BC
BD
BE
BF
C0
C1
C2
C3
C4
C5
C6
C7
C8
C9
CA
CB
CC
CD
CE
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
DA
DB
DC
DD
DE
DF
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9
FA
FB
FC
FD
FE
FF
# sort_order array (must be 256 elements)
00
01
02
03
04
05
06
07
08
09
0
A
0
B
0
C
0
D
0
E
0
F
10
11
12
13
14
15
16
17
18
19
1
A
1
B
1
C
1
D
1
E
1
F
20
21
22
23
24
25
26
27
28
29
2
A
2
B
2
C
2
D
2
E
2
F
30
31
32
33
34
35
36
37
38
39
3
A
3
B
3
C
3
D
3
E
3
F
40
41
45
47
4
A
4
C
52
55
57
59
5
D
5
F
61
63
65
67
6
C
6
E
70
72
74
76
7
B
7
D
7
F
81
83
B9
BA
BB
BC
BD
BE
41
45
47
4
A
4
C
52
55
57
59
5
D
5
F
61
63
65
67
6
C
6
E
70
72
74
76
7
B
7
D
7
F
81
83
BF
C0
C1
C2
C3
C4
8
E
C5
54
C6
C7
C8
C9
CA
CB
CC
CD
6
A
92
99
CE
A5
CF
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
6
A
DA
DB
DC
DD
B6
DE
DF
E0
E1
E2
E3
E4
E5
E6
E7
E8
E9
EA
EB
EC
ED
EE
EF
F0
F1
F2
F3
F4
F5
B7
F6
F7
F8
F9
B8
FA
85
86
87
88
89
8
A
8
B
8
C
8
D
9
F
90
91
93
94
95
96
97
98
9
A
9
B
9
C
9
D
FB
9
E
9
F
A0
A1
AD
A2
A3
A4
43
A6
44
A7
A8
A9
AA
49
4
E
4
F
50
51
AB
AC
5
B
5
C
AE
AF
B0
B1
69
B2
B3
FC
B4
78
B5
79
7
A
FD
FE
FF
# Unicode mapping (must be 256 elements)
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
000
A
000
B
000
C
000
D
000
E
000
F
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
001
A
001
B
001
C
001
D
001
E
001
F
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
002
A
002
B
002
C
002
D
002
E
002
F
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
003
A
003
B
003
C
003
D
003
E
003
F
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
004
A
004
B
004
C
004
D
004
E
004
F
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
005
A
005
B
005
C
005
D
005
E
005
F
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
006
A
006
B
006
C
006
D
006
E
006
F
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
007
A
007
B
007
C
007
D
007
E
007
F
20
AC
067
E
201
A
0192
201
E
2026
2020
2021
02
C6
2030
0000
2039
0152
0686
0698
0000
06
AF
2018
2019
201
C
201
D
2022
2013
2014
0000
2122
0000
203
A
0153
200
C
200
D
0000
00
A0
060
C
00
A2
00
A3
00
A4
00
A5
00
A6
00
A7
00
A8
00
A9
0000
00
AB
00
AC
00
AD
00
AE
00
AF
00
B0
00
B1
00
B2
00
B3
00
B4
00
B5
00
B6
00
B7
00
B8
00
B9
061
B
00
BB
00
BC
00
BD
00
BE
061
F
0000
0621
0622
0623
0624
0625
0626
0627
0628
0629
062
A
062
B
062
C
062
D
062
E
062
F
0630
0631
0632
0633
0634
0635
0636
00
D7
0637
0638
0639
063
A
0640
0641
0642
0643
00
E0
0644
00
E2
0645
0646
0647
0648
00
E7
00
E8
00
E9
00
EA
00
EB
0649
064
A
00
EE
00
EF
064
B
064
C
064
D
064
E
00
F4
064
F
0650
00
F7
0651
00
F9
0652
00
FB
00
FC
200
E
200
F
0000
sql/sql_yacc.yy
View file @
3d32b14d
...
...
@@ -867,27 +867,36 @@ opt_create_table_options:
/* empty */
| create_table_options;
create_table_options_space_separated:
create_table_option
| create_table_option create_table_options_space_separated;
create_table_options:
create_table_option
| create_table_option create_table_options;
| create_table_option create_table_options;
| create_table_option ',' create_table_options;
o_eq:
/* empty */
| EQ {};
create_table_option:
TYPE_SYM
EQ table_types
{ Lex->create_info.db_type= $3; }
| MAX_ROWS
EQ
ulonglong_num { Lex->create_info.max_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;}
| MIN_ROWS
EQ
ulonglong_num { Lex->create_info.min_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;}
| AVG_ROW_LENGTH
EQ
ULONG_NUM { Lex->create_info.avg_row_length=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;}
| PASSWORD
EQ
TEXT_STRING { Lex->create_info.password=$3.str; }
| COMMENT_SYM
EQ
TEXT_STRING { Lex->create_info.comment=$3.str; }
| AUTO_INC
EQ
ulonglong_num { Lex->create_info.auto_increment_value=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;}
| PACK_KEYS_SYM
EQ
ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_PACK_KEYS : HA_OPTION_NO_PACK_KEYS; Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;}
| PACK_KEYS_SYM
EQ
DEFAULT { Lex->create_info.table_options&= ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS); Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;}
| CHECKSUM_SYM
EQ
ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; }
| DELAY_KEY_WRITE_SYM
EQ
ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; }
| ROW_FORMAT_SYM
EQ
row_types { Lex->create_info.row_type= $3; }
| RAID_TYPE
EQ
raid_types { Lex->create_info.raid_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKS
EQ
ULONG_NUM { Lex->create_info.raid_chunks= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKSIZE
EQ
ULONG_NUM { Lex->create_info.raid_chunksize= $3*RAID_BLOCK_SIZE; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| UNION_SYM
EQ
'(' table_list ')'
TYPE_SYM
o_eq table_types
{ Lex->create_info.db_type= $3; }
| MAX_ROWS
o_eq
ulonglong_num { Lex->create_info.max_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MAX_ROWS;}
| MIN_ROWS
o_eq
ulonglong_num { Lex->create_info.min_rows= $3; Lex->create_info.used_fields|= HA_CREATE_USED_MIN_ROWS;}
| AVG_ROW_LENGTH
o_eq
ULONG_NUM { Lex->create_info.avg_row_length=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AVG_ROW_LENGTH;}
| PASSWORD
o_eq
TEXT_STRING { Lex->create_info.password=$3.str; }
| COMMENT_SYM
o_eq
TEXT_STRING { Lex->create_info.comment=$3.str; }
| AUTO_INC
o_eq
ulonglong_num { Lex->create_info.auto_increment_value=$3; Lex->create_info.used_fields|= HA_CREATE_USED_AUTO;}
| PACK_KEYS_SYM
o_eq
ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_PACK_KEYS : HA_OPTION_NO_PACK_KEYS; Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;}
| PACK_KEYS_SYM
o_eq
DEFAULT { Lex->create_info.table_options&= ~(HA_OPTION_PACK_KEYS | HA_OPTION_NO_PACK_KEYS); Lex->create_info.used_fields|= HA_CREATE_USED_PACK_KEYS;}
| CHECKSUM_SYM
o_eq
ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; }
| DELAY_KEY_WRITE_SYM
o_eq
ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; }
| ROW_FORMAT_SYM
o_eq
row_types { Lex->create_info.row_type= $3; }
| RAID_TYPE
o_eq
raid_types { Lex->create_info.raid_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKS
o_eq
ULONG_NUM { Lex->create_info.raid_chunks= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKSIZE
o_eq
ULONG_NUM { Lex->create_info.raid_chunksize= $3*RAID_BLOCK_SIZE; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| UNION_SYM
o_eq
'(' table_list ')'
{
/* Move the union list to the merge_list */
LEX *lex=Lex;
...
...
@@ -900,14 +909,14 @@ create_table_option:
table_list->next=0;
lex->create_info.used_fields|= HA_CREATE_USED_UNION;
}
| CHARSET
EQ
charset_name_or_default
| CHARSET
o_eq
charset_name_or_default
{
Lex->create_info.table_charset= $3;
Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
}
| INSERT_METHOD
EQ
merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM
EQ TEXT_STRING
{ Lex->create_info.data_file_name= $4.str; }
| INDEX DIRECTORY_SYM
EQ TEXT_STRING
{ Lex->create_info.index_file_name= $4.str; };
| INSERT_METHOD
o_eq
merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM
o_eq TEXT_STRING
{ Lex->create_info.data_file_name= $4.str; }
| INDEX DIRECTORY_SYM
o_eq TEXT_STRING
{ Lex->create_info.index_file_name= $4.str; };
table_types:
ISAM_SYM { $$= DB_TYPE_ISAM; }
...
...
@@ -1140,7 +1149,15 @@ attribute:
| COMMENT_SYM text_literal { Lex->comment= $2; };
charset_name:
ident
BINARY
{
if (!($$=get_charset_by_name("binary",MYF(0))))
{
net_printf(current_thd,ER_UNKNOWN_CHARACTER_SET,"binary");
YYABORT;
}
}
| ident
{
if (!($$=get_charset_by_name($1.str,MYF(0))))
{
...
...
@@ -1368,7 +1385,7 @@ alter_list_item:
lex->select->db=$3->db.str;
lex->name= $3->table.str;
}
| create_table_options { Lex->simple_alter=0; }
| create_table_options
_space_separated
{ Lex->simple_alter=0; }
| order_clause { Lex->simple_alter=0; };
opt_column:
...
...
strings/Makefile.am
View file @
3d32b14d
...
...
@@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a
# Exact one of ASSEMBLER_X
if
ASSEMBLER_x86
ASRCS
=
strings-x86.s longlong2str-x86.s
CSRCS
=
bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c
CSRCS
=
bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c
ctype-bin.c
else
if
ASSEMBLER_sparc
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
ASRCS
=
bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s strxmov-sparc.s
CSRCS
=
strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c
CSRCS
=
strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c
ctype-bin.c
else
#no assembler
ASRCS
=
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
CSRCS
=
strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c
CSRCS
=
strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c
ctype-bin.c
endif
endif
...
...
strings/ctype-bin.c
0 → 100644
View file @
3d32b14d
/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* This file is for binary pseudo charset, created by bar@mysql.com */
#include <my_global.h>
#include "m_string.h"
#include "m_ctype.h"
static
int
my_strnncoll_binary
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
uchar
*
s
,
uint
slen
,
const
uchar
*
t
,
uint
tlen
)
{
int
len
=
(
slen
>
tlen
)
?
tlen
:
slen
;
return
memcmp
(
s
,
t
,
len
);
}
static
void
my_caseup_str_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
char
*
str
__attribute__
((
unused
)))
{
}
static
void
my_casedn_str_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
char
*
str
__attribute__
((
unused
)))
{
}
static
void
my_caseup_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
char
*
str
__attribute__
((
unused
)),
uint
length
__attribute__
((
unused
)))
{
}
static
void
my_casedn_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
char
*
str
__attribute__
((
unused
)),
uint
length
__attribute__
((
unused
)))
{
}
static
void
my_tosort_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
char
*
str
__attribute__
((
unused
)),
uint
length
__attribute__
((
unused
)))
{
}
static
int
my_strcasecmp_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
char
*
s
,
const
char
*
t
)
{
return
strcmp
(
s
,
t
);
}
static
int
my_strncasecmp_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
char
*
s
,
const
char
*
t
,
uint
len
)
{
return
memcmp
(
s
,
t
,
len
);
}
static
int
my_mb_wc_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
my_wc_t
*
wc
,
const
unsigned
char
*
str
,
const
unsigned
char
*
end
__attribute__
((
unused
)))
{
*
wc
=
str
[
0
];
return
1
;
}
static
int
my_wc_mb_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
my_wc_t
wc
,
unsigned
char
*
s
,
unsigned
char
*
e
__attribute__
((
unused
)))
{
if
(
wc
<
256
)
{
s
[
0
]
=
wc
;
return
1
;
}
return
MY_CS_ILUNI
;
}
#ifndef NEW_HASH_FUNCTION
/* Calc hashvalue for a key, case indepenently */
static
uint
my_hash_caseup_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
byte
*
key
,
uint
length
)
{
register
uint
nr
=
1
,
nr2
=
4
;
while
(
length
--
)
{
nr
^=
(((
nr
&
63
)
+
nr2
)
*
((
uint
)
(
uchar
)
*
key
++
))
+
(
nr
<<
8
);
nr2
+=
3
;
}
return
((
uint
)
nr
);
}
#else
static
uint
my_hash_caseup_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
byte
*
key
,
uint
len
)
{
const
byte
*
end
=
key
+
len
;
uint
hash
;
for
(
hash
=
0
;
key
<
end
;
key
++
)
{
hash
*=
16777619
;
hash
^=
(
uint
)
(
uchar
)
*
key
;
}
return
(
hash
);
}
#endif
void
my_hash_sort_bin
(
CHARSET_INFO
*
cs
__attribute__
((
unused
)),
const
uchar
*
key
,
uint
len
,
ulong
*
nr1
,
ulong
*
nr2
)
{
const
uchar
*
pos
=
key
;
key
+=
len
;
for
(;
pos
<
(
uchar
*
)
key
;
pos
++
)
{
nr1
[
0
]
^=
(
ulong
)
((((
uint
)
nr1
[
0
]
&
63
)
+
nr2
[
0
])
*
((
uint
)
*
pos
))
+
(
nr1
[
0
]
<<
8
);
nr2
[
0
]
+=
3
;
}
}
static
CHARSET_INFO
my_charset_bin_st
=
{
63
,
/* number */
MY_CS_COMPILED
|
MY_CS_BINSORT
,
/* state */
"binary"
,
/* name */
""
,
/* comment */
NULL
,
/* ctype */
NULL
,
/* to_lower */
NULL
,
/* to_upper */
NULL
,
/* sort_order */
NULL
,
/* tab_to_uni */
NULL
,
/* tab_from_uni */
0
,
/* strxfrm_multiply */
my_strnncoll_binary
,
/* strnncoll */
NULL
,
/* strxnfrm */
NULL
,
/* like_rabge */
0
,
/* mbmaxlen */
NULL
,
/* ismbchar */
NULL
,
/* ismbhead */
NULL
,
/* mbcharlen */
my_mb_wc_bin
,
/* mb_wc */
my_wc_mb_bin
,
/* wc_mb */
my_caseup_str_bin
,
/* caseup_str */
my_casedn_str_bin
,
/* casedn_str */
my_caseup_bin
,
/* caseup */
my_casedn_bin
,
/* casedn */
my_tosort_bin
,
/* tosort */
my_strcasecmp_bin
,
/* strcasecmp */
my_strncasecmp_bin
,
/* strncasecmp */
my_hash_caseup_bin
,
/* hash_caseup */
my_hash_sort_bin
,
/* hash_sort */
255
/* max_sort_char */
};
CHARSET_INFO
*
my_charset_bin
=
&
my_charset_bin_st
;
strings/ctype.c
View file @
3d32b14d
...
...
@@ -3676,6 +3676,8 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
{
CHARSET_INFO
*
cs
;
MY_ADD_CHARSET
(
my_charset_bin
);
#ifdef HAVE_CHARSET_big5
MY_ADD_CHARSET
(
&
my_charset_big5
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment