Commit graph

152 commits

Author SHA1 Message Date
Sergei Golubchik
1fce368089 MDEV-13636 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
correct detection of changes in DATA/INDEX DIRECTORY
2017-09-18 10:40:26 +02:00
Sergei Golubchik
e74f2e2b86 Merge branch '10.0' 10.1 2017-04-28 20:19:32 +02:00
Sergei Golubchik
663068c6ee Merge remote-tracking branch 'mysql/5.5' into 5.5 2017-04-11 10:18:04 -04:00
Dyre Tjeldvoll
7849a27cfb Bug#25514146: DB_NAME IS IGNORED WHEN CREATING TABLE WITH DATA DIRECTORY
Problem: CREATE TABLE using a fully qualified name with INDEX DIR/DATA DIR
option reports an error when the current database is not SET.

check_access() was incorrectly called with NULL as the database
argument in a situation where the database name was not needed for
the particular privilege being checked. This will cause the current
database to be used, or an error to be reported if there is no current
database.

Fix: Call check_access() with any_db as the database argument in this situation.
2017-02-23 14:48:25 +01:00
Vladislav Vaintroub
3a24f1cf84 MDEV-9307 - provide info about DATA/INDEX directory in INFORMATION_SCHEMA.TA
BLES (in CREATE_OPTIONS column)
2016-02-22 12:48:03 +01:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Dmitry Lenev
600647c7d8 Fix for bug #11759990 - "52354: 'CREATE TABLE .. LIKE ... '
STATEMENTS FAIL".

Attempt to execute CREATE TABLE LIKE statement on a MyISAM
table with INDEX or DATA DIRECTORY options specified as a
source resulted in "MyISAM table '...' is in use..." error.
According to our documentation such a statement should create
a copy of source table with DATA/INDEX DIRECTORY options
omitted.

The problem was that new implementation of CREATE TABLE LIKE
statement in 5.5 tried to copy value of INDEX and DATA DIRECTORY
parameters from the source table. Since in description of source
table this parameters also included name of this table, attempt
to create target table with these parameter led to file name
conflict and error.

This fix addresses the problem by preserving documented and
backward-compatible behavior. I.e. by ensuring that contents
of DATA/INDEX DIRECTORY clauses for the source table is
ignored when target table is created.

mysql-test/r/symlink.result:
  Added test for bug #11759990 - "52354: 'CREATE TABLE ..
  LIKE ... ' STATEMENTS FAIL".
mysql-test/t/symlink.test:
  Added test for bug #11759990 - "52354: 'CREATE TABLE ..
  LIKE ... ' STATEMENTS FAIL".
sql/sql_table.cc:
  Changed CREATE TABLE LIKE implementation to ignore contents
  of DATA/INDEX DIRECTORY clauses for source table when target
  table is created. This is documented and backward-compatible
  behavior.
2011-06-09 16:54:12 +04:00
Dmitry Lenev
95f1b6762b Fix for bug #11759990 - "52354: 'CREATE TABLE .. LIKE ... '
STATEMENTS FAIL".

Attempt to execute CREATE TABLE LIKE statement on a MyISAM
table with INDEX or DATA DIRECTORY options specified as a
source resulted in "MyISAM table '...' is in use..." error.
According to our documentation such a statement should create
a copy of source table with DATA/INDEX DIRECTORY options
omitted.

The problem was that new implementation of CREATE TABLE LIKE
statement in 5.5 tried to copy value of INDEX and DATA DIRECTORY
parameters from the source table. Since in description of source
table this parameters also included name of this table, attempt
to create target table with these parameter led to file name
conflict and error.

This fix addresses the problem by preserving documented and
backward-compatible behavior. I.e. by ensuring that contents
of DATA/INDEX DIRECTORY clauses for the source table is
ignored when target table is created.
2011-06-09 16:54:12 +04:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Sandeep Doddaballapur
29c2d1724d 2011-01-31 15:04:39 +05:30
Sandeep Doddaballapur
61163b51e0 2011-01-31 15:04:39 +05:30
Sergey Vojtovich
ab1242b9e3 BUG#40980 - Drop table can remove another MyISAM table's
data and index files

It was possible if DATA/INDEX DIRECTORY is pointing to
symlinked MySQL data home directory.

