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
0150dc6e
Commit
0150dc6e
authored
Nov 04, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
10.0-base merge
parents
a30e8741
bf603250
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
94 additions
and
20 deletions
+94
-20
mysql-test/include/default_mysqld.cnf
mysql-test/include/default_mysqld.cnf
+1
-1
mysql-test/include/mtr_warnings.sql
mysql-test/include/mtr_warnings.sql
+1
-1
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+1
-1
mysql-test/r/create.result
mysql-test/r/create.result
+1
-0
mysql-test/r/drop.result
mysql-test/r/drop.result
+1
-0
mysql-test/r/mysqlcheck.result
mysql-test/r/mysqlcheck.result
+1
-0
mysql-test/r/upgrade.result
mysql-test/r/upgrade.result
+1
-0
mysql-test/suite/roles/set_role-5232.result
mysql-test/suite/roles/set_role-5232.result
+15
-0
mysql-test/suite/roles/set_role-5232.test
mysql-test/suite/roles/set_role-5232.test
+20
-0
mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
+1
-0
mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
+1
-0
mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
+1
-0
mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
+2
-0
mysql-test/t/create.test
mysql-test/t/create.test
+1
-0
mysql-test/t/drop.test
mysql-test/t/drop.test
+2
-0
mysql-test/t/mysqlcheck.test
mysql-test/t/mysqlcheck.test
+1
-0
mysql-test/t/upgrade.test
mysql-test/t/upgrade.test
+1
-0
sql/handler.cc
sql/handler.cc
+30
-4
sql/handler.h
sql/handler.h
+3
-0
sql/sql_acl.cc
sql/sql_acl.cc
+3
-1
sql/sql_db.cc
sql/sql_db.cc
+1
-1
sql/sql_table.cc
sql/sql_table.cc
+3
-6
sql/sql_table.h
sql/sql_table.h
+2
-5
No files found.
mysql-test/include/default_mysqld.cnf
View file @
0150dc6e
...
@@ -40,7 +40,7 @@ loose-aria-pagecache-buffer-size=8M
...
@@ -40,7 +40,7 @@ loose-aria-pagecache-buffer-size=8M
loose-feedback-user-info= mysql-test
loose-feedback-user-info= mysql-test
loose-innodb_data_file_path= ibdata1:1
0
M:autoextend
loose-innodb_data_file_path= ibdata1:1
2
M:autoextend
loose-innodb_buffer_pool_size= 8M
loose-innodb_buffer_pool_size= 8M
loose-innodb_lru_scan_depth= 100
loose-innodb_lru_scan_depth= 100
loose-innodb_write_io_threads= 2
loose-innodb_write_io_threads= 2
...
...
mysql-test/include/mtr_warnings.sql
View file @
0150dc6e
...
@@ -108,7 +108,7 @@ INSERT INTO global_suppressions VALUES
...
@@ -108,7 +108,7 @@ INSERT INTO global_suppressions VALUES
(
"Incorrect definition of table"
),
(
"Incorrect definition of table"
),
(
"Incorrect information in file"
),
(
"Incorrect information in file"
),
(
"InnoDB: Warning: we did not need to do crash recovery"
),
(
"InnoDB: Warning: we did not need to do crash recovery"
),
(
"Invalid
\\
(old
\\
?
\\
) table or database name"
),
/*("Invalid \\(old\\?\\) table or database name"),*/
(
"Lock wait timeout exceeded"
),
(
"Lock wait timeout exceeded"
),
(
"Log entry on master is longer than max_allowed_packet"
),
(
"Log entry on master is longer than max_allowed_packet"
),
(
"unknown option '--loose-"
),
(
"unknown option '--loose-"
),
...
...
mysql-test/mysql-test-run.pl
View file @
0150dc6e
...
@@ -4783,7 +4783,7 @@ sub extract_warning_lines ($$) {
...
@@ -4783,7 +4783,7 @@ sub extract_warning_lines ($$) {
qr/slave SQL thread aborted/
,
qr/slave SQL thread aborted/
,
qr/unknown option '--loose[-_]/
,
qr/unknown option '--loose[-_]/
,
qr/unknown variable 'loose[-_]/
,
qr/unknown variable 'loose[-_]/
,
qr/Invalid .*old.* table or database name/
,
#
qr/Invalid .*old.* table or database name/,
qr/Now setting lower_case_table_names to [02]/
,
qr/Now setting lower_case_table_names to [02]/
,
qr/Setting lower_case_table_names=2/
,
qr/Setting lower_case_table_names=2/
,
qr/You have forced lower_case_table_names to 0/
,
qr/You have forced lower_case_table_names to 0/
,
...
...
mysql-test/r/create.result
View file @
0150dc6e
call mtr.add_suppression("table or database name 't-1'");
drop table if exists t1,t2,t3,t4,t5;
drop table if exists t1,t2,t3,t4,t5;
drop database if exists mysqltest;
drop database if exists mysqltest;
drop view if exists v1;
drop view if exists v1;
...
...
mysql-test/r/drop.result
View file @
0150dc6e
call mtr.add_suppression("table or database name 'abc`def'");
drop table if exists t1;
drop table if exists t1;
drop database if exists mysqltest;
drop database if exists mysqltest;
drop database if exists client_test_db;
drop database if exists client_test_db;
...
...
mysql-test/r/mysqlcheck.result
View file @
0150dc6e
call mtr.add_suppression("Invalid .old.. table or database name");
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
DROP TABLE IF EXISTS t1, `t``1`, `t 1`;
drop view if exists v1;
drop view if exists v1;
drop database if exists client_test_db;
drop database if exists client_test_db;
...
...
mysql-test/r/upgrade.result
View file @
0150dc6e
call mtr.add_suppression("Invalid .old.. table or database name");
drop database if exists `mysqltest1`;
drop database if exists `mysqltest1`;
drop database if exists `mysqltest-1`;
drop database if exists `mysqltest-1`;
drop database if exists `#mysql50#mysqltest-1`;
drop database if exists `#mysql50#mysqltest-1`;
...
...
mysql-test/suite/roles/set_role-5232.result
0 → 100644
View file @
0150dc6e
create user ''@localhost;
create user c;
grant select on mysql.* to c;
create role r1;
grant r1 to c;
select user(), current_user();
user() current_user()
c@localhost @localhost
select user from mysql.user group by user;
ERROR 42000: SELECT command denied to user ''@'localhost' for table 'user'
set role r1;
ERROR OP000: Invalid role specification `r1`.
drop role r1;
drop user c;
drop user ''@localhost;
mysql-test/suite/roles/set_role-5232.test
0 → 100644
View file @
0150dc6e
#
# MDEV-5232 SET ROLE checks privileges differently from check_access()
#
--
source
include
/
not_embedded
.
inc
create
user
''
@
localhost
;
create
user
c
;
grant
select
on
mysql
.*
to
c
;
create
role
r1
;
grant
r1
to
c
;
connect
(
c
,
localhost
,
c
,,,,,);
select
user
(),
current_user
();
--
error
ER_TABLEACCESS_DENIED_ERROR
select
user
from
mysql
.
user
group
by
user
;
--
error
ER_INVALID_ROLE
set
role
r1
;
disconnect
c
;
connection
default
;
drop
role
r1
;
drop
user
c
;
drop
user
''
@
localhost
;
mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
View file @
0150dc6e
include/master-slave.inc
include/master-slave.inc
[connection master]
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("table or database name 'mysqltest-1'");
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
Master position is not changed
Master position is not changed
...
...
mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
View file @
0150dc6e
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
--
source
include
/
have_mysql_upgrade
.
inc
--
source
include
/
have_mysql_upgrade
.
inc
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
call
mtr
.
add_suppression
(
"Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"
);
call
mtr
.
add_suppression
(
"table or database name 'mysqltest-1'"
);
connection
master
;
connection
master
;
--
disable_warnings
--
disable_warnings
...
...
mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
View file @
0150dc6e
call mtr.add_suppression("table or database name '.otherdir'");
select @@ignore_db_dirs;
select @@ignore_db_dirs;
@@ignore_db_dirs
@@ignore_db_dirs
e,lost+found,.mysqlgui,ignored_db
e,lost+found,.mysqlgui,ignored_db
...
...
mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
View file @
0150dc6e
call
mtr
.
add_suppression
(
"table or database name '.otherdir'"
);
select
@@
ignore_db_dirs
;
select
@@
ignore_db_dirs
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
...
...
mysql-test/t/create.test
View file @
0150dc6e
call
mtr
.
add_suppression
(
"table or database name 't-1'"
);
#
#
# Check some special create statements.
# Check some special create statements.
#
#
...
...
mysql-test/t/drop.test
View file @
0150dc6e
call
mtr
.
add_suppression
(
"table or database name 'abc`def'"
);
# Initialise
# Initialise
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
...
...
mysql-test/t/mysqlcheck.test
View file @
0150dc6e
call
mtr
.
add_suppression
(
"Invalid .old.. table or database name"
);
# Embedded server doesn't support external clients
# Embedded server doesn't support external clients
--
source
include
/
not_embedded
.
inc
--
source
include
/
not_embedded
.
inc
...
...
mysql-test/t/upgrade.test
View file @
0150dc6e
call
mtr
.
add_suppression
(
"Invalid .old.. table or database name"
);
--
source
include
/
not_embedded
.
inc
--
source
include
/
not_embedded
.
inc
--
disable_warnings
--
disable_warnings
...
...
sql/handler.cc
View file @
0150dc6e
...
@@ -4950,10 +4950,9 @@ static int cmp_table_names(LEX_STRING * const *a, LEX_STRING * const *b)
...
@@ -4950,10 +4950,9 @@ static int cmp_table_names(LEX_STRING * const *a, LEX_STRING * const *b)
Discovered_table_list
::
Discovered_table_list
(
THD
*
thd_arg
,
Discovered_table_list
::
Discovered_table_list
(
THD
*
thd_arg
,
Dynamic_array
<
LEX_STRING
*>
*
tables_arg
,
Dynamic_array
<
LEX_STRING
*>
*
tables_arg
,
const
LEX_STRING
*
wild_arg
)
const
LEX_STRING
*
wild_arg
)
:
thd
(
thd_arg
),
with_temps
(
false
),
tables
(
tables_arg
)
{
{
thd
=
thd_arg
;
tables
=
tables_arg
;
if
(
wild_arg
->
str
&&
wild_arg
->
str
[
0
])
if
(
wild_arg
->
str
&&
wild_arg
->
str
[
0
])
{
{
wild
=
wild_arg
->
str
;
wild
=
wild_arg
->
str
;
...
@@ -4965,6 +4964,12 @@ Discovered_table_list::Discovered_table_list(THD *thd_arg,
...
@@ -4965,6 +4964,12 @@ Discovered_table_list::Discovered_table_list(THD *thd_arg,
bool
Discovered_table_list
::
add_table
(
const
char
*
tname
,
size_t
tlen
)
bool
Discovered_table_list
::
add_table
(
const
char
*
tname
,
size_t
tlen
)
{
{
/*
TODO Check with_temps and filter out temp tables.
Implement the check, when we'll have at least one affected engine (with
custom discover_table_names() method, that calls add_table() directly).
Note: avoid comparing the same name twice (here and in add_file).
*/
if
(
wild
&&
my_wildcmp
(
files_charset_info
,
tname
,
tname
+
tlen
,
wild
,
wend
,
if
(
wild
&&
my_wildcmp
(
files_charset_info
,
tname
,
tname
+
tlen
,
wild
,
wend
,
wild_prefix
,
wild_one
,
wild_many
))
wild_prefix
,
wild_one
,
wild_many
))
return
0
;
return
0
;
...
@@ -4977,8 +4982,13 @@ bool Discovered_table_list::add_table(const char *tname, size_t tlen)
...
@@ -4977,8 +4982,13 @@ bool Discovered_table_list::add_table(const char *tname, size_t tlen)
bool
Discovered_table_list
::
add_file
(
const
char
*
fname
)
bool
Discovered_table_list
::
add_file
(
const
char
*
fname
)
{
{
bool
is_temp
=
strncmp
(
fname
,
STRING_WITH_LEN
(
tmp_file_prefix
))
==
0
;
if
(
is_temp
&&
!
with_temps
)
return
0
;
char
tname
[
SAFE_NAME_LEN
+
1
];
char
tname
[
SAFE_NAME_LEN
+
1
];
size_t
tlen
=
filename_to_tablename
(
fname
,
tname
,
sizeof
(
tname
));
size_t
tlen
=
filename_to_tablename
(
fname
,
tname
,
sizeof
(
tname
)
,
is_temp
);
return
add_table
(
tname
,
tlen
);
return
add_table
(
tname
,
tlen
);
}
}
...
@@ -5037,6 +5047,22 @@ static my_bool discover_names(THD *thd, plugin_ref plugin,
...
@@ -5037,6 +5047,22 @@ static my_bool discover_names(THD *thd, plugin_ref plugin,
return
0
;
return
0
;
}
}
/**
Return the list of tables
@param thd
@param db database to look into
@param dirp list of files in this database (as returned by my_dir())
@param result the object to return the list of files in
@param reusable if true, on return, 'dirp' will be a valid list of all
non-table files. If false, discovery will work much faster,
but it will leave 'dirp' corrupted and completely unusable,
only good for my_dirend().
Normally, reusable=false for SHOW and INFORMATION_SCHEMA, and reusable=true
for DROP DATABASE (as it needs to know and delete non-table files).
*/
int
ha_discover_table_names
(
THD
*
thd
,
LEX_STRING
*
db
,
MY_DIR
*
dirp
,
int
ha_discover_table_names
(
THD
*
thd
,
LEX_STRING
*
db
,
MY_DIR
*
dirp
,
Discovered_table_list
*
result
,
bool
reusable
)
Discovered_table_list
*
result
,
bool
reusable
)
{
{
...
...
sql/handler.h
View file @
0150dc6e
...
@@ -3962,11 +3962,14 @@ class Discovered_table_list: public handlerton::discovered_list
...
@@ -3962,11 +3962,14 @@ class Discovered_table_list: public handlerton::discovered_list
{
{
THD
*
thd
;
THD
*
thd
;
const
char
*
wild
,
*
wend
;
const
char
*
wild
,
*
wend
;
bool
with_temps
;
// whether to include temp tables in the result
public:
public:
Dynamic_array
<
LEX_STRING
*>
*
tables
;
Dynamic_array
<
LEX_STRING
*>
*
tables
;
Discovered_table_list
(
THD
*
thd_arg
,
Dynamic_array
<
LEX_STRING
*>
*
tables_arg
,
Discovered_table_list
(
THD
*
thd_arg
,
Dynamic_array
<
LEX_STRING
*>
*
tables_arg
,
const
LEX_STRING
*
wild_arg
);
const
LEX_STRING
*
wild_arg
);
Discovered_table_list
(
THD
*
thd_arg
,
Dynamic_array
<
LEX_STRING
*>
*
tables_arg
)
:
thd
(
thd_arg
),
wild
(
NULL
),
with_temps
(
true
),
tables
(
tables_arg
)
{}
~
Discovered_table_list
()
{}
~
Discovered_table_list
()
{}
bool
add_table
(
const
char
*
tname
,
size_t
tlen
);
bool
add_table
(
const
char
*
tname
,
size_t
tlen
);
...
...
sql/sql_acl.cc
View file @
0150dc6e
...
@@ -1872,7 +1872,9 @@ int acl_check_setrole(THD *thd, char *rolename, ulonglong *access)
...
@@ -1872,7 +1872,9 @@ int acl_check_setrole(THD *thd, char *rolename, ulonglong *access)
continue
;
continue
;
acl_user
=
(
ACL_USER
*
)
acl_user_base
;
acl_user
=
(
ACL_USER
*
)
acl_user_base
;
if
(
acl_user
->
wild_eq
(
thd
->
security_ctx
->
user
,
thd
->
security_ctx
->
host
))
/* Yes! priv_user@host. Don't ask why - that's what check_access() does. */
if
(
acl_user
->
wild_eq
(
thd
->
security_ctx
->
priv_user
,
thd
->
security_ctx
->
host
))
{
{
is_granted
=
TRUE
;
is_granted
=
TRUE
;
break
;
break
;
...
...
sql/sql_db.cc
View file @
0150dc6e
...
@@ -992,7 +992,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
...
@@ -992,7 +992,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
/* first, get the list of tables */
/* first, get the list of tables */
Dynamic_array
<
LEX_STRING
*>
files
(
dirp
->
number_of_files
);
Dynamic_array
<
LEX_STRING
*>
files
(
dirp
->
number_of_files
);
Discovered_table_list
tl
(
thd
,
&
files
,
&
null_lex_str
);
Discovered_table_list
tl
(
thd
,
&
files
);
if
(
ha_discover_table_names
(
thd
,
&
db
,
dirp
,
&
tl
,
true
))
if
(
ha_discover_table_names
(
thd
,
&
db
,
dirp
,
&
tl
,
true
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
...
sql/sql_table.cc
View file @
0150dc6e
...
@@ -369,11 +369,8 @@ uint explain_filename(THD* thd,
...
@@ -369,11 +369,8 @@ uint explain_filename(THD* thd,
Table name length.
Table name length.
*/
*/
uint
filename_to_tablename
(
const
char
*
from
,
char
*
to
,
uint
to_length
uint
filename_to_tablename
(
const
char
*
from
,
char
*
to
,
uint
to_length
,
#ifndef DBUG_OFF
bool
stay_quiet
)
,
bool
stay_quiet
#endif
/* DBUG_OFF */
)
{
{
uint
errors
;
uint
errors
;
size_t
res
;
size_t
res
;
...
@@ -386,7 +383,7 @@ uint filename_to_tablename(const char *from, char *to, uint to_length
...
@@ -386,7 +383,7 @@ uint filename_to_tablename(const char *from, char *to, uint to_length
{
{
res
=
(
strxnmov
(
to
,
to_length
,
MYSQL50_TABLE_NAME_PREFIX
,
from
,
NullS
)
-
res
=
(
strxnmov
(
to
,
to_length
,
MYSQL50_TABLE_NAME_PREFIX
,
from
,
NullS
)
-
to
);
to
);
if
(
IF_DBUG
(
!
stay_quiet
,
0
)
)
if
(
!
stay_quiet
)
sql_print_error
(
"Invalid (old?) table or database name '%s'"
,
from
);
sql_print_error
(
"Invalid (old?) table or database name '%s'"
,
from
);
}
}
...
...
sql/sql_table.h
View file @
0150dc6e
...
@@ -137,11 +137,8 @@ static const uint SKIP_SYMDIR_ACCESS= 1 << 5;
...
@@ -137,11 +137,8 @@ static const uint SKIP_SYMDIR_ACCESS= 1 << 5;
/** Don't check foreign key constraints while renaming table */
/** Don't check foreign key constraints while renaming table */
static
const
uint
NO_FK_CHECKS
=
1
<<
6
;
static
const
uint
NO_FK_CHECKS
=
1
<<
6
;
uint
filename_to_tablename
(
const
char
*
from
,
char
*
to
,
uint
to_length
uint
filename_to_tablename
(
const
char
*
from
,
char
*
to
,
uint
to_length
,
#ifndef DBUG_OFF
bool
stay_quiet
=
false
);
,
bool
stay_quiet
=
false
#endif
/* DBUG_OFF */
);
uint
tablename_to_filename
(
const
char
*
from
,
char
*
to
,
uint
to_length
);
uint
tablename_to_filename
(
const
char
*
from
,
char
*
to
,
uint
to_length
);
uint
check_n_cut_mysql50_prefix
(
const
char
*
from
,
char
*
to
,
uint
to_length
);
uint
check_n_cut_mysql50_prefix
(
const
char
*
from
,
char
*
to
,
uint
to_length
);
bool
check_mysql50_prefix
(
const
char
*
name
);
bool
check_mysql50_prefix
(
const
char
*
name
);
...
...
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