mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
0afb6ff660
(Needed for "list of pushes" web page and autopush) include/mysql.h: Fix to embedded server to be able to run tests on it libmysql/libmysql.c: Fix to embedded server to be able to run tests on it libmysqld/emb_qcache.cc: Fix to embedded server to be able to run tests on it libmysqld/embedded_priv.h: Fix to embedded server to be able to run tests on it libmysqld/lib_sql.cc: Fix to embedded server to be able to run tests on it libmysqld/libmysqld.c: Fix to embedded server to be able to run tests on it mysql-test/mysql-test-run.sh: Fix to embedded server to be able to run tests on it mysql-test/r/binlog.result: Updated test for embedded server mysql-test/r/ctype_cp932.result: Updated test for embedded server mysql-test/r/innodb.result: Updated test for embedded server mysql-test/r/mysqltest.result: Updated test for embedded server mysql-test/r/query_cache.result: Updated test for embedded server mysql-test/r/query_cache_notembedded.result: Updated test for embedded server mysql-test/r/sp-error.result: Updated test for embedded server mysql-test/r/sp.result: Updated test for embedded server mysql-test/r/subselect.result: Updated test for embedded server mysql-test/r/view.result: Updated test for embedded server mysql-test/r/view_grant.result: Updated test for embedded server mysql-test/t/backup.test: Updated test for embedded server mysql-test/t/binlog.test: Updated test for embedded server mysql-test/t/blackhole.test: Updated test for embedded server mysql-test/t/compress.test: Updated test for embedded server mysql-test/t/ctype_cp932.test: Updated test for embedded server mysql-test/t/delayed.test: Updated test for embedded server mysql-test/t/handler.test: Updated test for embedded server mysql-test/t/innodb.test: Updated test for embedded server mysql-test/t/mysql.test: Updated test for embedded server mysql-test/t/mysql_client_test.test: Updated test for embedded server mysql-test/t/mysqltest.test: Updated test for embedded server mysql-test/t/query_cache.test: Updated test for embedded server mysql-test/t/query_cache_notembedded.test: Updated test for embedded server mysql-test/t/read_only.test: Updated test for embedded server mysql-test/t/skip_grants.test: Updated test for embedded server mysql-test/t/sp-destruct.test: Updated test for embedded server mysql-test/t/sp-error.test: Updated test for embedded server mysql-test/t/sp-threads.test: Updated test for embedded server mysql-test/t/sp.test: Updated test for embedded server mysql-test/t/subselect.test: Updated test for embedded server mysql-test/t/temp_table.test: Updated test for embedded server mysql-test/t/view.test: Updated test for embedded server mysql-test/t/view_grant.test: Updated test for embedded server mysql-test/t/wait_timeout.test: Updated test for embedded server mysys/mf_dirname.c: Review fix: Don't access data outside of array mysys/my_bitmap.c: Remove compiler warnings scripts/mysql_fix_privilege_tables.sql: Add flush privileges to .sql script so that one doesn't have to reboot mysqld when one runs the mysql_fix_privilege_script sql-common/client.c: Updated test for embedded server sql/item.cc: Remove DBUG_PRINT statement that can cause crashes when running with --debug sql/mysqld.cc: Fix to embedded server to be able to run tests on it sql/protocol.cc: Fix to embedded server to be able to run tests on it (Trivial reconstruction of code) sql/protocol.h: Fix to embedded server to be able to run tests on it sql/sql_base.cc: Better comment sql/sql_class.cc: Fix to embedded server to be able to run tests on it sql/sql_class.h: Fix to embedded server to be able to run tests on it sql/sql_cursor.cc: Fix to embedded server to be able to run tests on it sql/sql_parse.cc: Fix to embedded server to be able to run tests on it Don't crash for disabled commands when using embedded server sql/sql_prepare.cc: Fix to embedded server to be able to run tests on it mysql-test/r/ctype_cp932_notembedded.result: New BitKeeper file ``mysql-test/r/ctype_cp932_notembedded.result'' mysql-test/r/innodb_notembedded.result: New BitKeeper file ``mysql-test/r/innodb_notembedded.result'' mysql-test/r/sp.result.orig: New BitKeeper file ``mysql-test/r/sp.result.orig'' mysql-test/r/sp_notembedded.result: New BitKeeper file ``mysql-test/r/sp_notembedded.result'' mysql-test/r/subselect_notembedded.result: New BitKeeper file ``mysql-test/r/subselect_notembedded.result'' mysql-test/t/ctype_cp932_notembedded.test: New BitKeeper file ``mysql-test/t/ctype_cp932_notembedded.test'' mysql-test/t/innodb_notembedded.test: New BitKeeper file ``mysql-test/t/innodb_notembedded.test'' mysql-test/t/sp.test.orig: New BitKeeper file ``mysql-test/t/sp.test.orig'' mysql-test/t/sp_notembedded.test: New BitKeeper file ``mysql-test/t/sp_notembedded.test'' mysql-test/t/subselect_notembedded.test: New BitKeeper file ``mysql-test/t/subselect_notembedded.test''
130 lines
3.8 KiB
Text
130 lines
3.8 KiB
Text
#
|
|
# Simple test for blackhole example
|
|
# Taken from the select test
|
|
#
|
|
-- source include/not_embedded.inc
|
|
-- source include/have_blackhole.inc
|
|
|
|
--disable_warnings
|
|
drop table if exists t1,t2;
|
|
--enable_warnings
|
|
|
|
CREATE TABLE t1 (
|
|
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
|
|
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
|
|
) ENGINE=blackhole;
|
|
|
|
INSERT INTO t1 VALUES (9410,9412);
|
|
|
|
select period from t1;
|
|
select * from t1;
|
|
select t1.* from t1;
|
|
|
|
#
|
|
# Create test table
|
|
#
|
|
|
|
CREATE TABLE t2 (
|
|
auto int NOT NULL auto_increment,
|
|
fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,
|
|
companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,
|
|
fld3 char(30) DEFAULT '' NOT NULL,
|
|
fld4 char(35) DEFAULT '' NOT NULL,
|
|
fld5 char(35) DEFAULT '' NOT NULL,
|
|
fld6 char(4) DEFAULT '' NOT NULL,
|
|
primary key (auto)
|
|
) ENGINE=blackhole;
|
|
|
|
INSERT INTO t2 VALUES (1192,068305,00,'Colombo','hardware','colicky','');
|
|
INSERT INTO t2 VALUES (1193,000000,00,'nondecreasing','implant','thrillingly','');
|
|
--enable_query_log
|
|
|
|
#
|
|
# Search with a key
|
|
#
|
|
|
|
select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";
|
|
select fld3 from t2 where fld3 like "%cultivation" ;
|
|
|
|
#
|
|
# Search with a key using sorting and limit the same time
|
|
#
|
|
|
|
select t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;
|
|
select fld3,companynr from t2 where companynr = 58 order by fld3;
|
|
|
|
select fld3 from t2 order by fld3 desc limit 10;
|
|
select fld3 from t2 order by fld3 desc limit 5;
|
|
select fld3 from t2 order by fld3 desc limit 5,5;
|
|
|
|
#
|
|
# Search with a key having a constant with each unique key.
|
|
# The table is read directly with read-next on fld3
|
|
#
|
|
|
|
select t2.fld3 from t2 where fld3 = 'honeysuckle';
|
|
select t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';
|
|
select t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';
|
|
select t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';
|
|
select t2.fld3 from t2 where fld3 LIKE 'h%le';
|
|
|
|
select t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';
|
|
select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';
|
|
|
|
#
|
|
# Test sorting with a used key (there is no need for sorting)
|
|
#
|
|
|
|
select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;
|
|
select fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;
|
|
|
|
|
|
# Test for fulltext
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
|
|
INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
|
|
('Full-text indexes', 'are called collections'),
|
|
('Only MyISAM tables','support collections'),
|
|
('Function MATCH ... AGAINST()','is used to do a search'),
|
|
('Full-text search in MySQL', 'implements vector space model');
|
|
SHOW INDEX FROM t1;
|
|
|
|
# nl search
|
|
|
|
select * from t1 where MATCH(a,b) AGAINST ("collections");
|
|
explain extended select * from t1 where MATCH(a,b) AGAINST ("collections");
|
|
select * from t1 where MATCH(a,b) AGAINST ("indexes");
|
|
select * from t1 where MATCH(a,b) AGAINST ("indexes collections");
|
|
select * from t1 where MATCH(a,b) AGAINST ("only");
|
|
|
|
# Test that every DML (except SELECT) and DDL gets into binlog
|
|
# so that blackhole can be used as "binlog propagator"
|
|
|
|
reset master;
|
|
drop table t1,t2;
|
|
create table t1 (a int) engine=blackhole;
|
|
delete from t1 where a=10;
|
|
update t1 set a=11 where a=15;
|
|
insert into t1 values(1);
|
|
insert ignore into t1 values(1);
|
|
replace into t1 values(100);
|
|
create table t2 (a varchar(200)) engine=blackhole;
|
|
load data infile '../std_data_ln/words.dat' into table t2;
|
|
alter table t1 add b int;
|
|
alter table t1 drop b;
|
|
create table t3 like t1;
|
|
insert into t1 select * from t3;
|
|
replace into t1 select * from t3;
|
|
# Just to verify
|
|
select * from t1;
|
|
select * from t2;
|
|
select * from t3;
|
|
|
|
let $VERSION=`select version()`;
|
|
--replace_result $VERSION VERSION
|
|
--replace_column 2 # 5 #
|
|
show binlog events;
|
|
|
|
drop table t1,t2,t3;
|
|
|
|
# End of 4.1 tests
|