Do not allow to drop data/index files implicitly symlinked
to data home directory. For such tables remove symlink only.

mysql-test/r/symlink.result:
  A test case for BUG#40980.
mysql-test/t/symlink.test:
  A test case for BUG#40980.
storage/myisam/mi_delete_table.c:
  Do not allow to drop data/index files implicitly symlinked
  to data home directory. For such tables remove symlink only.
2010-04-01 18:49:02 +04:00
Sergey Vojtovich
4050910f03 BUG#40980 - Drop table can remove another MyISAM table's
data and index files

It was possible if DATA/INDEX DIRECTORY is pointing to
symlinked MySQL data home directory.

Do not allow to drop data/index files implicitly symlinked
to data home directory. For such tables remove symlink only.
2010-04-01 18:49:02 +04:00
Alfranio Correia
19f859a27e merge 5.1 --> 5.1-rpl 2008-12-13 19:42:12 +00:00
Alfranio Correia
3175a06a13 merge 5.1 --> 5.1-rpl 2008-12-13 19:42:12 +00:00
Ingo Struewing
a8d3f0325b Bug#41002 - symlink.test fails on symlinked datadir
symlink.test failed when run in an environment that has mysql-test/var
symlinked to elsewhere, e.g. a memory file system. This is the case
when running mysql-test-run --mem.

In this case the server does not detect that the directory specified
with a DATA/INDEX DIRECTORY clause is within its data home directory.
This problem was reported as Bug#39277 (Creation of table with data
and/or index files in data home directory succeeds). It was decided
that it will not be fixed in 5.1. Hence, the current behavior is
accepted for 5.1. It will be fixed in 6.0 though.

Fixed the test case so that it works in both environments. 1. When no
symbolic link is involved, the server notices that the data/index
directory is in its data hone directory and rejects the CREATE/ALTER
TABLE statement. 2. When the data home directory is symlinked, it
does not notice the problem and executes the statement sucessfully.


mysql-test/r/symlink.result:
  Bug#41002 - symlink.test fails on symlinked datadir
  Updated test result.
mysql-test/t/symlink.test:
  Bug#41002 - symlink.test fails on symlinked datadir
  Adjusted the test case to the accepted behavior.
  It needs to accept success and failure of some statements.
2008-11-25 15:06:31 +01:00
Ingo Struewing
6673b2849a Bug#41002 - symlink.test fails on symlinked datadir
symlink.test failed when run in an environment that has mysql-test/var
symlinked to elsewhere, e.g. a memory file system. This is the case
when running mysql-test-run --mem.

In this case the server does not detect that the directory specified
with a DATA/INDEX DIRECTORY clause is within its data home directory.
This problem was reported as Bug#39277 (Creation of table with data
and/or index files in data home directory succeeds). It was decided
that it will not be fixed in 5.1. Hence, the current behavior is
accepted for 5.1. It will be fixed in 6.0 though.

