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
3a37745c
Commit
3a37745c
authored
Nov 28, 2016
by
Arun Kuruvila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No commit message
No commit message
parent
07fb5cff
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
618 additions
and
26 deletions
+618
-26
sql/sp.cc
sql/sp.cc
+2
-2
sql/sql_acl.cc
sql/sql_acl.cc
+500
-1
sql/sql_acl.h
sql/sql_acl.h
+98
-1
sql/table.cc
sql/table.cc
+18
-22
No files found.
sql/sp.cc
View file @
3a37745c
/*
Copyright (c) 2002, 201
5
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2002, 201
6
, Oracle and/or its affiliates. All rights reserved.
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
...
...
@@ -372,7 +372,7 @@ void Proc_table_intact::report_error(uint code, const char *fmt, ...)
my_vsnprintf
(
buf
,
sizeof
(
buf
),
fmt
,
args
);
va_end
(
args
);
if
(
code
)
if
(
code
==
ER_COL_COUNT_DOESNT_MATCH_CORRUPTED
)
my_message
(
code
,
buf
,
MYF
(
0
));
else
my_error
(
ER_CANNOT_LOAD_FROM_TABLE
,
MYF
(
0
),
"proc"
);
...
...
sql/sql_acl.cc
View file @
3a37745c
This diff is collapsed.
Click to expand it.
sql/sql_acl.h
View file @
3a37745c
#ifndef SQL_ACL_INCLUDED
#define SQL_ACL_INCLUDED
/* Copyright (c) 2000, 201
0
, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 201
6
, Oracle and/or its affiliates. All rights reserved.
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
...
...
@@ -143,6 +143,53 @@
(((A) & ALTER_PROC_ACL) >> 23) | \
(((A) & GRANT_ACL) >> 8))
enum
mysql_user_table_field
{
MYSQL_USER_FIELD_HOST
=
0
,
MYSQL_USER_FIELD_USER
,
MYSQL_USER_FIELD_PASSWORD
,
MYSQL_USER_FIELD_SELECT_PRIV
,
MYSQL_USER_FIELD_INSERT_PRIV
,
MYSQL_USER_FIELD_UPDATE_PRIV
,
MYSQL_USER_FIELD_DELETE_PRIV
,
MYSQL_USER_FIELD_CREATE_PRIV
,
MYSQL_USER_FIELD_DROP_PRIV
,
MYSQL_USER_FIELD_RELOAD_PRIV
,
MYSQL_USER_FIELD_SHUTDOWN_PRIV
,
MYSQL_USER_FIELD_PROCESS_PRIV
,
MYSQL_USER_FIELD_FILE_PRIV
,
MYSQL_USER_FIELD_GRANT_PRIV
,
MYSQL_USER_FIELD_REFERENCES_PRIV
,
MYSQL_USER_FIELD_INDEX_PRIV
,
MYSQL_USER_FIELD_ALTER_PRIV
,
MYSQL_USER_FIELD_SHOW_DB_PRIV
,
MYSQL_USER_FIELD_SUPER_PRIV
,
MYSQL_USER_FIELD_CREATE_TMP_TABLE_PRIV
,
MYSQL_USER_FIELD_LOCK_TABLES_PRIV
,
MYSQL_USER_FIELD_EXECUTE_PRIV
,
MYSQL_USER_FIELD_REPL_SLAVE_PRIV
,
MYSQL_USER_FIELD_REPL_CLIENT_PRIV
,
MYSQL_USER_FIELD_CREATE_VIEW_PRIV
,
MYSQL_USER_FIELD_SHOW_VIEW_PRIV
,
MYSQL_USER_FIELD_CREATE_ROUTINE_PRIV
,
MYSQL_USER_FIELD_ALTER_ROUTINE_PRIV
,
MYSQL_USER_FIELD_CREATE_USER_PRIV
,
MYSQL_USER_FIELD_EVENT_PRIV
,
MYSQL_USER_FIELD_TRIGGER_PRIV
,
MYSQL_USER_FIELD_CREATE_TABLESPACE_PRIV
,
MYSQL_USER_FIELD_SSL_TYPE
,
MYSQL_USER_FIELD_SSL_CIPHER
,
MYSQL_USER_FIELD_X509_ISSUER
,
MYSQL_USER_FIELD_X509_SUBJECT
,
MYSQL_USER_FIELD_MAX_QUESTIONS
,
MYSQL_USER_FIELD_MAX_UPDATES
,
MYSQL_USER_FIELD_MAX_CONNECTIONS
,
MYSQL_USER_FIELD_MAX_USER_CONNECTIONS
,
MYSQL_USER_FIELD_PLUGIN
,
MYSQL_USER_FIELD_AUTHENTICATION_STRING
,
MYSQL_USER_FIELD_COUNT
};
enum
mysql_db_table_field
{
MYSQL_DB_FIELD_HOST
=
0
,
...
...
@@ -170,6 +217,56 @@ enum mysql_db_table_field
MYSQL_DB_FIELD_COUNT
};
enum
mysql_proxies_priv_table_feild
{
MYSQL_PROXIES_PRIV_FIELD_HOST
=
0
,
MYSQL_PROXIES_PRIV_FIELD_USER
,
MYSQL_PROXIES_PRIV_FIELD_PROXIED_HOST
,
MYSQL_PROXIES_PRIV_FIELD_PROXIED_USER
,
MYSQL_PROXIES_PRIV_FIELD_WITH_GRANT
,
MYSQL_PROXIES_PRIV_FIELD_GRANTOR
,
MYSQL_PROXIES_PRIV_FIELD_TIMESTAMP
,
MYSQL_PROXIES_PRIV_FIELD_COUNT
};
enum
mysql_procs_priv_table_field
{
MYSQL_PROCS_PRIV_FIELD_HOST
=
0
,
MYSQL_PROCS_PRIV_FIELD_DB
,
MYSQL_PROCS_PRIV_FIELD_USER
,
MYSQL_PROCS_PRIV_FIELD_ROUTINE_NAME
,
MYSQL_PROCS_PRIV_FIELD_ROUTINE_TYPE
,
MYSQL_PROCS_PRIV_FIELD_GRANTOR
,
MYSQL_PROCS_PRIV_FIELD_PROC_PRIV
,
MYSQL_PROCS_PRIV_FIELD_TIMESTAMP
,
MYSQL_PROCS_PRIV_FIELD_COUNT
};
enum
mysql_columns_priv_table_field
{
MYSQL_COLUMNS_PRIV_FIELD_HOST
=
0
,
MYSQL_COLUMNS_PRIV_FIELD_DB
,
MYSQL_COLUMNS_PRIV_FIELD_USER
,
MYSQL_COLUMNS_PRIV_FIELD_TABLE_NAME
,
MYSQL_COLUMNS_PRIV_FIELD_COLUMN_NAME
,
MYSQL_COLUMNS_PRIV_FIELD_TIMESTAMP
,
MYSQL_COLUMNS_PRIV_FIELD_COLUMN_PRIV
,
MYSQL_COLUMNS_PRIV_FIELD_COUNT
};
enum
mysql_tables_priv_table_field
{
MYSQL_TABLES_PRIV_FIELD_HOST
=
0
,
MYSQL_TABLES_PRIV_FIELD_DB
,
MYSQL_TABLES_PRIV_FIELD_USER
,
MYSQL_TABLES_PRIV_FIELD_TABLE_NAME
,
MYSQL_TABLES_PRIV_FIELD_GRANTOR
,
MYSQL_TABLES_PRIV_FIELD_TIMESTAMP
,
MYSQL_TABLES_PRIV_FIELD_TABLE_PRIV
,
MYSQL_TABLES_PRIV_FIELD_COLUMN_PRIV
,
MYSQL_TABLES_PRIV_FIELD_COUNT
};
extern
const
TABLE_FIELD_DEF
mysql_db_table_def
;
extern
bool
mysql_user_table_is_in_short_password_format
;
...
...
sql/table.cc
View file @
3a37745c
/*
Copyright (c) 2000, 201
5
, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 201
6
, Oracle and/or its affiliates. All rights reserved.
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
...
...
@@ -2998,11 +2998,7 @@ bool check_column_name(const char *name)
and type)
@retval FALSE OK
@retval TRUE There was an error. An error message is output
to the error log. We do not push an error
message into the error stack because this
function is currently only called at start up,
and such errors never reach the user.
@retval TRUE There was an error.
*/
bool
...
...
@@ -3091,28 +3087,28 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
if
(
strncmp
(
sql_type
.
c_ptr_safe
(),
field_def
->
type
.
str
,
field_def
->
type
.
length
-
1
))
{
report_error
(
0
,
"Incorrect definition of table %s.%s:
"
"
expected column '%s' at position %d to have type
"
"
%s, found type %s."
,
table
->
s
->
db
.
str
,
table
->
alias
,
field_def
->
name
.
str
,
i
,
field_def
->
type
.
str
,
report_error
(
ER_CANNOT_LOAD_FROM_TABLE
,
"Incorrect definition of
"
"
table %s.%s: expected column '%s' at position %d to
"
"
have type %s, found type %s."
,
table
->
s
->
db
.
str
,
table
->
alias
,
field_def
->
name
.
str
,
i
,
field_def
->
type
.
str
,
sql_type
.
c_ptr_safe
());
error
=
TRUE
;
}
else
if
(
field_def
->
cset
.
str
&&
!
field
->
has_charset
())
{
report_error
(
0
,
"Incorrect definition of table %s.%s:
"
"
expected the type of column '%s' at position %d
"
"
to have character set '%s' but the type has no
"
"character set."
,
table
->
s
->
db
.
str
,
table
->
alias
,
report_error
(
ER_CANNOT_LOAD_FROM_TABLE
,
"Incorrect definition of
"
"
table %s.%s: expected the type of column '%s' at
"
"
position %d to have character set '%s' but the type
"
"
has no
character set."
,
table
->
s
->
db
.
str
,
table
->
alias
,
field_def
->
name
.
str
,
i
,
field_def
->
cset
.
str
);
error
=
TRUE
;
}
else
if
(
field_def
->
cset
.
str
&&
strcmp
(
field
->
charset
()
->
csname
,
field_def
->
cset
.
str
))
{
report_error
(
0
,
"Incorrect definition of table %s.%s:
"
"
expected the type of column '%s' at position %d
"
"to have character set '%s' but found "
report_error
(
ER_CANNOT_LOAD_FROM_TABLE
,
"Incorrect definition of
"
"
table %s.%s: expected the type of column '%s' at
"
"
position %d
to have character set '%s' but found "
"character set '%s'."
,
table
->
s
->
db
.
str
,
table
->
alias
,
field_def
->
name
.
str
,
i
,
field_def
->
cset
.
str
,
field
->
charset
()
->
csname
);
...
...
@@ -3121,11 +3117,11 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
}
else
{
report_error
(
0
,
"Incorrect definition of table %s.%s:
"
"
expected column '%s' at position %d to have type %s
"
" but the column is not found."
,
table
->
s
->
db
.
str
,
table
->
alias
,
field_def
->
name
.
str
,
i
,
field_def
->
type
.
str
);
report_error
(
ER_CANNOT_LOAD_FROM_TABLE
,
"Incorrect definition of
"
"
table %s.%s: expected column '%s' at position %d to
"
"
have type %s
but the column is not found."
,
table
->
s
->
db
.
str
,
table
->
alias
,
field_def
->
name
.
str
,
i
,
field_def
->
type
.
str
);
error
=
TRUE
;
}
}
...
...
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