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
72830a77
Commit
72830a77
authored
Mar 25, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
parents
c9458e16
c8bdced2
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
618 additions
and
495 deletions
+618
-495
include/my_sys.h
include/my_sys.h
+3
-3
myisam/mi_test2.c
myisam/mi_test2.c
+5
-5
myisam/sp_test.c
myisam/sp_test.c
+1
-1
mysys/mf_keycache.c
mysys/mf_keycache.c
+494
-443
sql/item_strfunc.cc
sql/item_strfunc.cc
+11
-6
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+7
-7
sql/share/charsets/Index.xml
sql/share/charsets/Index.xml
+12
-3
sql/share/charsets/latin7.xml
sql/share/charsets/latin7.xml
+3
-3
sql/sql_lex.h
sql/sql_lex.h
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+3
-0
sql/sql_show.cc
sql/sql_show.cc
+71
-19
sql/sql_string.cc
sql/sql_string.cc
+1
-1
sql/sql_test.cc
sql/sql_test.cc
+2
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-0
strings/ctype-extra.c
strings/ctype-extra.c
+1
-1
No files found.
include/my_sys.h
View file @
72830a77
...
@@ -219,9 +219,9 @@ extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
...
@@ -219,9 +219,9 @@ extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
/* statistics */
/* statistics */
extern
ulong
_my_cache_w_requests
,
_my_cache_write
,
_
my_cache_r_requests
,
extern
ulong
my_cache_w_requests
,
my_cache_write
,
my_cache_r_requests
,
_
my_cache_read
;
my_cache_read
;
extern
ulong
_my_blocks_used
,
_
my_blocks_changed
;
extern
ulong
my_blocks_used
,
my_blocks_changed
;
extern
uint
key_cache_block_size
;
extern
uint
key_cache_block_size
;
extern
ulong
my_file_opened
,
my_stream_opened
,
my_tmp_file_created
;
extern
ulong
my_file_opened
,
my_stream_opened
,
my_tmp_file_created
;
extern
my_bool
key_cache_inited
,
my_init_done
;
extern
my_bool
key_cache_inited
,
my_init_done
;
...
...
myisam/mi_test2.c
View file @
72830a77
...
@@ -646,13 +646,13 @@ int main(int argc, char *argv[])
...
@@ -646,13 +646,13 @@ int main(int argc, char *argv[])
(
long
)
range_records
>
(
long
)
records
*
14
/
10
+
2
)
(
long
)
range_records
>
(
long
)
records
*
14
/
10
+
2
)
{
{
printf
(
"mi_records_range for key: %d returned %ld; Should be about %ld
\n
"
,
printf
(
"mi_records_range for key: %d returned %ld; Should be about %ld
\n
"
,
i
,
range_records
,
records
);
i
,
(
long
)
range_records
,
(
long
)
records
);
goto
end
;
goto
end
;
}
}
if
(
verbose
&&
records
)
if
(
verbose
&&
records
)
{
{
printf
(
"mi_records_range returned %ld; Exact is %ld (diff: %4.2g %%)
\n
"
,
printf
(
"mi_records_range returned %ld; Exact is %ld (diff: %4.2g %%)
\n
"
,
range_records
,
records
,
(
long
)
range_records
,
(
long
)
records
,
labs
((
long
)
range_records
-
(
long
)
records
)
*
100
.
0
/
records
);
labs
((
long
)
range_records
-
(
long
)
records
)
*
100
.
0
/
records
);
}
}
...
@@ -667,7 +667,7 @@ int main(int argc, char *argv[])
...
@@ -667,7 +667,7 @@ int main(int argc, char *argv[])
{
{
puts
(
"Wrong info from mi_info"
);
puts
(
"Wrong info from mi_info"
);
printf
(
"Got: records: %ld delete: %ld i_keys: %d
\n
"
,
printf
(
"Got: records: %ld delete: %ld i_keys: %d
\n
"
,
info
.
records
,
info
.
deleted
,
info
.
keys
);
(
long
)
info
.
records
,
(
long
)
info
.
deleted
,
info
.
keys
);
}
}
if
(
verbose
)
if
(
verbose
)
{
{
...
@@ -822,8 +822,8 @@ w_requests: %10lu\n\
...
@@ -822,8 +822,8 @@ w_requests: %10lu\n\
writes: %10lu
\n
\
writes: %10lu
\n
\
r_requests: %10lu
\n
\
r_requests: %10lu
\n
\
reads: %10lu
\n
"
,
reads: %10lu
\n
"
,
_my_blocks_used
,
_my_cache_w_requests
,
_
my_cache_write
,
my_blocks_used
,
my_cache_w_requests
,
my_cache_write
,
_my_cache_r_requests
,
_
my_cache_read
);
my_cache_r_requests
,
my_cache_read
);
}
}
end_key_cache
();
end_key_cache
();
if
(
blob_buffer
)
if
(
blob_buffer
)
...
...
myisam/sp_test.c
View file @
72830a77
...
@@ -272,7 +272,7 @@ int run_test(const char *filename)
...
@@ -272,7 +272,7 @@ int run_test(const char *filename)
create_key
(
key
,
nrecords
*
upd
);
create_key
(
key
,
nrecords
*
upd
);
print_key
(
key
,
" INTERSECT
\n
"
);
print_key
(
key
,
" INTERSECT
\n
"
);
hrows
=
mi_records_in_range
(
file
,
0
,
key
,
0
,
HA_READ_MBR_INTERSECT
,
record
+
1
,
0
,
0
);
hrows
=
mi_records_in_range
(
file
,
0
,
key
,
0
,
HA_READ_MBR_INTERSECT
,
record
+
1
,
0
,
0
);
printf
(
" %ld rows
\n
"
,
hrows
);
printf
(
" %ld rows
\n
"
,
(
long
)
hrows
);
if
(
mi_close
(
file
))
goto
err
;
if
(
mi_close
(
file
))
goto
err
;
...
...
mysys/mf_keycache.c
View file @
72830a77
This diff is collapsed.
Click to expand it.
sql/item_strfunc.cc
View file @
72830a77
...
@@ -235,8 +235,6 @@ String *Item_func_concat::val_str(String *str)
...
@@ -235,8 +235,6 @@ String *Item_func_concat::val_str(String *str)
use_as_buff
=
&
tmp_value
;
use_as_buff
=
&
tmp_value
;
for
(
i
=
1
;
i
<
arg_count
;
i
++
)
for
(
i
=
1
;
i
<
arg_count
;
i
++
)
{
{
if
(
args
[
i
]
->
binary
())
set_charset
(
&
my_charset_bin
);
if
(
res
->
length
()
==
0
)
if
(
res
->
length
()
==
0
)
{
{
if
(
!
(
res
=
args
[
i
]
->
val_str
(
str
)))
if
(
!
(
res
=
args
[
i
]
->
val_str
(
str
)))
...
@@ -265,7 +263,6 @@ String *Item_func_concat::val_str(String *str)
...
@@ -265,7 +263,6 @@ String *Item_func_concat::val_str(String *str)
str
->
append
(
*
res2
);
str
->
append
(
*
res2
);
}
}
res
=
str
;
res
=
str
;
res
->
set_charset
(
charset
());
}
}
else
if
(
res
==
&
tmp_value
)
else
if
(
res
==
&
tmp_value
)
{
{
...
@@ -277,7 +274,6 @@ String *Item_func_concat::val_str(String *str)
...
@@ -277,7 +274,6 @@ String *Item_func_concat::val_str(String *str)
if
(
tmp_value
.
replace
(
0
,
0
,
*
res
))
if
(
tmp_value
.
replace
(
0
,
0
,
*
res
))
goto
null
;
goto
null
;
res
=
&
tmp_value
;
res
=
&
tmp_value
;
res
->
set_charset
(
charset
());
use_as_buff
=
str
;
// Put next arg here
use_as_buff
=
str
;
// Put next arg here
}
}
else
if
(
tmp_value
.
is_alloced
()
&&
res2
->
ptr
()
>=
tmp_value
.
ptr
()
&&
else
if
(
tmp_value
.
is_alloced
()
&&
res2
->
ptr
()
>=
tmp_value
.
ptr
()
&&
...
@@ -296,7 +292,6 @@ String *Item_func_concat::val_str(String *str)
...
@@ -296,7 +292,6 @@ String *Item_func_concat::val_str(String *str)
*
res
))
*
res
))
goto
null
;
goto
null
;
res
=
&
tmp_value
;
res
=
&
tmp_value
;
res
->
set_charset
(
charset
());
use_as_buff
=
str
;
// Put next arg here
use_as_buff
=
str
;
// Put next arg here
}
}
else
else
...
@@ -306,11 +301,11 @@ String *Item_func_concat::val_str(String *str)
...
@@ -306,11 +301,11 @@ String *Item_func_concat::val_str(String *str)
tmp_value
.
append
(
*
res2
))
tmp_value
.
append
(
*
res2
))
goto
null
;
goto
null
;
res
=
&
tmp_value
;
res
=
&
tmp_value
;
res
->
set_charset
(
charset
());
use_as_buff
=
str
;
use_as_buff
=
str
;
}
}
}
}
}
}
res
->
set_charset
(
charset
());
return
res
;
return
res
;
null:
null:
...
@@ -602,6 +597,7 @@ String *Item_func_concat_ws::val_str(String *str)
...
@@ -602,6 +597,7 @@ String *Item_func_concat_ws::val_str(String *str)
use_as_buff
=
str
;
use_as_buff
=
str
;
}
}
}
}
res
->
set_charset
(
charset
());
return
res
;
return
res
;
null:
null:
...
@@ -626,9 +622,18 @@ void Item_func_concat_ws::split_sum_func(Item **ref_pointer_array,
...
@@ -626,9 +622,18 @@ void Item_func_concat_ws::split_sum_func(Item **ref_pointer_array,
void
Item_func_concat_ws
::
fix_length_and_dec
()
void
Item_func_concat_ws
::
fix_length_and_dec
()
{
{
set_charset
(
separator
->
charset
(),
separator
->
coercibility
);
max_length
=
separator
->
max_length
*
(
arg_count
-
1
);
max_length
=
separator
->
max_length
*
(
arg_count
-
1
);
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
for
(
uint
i
=
0
;
i
<
arg_count
;
i
++
)
{
max_length
+=
args
[
i
]
->
max_length
;
max_length
+=
args
[
i
]
->
max_length
;
if
(
set_charset
(
charset
(),
coercibility
,
args
[
i
]
->
charset
(),
args
[
i
]
->
coercibility
))
{
my_error
(
ER_WRONG_ARGUMENTS
,
MYF
(
0
),
func_name
());
break
;
}
}
if
(
max_length
>
MAX_BLOB_WIDTH
)
if
(
max_length
>
MAX_BLOB_WIDTH
)
{
{
max_length
=
MAX_BLOB_WIDTH
;
max_length
=
MAX_BLOB_WIDTH
;
...
...
sql/mysql_priv.h
View file @
72830a77
...
@@ -528,6 +528,7 @@ int mysqld_show_variables(THD *thd,const char *wild);
...
@@ -528,6 +528,7 @@ int mysqld_show_variables(THD *thd,const char *wild);
int
mysqld_show
(
THD
*
thd
,
const
char
*
wild
,
show_var_st
*
variables
,
int
mysqld_show
(
THD
*
thd
,
const
char
*
wild
,
show_var_st
*
variables
,
enum
enum_var_type
value_type
);
enum
enum_var_type
value_type
);
int
mysqld_show_charsets
(
THD
*
thd
,
const
char
*
wild
);
int
mysqld_show_charsets
(
THD
*
thd
,
const
char
*
wild
);
int
mysqld_show_collations
(
THD
*
thd
,
const
char
*
wild
);
int
mysqld_show_table_types
(
THD
*
thd
);
int
mysqld_show_table_types
(
THD
*
thd
);
int
mysqld_show_privileges
(
THD
*
thd
);
int
mysqld_show_privileges
(
THD
*
thd
);
int
mysqld_show_column_types
(
THD
*
thd
);
int
mysqld_show_column_types
(
THD
*
thd
);
...
...
sql/mysqld.cc
View file @
72830a77
...
@@ -4415,13 +4415,13 @@ struct show_var_st status_vars[]= {
...
@@ -4415,13 +4415,13 @@ struct show_var_st status_vars[]= {
{
"Handler_rollback"
,
(
char
*
)
&
ha_rollback_count
,
SHOW_LONG
},
{
"Handler_rollback"
,
(
char
*
)
&
ha_rollback_count
,
SHOW_LONG
},
{
"Handler_update"
,
(
char
*
)
&
ha_update_count
,
SHOW_LONG
},
{
"Handler_update"
,
(
char
*
)
&
ha_update_count
,
SHOW_LONG
},
{
"Handler_write"
,
(
char
*
)
&
ha_write_count
,
SHOW_LONG
},
{
"Handler_write"
,
(
char
*
)
&
ha_write_count
,
SHOW_LONG
},
{
"Key_blocks_used"
,
(
char
*
)
&
_
my_blocks_used
,
SHOW_LONG_CONST
},
{
"Key_blocks_used"
,
(
char
*
)
&
my_blocks_used
,
SHOW_LONG_CONST
},
{
"Key_read_requests"
,
(
char
*
)
&
_
my_cache_r_requests
,
SHOW_LONG
},
{
"Key_read_requests"
,
(
char
*
)
&
my_cache_r_requests
,
SHOW_LONG
},
{
"Key_reads"
,
(
char
*
)
&
_
my_cache_read
,
SHOW_LONG
},
{
"Key_reads"
,
(
char
*
)
&
my_cache_read
,
SHOW_LONG
},
{
"Key_write_requests"
,
(
char
*
)
&
_
my_cache_w_requests
,
SHOW_LONG
},
{
"Key_write_requests"
,
(
char
*
)
&
my_cache_w_requests
,
SHOW_LONG
},
{
"Key_writes"
,
(
char
*
)
&
_
my_cache_write
,
SHOW_LONG
},
{
"Key_writes"
,
(
char
*
)
&
my_cache_write
,
SHOW_LONG
},
{
"Max_used_connections"
,
(
char
*
)
&
max_used_connections
,
SHOW_LONG
},
{
"Max_used_connections"
,
(
char
*
)
&
max_used_connections
,
SHOW_LONG
},
{
"Not_flushed_key_blocks"
,
(
char
*
)
&
_
my_blocks_changed
,
SHOW_LONG_CONST
},
{
"Not_flushed_key_blocks"
,
(
char
*
)
&
my_blocks_changed
,
SHOW_LONG_CONST
},
{
"Not_flushed_delayed_rows"
,
(
char
*
)
&
delayed_rows_in_use
,
SHOW_LONG_CONST
},
{
"Not_flushed_delayed_rows"
,
(
char
*
)
&
delayed_rows_in_use
,
SHOW_LONG_CONST
},
{
"Open_tables"
,
(
char
*
)
0
,
SHOW_OPENTABLES
},
{
"Open_tables"
,
(
char
*
)
0
,
SHOW_OPENTABLES
},
{
"Open_files"
,
(
char
*
)
&
my_file_opened
,
SHOW_LONG_CONST
},
{
"Open_files"
,
(
char
*
)
&
my_file_opened
,
SHOW_LONG_CONST
},
...
...
sql/share/charsets/Index.xml
View file @
72830a77
...
@@ -240,9 +240,18 @@ To make maintaining easier please:
...
@@ -240,9 +240,18 @@ To make maintaining easier please:
<alias>
BalticRim
</alias>
<alias>
BalticRim
</alias>
<alias>
iso-8859-13
</alias>
<alias>
iso-8859-13
</alias>
<alias>
l7
</alias>
<alias>
l7
</alias>
<collation
name=
"estonia"
id=
"20"
order=
"Estonian"
flag=
"primary"
/>
<collation
name=
"latin7_estonian_ci_as"
id=
"20"
>
<collation
name=
"latvian"
id=
"41"
order=
"Latvian"
/>
<order>
Estonian
</order>
<collation
name=
"latvian1"
id=
"42"
order=
"Latvian"
/>
<flag>
primary
</flag>
</collation>
<collation
name=
"latin7_ci_as"
id=
"41"
>
<order>
Latvian
</order>
<order>
Lithuanian
</order>
</collation>
<collation
name=
"latin7_cs_as"
id=
"42"
>
<order>
Latvian
</order>
<order>
Lithuanian
</order>
</collation>
<collation
name=
"latin7_bin"
id=
"79"
order=
"Binary"
flag=
"binary"
/>
<collation
name=
"latin7_bin"
id=
"79"
order=
"Binary"
flag=
"binary"
/>
</charset>
</charset>
...
...
sql/share/charsets/latin7.xml
View file @
72830a77
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
</unicode>
</unicode>
<collation
name=
"
estonia
"
>
<collation
name=
"
latin7_estonian_ci_as
"
>
<map>
<map>
00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B
00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B
0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
</collation>
</collation>
<collation
name=
"lat
vian
"
>
<collation
name=
"lat
in7_ci_as
"
>
<!-- Created for case-sensitive record search -->
<!-- Created for case-sensitive record search -->
<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
<map>
<map>
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
</collation>
</collation>
<collation
name=
"lat
vian1
"
>
<collation
name=
"lat
in7_cs_as
"
>
<!-- Created for case-insensitive record search -->
<!-- Created for case-insensitive record search -->
<!-- Created by Andis & Rihards -->
<!-- Created by Andis & Rihards -->
<map>
<map>
...
...
sql/sql_lex.h
View file @
72830a77
...
@@ -52,7 +52,7 @@ enum enum_sql_command {
...
@@ -52,7 +52,7 @@ enum enum_sql_command {
SQLCOM_SHOW_INNODB_STATUS
,
SQLCOM_SHOW_INNODB_STATUS
,
SQLCOM_SHOW_PROCESSLIST
,
SQLCOM_SHOW_MASTER_STAT
,
SQLCOM_SHOW_SLAVE_STAT
,
SQLCOM_SHOW_PROCESSLIST
,
SQLCOM_SHOW_MASTER_STAT
,
SQLCOM_SHOW_SLAVE_STAT
,
SQLCOM_SHOW_GRANTS
,
SQLCOM_SHOW_CREATE
,
SQLCOM_SHOW_CHARSETS
,
SQLCOM_SHOW_GRANTS
,
SQLCOM_SHOW_CREATE
,
SQLCOM_SHOW_CHARSETS
,
SQLCOM_SHOW_CREATE_DB
,
SQLCOM_SHOW_C
OLLATIONS
,
SQLCOM_SHOW_C
REATE_DB
,
SQLCOM_LOAD
,
SQLCOM_SET_OPTION
,
SQLCOM_LOCK_TABLES
,
SQLCOM_UNLOCK_TABLES
,
SQLCOM_LOAD
,
SQLCOM_SET_OPTION
,
SQLCOM_LOCK_TABLES
,
SQLCOM_UNLOCK_TABLES
,
SQLCOM_GRANT
,
SQLCOM_GRANT
,
...
...
sql/sql_parse.cc
View file @
72830a77
...
@@ -2566,6 +2566,9 @@ mysql_execute_command(THD *thd)
...
@@ -2566,6 +2566,9 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_CHARSETS
:
case
SQLCOM_SHOW_CHARSETS
:
res
=
mysqld_show_charsets
(
thd
,(
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
));
res
=
mysqld_show_charsets
(
thd
,(
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
));
break
;
break
;
case
SQLCOM_SHOW_COLLATIONS
:
res
=
mysqld_show_collations
(
thd
,(
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
));
break
;
case
SQLCOM_SHOW_FIELDS
:
case
SQLCOM_SHOW_FIELDS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
...
...
sql/sql_show.cc
View file @
72830a77
...
@@ -1414,7 +1414,22 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
...
@@ -1414,7 +1414,22 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
Status functions
Status functions
*****************************************************************************/
*****************************************************************************/
int
mysqld_show_charsets
(
THD
*
thd
,
const
char
*
wild
)
static
bool
write_collation
(
Protocol
*
protocol
,
CHARSET_INFO
*
cs
)
{
char
flags
[
4
];
protocol
->
prepare_for_resend
();
protocol
->
store
(
cs
->
csname
,
system_charset_info
);
protocol
->
store
(
cs
->
name
,
system_charset_info
);
protocol
->
store_short
((
longlong
)
cs
->
number
);
flags
[
0
]
=
'\0'
;
if
(
cs
->
state
&
MY_CS_PRIMARY
)
strcat
(
flags
,
"def"
);
protocol
->
store
(
flags
,
system_charset_info
);
protocol
->
store_short
((
longlong
)
cs
->
strxfrm_multiply
);
return
protocol
->
write
();
}
int
mysqld_show_collations
(
THD
*
thd
,
const
char
*
wild
)
{
{
char
buff
[
8192
];
char
buff
[
8192
];
String
packet2
(
buff
,
sizeof
(
buff
),
thd
->
charset
());
String
packet2
(
buff
,
sizeof
(
buff
),
thd
->
charset
());
...
@@ -1425,32 +1440,69 @@ int mysqld_show_charsets(THD *thd, const char *wild)
...
@@ -1425,32 +1440,69 @@ int mysqld_show_charsets(THD *thd, const char *wild)
DBUG_ENTER
(
"mysqld_show_charsets"
);
DBUG_ENTER
(
"mysqld_show_charsets"
);
field_list
.
push_back
(
new
Item_empty_string
(
"C
S_Name
"
,
30
));
field_list
.
push_back
(
new
Item_empty_string
(
"C
harset
"
,
30
));
field_list
.
push_back
(
new
Item_empty_string
(
"C
OL_Name
"
,
30
));
field_list
.
push_back
(
new
Item_empty_string
(
"C
ollation
"
,
30
));
field_list
.
push_back
(
new
Item_return_int
(
"Id"
,
11
,
FIELD_TYPE_SHORT
));
field_list
.
push_back
(
new
Item_return_int
(
"Id"
,
11
,
FIELD_TYPE_SHORT
));
field_list
.
push_back
(
new
Item_empty_string
(
"Flags"
,
30
));
field_list
.
push_back
(
new
Item_empty_string
(
"Flags"
,
30
));
field_list
.
push_back
(
new
Item_return_int
(
"strx_maxlen"
,
3
,
FIELD_TYPE_TINY
));
field_list
.
push_back
(
new
Item_return_int
(
"strx_maxlen"
,
3
,
FIELD_TYPE_SHORT
));
field_list
.
push_back
(
new
Item_return_int
(
"mb_maxlen"
,
3
,
FIELD_TYPE_TINY
));
if
(
protocol
->
send_fields
(
&
field_list
,
1
))
if
(
protocol
->
send_fields
(
&
field_list
,
1
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
cs
++
)
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
cs
++
)
{
{
if
(
cs
[
0
]
&&
!
(
wild
&&
wild
[
0
]
&&
CHARSET_INFO
**
cl
;
wild_case_compare
(
system_charset_info
,
cs
[
0
]
->
name
,
wild
))
)
for
(
cl
=
all_charsets
;
cl
<
all_charsets
+
255
;
cl
++
)
{
{
protocol
->
prepare_for_resend
();
if
(
!
cs
[
0
]
||
!
cl
[
0
]
||
!
my_charset_same
(
cs
[
0
],
cl
[
0
])
||
!
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
))
protocol
->
store
(
cs
[
0
]
->
csname
,
system_charset_info
);
continue
;
protocol
->
store
(
cs
[
0
]
->
name
,
system_charset_info
);
if
(
cs
[
0
]
&&
!
(
wild
&&
wild
[
0
]
&&
protocol
->
store_short
((
longlong
)
cs
[
0
]
->
number
);
wild_case_compare
(
system_charset_info
,
cl
[
0
]
->
name
,
wild
)))
flags
[
0
]
=
'\0'
;
{
if
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
)
if
(
write_collation
(
protocol
,
cl
[
0
]))
strcat
(
flags
,
"pri"
);
goto
err
;
protocol
->
store
(
flags
,
system_charset_info
);
}
protocol
->
store_tiny
((
longlong
)
cs
[
0
]
->
strxfrm_multiply
);
}
protocol
->
store_tiny
((
longlong
)
cs
[
0
]
->
mbmaxlen
);
}
if
(
protocol
->
write
())
send_eof
(
thd
);
DBUG_RETURN
(
0
);
err:
DBUG_RETURN
(
1
);
}
static
bool
write_charset
(
Protocol
*
protocol
,
CHARSET_INFO
*
cs
)
{
protocol
->
prepare_for_resend
();
protocol
->
store
(
cs
->
csname
,
system_charset_info
);
protocol
->
store
(
cs
->
name
,
system_charset_info
);
protocol
->
store_short
((
longlong
)
cs
->
mbmaxlen
);
return
protocol
->
write
();
}
int
mysqld_show_charsets
(
THD
*
thd
,
const
char
*
wild
)
{
char
buff
[
8192
];
String
packet2
(
buff
,
sizeof
(
buff
),
thd
->
charset
());
List
<
Item
>
field_list
;
CHARSET_INFO
**
cs
;
Protocol
*
protocol
=
thd
->
protocol
;
char
flags
[
64
];
DBUG_ENTER
(
"mysqld_show_charsets"
);
field_list
.
push_back
(
new
Item_empty_string
(
"Charset"
,
30
));
field_list
.
push_back
(
new
Item_empty_string
(
"Default collation"
,
60
));
field_list
.
push_back
(
new
Item_return_int
(
"Maxlen"
,
3
,
FIELD_TYPE_SHORT
));
if
(
protocol
->
send_fields
(
&
field_list
,
1
))
DBUG_RETURN
(
1
);
for
(
cs
=
all_charsets
;
cs
<
all_charsets
+
255
;
cs
++
)
{
if
(
cs
[
0
]
&&
(
cs
[
0
]
->
state
&
MY_CS_PRIMARY
)
&&
!
(
wild
&&
wild
[
0
]
&&
wild_case_compare
(
system_charset_info
,
cs
[
0
]
->
name
,
wild
)))
{
if
(
write_charset
(
protocol
,
cs
[
0
]))
goto
err
;
goto
err
;
}
}
}
}
...
...
sql/sql_string.cc
View file @
72830a77
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
CHARSET_INFO
*
system_charset_info
=
&
my_charset_utf8
;
CHARSET_INFO
*
system_charset_info
=
&
my_charset_utf8
;
CHARSET_INFO
*
files_charset_info
=
&
my_charset_utf8
;
CHARSET_INFO
*
files_charset_info
=
&
my_charset_utf8
;
CHARSET_INFO
*
national_charset_info
=
&
my_charset_
utf8
;
CHARSET_INFO
*
national_charset_info
=
&
my_charset_
latin1
;
extern
gptr
sql_alloc
(
unsigned
size
);
extern
gptr
sql_alloc
(
unsigned
size
);
extern
void
sql_element_free
(
void
*
ptr
);
extern
void
sql_element_free
(
void
*
ptr
);
...
...
sql/sql_test.cc
View file @
72830a77
...
@@ -321,8 +321,8 @@ w_requests: %10lu\n\
...
@@ -321,8 +321,8 @@ w_requests: %10lu\n\
writes: %10lu
\n
\
writes: %10lu
\n
\
r_requests: %10lu
\n
\
r_requests: %10lu
\n
\
reads: %10lu
\n
"
,
reads: %10lu
\n
"
,
_my_blocks_used
,
_my_blocks_changed
,
_
my_cache_w_requests
,
my_blocks_used
,
my_blocks_changed
,
my_cache_w_requests
,
_my_cache_write
,
_my_cache_r_requests
,
_
my_cache_read
);
my_cache_write
,
my_cache_r_requests
,
my_cache_read
);
pthread_mutex_unlock
(
&
THR_LOCK_keycache
);
pthread_mutex_unlock
(
&
THR_LOCK_keycache
);
if
(
thd
)
if
(
thd
)
...
...
sql/sql_yacc.yy
View file @
72830a77
...
@@ -3578,6 +3578,8 @@ show_param:
...
@@ -3578,6 +3578,8 @@ show_param:
}
}
| charset wild
| charset wild
{ Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
{ Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
| COLLATION_SYM wild
{ Lex->sql_command= SQLCOM_SHOW_COLLATIONS; }
| LOGS_SYM
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
| GRANTS FOR_SYM user
| GRANTS FOR_SYM user
...
...
strings/ctype-extra.c
View file @
72830a77
...
@@ -3169,7 +3169,7 @@ CHARSET_INFO compiled_charsets[] = {
...
@@ -3169,7 +3169,7 @@ CHARSET_INFO compiled_charsets[] = {
20
,
0
,
0
,
/* number */
20
,
0
,
0
,
/* number */
MY_CS_COMPILED
,
/* state */
MY_CS_COMPILED
,
/* state */
"latin7"
,
/* cs name */
"latin7"
,
/* cs name */
"
estonia
"
,
/* name */
"
latin7_estonian_ci_as
"
,
/* name */
""
,
/* comment */
""
,
/* comment */
ctype_estonia
,
ctype_estonia
,
to_lower_estonia
,
to_lower_estonia
,
...
...
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