mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Symlinking of tables should not work.
Fixed error number handling bug in mysqltest. Fixed that error number from insert delayed is reported correctly. merged new vio code with old violite code. client/mysqltest.c: Fixed bug that error numbers wasn't tested properly. myisam/mi_check.c: Moved initialization of variables to avoid a bug. myisam/mi_create.c: Fixed bug in symlink handling. myisam/mi_test_all.sh: Fixed script so that it works. myisam/myisamchk.c: Removed --no-symlinks option mysql-test/mysql-test-run.sh: Cleaned up error message mysql-test/t/bdb.test: Fixed wrong error numbers mysql-test/t/err000001.test: Fixed wrong error numbers mysql-test/t/innodb.test: Fixed wrong error numbers mysql-test/t/overflow.test: Fixed wrong error numbers mysql-test/t/status.test: Ensure that we are using myisam tables for the lock test. mysys/my_delete.c: cleanup mysys/my_symlink2.c: Added option to not overwrite files when using symlinks. sql/Makefile.am: Moved vio to avoid link error. sql/ha_myisam.cc: Fixed symlink handling. sql/mysqld.cc: Changed --skip-symlinks to --skip-symlink sql/sql_insert.cc: Fixed that error number from insert delayed is reported correctly sql/sql_parse.cc: Fixed symlink handling. sql/sql_table.cc: Fixed symlink handling. vio/vio.c: cleanup vio/viosocket.c: c
This commit is contained in:
@ -99,8 +99,9 @@ export MYSQL_TEST_DIR
|
||||
STD_DATA=$MYSQL_TEST_DIR/std_data
|
||||
hostname=`hostname` # Installed in the mysql privilege table
|
||||
|
||||
TESTDIR="$MYSQL_TEST_DIR/t/"
|
||||
TESTDIR="$MYSQL_TEST_DIR/t"
|
||||
TESTSUFFIX=test
|
||||
TOT_SKIP=0
|
||||
TOT_PASS=0
|
||||
TOT_FAIL=0
|
||||
TOT_TEST=0
|
||||
@ -359,8 +360,10 @@ report_stats () {
|
||||
$ECHO ""
|
||||
$ECHO "The log files in $MYSQL_TEST_DIR/var/log may give you some hint"
|
||||
$ECHO "of what when wrong."
|
||||
$ECHO "If you want to report this error, please read first the documentation at"
|
||||
$ECHO "http://www.mysql.com/doc/M/y/MySQL_test_suite.html"
|
||||
$ECHO ""
|
||||
$ECHO "Please follow the instructions outlined at"
|
||||
$ECHO "http://www.mysql.com/doc/R/e/Reporting_mysqltest_bugs.html"
|
||||
$ECHO "to find the reason to this problem and how to report this."
|
||||
fi
|
||||
}
|
||||
|
||||
@ -640,7 +643,7 @@ run_testcase ()
|
||||
timestr="$USERT $SYST $REALT"
|
||||
pname=`$ECHO "$tname "|$CUT -c 1-16`
|
||||
RES="$pname $timestr"
|
||||
pass_inc
|
||||
skip_inc
|
||||
$ECHO "$RES$RES_SPACE [ skipped ]"
|
||||
return
|
||||
fi
|
||||
@ -747,7 +750,7 @@ run_testcase ()
|
||||
$ECHO "Resuming Tests"
|
||||
$ECHO ""
|
||||
else
|
||||
pass_inc
|
||||
skip_inc
|
||||
$ECHO "$RES$RES_SPACE [ skipped ]"
|
||||
fi
|
||||
fi
|
||||
|
2
mysql-test/r/have_symlink.require
Normal file
2
mysql-test/r/have_symlink.require
Normal file
@ -0,0 +1,2 @@
|
||||
Variable_name Value
|
||||
have_symlink YES
|
23
mysql-test/r/symlink.result
Normal file
23
mysql-test/r/symlink.result
Normal file
@ -0,0 +1,23 @@
|
||||
Table Op Msg_type Msg_text
|
||||
test.t9 check status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t9 optimize status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t9 repair status OK
|
||||
Table Create Table
|
||||
t9 CREATE TABLE `t9` (
|
||||
`a` int(11) NOT NULL auto_increment,
|
||||
`b` char(16) NOT NULL default '',
|
||||
`c` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) TYPE=MyISAM
|
||||
count(*)
|
||||
16724
|
||||
Table Create Table
|
||||
t9 CREATE TABLE `t9` (
|
||||
`a` int(11) NOT NULL auto_increment,
|
||||
`b` char(16) NOT NULL default '',
|
||||
`c` int(11) NOT NULL default '0',
|
||||
`d` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`a`)
|
||||
) TYPE=MyISAM
|
@ -686,7 +686,7 @@ drop table t1;
|
||||
create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb;
|
||||
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
|
||||
LOCK TABLES t1 WRITE;
|
||||
--error 690
|
||||
--error 1062
|
||||
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
|
||||
select id from t1;
|
||||
select id from t1;
|
||||
@ -697,7 +697,7 @@ create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(3
|
||||
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
|
||||
LOCK TABLES t1 WRITE;
|
||||
begin;
|
||||
--error 690
|
||||
--error 1062
|
||||
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
|
||||
select id from t1;
|
||||
insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
|
||||
|
@ -10,7 +10,8 @@ create table t1 (a int);
|
||||
!$1054 select count(test.t1.b) from t1;
|
||||
!$1109 select count(not_existing_database.t1) from t1;
|
||||
!$1109 select count(not_existing_database.t1.a) from t1;
|
||||
!$1044 select count(not_existing_database.t1.a) from not_existing_database.t1;
|
||||
--error 1044,1146
|
||||
select count(not_existing_database.t1.a) from not_existing_database.t1;
|
||||
!$1054 select 1 from t1 order by 2;
|
||||
!$1054 select 1 from t1 group by 2;
|
||||
!$1054 select 1 from t1 order by t1.b;
|
||||
|
@ -437,7 +437,7 @@ drop table t1;
|
||||
create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=innodb;
|
||||
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
|
||||
LOCK TABLES t1 WRITE;
|
||||
--error 690
|
||||
--error 1062
|
||||
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
|
||||
select id from t1;
|
||||
select id from t1;
|
||||
@ -448,7 +448,7 @@ create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(3
|
||||
insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
|
||||
LOCK TABLES t1 WRITE;
|
||||
begin;
|
||||
--error 690
|
||||
--error 1062
|
||||
insert into t1 values (99,1,2,'D'),(1,1,2,'D');
|
||||
select id from t1;
|
||||
insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
|
||||
|
@ -1,4 +1,4 @@
|
||||
connect (con1,localhost,boo,,);
|
||||
connection con1;
|
||||
-- error 1064;
|
||||
-- error 1064,1102
|
||||
drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
|
||||
|
@ -6,7 +6,7 @@ show status like 'Table_lock%';
|
||||
connection con1;
|
||||
SET SQL_LOG_BIN=0;
|
||||
drop table if exists t1;
|
||||
create table t1(n int);
|
||||
create table t1(n int) type=myisam;
|
||||
insert into t1 values(1);
|
||||
connection con2;
|
||||
lock tables t1 read;
|
||||
|
82
mysql-test/t/symlink.test
Normal file
82
mysql-test/t/symlink.test
Normal file
@ -0,0 +1,82 @@
|
||||
-- require r/have_symlink.require
|
||||
show variables like "have_symlink";
|
||||
|
||||
#
|
||||
# First create little data to play with
|
||||
#
|
||||
drop table if exists t1,t2,t7,t8,t9;
|
||||
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a));
|
||||
create table t2 (a int not null auto_increment, b char(16) not null, primary key (a));
|
||||
insert into t1 (b) values ("test"),("test1"),("test2"),("test3");
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
insert into t2 (b) select b from t1;
|
||||
insert into t1 (b) select b from t2;
|
||||
drop table t2;
|
||||
|
||||
#
|
||||
# Start the test
|
||||
# We use t9 here to not crash with tables generated by the backup test
|
||||
#
|
||||
|
||||
eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="$MYSQL_TEST_DIR/var/tmp" index directory="$MYSQL_TEST_DIR/var/run";
|
||||
insert into t9 select * from t1;
|
||||
check table t9;
|
||||
optimize table t9;
|
||||
repair table t9;
|
||||
alter table t9 add column c int not null;
|
||||
show create table t9;
|
||||
|
||||
# Test renames
|
||||
alter table t9 rename t8, add column d int not null;
|
||||
alter table t8 rename t7;
|
||||
rename table t7 to t9;
|
||||
# Drop old t1 table, keep t9
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test error handling
|
||||
# Note that we are using the above table t9 here!
|
||||
#
|
||||
|
||||
--error 1103
|
||||
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="tmp";
|
||||
|
||||
# Check that we cannot link over a table from another database.
|
||||
|
||||
drop database if exists test_mysqltest;
|
||||
create database test_mysqltest;
|
||||
|
||||
--error 1
|
||||
create table test_mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="/this-dir-does-not-exist";
|
||||
|
||||
--error 1103
|
||||
create table test_mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="not-hard-path";
|
||||
|
||||
--error 1
|
||||
eval create table test_mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam index directory="$MYSQL_TEST_DIR/var/run";
|
||||
|
||||
--error 1
|
||||
eval create table test_mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) type=myisam data directory="$MYSQL_TEST_DIR/var/tmp";
|
||||
|
||||
# Check moving table t9 from default database to test_mysqltest;
|
||||
# In this case the symlinks should be removed.
|
||||
|
||||
alter table t9 rename test_mysqltest.t9;
|
||||
select count(*) from test_mysqltest.t9;
|
||||
show create table test_mysqltest.t9;
|
||||
drop database test_mysqltest;
|
Reference in New Issue
Block a user