Fixed the test case so that it works in both environments. 1. When no
symbolic link is involved, the server notices that the data/index
directory is in its data hone directory and rejects the CREATE/ALTER
TABLE statement. 2. When the data home directory is symlinked, it
does not notice the problem and executes the statement sucessfully.
2008-11-25 15:06:31 +01:00
Mats Kindahl
32c161f3ea Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
Mats Kindahl
1f29c52581 Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
Patrick Crews
446fd5044c Merge 5.0 -> 5.1 2008-09-30 15:32:35 -04:00
Patrick Crews
99abc81c5f Merge 5.0 -> 5.1 2008-09-30 15:32:35 -04:00
Patrick Crews
f5c1c9af8e Bug#38311 - Fix of some cruft from remove_files in ndb_autodiscover.test, clean up of distinct.test,
and replacing error numbers with error names.
2008-09-23 05:24:32 -04:00
Patrick Crews
51c40c5bd0 Bug#38311 - Fix of some cruft from remove_files in ndb_autodiscover.test, clean up of distinct.test,
and replacing error numbers with error names.
2008-09-23 05:24:32 -04:00
Patrick Crews
404e4b802c Bug#38311 Some tests use 'rm' which is not portable
Substituted use of MTR's remove_file function in the tests
Started with 5.0 tree and will clean up any offenders discovered during upmerge.
2008-09-20 02:21:28 -04:00
Patrick Crews
2a419a5627 Bug#38311 Some tests use 'rm' which is not portable
Substituted use of MTR's remove_file function in the tests
Started with 5.0 tree and will clean up any offenders discovered during upmerge.
2008-09-20 02:21:28 -04:00
He Zhenxing
b17458dcc1 Merge 5.1 main -> 5.1-rpl 2008-09-06 08:51:17 +08:00
He Zhenxing
6e86e05823 Merge 5.1 main -> 5.1-rpl 2008-09-06 08:51:17 +08:00
Alexey Botchkov
5b68e3dc30 merging fix 2008-08-26 14:50:32 +05:00
Alexey Botchkov
3b1adb501e merging fixes 2008-08-26 14:21:07 +05:00
Alexey Botchkov
ab1ce67eb0 merging fix 2008-08-26 14:50:32 +05:00
Alexey Botchkov
d7445d0493 merging fixes 2008-08-26 14:21:07 +05:00
Alexey Botchkov
491dc13898 merging 2008-08-23 07:47:43 +05:00
Alexey Botchkov
871201db3d merging 2008-08-23 07:47:43 +05:00
Alexey Botchkov
ec524d50a8 Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
test_if_data_home_dir fixed to look into real path.
            Checks added to mi_open for symlinks into data home directory.

per-file messages:
        include/my_sys.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink interface added
        include/myisam.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlink interface added
        myisam/mi_check.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile calls modified
        myisam/mi_open.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          code added to mi_open to check for symlinks into data home directory.
          mi_open_datafile now accepts 'original' file path to check if it's
          an allowed symlink.
        myisam/mi_static.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invlaid_symlink defined
        myisam/myisamchk.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile call modified
        myisam/myisamdef.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile interface modified - 'real_path' parameter added
        mysql-test/r/symlink.test
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error codes corrected as some patch now rejected pointing inside datahome
        mysql-test/r/symlink.result
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected in the result
        mysys/my_symlink.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink() implementsd
          my_realpath() now returns the 'realpath' even if a file isn't a symlink
        sql/mysql_priv.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          test_if_data_home_dir interface
        sql/mysqld.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
        sql/sql_parse.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected
          test_if_data_home_dir code fixed
2008-08-22 17:31:53 +05:00
Alexey Botchkov
69657f972b Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
test_if_data_home_dir fixed to look into real path.
            Checks added to mi_open for symlinks into data home directory.

per-file messages:
        include/my_sys.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink interface added
        include/myisam.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlink interface added
        myisam/mi_check.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile calls modified
        myisam/mi_open.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          code added to mi_open to check for symlinks into data home directory.
          mi_open_datafile now accepts 'original' file path to check if it's
          an allowed symlink.
        myisam/mi_static.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invlaid_symlink defined
        myisam/myisamchk.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile call modified
        myisam/myisamdef.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile interface modified - 'real_path' parameter added
        mysql-test/r/symlink.test
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error codes corrected as some patch now rejected pointing inside datahome
        mysql-test/r/symlink.result
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected in the result
        mysys/my_symlink.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink() implementsd
          my_realpath() now returns the 'realpath' even if a file isn't a symlink
        sql/mysql_priv.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          test_if_data_home_dir interface
        sql/mysqld.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
        sql/sql_parse.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected
          test_if_data_home_dir code fixed
2008-08-22 17:31:53 +05:00
unknown
7674605d79 Fix paths in test and result files
mysql-test/r/loaddata.result:
  Update paths in result
mysql-test/r/myisam.result:
  Update paths in result
mysql-test/r/partition_not_windows.result:
  Update paths in result
mysql-test/r/symlink.result:
  Update paths in result
mysql-test/suite/binlog/r/binlog_index.result:
  Update paths in result
mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test:
  Update paths
mysql-test/suite/binlog/t/binlog_index.test:
  Update paths
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
  Fix merge error s/start-position/stop-position/
mysql-test/t/drop.test:
  Update paths
mysql-test/t/loaddata.test:
  Update paths
mysql-test/t/myisam.test:
  Update paths
