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
98071621
Commit
98071621
authored
Nov 10, 2005
by
brian@grrr.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "SHOW AUTHORS" code
parent
2cb601c8
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
76 additions
and
2 deletions
+76
-2
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+4
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+4
-0
sql/authors.h
sql/authors.h
+18
-0
sql/field.h
sql/field.h
+2
-2
sql/lex.h
sql/lex.h
+1
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_cache.h
sql/sql_cache.h
+2
-0
sql/sql_lex.h
sql/sql_lex.h
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+3
-0
sql/sql_show.cc
sql/sql_show.cc
+33
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+7
-0
No files found.
mysql-test/r/show_check.result
View file @
98071621
...
@@ -564,3 +564,7 @@ DROP TABLE tyt2;
...
@@ -564,3 +564,7 @@ DROP TABLE tyt2;
DROP TABLE urkunde;
DROP TABLE urkunde;
SHOW TABLES FROM non_existing_database;
SHOW TABLES FROM non_existing_database;
ERROR 42000: Unknown database 'non_existing_database'
ERROR 42000: Unknown database 'non_existing_database'
SHOW AUTHORS;
Name Location Comment
Brian "Krow" Aker Seattle, WA. USA Architecture, archive, federated, buncha of little stuff :)
David Axmark Uppsala, Sweden Small stuff long time ago, Monty ripped it out!
mysql-test/t/show_check.test
View file @
98071621
...
@@ -424,3 +424,7 @@ DROP TABLE urkunde;
...
@@ -424,3 +424,7 @@ DROP TABLE urkunde;
#
#
--
error
1049
--
error
1049
SHOW
TABLES
FROM
non_existing_database
;
SHOW
TABLES
FROM
non_existing_database
;
# End of 4.1 tests
#
SHOW
AUTHORS
;
sql/authors.h
0 → 100644
View file @
98071621
/***************************************************************************
** Output from "SHOW AUTHORS"
** If you can update it, you get to be in it :)
** Dont be offended if your name is not in here, just add it!
***************************************************************************/
struct
show_table_authors_st
{
const
char
*
name
;
const
char
*
location
;
const
char
*
comment
;
};
struct
show_table_authors_st
show_table_authors
[]
=
{
{
"Brian
\"
Krow
\"
Aker"
,
"Seattle, WA. USA"
,
"Architecture, archive, federated, buncha of little stuff :)"
},
{
"David Axmark"
,
"Uppsala, Sweden"
,
"Small stuff long time ago, Monty ripped it out!"
},
{
NULL
,
NULL
,
NULL
}
};
sql/field.h
View file @
98071621
...
@@ -1081,7 +1081,7 @@ class Field_varstring :public Field_longstr {
...
@@ -1081,7 +1081,7 @@ class Field_varstring :public Field_longstr {
int
cmp_max
(
const
char
*
,
const
char
*
,
uint
max_length
);
int
cmp_max
(
const
char
*
,
const
char
*
,
uint
max_length
);
int
cmp
(
const
char
*
a
,
const
char
*
b
)
int
cmp
(
const
char
*
a
,
const
char
*
b
)
{
{
return
cmp_max
(
a
,
b
,
~
0
);
return
cmp_max
(
a
,
b
,
~
0
L
);
}
}
void
sort_string
(
char
*
buff
,
uint
length
);
void
sort_string
(
char
*
buff
,
uint
length
);
void
get_key_image
(
char
*
buff
,
uint
length
,
imagetype
type
);
void
get_key_image
(
char
*
buff
,
uint
length
,
imagetype
type
);
...
@@ -1141,7 +1141,7 @@ class Field_blob :public Field_longstr {
...
@@ -1141,7 +1141,7 @@ class Field_blob :public Field_longstr {
my_decimal
*
val_decimal
(
my_decimal
*
);
my_decimal
*
val_decimal
(
my_decimal
*
);
int
cmp_max
(
const
char
*
,
const
char
*
,
uint
max_length
);
int
cmp_max
(
const
char
*
,
const
char
*
,
uint
max_length
);
int
cmp
(
const
char
*
a
,
const
char
*
b
)
int
cmp
(
const
char
*
a
,
const
char
*
b
)
{
return
cmp_max
(
a
,
b
,
~
0
);
}
{
return
cmp_max
(
a
,
b
,
~
0
L
);
}
int
cmp
(
const
char
*
a
,
uint32
a_length
,
const
char
*
b
,
uint32
b_length
);
int
cmp
(
const
char
*
a
,
uint32
a_length
,
const
char
*
b
,
uint32
b_length
);
int
cmp_binary
(
const
char
*
a
,
const
char
*
b
,
uint32
max_length
=~
0L
);
int
cmp_binary
(
const
char
*
a
,
const
char
*
b
,
uint32
max_length
=~
0L
);
int
key_cmp
(
const
byte
*
,
const
byte
*
);
int
key_cmp
(
const
byte
*
,
const
byte
*
);
...
...
sql/lex.h
View file @
98071621
...
@@ -74,6 +74,7 @@ static SYMBOL symbols[] = {
...
@@ -74,6 +74,7 @@ static SYMBOL symbols[] = {
{
"ASC"
,
SYM
(
ASC
)},
{
"ASC"
,
SYM
(
ASC
)},
{
"ASCII"
,
SYM
(
ASCII_SYM
)},
{
"ASCII"
,
SYM
(
ASCII_SYM
)},
{
"ASENSITIVE"
,
SYM
(
ASENSITIVE_SYM
)},
{
"ASENSITIVE"
,
SYM
(
ASENSITIVE_SYM
)},
{
"AUTHORS"
,
SYM
(
AUTHORS_SYM
)},
{
"AUTO_INCREMENT"
,
SYM
(
AUTO_INC
)},
{
"AUTO_INCREMENT"
,
SYM
(
AUTO_INC
)},
{
"AVG"
,
SYM
(
AVG_SYM
)},
{
"AVG"
,
SYM
(
AVG_SYM
)},
{
"AVG_ROW_LENGTH"
,
SYM
(
AVG_ROW_LENGTH
)},
{
"AVG_ROW_LENGTH"
,
SYM
(
AVG_ROW_LENGTH
)},
...
...
sql/mysql_priv.h
View file @
98071621
...
@@ -857,6 +857,7 @@ int mysqld_show_variables(THD *thd,const char *wild);
...
@@ -857,6 +857,7 @@ int mysqld_show_variables(THD *thd,const char *wild);
int
mysql_find_files
(
THD
*
thd
,
List
<
char
>
*
files
,
const
char
*
db
,
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_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
);
...
...
sql/sql_cache.h
View file @
98071621
...
@@ -215,6 +215,8 @@ struct Query_cache_memory_bin
...
@@ -215,6 +215,8 @@ struct Query_cache_memory_bin
struct
Query_cache_memory_bin_step
struct
Query_cache_memory_bin_step
{
{
public:
Query_cache_memory_bin_step
()
{}
ulong
size
;
ulong
size
;
ulong
increment
;
ulong
increment
;
uint
idx
;
uint
idx
;
...
...
sql/sql_lex.h
View file @
98071621
...
@@ -92,6 +92,7 @@ enum enum_sql_command {
...
@@ -92,6 +92,7 @@ enum enum_sql_command {
SQLCOM_XA_START
,
SQLCOM_XA_END
,
SQLCOM_XA_PREPARE
,
SQLCOM_XA_START
,
SQLCOM_XA_END
,
SQLCOM_XA_PREPARE
,
SQLCOM_XA_COMMIT
,
SQLCOM_XA_ROLLBACK
,
SQLCOM_XA_RECOVER
,
SQLCOM_XA_COMMIT
,
SQLCOM_XA_ROLLBACK
,
SQLCOM_XA_RECOVER
,
SQLCOM_INSTALL_PLUGIN
,
SQLCOM_UNINSTALL_PLUGIN
,
SQLCOM_INSTALL_PLUGIN
,
SQLCOM_UNINSTALL_PLUGIN
,
SQLCOM_SHOW_AUTHORS
,
/* This should be the last !!! */
/* This should be the last !!! */
SQLCOM_END
SQLCOM_END
...
...
sql/sql_parse.cc
View file @
98071621
...
@@ -3409,6 +3409,9 @@ mysql_execute_command(THD *thd)
...
@@ -3409,6 +3409,9 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_STORAGE_ENGINES
:
case
SQLCOM_SHOW_STORAGE_ENGINES
:
res
=
mysqld_show_storage_engines
(
thd
);
res
=
mysqld_show_storage_engines
(
thd
);
break
;
break
;
case
SQLCOM_SHOW_AUTHORS
:
res
=
mysqld_show_authors
(
thd
);
break
;
case
SQLCOM_SHOW_PRIVILEGES
:
case
SQLCOM_SHOW_PRIVILEGES
:
res
=
mysqld_show_privileges
(
thd
);
res
=
mysqld_show_privileges
(
thd
);
break
;
break
;
...
...
sql/sql_show.cc
View file @
98071621
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "sp.h"
#include "sp.h"
#include "sp_head.h"
#include "sp_head.h"
#include "sql_trigger.h"
#include "sql_trigger.h"
#include "authors.h"
#include <my_dir.h>
#include <my_dir.h>
...
@@ -83,6 +84,38 @@ bool mysqld_show_storage_engines(THD *thd)
...
@@ -83,6 +84,38 @@ bool mysqld_show_storage_engines(THD *thd)
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
FALSE
);
}
}
/***************************************************************************
** List all Authors.
** If you can update it, you get to be in it :)
***************************************************************************/
bool
mysqld_show_authors
(
THD
*
thd
)
{
List
<
Item
>
field_list
;
Protocol
*
protocol
=
thd
->
protocol
;
DBUG_ENTER
(
"mysqld_show_authors"
);
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_authors_st
*
authors
;
for
(
authors
=
show_table_authors
;
authors
->
name
;
authors
++
)
{
protocol
->
prepare_for_resend
();
protocol
->
store
(
authors
->
name
,
system_charset_info
);
protocol
->
store
(
authors
->
location
,
system_charset_info
);
protocol
->
store
(
authors
->
comment
,
system_charset_info
);
if
(
protocol
->
write
())
DBUG_RETURN
(
TRUE
);
}
send_eof
(
thd
);
DBUG_RETURN
(
FALSE
);
}
/***************************************************************************
/***************************************************************************
List all privileges supported
List all privileges supported
...
...
sql/sql_yacc.yy
View file @
98071621
...
@@ -137,6 +137,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
...
@@ -137,6 +137,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token ASCII_SYM
%token ASCII_SYM
%token ASENSITIVE_SYM
%token ASENSITIVE_SYM
%token ATAN
%token ATAN
%token AUTHORS_SYM
%token AUTO_INC
%token AUTO_INC
%token AVG_ROW_LENGTH
%token AVG_ROW_LENGTH
%token AVG_SYM
%token AVG_SYM
...
@@ -7174,6 +7175,11 @@ show_param:
...
@@ -7174,6 +7175,11 @@ show_param:
LEX *lex=Lex;
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
lex->sql_command= SQLCOM_SHOW_STORAGE_ENGINES;
}
}
| AUTHORS_SYM
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SHOW_AUTHORS;
}
| PRIVILEGES
| PRIVILEGES
{
{
LEX *lex=Lex;
LEX *lex=Lex;
...
@@ -8171,6 +8177,7 @@ user:
...
@@ -8171,6 +8177,7 @@ user:
keyword:
keyword:
keyword_sp {}
keyword_sp {}
| ASCII_SYM {}
| ASCII_SYM {}
| AUTHORS_SYM {}
| BACKUP_SYM {}
| BACKUP_SYM {}
| BEGIN_SYM {}
| BEGIN_SYM {}
| BYTE_SYM {}
| BYTE_SYM {}
...
...
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