diff options
author | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-11-13 20:06:45 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-11-13 20:06:45 +0400 |
commit | ea1f7e4b5697c3275c301011beaa394548f273ae (patch) | |
tree | 24f445de7d3e3981e59c68744b1c7dda5f765e32 /mysql-test/t | |
parent | 71419317f1955d8ea00cee070e224b2e55857cc2 (diff) | |
download | mariadb-git-ea1f7e4b5697c3275c301011beaa394548f273ae.tar.gz |
several fixes to make tests pass in embedded-server mode
libmysqld/lib_sql.cc:
check for bootstrap added
mysql-test/include/federated.inc:
disabled in embedded
mysql-test/mysql-test-run.pl:
we disable ssh in embedded server
mysql-test/r/bdb.result:
part moved to bdb_notembedded as it uses binlog
mysql-test/r/flush_block_commit.result:
part moved to flush_block_commit_notembedded
mysql-test/r/insert.result:
part moved to insert_notembedded as delayed works differently in embedded server
mysql-test/r/insert_select.result:
part moved to insert_notembedded as GRANTS usually disabled in embedded server
mysql-test/r/join.result:
access rights hidden in result
mysql-test/t/backup.test:
now available in embedded server
mysql-test/t/bdb.test:
part moved to bdb_notembedded as it uses binlog
mysql-test/t/delayed.test:
code trimmed
mysql-test/t/execution_constants.test:
skipped in embedded-server mode
mysql-test/t/flush_block_commit.test:
moved to flush_block_commit_notembedded
mysql-test/t/information_schema_db.test:
skipped in embedded-server
mysql-test/t/innodb.test:
directories replaced to be embedded-server compliant
mysql-test/t/insert.test:
part moved to insert_notembedded
mysql-test/t/insert_select.test:
part moved to insert_notembedded
mysql-test/t/join.test:
access rights hidden
mysql-test/t/status.test:
skipped in embedded server
mysql-test/t/trigger.test:
directories replaced to be embedded-server compliant
sql/item_strfunc.cc:
extra contexts not needed whan access checks disabled
sql/share/errmsg.txt:
bigger paths reserved to prevent test's fails
mysql-test/r/bdb_notembedded.result:
***MISSING WEAVE***
mysql-test/r/flush_block_commit_notembedded.result:
added
mysql-test/r/insert_notembedded.result:
added
mysql-test/t/bdb_notembedded.test:
***MISSING WEAVE***
mysql-test/t/flush_block_commit_notembedded.test:
added
mysql-test/t/insert_notembedded.test:
added
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/backup.test | 3 | ||||
-rw-r--r-- | mysql-test/t/bdb.test | 35 | ||||
-rw-r--r-- | mysql-test/t/delayed.test | 3 | ||||
-rw-r--r-- | mysql-test/t/execution_constants.test | 3 | ||||
-rw-r--r-- | mysql-test/t/flush_block_commit.test | 21 | ||||
-rw-r--r-- | mysql-test/t/flush_block_commit_notembedded.test | 32 | ||||
-rw-r--r-- | mysql-test/t/information_schema_db.test | 4 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 1 | ||||
-rw-r--r-- | mysql-test/t/insert.test | 12 | ||||
-rw-r--r-- | mysql-test/t/insert_notembedded.test | 154 | ||||
-rw-r--r-- | mysql-test/t/insert_select.test | 137 | ||||
-rw-r--r-- | mysql-test/t/join.test | 2 | ||||
-rw-r--r-- | mysql-test/t/status.test | 3 | ||||
-rw-r--r-- | mysql-test/t/trigger.test | 1 |
14 files changed, 200 insertions, 211 deletions
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 053e83528e0..a3339ecce69 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -1,6 +1,3 @@ -# This test should work in embedded server after we fix mysqltest --- source include/not_embedded.inc - # # This test is a bit tricky as we can't use backup table to overwrite an old # table diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index ec05eeb3c34..d017d91bfb1 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -1019,39 +1019,4 @@ commit; alter table t1 add primary key(a); drop table t1; - -# -# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode -# -set autocommit=1; - -let $VERSION=`select version()`; - -reset master; -create table bug16206 (a int); -insert into bug16206 values(1); -start transaction; -insert into bug16206 values(2); -commit; ---replace_result $VERSION VERSION ---replace_column 1 f 2 n 5 n -show binlog events; -drop table bug16206; - -reset master; -create table bug16206 (a int) engine= bdb; -insert into bug16206 values(0); -insert into bug16206 values(1); -start transaction; -insert into bug16206 values(2); -commit; -insert into bug16206 values(3); ---replace_result $VERSION VERSION ---replace_column 1 f 2 n 5 n -show binlog events; -drop table bug16206; - -set autocommit=0; - - --echo End of 5.0 tests diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index f9a7312346f..fe8bc167e0f 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -5,9 +5,6 @@ # (Can't be tested with purify :( ) # -# This tests not performed with embedded server --- source include/not_embedded.inc - --disable_warnings drop table if exists t1; --enable_warnings diff --git a/mysql-test/t/execution_constants.test b/mysql-test/t/execution_constants.test index 00967b2eeba..4930164d3fa 100644 --- a/mysql-test/t/execution_constants.test +++ b/mysql-test/t/execution_constants.test @@ -1,3 +1,6 @@ +# In embedded server we don't really have a control over stack usage +-- source include/not_embedded.inc + # # Bug#21476: Lost Database Connection During Query # diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test index 4412b2c357c..0c1d2b82df6 100644 --- a/mysql-test/t/flush_block_commit.test +++ b/mysql-test/t/flush_block_commit.test @@ -75,24 +75,3 @@ show create database test; drop table t1; # End of 4.1 tests - -# FLUSH TABLES WITH READ LOCK should block writes to binlog too -connection con1; -create table t1 (a int) engine=innodb; -reset master; -set autocommit=0; -insert t1 values (1); -connection con2; -flush tables with read lock; -show master status; -connection con1; -send commit; -connection con2; -sleep 1; -show master status; -unlock tables; -connection con1; -reap; -drop table t1; -set autocommit=1; - diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test new file mode 100644 index 00000000000..4650a5a15a8 --- /dev/null +++ b/mysql-test/t/flush_block_commit_notembedded.test @@ -0,0 +1,32 @@ +# Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing +# transactions. +# We verify that we did not introduce a deadlock. +# This is intended to mimick how mysqldump and innobackup work. + +# And it requires InnoDB +-- source include/not_embedded.inc +-- source include/have_innodb.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +# FLUSH TABLES WITH READ LOCK should block writes to binlog too +connection con1; +create table t1 (a int) engine=innodb; +reset master; +set autocommit=0; +insert t1 values (1); +connection con2; +flush tables with read lock; +show master status; +connection con1; +send commit; +connection con2; +sleep 1; +show master status; +unlock tables; +connection con1; +reap; +drop table t1; +set autocommit=1; + diff --git a/mysql-test/t/information_schema_db.test b/mysql-test/t/information_schema_db.test index 4dfe1ad56b5..e15e50e8766 100644 --- a/mysql-test/t/information_schema_db.test +++ b/mysql-test/t/information_schema_db.test @@ -1,3 +1,7 @@ +# this test mostly test privilege control (what doesn't work +# in the embedded server by default). So disabled in embedded-server mode +-- source include/not_embedded.inc + -- source include/testdb_only.inc --disable_warnings diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 0c083ccdfd3..561d47253d2 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2154,6 +2154,7 @@ select * from t1, t2 drop table t1, t2; # bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID" +--replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / --error 1005 CREATE TABLE t1 (DB_ROW_ID int) engine=innodb; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index ac43d0bc818..029c4d19e63 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -177,18 +177,6 @@ select count(*) from t2; drop table t1,t2,t3; # -# Test for INSERT DELAYED INTO a <view> -# BUG#13683: INSERT DELAYED into a view creates an infinite loop -# - -create table t1 (n int); -create view v1 as select * from t1; ---error 1347 -insert delayed into v1 values (1); -drop table t1; -drop view v1; - -# # Test for values returned by ROW_COUNT() function # (and thus for values returned by mysql_affected_rows()) # for various forms of INSERT diff --git a/mysql-test/t/insert_notembedded.test b/mysql-test/t/insert_notembedded.test new file mode 100644 index 00000000000..bdea72e9eca --- /dev/null +++ b/mysql-test/t/insert_notembedded.test @@ -0,0 +1,154 @@ +-- source include/not_embedded.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# Test for INSERT DELAYED INTO a <view> +# BUG#13683: INSERT DELAYED into a view creates an infinite loop +# + +create table t1 (n int); +create view v1 as select * from t1; +--error 1347 +insert delayed into v1 values (1); +drop table t1; +drop view v1; + +# +# Bug #20989: View '(null).(null)' references invalid table(s)... on +# SQL SECURITY INVOKER +# +# this is really the fact that REPLACE ... SELECT required additional +# INSERT privs (on tables that are part of a view) over the related +# REPLACE, SELECT +# + +CREATE DATABASE meow; + +connect (root,localhost,root,,meow); +connection root; + +CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id)); +CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id)); +CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id)); +CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2; +CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3; + +CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE); +INSERT INTO table_stations VALUES ('87654321','XXXX','YY'); + +CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country)); +INSERT INTO table_countries VALUES ('YY','Entenhausen'); + +CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country))); + +CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id)); +INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00'); + +GRANT SELECT ON table_source TO user20989@localhost; +GRANT SELECT ON table_countries TO user20989@localhost; +GRANT SELECT ON table_stations TO user20989@localhost; +GRANT SELECT ON view_stations TO user20989@localhost; +GRANT SELECT ON table_target TO user20989@localhost; +GRANT SELECT ON table_target2 TO user20989@localhost; +GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost; + +connect (user20989,localhost,user20989,,meow); +connection user20989; + +--error 1142 +REPLACE INTO table_target +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN table_target AS old +USING (mexs_id); + +--error 1142 +REPLACE INTO view_target2 +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN view_target2 AS old +USING (mexs_id); + +--error 1356 +REPLACE INTO view_target3 +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN view_target3 AS old +USING (mexs_id); + +connection root; +disconnect user20989; + +GRANT INSERT,DELETE ON table_target TO user20989@localhost; +GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost; +GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost; + +connect (user20989,localhost,user20989,,meow); +connection user20989; + +REPLACE INTO table_target +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN table_target AS old +USING (mexs_id); + +--error 1142 +REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00'); +REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00'); + +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN view_target2 AS old +USING (mexs_id); + +REPLACE INTO view_target2 +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN view_target2 AS old +USING (mexs_id); + +REPLACE INTO view_target3 +SELECT stations.mexs_id AS mexs_id, datetime AS messzeit +FROM table_source +INNER JOIN view_stations AS stations +ON table_source.id = stations.icao +LEFT JOIN view_target3 AS old +USING (mexs_id); + +connection root; +disconnect user20989; + +SELECT * FROM table_target; +SELECT * FROM view_target2; +SELECT * FROM view_target3; + +DROP VIEW view_stations; +DROP TABLE table_source; +DROP TABLE table_countries; +DROP TABLE table_stations; +DROP TABLE table_target; +DROP TABLE table_target2; +DROP TABLE table_target3; +DROP VIEW view_target2; +DROP VIEW view_target3; +DROP USER user20989@localhost; + +disconnect root; + +connection default; + +DROP DATABASE meow; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 6f86ed897ac..404d67390ab 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -266,140 +266,3 @@ INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1; DROP DATABASE bug21774_1; DROP DATABASE bug21774_2; -# -# Bug #20989: View '(null).(null)' references invalid table(s)... on -# SQL SECURITY INVOKER -# -# this is really the fact that REPLACE ... SELECT required additional -# INSERT privs (on tables that are part of a view) over the related -# REPLACE, SELECT -# - -CREATE DATABASE meow; - -connect (root,localhost,root,,meow); -connection root; - -CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id)); -CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id)); -CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id)); -CREATE VIEW view_target2 AS SELECT mexs_id,messzeit FROM table_target2; -CREATE SQL SECURITY INVOKER VIEW view_target3 AS SELECT mexs_id,messzeit FROM table_target3; - -CREATE TABLE table_stations ( mexs_id VARCHAR(8), icao VARCHAR(4), country CHAR(2), PRIMARY KEY (mexs_id), UNIQUE KEY icao (icao), KEY country (country), CONSTRAINT stations_ibfk_8 FOREIGN KEY (country) REFERENCES countries (country) ON UPDATE CASCADE); -INSERT INTO table_stations VALUES ('87654321','XXXX','YY'); - -CREATE TABLE table_countries ( country CHAR(2), iso_short_en VARCHAR(64), PRIMARY KEY (country)); -INSERT INTO table_countries VALUES ('YY','Entenhausen'); - -CREATE ALGORITHM=MERGE SQL SECURITY INVOKER VIEW view_stations AS select table_stations.mexs_id AS mexs_id, table_stations.icao AS icao, table_stations.country AS landescode from (table_stations join table_countries on((table_stations.country = table_countries.country))); - -CREATE TABLE table_source ( id varchar(4), datetime TIMESTAMP, PRIMARY KEY (id)); -INSERT INTO table_source VALUES ('XXXX','2006-07-12 07:50:00'); - -GRANT SELECT ON table_source TO user20989@localhost; -GRANT SELECT ON table_countries TO user20989@localhost; -GRANT SELECT ON table_stations TO user20989@localhost; -GRANT SELECT ON view_stations TO user20989@localhost; -GRANT SELECT ON table_target TO user20989@localhost; -GRANT SELECT ON table_target2 TO user20989@localhost; -GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost; - -connect (user20989,localhost,user20989,,meow); -connection user20989; - ---error 1142 -REPLACE INTO table_target -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN table_target AS old -USING (mexs_id); - ---error 1142 -REPLACE INTO view_target2 -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN view_target2 AS old -USING (mexs_id); - ---error 1356 -REPLACE INTO view_target3 -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN view_target3 AS old -USING (mexs_id); - -connection root; -disconnect user20989; - -GRANT INSERT,DELETE ON table_target TO user20989@localhost; -GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost; -GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost; - -connect (user20989,localhost,user20989,,meow); -connection user20989; - -REPLACE INTO table_target -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN table_target AS old -USING (mexs_id); - ---error 1142 -REPLACE INTO table_target2 VALUES ('00X45Y78','2006-07-12 07:50:00'); -REPLACE INTO view_target2 VALUES ('12X45Y78','2006-07-12 07:50:00'); - -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN view_target2 AS old -USING (mexs_id); - -REPLACE INTO view_target2 -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN view_target2 AS old -USING (mexs_id); - -REPLACE INTO view_target3 -SELECT stations.mexs_id AS mexs_id, datetime AS messzeit -FROM table_source -INNER JOIN view_stations AS stations -ON table_source.id = stations.icao -LEFT JOIN view_target3 AS old -USING (mexs_id); - -connection root; -disconnect user20989; - -SELECT * FROM table_target; -SELECT * FROM view_target2; -SELECT * FROM view_target3; - -DROP VIEW view_stations; -DROP TABLE table_source; -DROP TABLE table_countries; -DROP TABLE table_stations; -DROP TABLE table_target; -DROP TABLE table_target2; -DROP TABLE table_target3; -DROP VIEW view_target2; -DROP VIEW view_target3; -DROP USER user20989@localhost; - -disconnect root; - -connection default; - -DROP DATABASE meow; diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index 27558a31d68..f6804ed3db5 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -520,6 +520,8 @@ select * from v1a join v1b on t1.b = t2.b; # # Bug #17523 natural join and information_schema # +# We mask out the Privileges column because it differs with embedded server +--replace_column 31 # select * from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user'; diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 9d5adf57f81..3f7671b18d4 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -1,3 +1,6 @@ +# embedded server causes different stat +-- source include/not_embedded.inc + # PS causes different statistics --disable_ps_protocol diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 6bd812d473e..969047929b9 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1140,6 +1140,7 @@ select trigger_schema, trigger_name, event_object_schema, # Trick which makes update of second .TRN file impossible system echo dummy >$MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; system chmod 000 $MYSQLTEST_VARDIR/master-data/test/t1_ai.TRN~; +--replace_result $MYSQLTEST_VARDIR . master-data/ '' --error 1 rename table t1 to t2; # 't1' should be still there and triggers should work correctly |