mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
29f148bd36
added support for quiet increased line buffer size client/mysqltest.c fixed memory leak added query logging to result file added error message logging to result file added enable_query_log/disable_query_log mysql-test/mysql-test-run.sh converted tests to use mysqlmanager Updated test results BitKeeper/etc/ignore: added *.reject client/mysqlmanagerc.c: added support for quiet increased line buffer size client/mysqltest.c: fixed memory leak added query logging to result file added error message logging to result file added enable_query_log/disable_query_log mysql-test/mysql-test-run.sh: converted tests to use mysqlmanager mysql-test/r/alias.result: log queries mysql-test/r/alter_table.result: log queries mysql-test/r/analyse.result: log queries mysql-test/r/auto_increment.result: log queries mysql-test/r/backup.result: log queries mysql-test/r/bdb-crash.result: log queries mysql-test/r/bench_count_distinct.result: log queries mysql-test/r/bigint.result: log queries mysql-test/r/binary.result: log queries mysql-test/r/bulk_replace.result: log queries mysql-test/r/case.result: log queries mysql-test/r/check.result: log queries mysql-test/r/comments.result: log queries mysql-test/r/compare.result: log queries mysql-test/r/count_distinct.result: log queries mysql-test/r/count_distinct2.result: log queries mysql-test/r/create.result: log queries mysql-test/r/ctype_latin1_de.result: log queries mysql-test/r/delayed.result: log queries mysql-test/r/dirty-close.result: log queries mysql-test/r/distinct.result: log queries mysql-test/r/drop.result: log queries mysql-test/r/empty_table.result: log queries mysql-test/r/explain.result: log queries mysql-test/r/flush.result: log queries mysql-test/r/fulltext.result: log queries mysql-test/r/fulltext_cache.result: log queries mysql-test/r/fulltext_distinct.result: log queries mysql-test/r/fulltext_left_join.result: log queries mysql-test/r/fulltext_multi.result: log queries mysql-test/r/fulltext_order_by.result: log queries mysql-test/r/fulltext_update.result: log queries mysql-test/r/fulltext_var.result: log queries mysql-test/r/func_crypt.result: log queries mysql-test/r/func_date_add.result: log queries mysql-test/r/func_equal.result: log queries mysql-test/r/func_group.result: log queries mysql-test/r/func_in.result: log queries mysql-test/r/func_like.result: log queries mysql-test/r/func_math.result: log queries mysql-test/r/func_misc.result: log queries mysql-test/r/func_op.result: log queries mysql-test/r/func_regexp.result: log queries mysql-test/r/func_set.result: log queries mysql-test/r/func_str.result: log queries mysql-test/r/func_system.result: log queries mysql-test/r/func_test.result: log queries mysql-test/r/func_time.result: log queries mysql-test/r/func_timestamp.result: log queries mysql-test/r/group_by.result: log queries mysql-test/r/handler.result: log queries mysql-test/r/having.result: log queries mysql-test/r/heap.result: log queries mysql-test/r/identity.result: log queries mysql-test/r/ins000001.result: log queries mysql-test/r/insert.result: log queries mysql-test/r/insert_select.result: log queries mysql-test/r/isam.result: log queries mysql-test/r/join.result: log queries mysql-test/r/join_crash.result: log queries mysql-test/r/join_outer.result: log queries mysql-test/r/key.result: log queries mysql-test/r/key_diff.result: log queries mysql-test/r/key_primary.result: log queries mysql-test/r/keywords.result: log queries mysql-test/r/kill.result: log queries mysql-test/r/limit.result: log queries mysql-test/r/lock.result: log queries mysql-test/r/merge.result: log queries mysql-test/r/multi_update.result: log queries mysql-test/r/myisam.result: log queries mysql-test/r/null.result: log queries mysql-test/r/null_key.result: log queries mysql-test/r/odbc.result: log queries mysql-test/r/openssl_1.result: log queries mysql-test/r/openssl_2.result: log queries mysql-test/r/order_by.result: log queries mysql-test/r/order_fill_sortbuf.result: log queries mysql-test/r/raid.result: log queries mysql-test/r/range.result: log queries mysql-test/r/rename.result: log queries mysql-test/r/replace.result: log queries mysql-test/r/rollback.result: log queries mysql-test/r/rpl000001.result: log queries mysql-test/r/rpl000002.result: log queries mysql-test/r/rpl000003.result: log queries mysql-test/r/rpl000004.result: log queries mysql-test/r/rpl000005.result: log queries mysql-test/r/rpl000006.result: log queries mysql-test/r/rpl000007.result: log queries mysql-test/r/rpl000008.result: log queries mysql-test/r/rpl000009.result: log queries mysql-test/r/rpl000010.result: log queries mysql-test/r/rpl000011.result: log queries mysql-test/r/rpl000012.result: log queries mysql-test/r/rpl000013.result: log queries mysql-test/r/rpl000014.result: log queries mysql-test/r/rpl000015.result: log queries mysql-test/r/rpl000016.result: log queries mysql-test/r/rpl000017.result: log queries mysql-test/r/rpl000018.result: log queries mysql-test/r/rpl_get_lock.result: log queries mysql-test/r/rpl_log.result: log queries mysql-test/r/rpl_magic.result: log queries mysql-test/r/rpl_mystery22.result: log queries mysql-test/r/rpl_sporadic_master.result: log queries mysql-test/r/sel000001.result: log queries mysql-test/r/sel000002.result: log queries mysql-test/r/sel000003.result: log queries mysql-test/r/sel000031.result: log queries mysql-test/r/sel000032.result: log queries mysql-test/r/sel000033.result: log queries mysql-test/r/sel000100.result: log queries mysql-test/r/select.result: log queries mysql-test/r/select_found.result: log queries mysql-test/r/select_safe.result: log queries mysql-test/r/show_check.result: log queries mysql-test/r/slave-running.result: log queries mysql-test/r/slave-stopped.result: log queries mysql-test/r/status.result: log queries mysql-test/r/symlink.result: log queries mysql-test/r/tablelock.result: log queries mysql-test/r/temp_table.result: log queries mysql-test/r/truncate.result: log queries mysql-test/r/type_blob.result: log queries mysql-test/r/type_date.result: log queries mysql-test/r/type_datetime.result: log queries mysql-test/r/type_decimal.result: log queries mysql-test/r/type_enum.result: log queries mysql-test/r/type_float.result: log queries mysql-test/r/type_ranges.result: log queries mysql-test/r/type_time.result: log queries mysql-test/r/type_timestamp.result: log queries mysql-test/r/type_uint.result: log queries mysql-test/r/type_year.result: log queries mysql-test/r/union.result: log queries mysql-test/r/update.result: log queries mysql-test/r/user_var.result: log queries mysql-test/r/varbinary.result: log queries mysql-test/r/variables.result: log queries mysql-test/t/bench_count_distinct.test: log queries mysql-test/t/check.test: log queries mysql-test/t/count_distinct2.test: log queries mysql-test/t/flush.test: log queries mysql-test/t/isam.test: log queries mysql-test/t/multi_update.test: log queries mysql-test/t/myisam.test: log queries mysql-test/t/order_fill_sortbuf.test: log queries mysql-test/t/rpl000016.test: log queries tools/managertest1.nc: test for def_exec overwrite tools/mysqlmanager.c: support def_exec overwrite and queries on running server
186 lines
9.8 KiB
Text
186 lines
9.8 KiB
Text
drop table if exists t1;
|
|
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
|
|
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
|
|
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
|
|
select 'hello' 'monty';
|
|
hello
|
|
hellomonty
|
|
select length('\n\t\r\b\0\_\%\\');
|
|
length('\n\t\r\b\0\_\%\\')
|
|
10
|
|
select concat('monty',' was here ','again'),length('hello'),char(ascii('h'));
|
|
concat('monty',' was here ','again') length('hello') char(ascii('h'))
|
|
monty was here again 5 h
|
|
select locate('he','hello'),locate('he','hello',2),locate('lo','hello',2) ;
|
|
locate('he','hello') locate('he','hello',2) locate('lo','hello',2)
|
|
1 0 4
|
|
select instr('hello','he');
|
|
instr('hello','he')
|
|
1
|
|
select position('ll' in 'hello'),position('a' in 'hello');
|
|
position('ll' in 'hello') position('a' in 'hello')
|
|
3 0
|
|
select left('hello',2),right('hello',2),substring('hello',2,2),mid('hello',1,5) ;
|
|
left('hello',2) right('hello',2) substring('hello',2,2) mid('hello',1,5)
|
|
he lo el hello
|
|
select concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1)) ;
|
|
concat('',left(right(concat('what ',concat('is ','happening')),9),4),'',substring('monty',5,1))
|
|
happy
|
|
select substring_index('www.tcx.se','.',-2),substring_index('www.tcx.se','.',1);
|
|
substring_index('www.tcx.se','.',-2) substring_index('www.tcx.se','.',1)
|
|
tcx.se www
|
|
select substring_index('www.tcx.se','tcx',1),substring_index('www.tcx.se','tcx',-1);
|
|
substring_index('www.tcx.se','tcx',1) substring_index('www.tcx.se','tcx',-1)
|
|
www. .se
|
|
select substring_index('.tcx.se','.',-2),substring_index('.tcx.se','.tcx',-1);
|
|
substring_index('.tcx.se','.',-2) substring_index('.tcx.se','.tcx',-1)
|
|
tcx.se .se
|
|
select concat(':',ltrim(' left '),':',rtrim(' right '),':');
|
|
concat(':',ltrim(' left '),':',rtrim(' right '),':')
|
|
:left : right:
|
|
select concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':');
|
|
concat(':',trim(LEADING FROM ' left'),':',trim(TRAILING FROM ' right '),':')
|
|
:left: right:
|
|
select concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':');
|
|
concat(':',trim(' m '),':',trim(BOTH FROM ' y '),':',trim('*' FROM '*s*'),':')
|
|
:m:y:s:
|
|
select concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':');
|
|
concat(':',trim(BOTH 'ab' FROM 'ababmyabab'),':',trim(BOTH '*' FROM '***sql'),':')
|
|
:my:sql:
|
|
select concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':');
|
|
concat(':',trim(LEADING '.*' FROM '.*my'),':',trim(TRAILING '.*' FROM 'sql.*.*'),':')
|
|
:my:sql:
|
|
select TRIM("foo" FROM "foo"), TRIM("foo" FROM "foook"), TRIM("foo" FROM "okfoo");
|
|
TRIM("foo" FROM "foo") TRIM("foo" FROM "foook") TRIM("foo" FROM "okfoo")
|
|
ok ok
|
|
select concat_ws(', ','monty','was here','again');
|
|
concat_ws(', ','monty','was here','again')
|
|
monty, was here, again
|
|
select concat_ws(NULL,'a'),concat_ws(',',NULL,'');
|
|
concat_ws(NULL,'a') concat_ws(',',NULL,'')
|
|
NULL
|
|
select concat_ws(',','',NULL,'a');
|
|
concat_ws(',','',NULL,'a')
|
|
a
|
|
SELECT CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"');
|
|
CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat('d',100)), '"')
|
|
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
|
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
|
|
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
|
|
this is a test
|
|
select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c');
|
|
replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c')
|
|
bbbb bb bbbbbbbb aaaa bbbb
|
|
select replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL') ;
|
|
replace(concat(lcase(concat('THIS',' ','IS',' ','A',' ')),ucase('false'),' ','test'),'FALSE','REAL')
|
|
this is a REAL test
|
|
select soundex(''),soundex('he'),soundex('hello all folks');
|
|
soundex('') soundex('he') soundex('hello all folks')
|
|
H000 H4142
|
|
select password('test'),length(encrypt('test')),encrypt('test','aa');
|
|
password('test') length(encrypt('test')) encrypt('test','aa')
|
|
378b243e220ca493 13 aaqPiZY5xR5l.
|
|
select md5('hello');
|
|
md5('hello')
|
|
5d41402abc4b2a76b9719d911017c592
|
|
select repeat('monty',5),concat('*',space(5),'*');
|
|
repeat('monty',5) concat('*',space(5),'*')
|
|
montymontymontymontymonty * *
|
|
select reverse('abc'),reverse('abcd');
|
|
reverse('abc') reverse('abcd')
|
|
cba dcba
|
|
select rpad('a',4,'1'),rpad('a',4,'12'),rpad('abcd',3,'12');
|
|
rpad('a',4,'1') rpad('a',4,'12') rpad('abcd',3,'12')
|
|
a111 a121 abc
|
|
select lpad('a',4,'1'),lpad('a',4,'12'),lpad('abcd',3,'12');
|
|
lpad('a',4,'1') lpad('a',4,'12') lpad('abcd',3,'12')
|
|
111a 121a abc
|
|
select rpad(741653838,17,'0'),lpad(741653838,17,'0');
|
|
rpad(741653838,17,'0') lpad(741653838,17,'0')
|
|
74165383800000000 00000000741653838
|
|
select rpad('abcd',7,'ab'),lpad('abcd',7,'ab');
|
|
rpad('abcd',7,'ab') lpad('abcd',7,'ab')
|
|
abcdaba abaabcd
|
|
select rpad('abcd',1,'ab'),lpad('abcd',1,'ab');
|
|
rpad('abcd',1,'ab') lpad('abcd',1,'ab')
|
|
a a
|
|
select LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD'),GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD');
|
|
LEAST(NULL,'HARRY','HARRIOT',NULL,'HAROLD') GREATEST(NULL,'HARRY','HARRIOT',NULL,'HAROLD')
|
|
HAROLD HARRY
|
|
select least(1,2,3) | greatest(16,32,8), least(5,4)*1,greatest(-1.0,1.0)*1,least(3,2,1)*1.0,greatest(1,1.1,1.0),least("10",9),greatest("A","B","0");
|
|
least(1,2,3) | greatest(16,32,8) least(5,4)*1 greatest(-1.0,1.0)*1 least(3,2,1)*1.0 greatest(1,1.1,1.0) least("10",9) greatest("A","B","0")
|
|
33 4 1.0 1.0 1.1 9 B
|
|
select decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000);
|
|
decode(encode(repeat("a",100000),"monty"),"monty")=repeat("a",100000)
|
|
1
|
|
select decode(encode("abcdef","monty"),"monty")="abcdef";
|
|
decode(encode("abcdef","monty"),"monty")="abcdef"
|
|
1
|
|
select reverse("");
|
|
reverse("")
|
|
|
|
select insert("aa",100,1,"b"),insert("aa",1,3,"b"),left("aa",-1),substring("a",1,2);
|
|
insert("aa",100,1,"b") insert("aa",1,3,"b") left("aa",-1) substring("a",1,2)
|
|
aa b a
|
|
select elt(2,1),field(NULL,"a","b","c"),reverse("");
|
|
elt(2,1) field(NULL,"a","b","c") reverse("")
|
|
NULL 0
|
|
select locate("a","b",2),locate("","a",1);
|
|
locate("a","b",2) locate("","a",1)
|
|
0 1
|
|
select ltrim("a"),rtrim("a"),trim(BOTH "" from "a"),trim(BOTH " " from "a");
|
|
ltrim("a") rtrim("a") trim(BOTH "" from "a") trim(BOTH " " from "a")
|
|
a a a a
|
|
select concat("1","2")|0,concat("1",".5")+0.0;
|
|
concat("1","2")|0 concat("1",".5")+0.0
|
|
12 1.5
|
|
select substring_index("www.tcx.se","",3);
|
|
substring_index("www.tcx.se","",3)
|
|
|
|
select length(repeat("a",100000000)),length(repeat("a",1000*64));
|
|
length(repeat("a",100000000)) length(repeat("a",1000*64))
|
|
NULL 64000
|
|
select position("0" in "baaa" in (1)),position("0" in "1" in (1,2,3)),position("sql" in ("mysql"));
|
|
position("0" in "baaa" in (1)) position("0" in "1" in (1,2,3)) position("sql" in ("mysql"))
|
|
1 0 3
|
|
select position(("1" in (1,2,3)) in "01");
|
|
position(("1" in (1,2,3)) in "01")
|
|
2
|
|
select length(repeat("a",65500)),length(concat(repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",10000)))),length(insert(repeat("a",40000),1,30000,repeat("b",50000)));
|
|
length(repeat("a",65500)) length(concat(repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",10000)))) length(insert(repeat("a",40000),1,30000,repeat("b",50000)))
|
|
65500 64000 50000 60000
|
|
select length(repeat("a",1000000)),length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))),length(replace("aaaaa","a",concat(repeat("a",32000)))),length(insert(repeat("a",48000),1,1000,repeat("a",48000)));
|
|
length(repeat("a",1000000)) length(concat(repeat("a",32000),repeat("a",32000),repeat("a",32000))) length(replace("aaaaa","a",concat(repeat("a",32000)))) length(insert(repeat("a",48000),1,1000,repeat("a",48000)))
|
|
1000000 96000 160000 95000
|
|
create table t1 ( domain char(50) );
|
|
insert into t1 VALUES ("hello.de" ), ("test.de" );
|
|
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@hello.de';
|
|
domain
|
|
hello.de
|
|
select domain from t1 where concat('@', trim(leading '.' from concat('.', domain))) = '@test.de';
|
|
domain
|
|
test.de
|
|
drop table t1;
|
|
CREATE TABLE t1 (
|
|
id int(10) unsigned NOT NULL,
|
|
title varchar(255) default NULL,
|
|
prio int(10) unsigned default NULL,
|
|
category int(10) unsigned default NULL,
|
|
program int(10) unsigned default NULL,
|
|
bugdesc text,
|
|
created datetime default NULL,
|
|
modified timestamp(14) NOT NULL,
|
|
bugstatus int(10) unsigned default NULL,
|
|
submitter int(10) unsigned default NULL
|
|
) TYPE=MyISAM;
|
|
INSERT INTO t1 VALUES (1,'Link',1,1,1,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa','2001-02-28 08:40:16',20010228084016,0,4);
|
|
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"') FROM t1;
|
|
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter), '"')
|
|
"Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4"
|
|
SELECT CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"') FROM t1;
|
|
CONCAT('"',CONCAT_WS('";"',title,prio,category,program,bugstatus,submitter), '"')
|
|
"Link";"1";"1";"1";"0";"4"
|
|
SELECT CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter) FROM t1;
|
|
CONCAT_WS('";"',title,prio,category,program,bugdesc,created,modified,bugstatus,submitter)
|
|
Link";"1";"1";"1";"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"2001-02-28 08:40:16";"20010228084016";"0";"4
|
|
drop table t1;
|