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
6ec9ba5a
Commit
6ec9ba5a
authored
Jun 11, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New command: SHOW CHARACTER SET [LIKE 'wild']
parent
2025ca35
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
1 deletion
+45
-1
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
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
+38
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-0
No files found.
sql/mysql_priv.h
View file @
6ec9ba5a
...
...
@@ -472,6 +472,7 @@ void mysqld_list_processes(THD *thd,const char *user,bool verbose);
int
mysqld_show_status
(
THD
*
thd
);
int
mysqld_show_variables
(
THD
*
thd
,
const
char
*
wild
);
int
mysqld_show
(
THD
*
thd
,
const
char
*
wild
,
show_var_st
*
variables
);
int
mysqld_show_charsets
(
THD
*
thd
,
const
char
*
wild
);
/* sql_handler.cc */
int
mysql_ha_open
(
THD
*
thd
,
TABLE_LIST
*
tables
);
...
...
sql/sql_lex.h
View file @
6ec9ba5a
...
...
@@ -41,7 +41,7 @@ enum enum_sql_command {
SQLCOM_SHOW_DATABASES
,
SQLCOM_SHOW_TABLES
,
SQLCOM_SHOW_FIELDS
,
SQLCOM_SHOW_KEYS
,
SQLCOM_SHOW_VARIABLES
,
SQLCOM_SHOW_LOGS
,
SQLCOM_SHOW_STATUS
,
SQLCOM_SHOW_PROCESSLIST
,
SQLCOM_SHOW_MASTER_STAT
,
SQLCOM_SHOW_SLAVE_STAT
,
SQLCOM_SHOW_GRANTS
,
SQLCOM_SHOW_CREATE
,
SQLCOM_SHOW_GRANTS
,
SQLCOM_SHOW_CREATE
,
SQLCOM_SHOW_CHARSETS
,
SQLCOM_LOAD
,
SQLCOM_SET_OPTION
,
SQLCOM_LOCK_TABLES
,
SQLCOM_UNLOCK_TABLES
,
SQLCOM_GRANT
,
SQLCOM_CHANGE_DB
,
SQLCOM_CREATE_DB
,
SQLCOM_DROP_DB
,
...
...
sql/sql_parse.cc
View file @
6ec9ba5a
...
...
@@ -2101,6 +2101,9 @@ mysql_execute_command(void)
case
SQLCOM_SHOW_OPEN_TABLES
:
res
=
mysqld_show_open_tables
(
thd
,(
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
));
break
;
case
SQLCOM_SHOW_CHARSETS
:
res
=
mysqld_show_charsets
(
thd
,(
lex
->
wild
?
lex
->
wild
->
ptr
()
:
NullS
));
break
;
case
SQLCOM_SHOW_FIELDS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
...
...
sql/sql_show.cc
View file @
6ec9ba5a
...
...
@@ -1162,6 +1162,44 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
** Status functions
*****************************************************************************/
int
mysqld_show_charsets
(
THD
*
thd
,
const
char
*
wild
)
{
uint
i
;
char
buff
[
8192
];
String
packet2
(
buff
,
sizeof
(
buff
),
default_charset_info
);
List
<
Item
>
field_list
;
CONVERT
*
convert
=
thd
->
convert_set
;
CHARSET_INFO
*
cs
;
DBUG_ENTER
(
"mysqld_show_charsets"
);
field_list
.
push_back
(
new
Item_empty_string
(
"Name"
,
30
));
field_list
.
push_back
(
new
Item_int
(
"Id"
,
0
,
7
));
field_list
.
push_back
(
new
Item_int
(
"strx_maxlen"
,
0
,
7
));
field_list
.
push_back
(
new
Item_int
(
"mb_maxlen"
,
0
,
7
));
if
(
send_fields
(
thd
,
field_list
,
1
))
DBUG_RETURN
(
1
);
for
(
cs
=
compiled_charsets
;
cs
->
name
;
cs
++
)
{
if
(
!
(
wild
&&
wild
[
0
]
&&
wild_case_compare
(
system_charset_info
,
cs
->
name
,
wild
)))
{
packet2
.
length
(
0
);
net_store_data
(
&
packet2
,
convert
,
cs
->
name
);
net_store_data
(
&
packet2
,(
uint32
)
cs
->
number
);
net_store_data
(
&
packet2
,(
uint32
)
cs
->
strxfrm_multiply
);
net_store_data
(
&
packet2
,(
uint32
)
cs
->
mbmaxlen
);
if
(
my_net_write
(
&
thd
->
net
,
(
char
*
)
packet2
.
ptr
(),
packet2
.
length
()))
goto
err
;
/* purecov: inspected */
}
}
send_eof
(
&
thd
->
net
);
DBUG_RETURN
(
0
);
err:
DBUG_RETURN
(
1
);
}
int
mysqld_show
(
THD
*
thd
,
const
char
*
wild
,
show_var_st
*
variables
)
{
...
...
sql/sql_yacc.yy
View file @
6ec9ba5a
...
...
@@ -2801,6 +2801,8 @@ show_param:
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
| VARIABLES wild
{ Lex->sql_command= SQLCOM_SHOW_VARIABLES; }
| CHAR_SYM SET wild
{ Lex->sql_command= SQLCOM_SHOW_CHARSETS; }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; }
| GRANTS FOR_SYM user
...
...
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