mysql-test/t/partition_not_windows.test:
  Update paths
mysql-test/t/symlink.test:
  Update paths
2008-04-03 21:40:10 +02:00
msvensson@pilot.mysql.com
95d9608d3e Fix paths in test and result files 2008-04-03 21:40:10 +02:00
unknown
030318d824 Merge stella.local:/home2/mydev/mysql-5.1-ateam
into  stella.local:/home2/mydev/mysql-5.1-axmrg


mysql-test/r/partition_not_windows.result:
  Auto merged
mysql-test/r/partition_symlink.result:
  Auto merged
mysql-test/r/symlink.result:
  Auto merged
mysql-test/suite/parts/r/partition_basic_innodb.result:
  Auto merged
mysql-test/suite/parts/r/partition_basic_myisam.result:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/t/partition_symlink.test:
  Manual merge
mysql-test/t/symlink.test:
  Manual merge
sql/sql_parse.cc:
  Manual merge
2008-03-20 12:22:02 +01:00
istruewing@stella.local
8c0300dae9 Merge stella.local:/home2/mydev/mysql-5.1-ateam
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2008-03-20 12:22:02 +01:00
unknown
166357b552 Bug#35305: partition_symlink test failures
Updated the test due to bug 32167

Corrected spelling of error message


mysql-test/r/partition_not_windows.result:
  Updated test result due to test case changes and corrected spelling error
mysql-test/r/partition_symlink.result:
  Bug#35305: partition_symlink test failure
  
  Updated test result due to test case changes
mysql-test/r/symlink.result:
  Updated test result due to test case changes and corrected spelling error
mysql-test/t/disabled.def:
  Bug#35305: partition_symlink test failure
  
  Enable the test after it has been fixed
mysql-test/t/partition_not_windows.test:
  Removed disable/enable_query_log for better result files
mysql-test/t/partition_symlink.test:
  Bug#35305: partition_symlink test failure
  
  Changes due to bug 32167
mysql-test/t/symlink.test:
  using replace_result instead of disable_query_log
sql/partition_info.cc:
  corrected spelling
sql/sql_parse.cc:
  corrected spelling
2008-03-17 16:11:26 +01:00
mattiasj@witty.
d733351148 Bug#35305: partition_symlink test failures
Updated the test due to bug 32167

Corrected spelling of error message
2008-03-17 16:11:26 +01:00
unknown
4801c682e7 Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1


configure.in:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/partition_symlink.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/partition_info.h:
  Auto merged
sql/rpl_rli.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
mysql-test/r/symlink.result:
  manual merge
mysql-test/suite/parts/inc/partition_basic.inc:
  manual merge
mysql-test/suite/parts/r/partition_basic_innodb.result:
  manual merge
mysql-test/suite/parts/r/partition_basic_myisam.result:
  manual merge
mysql-test/t/partition_symlink.test:
  manual merge
mysql-test/t/symlink.test:
  manual merge
sql/sql_parse.cc:
  manual merge
2008-03-14 11:13:54 -07:00
antony@pcg5ppc.xiphis.org
91e44529bd Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1
2008-03-14 11:13:54 -07:00
unknown
9fa2d50559 Post-merge fix. Moved the symlink handling from sql_parse.cc here.
mysql-test/r/symlink.result:
  Post-merge fix
mysql-test/t/symlink.test:
  Post-merge fix
2008-03-14 14:03:47 +01:00
istruewing@stella.local
ed89b81b3f Post-merge fix. Moved the symlink handling from sql_parse.cc here. 2008-03-14 14:03:47 +01:00
unknown
e79249f81b Manual merge
configure.in:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/partition_symlink.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/partition_info.h:
  Auto merged
sql/rpl_rli.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_parse.cc:
  Manual merge. Needs later fix. New code in create table was not
  accepted. Needs to be added to mysql_create_table_no_lock().
2008-03-14 12:02:11 +01:00
istruewing@stella.local
eabe082d6f Manual merge 2008-03-14 12:02:11 +01:00
unknown
2cb35cd680 test case fix 2008-03-03 15:02:34 +04:00
gluh@mysql.com/mgluh.(none)
fc1ae07785 test case fix 2008-03-03 15:02:34 +04:00