diff options
author | monty@donna.mysql.fi <> | 2001-03-03 03:03:12 +0200 |
---|---|---|
committer | monty@donna.mysql.fi <> | 2001-03-03 03:03:12 +0200 |
commit | 5ccbbd83f29b1057cfbe869259c4cb009b89a9d2 (patch) | |
tree | cd2f65141c35a1998982970704a3f854a987c568 /mysql-test | |
parent | f2d31048eb843d0209bfe4f6e2e2e0b3a57cc6f4 (diff) | |
download | mariadb-git-5ccbbd83f29b1057cfbe869259c4cb009b89a9d2.tar.gz |
Fixes for innobase usage
Fixed bug when using TEXT columns with BDB tables
Allow LOAD DATA INFILE to use numbers with ENUM and SET columns
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/install_test_db.sh | 2 | ||||
-rw-r--r-- | mysql-test/mysql-test-run.sh | 1 | ||||
-rw-r--r-- | mysql-test/r/bdb.result | 2 | ||||
-rw-r--r-- | mysql-test/t/bdb.test | 298 | ||||
-rw-r--r-- | mysql-test/t/innobase.test | 32 |
5 files changed, 303 insertions, 32 deletions
diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index e59b87cbe1c..3e6595f0b40 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -193,7 +193,7 @@ then fi if $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata << END_OF_DATA + --basedir=$basedir --datadir=$ldata --skip-innobase --skip-bdb --skip-gemini << END_OF_DATA use mysql; $c_d $i_d diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index be5e997bf3d..7ebf054b0d4 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -358,6 +358,7 @@ start_master() --core \ --tmpdir=$MYSQL_TMP_DIR \ --language=english \ + --innobase_data_file_path=ibdata1:50M \ $SMALL_SERVER \ $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" if [ x$DO_DDD = x1 ] diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 085a4214f35..4e7aab9594b 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -481,3 +481,5 @@ i j 1 2 i j 1 2 +build_path +current diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 72fbbe1dafa..8b9c1511840 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -429,4 +429,302 @@ create index ax1 on t1 (i,j); select * from t1 where i=1 and j=2; drop table t1; +# +# Test of with CONST tables and TEXT columns +# This gave a wrong result because the row information was freed too early +# +drop table if exists t1, t2, t3, t4, t5, t6, t7; +create table t1 +( + branch_id int auto_increment primary key, + branch_name varchar(255) not null, + branch_active int not null default 1, + + unique branch_name(branch_name), + index branch_active(branch_active) +) type=bdb; +drop table if exists t2 ; +create table t2 +( + target_id int auto_increment primary key, + target_name varchar(255) not null, + target_active int not null default 1, + + unique target_name(target_name), + index target_active(target_active) +) type=bdb; +drop table if exists t3 ; +create table t3 +( + platform_id int auto_increment primary key, + platform_name varchar(255) not null, + platform_active int not null default 1, + + unique platform_name(platform_name), + index platform_active(platform_active) +) type=bdb; +drop table if exists t4 ; +create table t4 +( + product_id int auto_increment primary key, + product_name varchar(255) not null, + version_file varchar(255) not null, + product_active int not null default 1, + + unique product_name(product_name), + index product_active(product_active) +) type=bdb; +drop table if exists t5 ; +create table t5 +( + product_file_id int auto_increment primary key, + product_id int not null, + file_name varchar(255) not null, + /* cvs module used to find the file version */ + module_name varchar(255) not null, + /* flag whether the file is still included in the product */ + file_included int not null default 1, + + unique product_file(product_id,file_name), + index file_included(file_included) +) type=bdb; +drop table if exists t6 ; +create table t6 +( + file_platform_id int auto_increment primary key, + product_file_id int not null, + platform_id int not null, + branch_id int not null, + /* filename in the build system */ + build_filename varchar(255) not null, + /* default filename in the build archive */ + archive_filename varchar(255) not null, + + unique file_platform(product_file_id,platform_id,branch_id) +) type=bdb; +drop table if exists ba_archive ; +create table ba_archive +( + archive_id int auto_increment primary key, + branch_id int not null, + target_id int not null, + platform_id int not null, + product_id int not null, + status_id int not null default 1, + + unique archive(branch_id,target_id,platform_id,product_id), + index status_id(status_id) +) type=bdb; +drop table if exists t7 ; +create table t7 +( + build_id int auto_increment primary key, + branch_id int not null, + target_id int not null, + build_number int not null, + build_date date not null, + /* build system tag, e.g. 'rmanight-022301-1779' */ + build_tag varchar(255) not null, + /* path relative to the build archive root, e.g. 'current' */ + build_path text not null, + + unique build(branch_id,target_id,build_number) +) type=bdb; +drop table if exists t4_build ; +create table t4_build +( + product_build_id int auto_increment primary key, + build_id int not null, + product_id int not null, + platform_id int not null, + /* flag whether this is a released build */ + product_release int not null default 0, + /* user-defined tag, e.g. 'RealPlayer 8.0' */ + release_tag varchar(255) not null, + + unique product_build(build_id,product_id,platform_id), + index product_release(product_release), + index release_tag(release_tag) +) type=bdb; +drop table if exists t7_file ; +create table t7_file +( + build_file_id int auto_increment primary key, + product_build_id int not null, + product_file_id int not null, + /* actual filename in the build archive */ + filename text not null, + /* actual path in the build archive */ + file_path text not null, + /* file version string, e.g. '8.0.1.368' */ + file_version varchar(255) not null, + + unique build_file(product_build_id,product_file_id), + index file_version(file_version) +) type=bdb; +drop table if exists ba_status ; +create table ba_status +( + status_id int auto_increment primary key, + status_name varchar(255) not null, + status_desc text not null +) type=bdb; +insert into ba_status + (status_name, status_desc) +values + ('new', 'This item has been newly added.'), + ('archived', 'This item is currently archived.'), + ('not archived', 'This item is currently not archived.'), + ('obsolete', 'This item is obsolete.'), + ('unknown', 'The status of this item is unknown.') ; + +insert into t1 (branch_name) +values ('RealMedia'); +insert into t1 (branch_name) +values ('RP8REV'); +insert into t1 (branch_name) +values ('SERVER_8_0_GOLD'); + +insert into t2 (target_name) +values ('rmanight'); +insert into t2 (target_name) +values ('playerall'); +insert into t2 (target_name) +values ('servproxyall'); + +insert into t3 (platform_name) +values ('linux-2.0-libc6-i386'); +insert into t3 (platform_name) +values ('win32-i386'); + +insert into t4 (product_name, version_file) +values ('realserver', 'servinst'); +insert into t4 (product_name, version_file) +values ('realproxy', 'prxyinst'); +insert into t4 (product_name, version_file) +values ('realplayer', 'playinst'); +insert into t4 (product_name, version_file) +values ('plusplayer', 'plusinst'); + +create temporary table tmp1 + select branch_id, target_id, platform_id, product_id + from t1, t2, t3, t4 ; +create temporary table tmp2 + select tmp1.branch_id, tmp1.target_id, tmp1.platform_id, tmp1.product_id + from tmp1 left join ba_archive + using (branch_id,target_id,platform_id,product_id) + where ba_archive.archive_id is null ; +insert into ba_archive + (branch_id, target_id, platform_id, product_id, status_id) + select branch_id, target_id, platform_id, product_id, 1 + from tmp2 ; +drop table tmp1 ; +drop table tmp2 ; + +insert into t5 (product_id, file_name, module_name) +values (1, 'servinst', 'server'); + +insert into t5 (product_id, file_name, module_name) +values (2, 'prxyinst', 'server'); + +insert into t5 (product_id, file_name, module_name) +values (3, 'playinst', 'rpapp'); + +insert into t5 (product_id, file_name, module_name) +values (4, 'plusinst', 'rpapp'); + +insert into t6 +(product_file_id,platform_id,branch_id,build_filename,archive_filename) +values (1, 2, 3, 'servinst.exe', 'win32-servinst.exe'); + +insert into t6 +(product_file_id,platform_id,branch_id,build_filename,archive_filename) +values (1, 1, 3, 'v80_linux-2.0-libc6-i386_servinst.bin', 'linux2-servinst.exe'); + +insert into t6 +(product_file_id,platform_id,branch_id,build_filename,archive_filename) +values (3, 2, 2, 'playinst.exe', 'win32-playinst.exe'); + +insert into t6 +(product_file_id,platform_id,branch_id,build_filename,archive_filename) +values (4, 2, 2, 'playinst.exe', 'win32-playinst.exe'); + +insert into t7 +(branch_id,target_id,build_number,build_tag,build_date,build_path) +values (2, 2, 1071, 'playerall-022101-1071', '2001-02-21', 'current'); + +insert into t7 +(branch_id,target_id,build_number,build_tag,build_date,build_path) +values (2, 2, 1072, 'playerall-022201-1072', '2001-02-22', 'current'); + +insert into t7 +(branch_id,target_id,build_number,build_tag,build_date,build_path) +values (3, 3, 388, 'servproxyall-022201-388', '2001-02-22', 'current'); + +insert into t7 +(branch_id,target_id,build_number,build_tag,build_date,build_path) +values (3, 3, 389, 'servproxyall-022301-389', '2001-02-23', 'current'); + +insert into t7 +(branch_id,target_id,build_number,build_tag,build_date,build_path) +values (4, 4, 100, 'foo target-010101-100', '2001-01-01', 'current'); + +insert into t4_build +(build_id, product_id, platform_id) +values (1, 3, 2); + +insert into t4_build +(build_id, product_id, platform_id) +values (2, 3, 2); + +insert into t4_build +(build_id, product_id, platform_id) +values (3, 1, 2); + +insert into t4_build +(build_id, product_id, platform_id) +values (4, 1, 2); + +insert into t4_build +(build_id, product_id, platform_id) +values (5, 5, 3); + +insert into t7_file +(product_build_id, product_file_id, filename, file_path, file_version) +values (1, 3, 'win32-playinst.exe', 'RP8REV/current/playerall-022101-1071/win32-i386', '8.0.3.263'); + +insert into t7_file +(product_build_id, product_file_id, filename, file_path, file_version) +values (5, 5, 'file1.exe', 'foo branch/current/foo target-022101-1071/foo platform', 'version 1'); + +insert into t7_file +(product_build_id, product_file_id, filename, file_path, file_version) +values (5, 6, 'file2.exe', 'foo branch/current/foo target-022101-1071/foo platform', 'version 2'); + +update ba_archive +set status_id=2 +where branch_id=2 and target_id=2 and platform_id=2 and product_id=1; + +select t7.build_path +from + t1, + t7, + t2, + t3, + t4, + t5, + t6 +where + t7.branch_id = t1.branch_id and + t7.target_id = t2.target_id and + t5.product_id = t4.product_id and + t6.product_file_id = t5.product_file_id and + t6.platform_id = t3.platform_id and + t6.branch_id = t6.branch_id and + t7.build_id = 1 and + t4.product_id = 3 and + t5.file_name = 'playinst' and + t3.platform_id = 2; + +drop table t1, t2, t3, t4, t5, t6,t7; diff --git a/mysql-test/t/innobase.test b/mysql-test/t/innobase.test index 8b814500154..bca10751c13 100644 --- a/mysql-test/t/innobase.test +++ b/mysql-test/t/innobase.test @@ -33,7 +33,7 @@ INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2), update t1 set parent_id=parent_id+100; select * from t1 where parent_id=102; update t1 set id=id+1000; --- error 1062 +-- error 1062,1022 update t1 set id=1024 where id=1009; select * from t1; update ignore t1 set id=id+1; # This will change all rows @@ -96,22 +96,6 @@ select * from t1 where a = 1; drop table t1; # -# Test auto_increment on sub key -# - -create table t1 (a char(10) not null, b int not null auto_increment, primary key(a,b)) type=innobase; -insert into t1 values ("a",1),("b",2),("a",2),("c",1); -insert into t1 values ("a",NULL),("b",NULL),("c",NULL),("e",NULL); -insert into t1 (a) values ("a"),("b"),("c"),("d"); -insert into t1 (a) values ('k'),('d'); -insert into t1 (a) values ("a"); -insert into t1 values ("d",last_insert_id()); -select * from t1; -flush tables; -select count(*) from t1; -drop table t1; - -# # Test rollback # @@ -392,20 +376,6 @@ select a from t1; drop table t1; # -# Test key on blob with null values -# -create table t1 (b blob, i int, key (b(100)), key (i), key (i, b(20))) type=innobase; -insert into t1 values ('this is a blob', 1), (null, -1), (null, null),("",1),("",2),("",3); -select b from t1 where b = 'this is a blob'; -select * from t1 where b like 't%'; -select b, i from t1 where b is not null; -select * from t1 where b is null and i > 0; -select * from t1 where i is NULL; -update t1 set b='updated' where i=1; -select * from t1; -drop table t1; - -# # Test with variable length primary key # create table t1 (a varchar(100) not null, primary key(a), b int not null) type=innobase; |