mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	Simplify testing of needed characterset Remove ndb from --with-plugins=max build mysqlbug now sends email to maria-developers@lists.launchpad.net client/mysqltest.cc: SKIP now expands variables (for better error messages) mysql-test/include/have_big5.inc: Simplify by using have_collation.inc mysql-test/include/have_collation.inc: Test if '$collation' is supported mysql-test/include/have_cp1250_ch.inc: Simplify by using have_collation.inc mysql-test/include/have_cp1251.inc: Simplify by using have_collation.inc mysql-test/include/have_cp866.inc: Simplify by using have_collation.inc mysql-test/include/have_cp932.inc: Simplify by using have_collation.inc mysql-test/include/have_eucjpms.inc: Simplify by using have_collation.inc mysql-test/include/have_euckr.inc: Simplify by using have_collation.inc mysql-test/include/have_gb2312.inc: Simplify by using have_collation.inc mysql-test/include/have_gbk.inc: Simplify by using have_collation.inc mysql-test/include/have_koi8r.inc: Simplify by using have_collation.inc mysql-test/include/have_latin2_ch.inc: Simplify by using have_collation.inc mysql-test/include/have_sjis.inc: Simplify by using have_collation.inc mysql-test/include/have_tis620.inc: Simplify by using have_collation.inc mysql-test/include/have_ucs2.inc: Simplify by using have_collation.inc mysql-test/include/have_ujis.inc: Simplify by using have_collation.inc mysql-test/include/have_utf8.inc: Simplify by using have_collation.inc mysql-test/r/create-uca.result: Create tests that uses unicode mysql-test/r/create.result: Move test with unicode to create-uca.test mysql-test/r/have_big5.require: Not needed anymore mysql-test/r/have_cp1250_ch.require: Not needed anymore mysql-test/r/have_cp1251.require: Not needed anymore mysql-test/r/have_cp866.require: Not needed anymore mysql-test/r/have_cp932.require: Not needed anymore mysql-test/r/have_eucjpms.require: Not needed anymore mysql-test/r/have_euckr.require: Not needed anymore mysql-test/r/have_gb2312.require: Not needed anymore mysql-test/r/have_gbk.require: Not needed anymore mysql-test/r/have_koi8r.require: Not needed anymore mysql-test/r/have_latin2_ch.require: Not needed anymore mysql-test/r/have_sjis.require: Not needed anymore mysql-test/r/have_tis620.require: Not needed anymore mysql-test/r/have_ucs2.require: Not needed anymore mysql-test/r/have_ujis.require: Not needed anymore mysql-test/r/have_utf8.require: Not needed anymore mysql-test/r/innodb.result: Move tests that depends on unicode to innodb_utf8.test mysql-test/r/innodb_utf8.result: Test moved from innodb.test mysql-test/suite/rpl/t/rpl_ignore_table.test: Test for required collations mysql-test/t/create-uca.test: Create tests that uses unicode mysql-test/t/create.test: Move test with unicode to create-uca.test mysql-test/t/ctype_utf8.test: Test that require unicode mysql-test/t/ddl_i18n_koi8r.test: Test for required collations mysql-test/t/ddl_i18n_utf8.test: Test for required collations mysql-test/t/fulltext.test: Test for required collations mysql-test/t/fulltext2.test: Test for required collations mysql-test/t/innodb.test: Move tests that depends on unicode to innodb_utf8.test mysql-test/t/innodb_utf8.test: Tests that uses unicode mysql-test/t/query_cache_ps_no_prot.test: Test for required collations mysql-test/t/query_cache_ps_ps_prot.test: Test for required collations scripts/mysqlbug.sh: Send emails to maria-developers@lists.launchpad.net storage/ndb/plug.in: Don't include ndb in 'max' builds
		
			
				
	
	
		
			241 lines
		
	
	
		
			8.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			241 lines
		
	
	
		
			8.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| #
 | ||
| # test of new fulltext search features
 | ||
| #
 | ||
| 
 | ||
| let collation=utf8_unicode_ci;
 | ||
| --source include/have_collation.inc
 | ||
| 
 | ||
| #
 | ||
| # two-level tree
 | ||
| #
 | ||
| 
 | ||
| --disable_warnings
 | ||
| DROP TABLE IF EXISTS t1;
 | ||
