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
6ebedbb6
Commit
6ebedbb6
authored
Feb 28, 2004
by
guilhem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
temporary undo needed for merge
parents
6f806352
6a8c314f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
36 deletions
+47
-36
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+2
-2
sql/sql_acl.cc
sql/sql_acl.cc
+28
-33
sql/sql_parse.cc
sql/sql_parse.cc
+17
-1
No files found.
sql/share/serbian/errmsg.txt
View file @
6ebedbb6
...
@@ -259,7 +259,7 @@ character-set=cp1250
...
@@ -259,7 +259,7 @@ character-set=cp1250
"Z_DATA_ERROR: Input data was corrupted for zlib",
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
"Row %ld doesn't contain data for all columns",
"Row %ld was truncated;
It contained more data than there wh
ere input columns",
"Row %ld was truncated;
it contained more data than there w
ere input columns",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated, out of range for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
"Data truncated for column '%s' at row %ld",
...
@@ -287,4 +287,4 @@ character-set=cp1250
...
@@ -287,4 +287,4 @@ character-set=cp1250
"'%s' is deprecated, use '%s' instead",
"'%s' is deprecated, use '%s' instead",
"The target table %-.100s of the %s is not updatable",
"The target table %-.100s of the %s is not updatable",
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working"
"The '%s' feature was disabled; you need MySQL built with '%s' define to have it working"
"
MySQL is started in --skip-grant-tables mode. You can't use this command
"
"
The MySQL server is running with the %s option so cannot execute this statement
"
sql/sql_acl.cc
View file @
6ebedbb6
...
@@ -1115,7 +1115,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
...
@@ -1115,7 +1115,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
{
{
if
(
!
initialized
)
if
(
!
initialized
)
{
{
send_error
(
thd
,
ER_SKIP_GRANT_TABLES
);
/* purecov: inspected */
net_printf
(
thd
,
ER_OPTION_PREVENTS_STATEMENT
,
"--skip-grant-tables"
);
/* purecov: inspected */
return
(
1
);
/* purecov: inspected */
return
(
1
);
/* purecov: inspected */
}
}
if
(
!
thd
->
slave_thread
&&
if
(
!
thd
->
slave_thread
&&
...
@@ -1433,13 +1434,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
...
@@ -1433,13 +1434,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
if
(
!
create_user
)
if
(
!
create_user
)
{
{
if
(
what
==
'N'
)
if
(
what
==
'N'
)
my_printf_error
(
ER_NONEXISTING_GRANT
,
ER
(
ER_NONEXISTING_GRANT
),
my_error
(
ER_NONEXISTING_GRANT
,
MYF
(
0
),
combo
.
user
.
str
,
combo
.
host
.
str
);
MYF
(
0
),
combo
.
user
.
str
,
combo
.
host
.
str
);
else
else
my_printf_error
(
ER_NO_PERMISSION_TO_CREATE_USER
,
my_error
(
ER_NO_PERMISSION_TO_CREATE_USER
,
MYF
(
0
),
ER
(
ER_NO_PERMISSION_TO_CREATE_USER
),
thd
->
user
,
thd
->
host_or_ip
);
MYF
(
0
),
thd
->
user
,
thd
->
host_or_ip
);
error
=
-
1
;
error
=
-
1
;
goto
end
;
goto
end
;
}
}
...
@@ -1593,7 +1591,7 @@ static int replace_db_table(TABLE *table, const char *db,
...
@@ -1593,7 +1591,7 @@ static int replace_db_table(TABLE *table, const char *db,
if
(
!
initialized
)
if
(
!
initialized
)
{
{
my_error
(
ER_
SKIP_GRANT_TABLES
,
MYF
(
0
)
);
my_error
(
ER_
OPTION_PREVENTS_STATEMENT
,
MYF
(
0
),
"--skip-grant-tables"
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
...
@@ -1613,8 +1611,7 @@ static int replace_db_table(TABLE *table, const char *db,
...
@@ -1613,8 +1611,7 @@ static int replace_db_table(TABLE *table, const char *db,
{
{
if
(
what
==
'N'
)
if
(
what
==
'N'
)
{
// no row, no revoke
{
// no row, no revoke
my_printf_error
(
ER_NONEXISTING_GRANT
,
ER
(
ER_NONEXISTING_GRANT
),
MYF
(
0
),
my_error
(
ER_NONEXISTING_GRANT
,
MYF
(
0
),
combo
.
user
.
str
,
combo
.
host
.
str
);
combo
.
user
.
str
,
combo
.
host
.
str
);
goto
abort
;
goto
abort
;
}
}
old_row_exists
=
0
;
old_row_exists
=
0
;
...
@@ -1903,9 +1900,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
...
@@ -1903,9 +1900,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
{
{
if
(
revoke_grant
)
if
(
revoke_grant
)
{
{
my_printf_error
(
ER_NONEXISTING_TABLE_GRANT
,
my_error
(
ER_NONEXISTING_TABLE_GRANT
,
MYF
(
0
),
ER
(
ER_NONEXISTING_TABLE_GRANT
),
MYF
(
0
),
combo
.
user
.
str
,
combo
.
host
.
str
,
table_name
);
/* purecov: inspected */
combo
.
user
.
str
,
combo
.
host
.
str
,
table_name
);
/* purecov: inspected */
result
=
-
1
;
/* purecov: inspected */
result
=
-
1
;
/* purecov: inspected */
continue
;
/* purecov: inspected */
continue
;
/* purecov: inspected */
}
}
...
@@ -2071,10 +2067,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
...
@@ -2071,10 +2067,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
*/
*/
if
(
revoke_grant
)
if
(
revoke_grant
)
{
// no row, no revoke
{
// no row, no revoke
my_printf_error
(
ER_NONEXISTING_TABLE_GRANT
,
my_error
(
ER_NONEXISTING_TABLE_GRANT
,
MYF
(
0
),
ER
(
ER_NONEXISTING_TABLE_GRANT
),
MYF
(
0
),
combo
.
user
.
str
,
combo
.
host
.
str
,
combo
.
user
.
str
,
combo
.
host
.
str
,
table_name
);
/* purecov: deadcode */
table_name
);
/* purecov: deadcode */
DBUG_RETURN
(
-
1
);
/* purecov: deadcode */
DBUG_RETURN
(
-
1
);
/* purecov: deadcode */
}
}
old_row_exists
=
0
;
old_row_exists
=
0
;
...
@@ -2174,8 +2169,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
...
@@ -2174,8 +2169,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if
(
!
initialized
)
if
(
!
initialized
)
{
{
send_error
(
thd
,
ER_SKIP_GRANT_TABLES
);
/* purecov: inspected */
my_error
(
ER_OPTION_PREVENTS_STATEMENT
,
MYF
(
0
),
DBUG_RETURN
(
1
);
/* purecov: inspected */
"--skip-grant-tables"
);
/* purecov: inspected */
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
}
}
if
(
rights
&
~
TABLE_ACLS
)
if
(
rights
&
~
TABLE_ACLS
)
{
{
...
@@ -2196,8 +2192,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
...
@@ -2196,8 +2192,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if
(
!
find_field_in_table
(
thd
,
table
,
column
->
column
.
ptr
(),
if
(
!
find_field_in_table
(
thd
,
table
,
column
->
column
.
ptr
(),
column
->
column
.
length
(),
0
,
0
))
column
->
column
.
length
(),
0
,
0
))
{
{
my_
printf_error
(
ER_BAD_FIELD_ERROR
,
ER
(
ER_BAD_FIELD_ERROR
),
MYF
(
0
),
my_
error
(
ER_BAD_FIELD_ERROR
,
MYF
(
0
),
column
->
column
.
c_ptr
(),
table_list
->
alias
);
column
->
column
.
c_ptr
(),
table_list
->
alias
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
column_priv
|=
column
->
rights
;
column_priv
|=
column
->
rights
;
...
@@ -2212,7 +2208,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
...
@@ -2212,7 +2208,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
fn_format
(
buf
,
buf
,
""
,
""
,
4
+
16
+
32
);
fn_format
(
buf
,
buf
,
""
,
""
,
4
+
16
+
32
);
if
(
access
(
buf
,
F_OK
))
if
(
access
(
buf
,
F_OK
))
{
{
my_error
(
ER_NO_SUCH_TABLE
,
MYF
(
0
),
table_list
->
db
,
table_list
->
alias
);
my_error
(
ER_NO_SUCH_TABLE
,
MYF
(
0
),
table_list
->
db
,
table_list
->
alias
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
}
}
...
@@ -2291,9 +2287,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
...
@@ -2291,9 +2287,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
{
{
if
(
revoke_grant
)
if
(
revoke_grant
)
{
{
my_printf_error
(
ER_NONEXISTING_TABLE_GRANT
,
my_error
(
ER_NONEXISTING_TABLE_GRANT
,
MYF
(
0
),
ER
(
ER_NONEXISTING_TABLE_GRANT
),
MYF
(
0
),
Str
->
user
.
str
,
Str
->
host
.
str
,
table_list
->
real_name
);
Str
->
user
.
str
,
Str
->
host
.
str
,
table_list
->
real_name
);
result
=
-
1
;
result
=
-
1
;
continue
;
continue
;
}
}
...
@@ -2384,7 +2379,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
...
@@ -2384,7 +2379,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
DBUG_ENTER
(
"mysql_grant"
);
DBUG_ENTER
(
"mysql_grant"
);
if
(
!
initialized
)
if
(
!
initialized
)
{
{
my_error
(
ER_SKIP_GRANT_TABLES
,
MYF
(
0
));
/* purecov: tested */
my_error
(
ER_OPTION_PREVENTS_STATEMENT
,
MYF
(
0
),
"--skip-grant-tables"
);
/* purecov: tested */
DBUG_RETURN
(
-
1
);
/* purecov: tested */
DBUG_RETURN
(
-
1
);
/* purecov: tested */
}
}
...
@@ -2463,8 +2459,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
...
@@ -2463,8 +2459,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
}
}
else
else
{
{
my_printf_error
(
ER_WRONG_USAGE
,
ER
(
ER_WRONG_USAGE
),
MYF
(
0
),
my_error
(
ER_WRONG_USAGE
,
MYF
(
0
),
"DB GRANT"
,
"GLOBAL PRIVILEGES"
);
"DB GRANT"
,
"GLOBAL PRIVILEGES"
);
result
=
-
1
;
result
=
-
1
;
}
}
}
}
...
@@ -2990,8 +2985,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
...
@@ -2990,8 +2985,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
LINT_INIT
(
acl_user
);
LINT_INIT
(
acl_user
);
if
(
!
initialized
)
if
(
!
initialized
)
{
{
send_error
(
thd
,
ER_SKIP_GRANT_TABLES
);
my_error
(
ER_OPTION_PREVENTS_STATEMENT
,
MYF
(
0
),
"--skip-grant-tables"
);
DBUG_RETURN
(
1
);
DBUG_RETURN
(
-
1
);
}
}
if
(
lex_user
->
host
.
length
>
HOSTNAME_LENGTH
||
if
(
lex_user
->
host
.
length
>
HOSTNAME_LENGTH
||
lex_user
->
user
.
length
>
USERNAME_LENGTH
)
lex_user
->
user
.
length
>
USERNAME_LENGTH
)
...
@@ -3014,8 +3009,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
...
@@ -3014,8 +3009,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
if
(
counter
==
acl_users
.
elements
)
if
(
counter
==
acl_users
.
elements
)
{
{
my_
printf_error
(
ER_NONEXISTING_GRANT
,
ER
(
ER_NONEXISTING_GRANT
),
my_
error
(
ER_NONEXISTING_GRANT
,
MYF
(
0
),
MYF
(
0
),
lex_user
->
user
.
str
,
lex_user
->
host
.
str
);
lex_user
->
user
.
str
,
lex_user
->
host
.
str
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
...
@@ -3343,7 +3338,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
...
@@ -3343,7 +3338,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
if
(
!
initialized
)
if
(
!
initialized
)
{
{
send_error
(
thd
,
ER_SKIP_GRANT_TABLES
);
net_printf
(
thd
,
ER_OPTION_PREVENTS_STATEMENT
,
"--skip-grant-tables"
);
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
}
}
...
...
sql/sql_parse.cc
View file @
6ebedbb6
...
@@ -1835,7 +1835,7 @@ mysql_execute_command(THD *thd)
...
@@ -1835,7 +1835,7 @@ mysql_execute_command(THD *thd)
!
(
thd
->
slave_thread
||
(
thd
->
master_access
&
SUPER_ACL
))
&&
!
(
thd
->
slave_thread
||
(
thd
->
master_access
&
SUPER_ACL
))
&&
(
uc_update_queries
[
lex
->
sql_command
]
>
0
))
(
uc_update_queries
[
lex
->
sql_command
]
>
0
))
{
{
send_error
(
thd
,
ER_CANT_UPDATE_WITH_READLOCK
);
net_printf
(
thd
,
ER_OPTION_PREVENTS_STATEMENT
,
"--read-only"
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
@@ -3053,6 +3053,22 @@ mysql_execute_command(THD *thd)
...
@@ -3053,6 +3053,22 @@ mysql_execute_command(THD *thd)
net_printf
(
thd
,
ER_WRONG_DB_NAME
,
lex
->
name
);
net_printf
(
thd
,
ER_WRONG_DB_NAME
,
lex
->
name
);
break
;
break
;
}
}
/*
If in a slave thread :
ALTER DATABASE DB may not be preceded by USE DB.
For that reason, maybe db_ok() in sql/slave.cc did not check the
do_db/ignore_db. And as this query involves no tables, tables_ok()
above was not called. So we have to check rules again here.
*/
#ifdef HAVE_REPLICATION
if
(
thd
->
slave_thread
&&
(
!
db_ok
(
lex
->
name
,
replicate_do_db
,
replicate_ignore_db
)
||
!
db_ok_with_wild_table
(
lex
->
name
)))
{
my_error
(
ER_SLAVE_IGNORED_TABLE
,
MYF
(
0
));
break
;
}
#endif
if
(
check_access
(
thd
,
ALTER_ACL
,
lex
->
name
,
0
,
1
,
0
))
if
(
check_access
(
thd
,
ALTER_ACL
,
lex
->
name
,
0
,
1
,
0
))
break
;
break
;
if
(
thd
->
locked_tables
||
thd
->
active_transaction
())
if
(
thd
->
locked_tables
||
thd
->
active_transaction
())
...
...
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