mirror of
https://github.com/MariaDB/server.git
synced 2025-02-14 17:35:35 +01:00
Added new show contributors command.
sql/lex.h: Additions for show contributors sql/mysql_priv.h: Show contributors addition sql/sp_head.cc: Added for show contributors sql/sql_lex.h: Adding contributors addition sql/sql_parse.cc: Execute for add contributors sql/sql_show.cc: Adding show contributors sql/sql_yacc.yy: Show contributors additio mysql-test/r/contributors.result: New BitKeeper file ``mysql-test/r/contributors.result'' mysql-test/t/contributors.test: New BitKeeper file ``mysql-test/t/contributors.test'' sql/contributors.h: New BitKeeper file ``sql/contributors.h''
This commit is contained in:
parent
472f4a84d2
commit
12ede0e0be
10 changed files with 95 additions and 0 deletions
5
mysql-test/r/contributors.result
Normal file
5
mysql-test/r/contributors.result
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
SHOW CONTRIBUTORS;
|
||||||
|
Name Location Comment
|
||||||
|
Ronald Bradford Brisbane, Australia EFF contribution for UC2006 Auction
|
||||||
|
Sheeri Kritzer Boston, Mass. USA EFF contribution for UC2006 Auction
|
||||||
|
Mark Shuttleworth London, UK. EFF contribution for UC2006 Auction
|
1
mysql-test/t/contributors.test
Normal file
1
mysql-test/t/contributors.test
Normal file
|
@ -0,0 +1 @@
|
||||||
|
SHOW CONTRIBUTORS;
|
40
sql/contributors.h
Normal file
40
sql/contributors.h
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
/* Copyright (C) 2005 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program 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 General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
/* Structure of the name list */
|
||||||
|
|
||||||
|
struct show_table_contributors_st {
|
||||||
|
const char *name;
|
||||||
|
const char *location;
|
||||||
|
const char *comment;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Output from "SHOW CONTRIBUTORS"
|
||||||
|
|
||||||
|
Get permission before editing.
|
||||||
|
|
||||||
|
IMPORTANT: Names should be left in historical order.
|
||||||
|
|
||||||
|
Names should be encoded using UTF-8.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct show_table_contributors_st show_table_contributors[]= {
|
||||||
|
{"Ronald Bradford", "Brisbane, Australia", "EFF contribution for UC2006 Auction"},
|
||||||
|
{"Sheeri Kritzer", "Boston, Mass. USA", "EFF contribution for UC2006 Auction"},
|
||||||
|
{"Mark Shuttleworth", "London, UK.", "EFF contribution for UC2006 Auction"},
|
||||||
|
{NULL, NULL, NULL}
|
||||||
|
};
|
|
@ -133,6 +133,7 @@ static SYMBOL symbols[] = {
|
||||||
{ "CONSTRAINT", SYM(CONSTRAINT)},
|
{ "CONSTRAINT", SYM(CONSTRAINT)},
|
||||||
{ "CONTAINS", SYM(CONTAINS_SYM)},
|
{ "CONTAINS", SYM(CONTAINS_SYM)},
|
||||||
{ "CONTINUE", SYM(CONTINUE_SYM)},
|
{ "CONTINUE", SYM(CONTINUE_SYM)},
|
||||||
|
{ "CONTRIBUTORS", SYM(CONTRIBUTORS_SYM)},
|
||||||
{ "CONVERT", SYM(CONVERT_SYM)},
|
{ "CONVERT", SYM(CONVERT_SYM)},
|
||||||
{ "CREATE", SYM(CREATE)},
|
{ "CREATE", SYM(CREATE)},
|
||||||
{ "CROSS", SYM(CROSS)},
|
{ "CROSS", SYM(CROSS)},
|
||||||
|
|
|
@ -1002,6 +1002,7 @@ int mysql_find_files(THD *thd,List<char> *files, const char *db,
|
||||||
const char *path, const char *wild, bool dir);
|
const char *path, const char *wild, bool dir);
|
||||||
bool mysqld_show_storage_engines(THD *thd);
|
bool mysqld_show_storage_engines(THD *thd);
|
||||||
bool mysqld_show_authors(THD *thd);
|
bool mysqld_show_authors(THD *thd);
|
||||||
|
bool mysqld_show_contributors(THD *thd);
|
||||||
bool mysqld_show_privileges(THD *thd);
|
bool mysqld_show_privileges(THD *thd);
|
||||||
bool mysqld_show_column_types(THD *thd);
|
bool mysqld_show_column_types(THD *thd);
|
||||||
bool mysqld_help (THD *thd, const char *text);
|
bool mysqld_help (THD *thd, const char *text);
|
||||||
|
|
|
@ -202,6 +202,7 @@ sp_get_flags_for_command(LEX *lex)
|
||||||
case SQLCOM_SHOW_PROC_CODE:
|
case SQLCOM_SHOW_PROC_CODE:
|
||||||
case SQLCOM_SHOW_FUNC_CODE:
|
case SQLCOM_SHOW_FUNC_CODE:
|
||||||
case SQLCOM_SHOW_AUTHORS:
|
case SQLCOM_SHOW_AUTHORS:
|
||||||
|
case SQLCOM_SHOW_CONTRIBUTORS:
|
||||||
case SQLCOM_REPAIR:
|
case SQLCOM_REPAIR:
|
||||||
case SQLCOM_BACKUP_TABLE:
|
case SQLCOM_BACKUP_TABLE:
|
||||||
case SQLCOM_RESTORE_TABLE:
|
case SQLCOM_RESTORE_TABLE:
|
||||||
|
|
|
@ -110,6 +110,7 @@ enum enum_sql_command {
|
||||||
SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
|
SQLCOM_INSTALL_PLUGIN, SQLCOM_UNINSTALL_PLUGIN,
|
||||||
SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
|
SQLCOM_SHOW_AUTHORS, SQLCOM_BINLOG_BASE64_EVENT,
|
||||||
SQLCOM_SHOW_PLUGINS,
|
SQLCOM_SHOW_PLUGINS,
|
||||||
|
SQLCOM_SHOW_CONTRIBUTORS,
|
||||||
SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
|
SQLCOM_CREATE_EVENT, SQLCOM_ALTER_EVENT, SQLCOM_DROP_EVENT,
|
||||||
SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
|
SQLCOM_SHOW_CREATE_EVENT, SQLCOM_SHOW_EVENTS,
|
||||||
|
|
||||||
|
|
|
@ -3522,6 +3522,9 @@ end_with_restore_list:
|
||||||
case SQLCOM_SHOW_AUTHORS:
|
case SQLCOM_SHOW_AUTHORS:
|
||||||
res= mysqld_show_authors(thd);
|
res= mysqld_show_authors(thd);
|
||||||
break;
|
break;
|
||||||
|
case SQLCOM_SHOW_CONTRIBUTORS:
|
||||||
|
res= mysqld_show_contributors(thd);
|
||||||
|
break;
|
||||||
case SQLCOM_SHOW_PRIVILEGES:
|
case SQLCOM_SHOW_PRIVILEGES:
|
||||||
res= mysqld_show_privileges(thd);
|
res= mysqld_show_privileges(thd);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "sp_head.h"
|
#include "sp_head.h"
|
||||||
#include "sql_trigger.h"
|
#include "sql_trigger.h"
|
||||||
#include "authors.h"
|
#include "authors.h"
|
||||||
|
#include "contributors.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
|
|
||||||
|
@ -226,6 +227,41 @@ bool mysqld_show_authors(THD *thd)
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
** List all Contributors.
|
||||||
|
** Please get permission before updating
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
bool mysqld_show_contributors(THD *thd)
|
||||||
|
{
|
||||||
|
List<Item> field_list;
|
||||||
|
Protocol *protocol= thd->protocol;
|
||||||
|
DBUG_ENTER("mysqld_show_contributors");
|
||||||
|
|
||||||
|
field_list.push_back(new Item_empty_string("Name",40));
|
||||||
|
field_list.push_back(new Item_empty_string("Location",40));
|
||||||
|
field_list.push_back(new Item_empty_string("Comment",80));
|
||||||
|
|
||||||
|
if (protocol->send_fields(&field_list,
|
||||||
|
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
|
||||||
|
show_table_contributors_st *contributors;
|
||||||
|
for (contributors= show_table_contributors; contributors->name; contributors++)
|
||||||
|
{
|
||||||
|
protocol->prepare_for_resend();
|
||||||
|
protocol->store(contributors->name, system_charset_info);
|
||||||
|
protocol->store(contributors->location, system_charset_info);
|
||||||
|
protocol->store(contributors->comment, system_charset_info);
|
||||||
|
if (protocol->write())
|
||||||
|
DBUG_RETURN(TRUE);
|
||||||
|
}
|
||||||
|
send_eof(thd);
|
||||||
|
DBUG_RETURN(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
List all privileges supported
|
List all privileges supported
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
|
@ -204,6 +204,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
|
||||||
%token CONSTRAINT
|
%token CONSTRAINT
|
||||||
%token CONTAINS_SYM
|
%token CONTAINS_SYM
|
||||||
%token CONTINUE_SYM
|
%token CONTINUE_SYM
|
||||||
|
%token CONTRIBUTORS_SYM
|
||||||
%token CONVERT_SYM
|
%token CONVERT_SYM
|
||||||
%token CONVERT_TZ_SYM
|
%token CONVERT_TZ_SYM
|
||||||
%token COUNT_SYM
|
%token COUNT_SYM
|
||||||
|
@ -8128,6 +8129,11 @@ show_param:
|
||||||
LEX *lex=Lex;
|
LEX *lex=Lex;
|
||||||
lex->sql_command= SQLCOM_SHOW_AUTHORS;
|
lex->sql_command= SQLCOM_SHOW_AUTHORS;
|
||||||
}
|
}
|
||||||
|
| CONTRIBUTORS_SYM
|
||||||
|
{
|
||||||
|
LEX *lex=Lex;
|
||||||
|
lex->sql_command= SQLCOM_SHOW_CONTRIBUTORS;
|
||||||
|
}
|
||||||
| PRIVILEGES
|
| PRIVILEGES
|
||||||
{
|
{
|
||||||
LEX *lex=Lex;
|
LEX *lex=Lex;
|
||||||
|
|
Loading…
Add table
Reference in a new issue