| --enable_warnings
 | ||
| 
 | ||
| CREATE TABLE t1 (
 | ||
|   i int(10) unsigned not null auto_increment primary key,
 | ||
|   a varchar(255) not null,
 | ||
|   FULLTEXT KEY (a)
 | ||
| ) ENGINE=MyISAM;
 | ||
| 
 | ||
| # two-level entry, second-level tree with depth 2
 | ||
| --disable_query_log
 | ||
| begin;
 | ||
| let $1=260;
 | ||
| while ($1)
 | ||
| {
 | ||
|   eval insert t1 (a) values ('aaaxxx');
 | ||
|   dec $1;
 | ||
| }
 | ||
| 
 | ||
| # two-level entry, second-level tree has only one page
 | ||
| let $1=255;
 | ||
| while ($1)
 | ||
| {
 | ||
|   eval insert t1 (a) values ('aaazzz');
 | ||
|   dec $1;
 | ||
| }
 | ||
| 
 | ||
| # one-level entry (entries)
 | ||
| let $1=250;
 | ||
| while ($1)
 | ||
| {
 | ||
|   eval insert t1 (a) values ('aaayyy');
 | ||
|   dec $1;
 | ||
| }
 | ||
| commit;
 | ||
| --enable_query_log
 | ||
| 
 | ||
| # converting to two-level
 | ||
| repair table t1 quick;
 | ||
| check table t1;
 | ||
| optimize table t1; # BUG#5327 - mi_sort_index() of 2-level tree
 | ||
| check table t1;
 | ||
| 
 | ||
| select count(*) from t1 where match a against ('aaaxxx');
 | ||
| select count(*) from t1 where match a against ('aaayyy');
 | ||
| select count(*) from t1 where match a against ('aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaayyy' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode);
 | ||
| 
 | ||
| select count(*) from t1 where match a against ('aaax*' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaay*' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaa*' in boolean mode);
 | ||
| 
 | ||
| # mi_write:
 | ||
| 
 | ||
| insert t1 (a) values ('aaaxxx'),('aaayyy');
 | ||
| # call to enlarge_root() below
 | ||
| insert t1 (a) values ('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx');
 | ||
| select count(*) from t1 where match a against ('aaayyy');
 | ||
| select count(*) from t1 where match a against ('aaazzz');
 | ||
| 
 | ||
| # mi_delete
 | ||
| insert t1 (a) values ('aaaxxx 000000');
 | ||
| select count(*) from t1 where match a against ('000000');
 | ||
| delete from t1 where match a against ('000000');
 | ||
| select count(*) from t1 where match a against ('000000');
 | ||
| select count(*) from t1 where match a against ('aaaxxx');
 | ||
