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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a6597812
Commit
a6597812
authored
21 years ago
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New fields in CHARSET_INFO structure to optimize searching for
binary and primary collations in the future
parent
64d48cd6
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
116 additions
and
56 deletions
+116
-56
include/m_ctype.h
include/m_ctype.h
+2
-0
mysys/charset.c
mysys/charset.c
+10
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+13
-15
strings/ctype-big5.c
strings/ctype-big5.c
+1
-1
strings/ctype-bin.c
strings/ctype-bin.c
+1
-1
strings/ctype-czech.c
strings/ctype-czech.c
+1
-1
strings/ctype-euc_kr.c
strings/ctype-euc_kr.c
+1
-1
strings/ctype-extra.c
strings/ctype-extra.c
+67
-27
strings/ctype-gb2312.c
strings/ctype-gb2312.c
+1
-1
strings/ctype-gbk.c
strings/ctype-gbk.c
+1
-1
strings/ctype-latin1.c
strings/ctype-latin1.c
+1
-1
strings/ctype-latin1_de.c
strings/ctype-latin1_de.c
+1
-1
strings/ctype-sjis.c
strings/ctype-sjis.c
+1
-1
strings/ctype-tis620.c
strings/ctype-tis620.c
+1
-1
strings/ctype-ujis.c
strings/ctype-ujis.c
+1
-1
strings/ctype-utf8.c
strings/ctype-utf8.c
+2
-2
strings/ctype-win1250ch.c
strings/ctype-win1250ch.c
+1
-1
strings/ctype.c
strings/ctype.c
+10
-0
No files found.
include/m_ctype.h
View file @
a6597812
...
...
@@ -77,6 +77,8 @@ typedef struct my_uni_idx_st
typedef
struct
charset_info_st
{
uint
number
;
uint
primary_number
;
uint
binary_number
;
uint
state
;
const
char
*
csname
;
const
char
*
name
;
...
...
This diff is collapsed.
Click to expand it.
mysys/charset.c
View file @
a6597812
...
...
@@ -257,7 +257,13 @@ static int add_collation(CHARSET_INFO *cs)
return
MY_XML_ERROR
;
bzero
((
void
*
)
all_charsets
[
cs
->
number
],
sizeof
(
CHARSET_INFO
));
}
if
(
cs
->
primary_number
==
cs
->
number
)
cs
->
state
|=
MY_CS_PRIMARY
;
if
(
cs
->
primary_number
==
cs
->
number
)
cs
->
state
|=
MY_CS_BINSORT
;
if
(
!
(
all_charsets
[
cs
->
number
]
->
state
&
MY_CS_COMPILED
))
{
simple_cs_copy_data
(
all_charsets
[
cs
->
number
],
cs
);
...
...
@@ -267,6 +273,10 @@ static int add_collation(CHARSET_INFO *cs)
all_charsets
[
cs
->
number
]
->
state
|=
MY_CS_LOADED
;
}
}
else
{
all_charsets
[
cs
->
number
]
->
state
|=
cs
->
state
;
}
cs
->
number
=
0
;
cs
->
name
=
NULL
;
cs
->
state
=
0
;
...
...
This diff is collapsed.
Click to expand it.
sql/sql_yacc.yy
View file @
a6597812
...
...
@@ -674,7 +674,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
handler_rkey_function handler_read_or_scan
single_multi table_wild_list table_wild_one opt_wild
union_clause union_list union_option
precision subselect_start opt_and
precision subselect_start opt_and
charset
subselect_end select_var_list select_var_list_init help opt_len
END_OF_INPUT
...
...
@@ -927,10 +927,9 @@ create_database_options:
create_database_option:
COLLATE_SYM collation_name_or_default
{ Lex->create_info.table_charset=$2; }
| opt_default CHAR_SYM SET charset_name_or_default
{ Lex->create_info.table_charset=$4; }
| opt_default CHARSET charset_name_or_default
{ Lex->create_info.table_charset=$3; };
| opt_default charset charset_name_or_default
{ Lex->create_info.table_charset=$3; }
;
opt_table_options:
/* empty */ { $$= 0; }
...
...
@@ -989,16 +988,11 @@ create_table_option:
table_list->next=0;
lex->create_info.used_fields|= HA_CREATE_USED_UNION;
}
| opt_default
CHARSET
opt_equal charset_name_or_default
| opt_default
charset
opt_equal charset_name_or_default
{
Lex->create_info.table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
}
| opt_default CHAR_SYM SET opt_equal charset_name_or_default
{
Lex->create_info.table_charset= $5;
Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
}
| COLLATE_SYM opt_equal collation_name_or_default
{
Lex->create_info.table_charset= $3;
...
...
@@ -1301,6 +1295,10 @@ attribute:
}
;
charset:
CHAR_SYM SET {}
| CHARSET {}
;
charset_name:
ident_or_text
...
...
@@ -1352,7 +1350,7 @@ opt_binary:
YYABORT;
}
}
|
CHAR_SYM SET charset_name { Lex->charset=$3
; } ;
|
charset charset_name { Lex->charset=$2
; } ;
opt_primary:
/* empty */
...
...
@@ -3543,7 +3541,7 @@ show_param:
thd->lex.sql_command= SQLCOM_SHOW_VARIABLES;
thd->lex.option_type= (enum_var_type) $1;
}
|
CHAR_SYM SET
wild
|
charset
wild
{ Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
...
...
@@ -4215,12 +4213,12 @@ option_value:
find_sys_var("tx_isolation"),
new Item_int((int32) $4)));
}
|
CHAR_SYM SET
opt_equal set_expr_or_default
|
charset
opt_equal set_expr_or_default
{
LEX *lex=Lex;
lex->var_list.push_back(new set_var(lex->option_type,
find_sys_var("convert_character_set"),
$
4
));
$
3
));
}
| NAMES_SYM charset_name_or_default opt_collate
{
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-big5.c
View file @
a6597812
...
...
@@ -6233,7 +6233,7 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_big5
=
{
1
,
/* number */
1
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
|
MY_CS_STRNXFRM
,
/* state */
"big5"
,
/* cs name */
"big5"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-bin.c
View file @
a6597812
...
...
@@ -295,7 +295,7 @@ static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_bin
=
{
63
,
/* number */
63
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_BINSORT
|
MY_CS_PRIMARY
,
/* state */
"binary"
,
/* cs name */
"binary"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-czech.c
View file @
a6597812
...
...
@@ -607,7 +607,7 @@ int my_strnncollsp_czech(CHARSET_INFO * cs,
CHARSET_INFO
my_charset_czech
=
{
2
,
/* number */
2
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_STRNXFRM
,
/* state */
"latin2"
,
/* cs name */
"czech"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-euc_kr.c
View file @
a6597812
...
...
@@ -8641,7 +8641,7 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_euc_kr
=
{
19
,
/* number */
19
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
,
/* state */
"euckr"
,
/* cs name */
"euckr"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-extra.c
View file @
a6597812
This diff is collapsed.
Click to expand it.
strings/ctype-gb2312.c
View file @
a6597812
...
...
@@ -5691,7 +5691,7 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_gb2312
=
{
24
,
/* number */
24
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
,
/* state */
"gb2312"
,
/* cs name */
"gb2312"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-gbk.c
View file @
a6597812
...
...
@@ -9888,7 +9888,7 @@ my_mb_wc_gbk(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_gbk
=
{
28
,
/* number */
28
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
|
MY_CS_STRNXFRM
,
/* state */
"gbk"
,
/* cs name */
"gbk"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-latin1.c
View file @
a6597812
...
...
@@ -177,7 +177,7 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_latin1
=
{
8
,
/* number */
8
,
0
,
0
,
/* number */
MY_CS_COMPILED
,
/* state */
"latin1"
,
/* cs name */
"latin1"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-latin1_de.c
View file @
a6597812
...
...
@@ -348,7 +348,7 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_latin1_de
=
{
31
,
/* number */
31
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_STRNXFRM
,
/* state */
"latin1"
,
/* cs name */
"latin1_de"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-sjis.c
View file @
a6597812
...
...
@@ -4475,7 +4475,7 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_sjis
=
{
13
,
/* number */
13
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
|
MY_CS_STRNXFRM
,
/* state */
"sjis"
,
/* cs name */
"sjis"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-tis620.c
View file @
a6597812
...
...
@@ -698,7 +698,7 @@ void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length)
CHARSET_INFO
my_charset_tis620
=
{
18
,
/* number */
18
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
|
MY_CS_STRNXFRM
,
/* state */
"tis620"
,
/* cs name */
"tis620"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-ujis.c
View file @
a6597812
...
...
@@ -8432,7 +8432,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
CHARSET_INFO
my_charset_ujis
=
{
12
,
/* number */
12
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
,
/* state */
"ujis"
,
/* cs name */
"ujis"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-utf8.c
View file @
a6597812
...
...
@@ -1977,7 +1977,7 @@ static int my_mbcharlen_utf8(CHARSET_INFO *cs __attribute__((unused)) , uint c)
CHARSET_INFO
my_charset_utf8
=
{
33
,
/* number */
33
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
|
MY_CS_STRNXFRM
,
/* state */
"utf8"
,
/* cs name */
"utf8"
,
/* name */
...
...
@@ -3084,7 +3084,7 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_ucs2
=
{
35
,
/* number */
35
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_PRIMARY
|
MY_CS_STRNXFRM
,
/* state */
"ucs2"
,
/* cs name */
"ucs2"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype-win1250ch.c
View file @
a6597812
...
...
@@ -642,7 +642,7 @@ static my_bool my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO
my_charset_win1250ch
=
{
34
,
/* number */
34
,
0
,
0
,
/* number */
MY_CS_COMPILED
|
MY_CS_STRNXFRM
,
/* state */
"cp1250"
,
/* cs name */
"cp1250_czech"
,
/* name */
...
...
This diff is collapsed.
Click to expand it.
strings/ctype.c
View file @
a6597812
...
...
@@ -52,6 +52,8 @@ struct my_cs_file_section_st
#define _CS_UNIMAP 12
#define _CS_COLLMAP 13
#define _CS_CTYPEMAP 14
#define _CS_PRIMARY_ID 15
#define _CS_BINARY_ID 16
static
struct
my_cs_file_section_st
sec
[]
=
{
...
...
@@ -62,6 +64,8 @@ static struct my_cs_file_section_st sec[] =
{
_CS_MISC
,
"charsets.max-id"
},
{
_CS_MISC
,
"charsets.description"
},
{
_CS_CHARSET
,
"charsets.charset"
},
{
_CS_PRIMARY_ID
,
"charsets.charset.primary-id"
},
{
_CS_BINARY_ID
,
"charsets.charset.binary-id"
},
{
_CS_CSNAME
,
"charsets.charset.name"
},
{
_CS_FAMILY
,
"charsets.charset.family"
},
{
_CS_MISC
,
"charsets.charset.alias"
},
...
...
@@ -192,6 +196,12 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, uint len)
case
_CS_ID
:
i
->
cs
.
number
=
strtol
(
attr
,(
char
**
)
NULL
,
10
);
break
;
case
_CS_BINARY_ID
:
i
->
cs
.
binary_number
=
strtol
(
attr
,(
char
**
)
NULL
,
10
);
break
;
case
_CS_PRIMARY_ID
:
i
->
cs
.
primary_number
=
strtol
(
attr
,(
char
**
)
NULL
,
10
);
break
;
case
_CS_COLNAME
:
i
->
cs
.
name
=
mstr
(
i
->
name
,
attr
,
len
,
MY_CS_NAME_SIZE
-
1
);
break
;
...
...
This diff is collapsed.
Click to expand it.
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