| delete from t1 where match a against ('aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaayyy' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| # double-check without index
 | ||
| select count(*) from t1 where a = 'aaaxxx';
 | ||
| select count(*) from t1 where a = 'aaayyy';
 | ||
| select count(*) from t1 where a = 'aaazzz';
 | ||
| 
 | ||
| # update
 | ||
| insert t1 (a) values ('aaaxxx 000000');
 | ||
| select count(*) from t1 where match a against ('000000');
 | ||
| update t1 set a='aaazzz' where match a against ('000000');
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| update t1 set a='aaazzz' where a = 'aaaxxx';
 | ||
| update t1 set a='aaaxxx' where a = 'aaayyy';
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaayyy' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| 
 | ||
| drop table t1;
 | ||
| 
 | ||
| CREATE TABLE t1 (
 | ||
|   i int(10) unsigned not null auto_increment primary key,
 | ||
|   a varchar(255) not null,
 | ||
|   FULLTEXT KEY (a)
 | ||
| ) ENGINE=MyISAM;
 | ||
| 
 | ||
| #
 | ||
| # now same as about but w/o repair table
 | ||
| # 2-level tree created by mi_write
 | ||
| #
 | ||
| 
 | ||
| # two-level entry, second-level tree with depth 2
 | ||
| --disable_query_log
 | ||
| let $1=260;
 | ||
| begin;
 | ||
| while ($1)
 | ||
| {
 | ||
|   eval insert t1 (a) values ('aaaxxx');
 | ||
|   dec $1;
 | ||
| }
 | ||
| let $1=255;
 | ||
| while ($1)
 | ||
| {
 | ||
|   eval insert t1 (a) values ('aaazzz');
 | ||
|   dec $1;
 | ||
| }
 | ||
| let $1=250;
 | ||
| while ($1)
 | ||
| {
 | ||
|   eval insert t1 (a) values ('aaayyy');
 | ||
|   dec $1;
 | ||
| }
 | ||
| commit;
 | ||
| --enable_query_log
 | ||
| 
 | ||
| select count(*) from t1 where match a against ('aaaxxx');
 | ||
| select count(*) from t1 where match a against ('aaayyy');
 | ||
| select count(*) from t1 where match a against ('aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaayyy' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx aaayyy aaazzz' in boolean mode);
 | ||
| 
 | ||
| select count(*) from t1 where match a against ('aaax*' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaay*' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaa*' in boolean mode);
 | ||
| 
 | ||
| # mi_write:
 | ||
| 
 | ||
| insert t1 (a) values ('aaaxxx'),('aaayyy');
 | ||
| insert t1 (a) values ('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz'),('aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx');
 | ||
| select count(*) from t1 where match a against ('aaayyy');
 | ||
| select count(*) from t1 where match a against ('aaazzz');
 | ||
| 
 | ||
| # mi_delete
 | ||
| insert t1 (a) values ('aaaxxx 000000');
 | ||
| select count(*) from t1 where match a against ('000000');
 | ||
| delete from t1 where match a against ('000000');
 | ||
| select count(*) from t1 where match a against ('000000');
 | ||
| select count(*) from t1 where match a against ('aaaxxx');
 | ||
| delete from t1 where match a against ('aaazzz');
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaayyy' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| # double-check without index
 | ||
| select count(*) from t1 where a = 'aaaxxx';
 | ||
| select count(*) from t1 where a = 'aaayyy';
 | ||
| select count(*) from t1 where a = 'aaazzz';
 | ||
| 
 | ||
| # update
 | ||
| insert t1 (a) values ('aaaxxx 000000');
 | ||
| select count(*) from t1 where match a against ('000000');
 | ||
| update t1 set a='aaazzz' where match a against ('000000');
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| update t1 set a='aaazzz' where a = 'aaaxxx';
 | ||
| update t1 set a='aaaxxx' where a = 'aaayyy';
 | ||
| select count(*) from t1 where match a against ('aaaxxx' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaayyy' in boolean mode);
 | ||
| select count(*) from t1 where match a against ('aaazzz' in boolean mode);
 | ||
| drop table t1;
 | ||
| 
 | ||
| #
 | ||
| # BUG#11336
 | ||
| #
 | ||
| # for uca collation isalnum and strnncollsp don't agree on whether
 | ||
| # 0xC2A0 is a space (strnncollsp is right, isalnum is wrong).
 | ||
| #
 | ||
| # they still don't, the bug was fixed by avoiding strnncollsp
 | ||
| #
 | ||
| 
 | ||
| set names utf8;
 | ||
| create table t1(a text,fulltext(a)) collate=utf8_swedish_ci;
 | ||
| insert into t1 values('test test '),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test'),
 | ||
| ('test'),('test'),('test'),('test'),('test'),('test'),('test'),('test');
 | ||
| delete from t1 limit 1;
 | ||
| 
 | ||
| #
 | ||
| # BUG#16489: utf8 + fulltext leads to corrupt index file.
 | ||
| #
 | ||
| truncate table t1;
 | ||
| insert into t1 values('ab c d');
 | ||
| update t1 set a='ab c d';
 | ||
| select * from t1 where match a against('ab c' in boolean mode);
 | ||
| drop table t1;
 | ||
| set names latin1;
 | ||
| 
 | ||
| # End of 4.1 tests
 | ||
| 
 | ||
| #
 | ||
| # BUG#19580 - FULLTEXT search produces wrong results on UTF-8 columns
 | ||
| #
 | ||
| SET NAMES utf8;
 | ||
| CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 | ||
| INSERT INTO t1 VALUES('„MySQL“');
 | ||
| SELECT a FROM t1 WHERE MATCH a AGAINST('“MySQL„' IN BOOLEAN MODE);
 | ||
| DROP TABLE t1;
 | ||
| SET NAMES latin1;
 |