diff options
author | unknown <monty@mysql.com> | 2004-10-26 19:30:01 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-10-26 19:30:01 +0300 |
commit | 853c2c788c8bd7120a95c2357de7dabb1b6fcf3b (patch) | |
tree | 355a805ce6da2de5e852c4f9b8372d612070cd6d /mysql-test | |
parent | 08c39dd283a8723912f5ce798701af3d25aa2747 (diff) | |
download | mariadb-git-853c2c788c8bd7120a95c2357de7dabb1b6fcf3b.tar.gz |
A lot of fixes for prepared statements (PS):
New mysqltest that can run mysqltest with PS
Added support for ZEROFILL in PS
Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
Updated test cases to support --ps-protocol
(Some tests are still run using old protocol)
Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
Fixed crash in PS when using sub queries
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new PS query
group_concat(...ORDER BY) didn't work with PS
Fixed problem with test suite when not using innodb
BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87:
Delete: mysql-test/t/innodb-lock-master.opt
client/Makefile.am:
mysqltest now uses regex
client/mysqltest.c:
Added support for testing of prepared statements (with --ps-protocol)
Main code was done by Kent, I did mainly some cleanups and minor bug fixes
New test commands:
--disable_ps_protocol
--enable_ps_protocol
NOTE: new code still has some things that needs to be cleaned up.
For example run_query_stmt_handle_error() should be made more general so that same code can be used also by 'normal' queries
configure.in:
mysqltest now uses regex
libmysql/libmysql.c:
Reset warning_count after prepare (safety). In the future we should also provide warnings on prepare
integer -> string conversion now handles ZEROFILL
double -> string conversion is now closer to the one in the server
Fixed crash when one called mysql_stmt_store_result() without preceding mysql_stmt_bind_result()
libmysqld/examples/Makefile.am:
mysqltest now uses regex
mysql-test/include/have_query_cache.inc:
Fixes for --ps-protocol
mysql-test/include/ps_conv.inc:
Fixes for --ps-protocol
mysql-test/mysql-test-run.sh:
Added options --ps-protocol
mysql-test/r/ctype_utf8.result:
Fixed test case
mysql-test/r/fulltext_cache.result:
Changed output of MATCH to use round() to get same numbers with --ps-protocol
mysql-test/r/fulltext_left_join.result:
Changed output of MATCH to use round() to get same numbers with --ps-protocol
mysql-test/r/fulltext_multi.result:
Changed output of MATCH to use round() to get same numbers with --ps-protocol
mysql-test/r/innodb-lock.result:
Fixed test to work even if Innodb is not compiled in.
mysql-test/t/create.test:
Fixes for --ps-protocol
mysql-test/t/ctype_utf8.test:
Remove warnings
mysql-test/t/date_formats.test:
Fixes for --ps-protocol
mysql-test/t/fulltext_cache.test:
Changed output of MATCH to use round() to get same numbers with --ps-protocol
mysql-test/t/fulltext_left_join.test:
Changed output of MATCH to use round() to get same numbers with --ps-protocol
mysql-test/t/fulltext_multi.test:
Changed output of MATCH to use round() to get same numbers with --ps-protocol
mysql-test/t/func_group.test:
Fixes for --ps-protocol
mysql-test/t/func_sapdb.test:
Fixes for --ps-protocol
mysql-test/t/innodb-lock.test:
Fixed test to work even if Innodb is not compiled in.
mysql-test/t/insert.test:
Fixes for --ps-protocol
mysql-test/t/insert_select.test:
Fixes for --ps-protocol
mysql-test/t/insert_update.test:
Fixes for --ps-protocol
mysql-test/t/metadata.test:
Fixes for --ps-protocol
mysql-test/t/multi_statement.test:
Fixes for --ps-protocol
mysql-test/t/ps_1general.test:
Fixes for --ps-protocol
mysql-test/t/rollback.test:
Fixes for --ps-protocol
mysql-test/t/rpl_redirect.test:
Fixes for --ps-protocol
mysql-test/t/rpl_user_variables.test:
Fixes for --ps-protocol
mysql-test/t/select.test:
Fixes for --ps-protocol
mysql-test/t/status.test:
Fixes for --ps-protocol
mysql-test/t/type_blob.test:
Fixes for --ps-protocol
mysql-test/t/type_float.test:
Fixes for --ps-protocol
mysql-test/t/union.test:
Fixes for --ps-protocol
mysql-test/t/warnings.test:
Fixes for --ps-protocol
mysys/my_alloc.c:
More debugging information
sql-common/client.c:
More debugging information
sql-common/my_time.c:
TIME didn't support full range with PS
sql/field.cc:
TIME didn't support full range with PS
sql/item_cmpfunc.cc:
IN(constants,...) didn't work with PS
sql/item_subselect.cc:
Some subqueries didn't work with PS
sql/item_sum.cc:
group_concat(...ORDER BY) didn't work with PS
Removed variable warning_available as 'warning' can be used for this.
sql/item_sum.h:
Removed not needed variable
sql/protocol.cc:
TIME didn't support full range with PS
sql/set_var.cc:
Style fix
sql/sql_base.cc:
setup_wild() didn't properly restore old arena, which caused core dump in PS when using
SELECT * FROM t1 NATURAL JOIN t2...
sql/sql_class.cc:
Style fix
sql/sql_error.cc:
Style fix
sql/sql_insert.cc:
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
sql/sql_lex.h:
Fix for PS and procedures
sql/sql_parse.cc:
More debugging information
Make a copy of 'db' in PS as this may change
Fixed wrong permissions check in PS and multi-table updates
sql/sql_prepare.cc:
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new query
sql/sql_union.cc:
Fixes for PS and SELECT ... PROCEDURE
Reset 'with_wild' as 'wild' is resolved on prepare
Diffstat (limited to 'mysql-test')
33 files changed, 143 insertions, 55 deletions
diff --git a/mysql-test/include/have_query_cache.inc b/mysql-test/include/have_query_cache.inc index e5e6052c9a7..39549157849 100644 --- a/mysql-test/include/have_query_cache.inc +++ b/mysql-test/include/have_query_cache.inc @@ -1,4 +1,7 @@ -- require r/have_query_cache.require +# As PS are not cached we disable them to ensure the we get the right number +# of query cache hits +-- disable_ps_protocol disable_query_log; show variables like "have_query_cache"; enable_query_log; diff --git a/mysql-test/include/ps_conv.inc b/mysql-test/include/ps_conv.inc index 03d93b6190d..0a5bec26fe7 100644 --- a/mysql-test/include/ps_conv.inc +++ b/mysql-test/include/ps_conv.inc @@ -73,7 +73,9 @@ create table t5 as select show create table t5 ; --vertical_results --enable_metadata +--disable_ps_protocol select * from t5 ; +--enable_ps_protocol --disable_metadata --horizontal_results drop table t5 ; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index b12f7afb9f1..6b40fb3e974 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -321,6 +321,8 @@ while test $# -gt 0; do EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` ;; + --ps-protocol) + EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; --user-test=*) USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` ;; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e65eb96cb68..482a6502490 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -766,9 +766,7 @@ list_id smallint unsigned NOT NULL, term text NOT NULL, PRIMARY KEY(id), INDEX(list_id, term(19)) -) TYPE=MyISAM CHARSET=utf8; -Warnings: -Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +) ENGINE=MyISAM CHARSET=utf8; INSERT INTO t1 set list_id = 1, term = "testétest"; INSERT INTO t1 set list_id = 1, term = "testetest"; INSERT INTO t1 set list_id = 1, term = "testètest"; diff --git a/mysql-test/r/fulltext_cache.result b/mysql-test/r/fulltext_cache.result index c489bdefeb8..6a94189d8b4 100644 --- a/mysql-test/r/fulltext_cache.result +++ b/mysql-test/r/fulltext_cache.result @@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664016724 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0 -aaaaaaaaa dsaass de Feijoada 3 0 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0 -ssde df s fsda sad er um copo de Vodka 5 0 -ssde df s fsda sad er um chocolate Snickers 6 0 -aaaaaaaaa dsaass de Bife 7 0 -aaaaaaaaa dsaass de Pizza de Salmao 8 0 +aaaaaaaaa dsaass de sushi 1 1.92378664 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 +aaaaaaaaa dsaass de Feijoada 3 0.00000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 +ssde df s fsda sad er um copo de Vodka 5 0.00000000 +ssde df s fsda sad er um chocolate Snickers 6 0.00000000 +aaaaaaaaa dsaass de Bife 7 0.00000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x @@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0 ssde df s fsda sad er um chocolate Snickers 6 0 aaaaaaaaa dsaass de Bife 7 0 aaaaaaaaa dsaass de Pizza de Salmao 8 0 -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664016724 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0 -aaaaaaaaa dsaass de Feijoada 3 0 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0 -ssde df s fsda sad er um copo de Vodka 5 0 -ssde df s fsda sad er um chocolate Snickers 6 0 -aaaaaaaaa dsaass de Bife 7 0 -aaaaaaaaa dsaass de Pizza de Salmao 8 0 +aaaaaaaaa dsaass de sushi 1 1.92378664 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 +aaaaaaaaa dsaass de Feijoada 3 0.00000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 +ssde df s fsda sad er um copo de Vodka 5 0.00000000 +ssde df s fsda sad er um chocolate Snickers 6 0.00000000 +aaaaaaaaa dsaass de Bife 7 0.00000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x diff --git a/mysql-test/r/fulltext_left_join.result b/mysql-test/r/fulltext_left_join.result index bf3fe73690a..f3dad290525 100644 --- a/mysql-test/r/fulltext_left_join.result +++ b/mysql-test/r/fulltext_left_join.result @@ -16,13 +16,13 @@ author VARCHAR(255) NOT NULL INSERT INTO t2 VALUES('123', 'moi'); INSERT INTO t2 VALUES('123', 'lui'); INSERT INTO t2 VALUES('456', 'lui'); -select match(t1.texte,t1.sujet,t1.motsclefs) against('droit') +select round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) from t1 left join t2 on t2.id=t1.id; -match(t1.texte,t1.sujet,t1.motsclefs) against('droit') -0 -0 -0.67003107070923 -0 +round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) +0.00000 +0.00000 +0.67003 +0.00000 select match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) from t1 left join t2 on t2.id=t1.id; match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) diff --git a/mysql-test/r/fulltext_multi.result b/mysql-test/r/fulltext_multi.result index 968b00020e2..289ee004395 100644 --- a/mysql-test/r/fulltext_multi.result +++ b/mysql-test/r/fulltext_multi.result @@ -11,19 +11,19 @@ FULLTEXT KEY a(b,c) INSERT INTO t1 VALUES (1,'lala lolo lili','oooo aaaa pppp'); INSERT INTO t1 VALUES (2,'asdf fdsa','lkjh fghj'); INSERT INTO t1 VALUES (3,'qpwoei','zmxnvb'); -SELECT a, MATCH b AGAINST ('lala lkjh') FROM t1; -a MATCH b AGAINST ('lala lkjh') -1 0.67003107070923 -2 0 -3 0 -SELECT a, MATCH c AGAINST ('lala lkjh') FROM t1; -a MATCH c AGAINST ('lala lkjh') -1 0 -2 0.67756325006485 -3 0 -SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM t1; -a MATCH b,c AGAINST ('lala lkjh') -1 0.64840710163116 -2 0.66266459226608 -3 0 +SELECT a, round(MATCH b AGAINST ('lala lkjh'),5) FROM t1; +a round(MATCH b AGAINST ('lala lkjh'),5) +1 0.67003 +2 0.00000 +3 0.00000 +SELECT a, round(MATCH c AGAINST ('lala lkjh'),5) FROM t1; +a round(MATCH c AGAINST ('lala lkjh'),5) +1 0.00000 +2 0.67756 +3 0.00000 +SELECT a, round(MATCH b,c AGAINST ('lala lkjh'),5) FROM t1; +a round(MATCH b,c AGAINST ('lala lkjh'),5) +1 0.64841 +2 0.66266 +3 0.00000 drop table t1; diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result index 407a85ed038..4ace4065c34 100644 --- a/mysql-test/r/innodb-lock.result +++ b/mysql-test/r/innodb-lock.result @@ -1,3 +1,4 @@ +set global innodb_table_locks=1; select @@innodb_table_locks; @@innodb_table_locks 1 diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 26c527ca7cb..6f222eedec1 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -272,8 +272,11 @@ insert into t2 values(10),(20); create table t3 like t1; show create table t3; select * from t3; +# Disable PS becasue of @@warning_count +--disable_ps_protocol create table if not exists t3 like t1; select @@warning_count; +--enable_ps_protocol create temporary table t3 like t2; show create table t3; select * from t3; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 238cd6daef3..2ee796eeb67 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -621,7 +621,7 @@ CREATE TABLE t1 ( term text NOT NULL, PRIMARY KEY(id), INDEX(list_id, term(19)) -) TYPE=MyISAM CHARSET=utf8; +) ENGINE=MyISAM CHARSET=utf8; INSERT INTO t1 set list_id = 1, term = "testétest"; INSERT INTO t1 set list_id = 1, term = "testetest"; INSERT INTO t1 set list_id = 1, term = "testètest"; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index f769fe7af04..c369a9c85d5 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -118,8 +118,11 @@ SET datetime_format=default; # Test of str_to_date # +# PS doesn't support fraction of a seconds +--disable_ps_protocol select str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')); +--enable_ps_protocol create table t1 (date char(30), format char(30) not null); insert into t1 values @@ -153,7 +156,8 @@ insert into t1 values ('15-01-20', '%d-%m-%y'), ('15-2001-1', '%d-%Y-%c'); -# Use through protocol functions +# PS doesn't support fractional seconds +--disable_ps_protocol select date,format,str_to_date(date, format) as str_to_date from t1; # Use as a string select date,format,concat('',str_to_date(date, format)) as con from t1; @@ -198,6 +202,7 @@ select date,format,str_to_date(date, format) as str_to_date from t1; select date,format,concat(str_to_date(date, format),'') as con from t1; drop table t1; +--enable_ps_protocol # # Test of get_format @@ -221,6 +226,8 @@ insert into t1 values ('2004-07-14'),('2005-07-14'); select date_format(d,"%d") from t1 order by 1; drop table t1; +# PS doesn't support fractional seconds +--disable_ps_protocol select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a; @@ -249,3 +256,4 @@ select str_to_date("2003-01-02 10:11:12.0012ABCD", "%Y-%m-%d %H:%i:%S.%f") as f1 select str_to_date("2003-04-05 g", "%Y-%m-%d") as f1, str_to_date("2003-04-05 10:11:12.101010234567", "%Y-%m-%d %H:%i:%S.%f") as f2; +--enable_ps_protocol diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test index 15f32fdb5a0..234deab91e6 100644 --- a/mysql-test/t/fulltext_cache.test +++ b/mysql-test/t/fulltext_cache.test @@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test index f8dcfb2aad6..96751ef8678 100644 --- a/mysql-test/t/fulltext_left_join.test +++ b/mysql-test/t/fulltext_left_join.test @@ -24,7 +24,7 @@ INSERT INTO t2 VALUES('123', 'moi'); INSERT INTO t2 VALUES('123', 'lui'); INSERT INTO t2 VALUES('456', 'lui'); -select match(t1.texte,t1.sujet,t1.motsclefs) against('droit') +select round(match(t1.texte,t1.sujet,t1.motsclefs) against('droit'),5) from t1 left join t2 on t2.id=t1.id; select match(t1.texte,t1.sujet,t1.motsclefs) against('droit' IN BOOLEAN MODE) from t1 left join t2 on t2.id=t1.id; diff --git a/mysql-test/t/fulltext_multi.test b/mysql-test/t/fulltext_multi.test index c312a5938b2..3a622a551bc 100644 --- a/mysql-test/t/fulltext_multi.test +++ b/mysql-test/t/fulltext_multi.test @@ -17,7 +17,7 @@ INSERT INTO t1 VALUES (1,'lala lolo lili','oooo aaaa pppp'); INSERT INTO t1 VALUES (2,'asdf fdsa','lkjh fghj'); INSERT INTO t1 VALUES (3,'qpwoei','zmxnvb'); -SELECT a, MATCH b AGAINST ('lala lkjh') FROM t1; -SELECT a, MATCH c AGAINST ('lala lkjh') FROM t1; -SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM t1; +SELECT a, round(MATCH b AGAINST ('lala lkjh'),5) FROM t1; +SELECT a, round(MATCH c AGAINST ('lala lkjh'),5) FROM t1; +SELECT a, round(MATCH b,c AGAINST ('lala lkjh'),5) FROM t1; drop table t1; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 3e001961f90..8d8779e9d1b 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -30,7 +30,11 @@ select grp, sum(a)+count(a)+avg(a)+std(a)+variance(a)+bit_or(a)+bit_and(a)+min(a create table t2 (grp int, a bigint unsigned, c char(10)); insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; + +# REPLACE ... SELECT doesn't yet work with PS +--disable_ps_protocol replace into t2 select grp, a, c from t1 limit 2,1; +--enable_ps_protocol select * from t2; drop table t1,t2; diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 24028437fde..2ae3c438243 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -47,17 +47,23 @@ select subtime("1997-12-31 23:59:59.999999", "1998-01-01 01:01:01.999999"); select subtime("01:00:00.999999", "02:00:00.999998"); select subtime("02:01:01.999999", "01:01:01.999999"); +# PS doesn't support fractional seconds +--disable_ps_protocol select timediff("1997-01-01 23:59:59.000001","1995-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +--enable_ps_protocol select maketime(10,11,12); select maketime(25,11,12); select maketime(-25,11,12); -#Extraction functions +# Extraction functions + +# PS doesn't support fractional seconds +--disable_ps_protocol select timestamp("2001-12-01", "01:01:01.999999"); select timestamp("2001-13-01", "01:01:01.000001"); select timestamp("2001-12-01", "25:01:01"); @@ -69,6 +75,7 @@ select date("1997-13-31 23:59:59.000001"); select time("1997-12-31 23:59:59.000001"); select time("1997-12-31 25:59:59.000001"); select microsecond("1997-12-31 23:59:59.000001"); +--enable_ps_protocol create table t1 select makedate(1997,1) as f1, @@ -81,7 +88,10 @@ select makedate(1997,1) as f1, date("1997-12-31 23:59:59.000001") as f8, time("1997-12-31 23:59:59.000001") as f9; describe t1; +# PS doesn't support fractional seconds +--disable_ps_protocol select * from t1; +--enable_ps_protocol create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values @@ -94,7 +104,10 @@ insert into test values ('2001-01-01 01:01:01', '01:01:01', '1 01:01:01', '2001-01-01 01:01:01'); SELECT ADDTIME(t1,t2) As ttt, ADDTIME(t2, t3) As qqq from test; +# PS doesn't support fractional seconds +--disable_ps_protocol SELECT TIMEDIFF(t1,t4) As ttt, TIMEDIFF(t2, t3) As qqq from test; +--enable_ps_protocol drop table t1, test; @@ -102,4 +115,7 @@ select addtime("-01:01:01.01", "-23:59:59.1") as a; select microsecond("1997-12-31 23:59:59.01") as a; select microsecond(19971231235959.01) as a; select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a; +# PS doesn't support fractional seconds +--disable_ps_protocol select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); +--enable_ps_protocol diff --git a/mysql-test/t/innodb-lock-master.opt b/mysql-test/t/innodb-lock-master.opt deleted file mode 100644 index 403fcde87ed..00000000000 --- a/mysql-test/t/innodb-lock-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-table-lock=1 diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 2bbbac82ad5..a3b6f8993f2 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -4,6 +4,8 @@ # Check and select innodb lock type # +set global innodb_table_locks=1; + select @@innodb_table_locks; # diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index fd728c453aa..54379685731 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -92,6 +92,8 @@ drop database mysqltest; # Test of wrong values for float data (bug #2082) # +# PS gives sligthly different numbers for max-float/max-double +--disable_ps_protocol use test; create table t1(number int auto_increment primary key, original_value varchar(50), f_double double, f_float float, f_double_7_2 double(7,2), f_float_4_3 float (4,3), f_double_u double unsigned, f_float_u float unsigned, f_double_15_1_u double(15,1) unsigned, f_float_3_1_u float (3,1) unsigned); @@ -140,3 +142,4 @@ insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@val --query_vertical select * from t1 where number =last_insert_id() drop table t1; +--enable_ps_protocol diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 234a5ec0eef..db5dc8d91da 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -122,7 +122,10 @@ insert into t2 values (2,"t2:2"), (3,"t2:3"); --error 1062 insert into t1 select * from t2; select * from t1; +# REPLACE .. SELECT is not yet supported by PS +--disable_ps_protocol replace into t1 select * from t2; +--enable_ps_protocol select * from t1; drop table t1,t2; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index d2a70208022..fc54ce88f8a 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -35,10 +35,10 @@ create table t1(a int primary key, b int); insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5); select * from t1; -enable_info; +--enable_info insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18) on duplicate key update b=b+10; -disable_info; +--disable_info select * from t1; diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test index c426ab9864b..d11cb62b04e 100644 --- a/mysql-test/t/metadata.test +++ b/mysql-test/t/metadata.test @@ -6,6 +6,8 @@ drop table if exists t1,t2; --enable_warnings --enable_metadata +# PS protocol gives slightly different metadata +--disable_ps_protocol # # First some simple tests diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index bd90275c9f5..862f2294641 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -1,3 +1,6 @@ +# PS doesn't support multi-statements +--disable_ps_protocol + select 1; delimiter ||||; select 2; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index f27aca7a452..9e4acc2bf24 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -501,6 +501,8 @@ prepare stmt1 from ' KILL 0 '; ## simple explain # cases derived from client_test.c: test_explain_bug() prepare stmt1 from ' explain select a from t1 order by b '; +# PS protocol gives slightly different metadata +--disable_ps_protocol --enable_metadata execute stmt1; --disable_metadata @@ -509,6 +511,7 @@ prepare stmt1 from ' explain select a from t1 where a > ? order by b '; --enable_metadata execute stmt1 using @arg00; --disable_metadata +--enable_ps_protocol ## parameters with probably problematic characters (quote, double quote) # cases derived from client_test.c: test_logs() diff --git a/mysql-test/t/rollback.test b/mysql-test/t/rollback.test index 87f59417d90..3cb1ea3024b 100644 --- a/mysql-test/t/rollback.test +++ b/mysql-test/t/rollback.test @@ -5,6 +5,8 @@ --disable_warnings drop table if exists t1; --enable_warnings +# PS doesn't work with BEGIN ... ROLLBACK +--disable_ps_protocol create table t1 (n int not null primary key) engine=myisam; begin work; diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/t/rpl_redirect.test index 3b5ad6ba88d..c533c0052f0 100644 --- a/mysql-test/t/rpl_redirect.test +++ b/mysql-test/t/rpl_redirect.test @@ -3,6 +3,8 @@ # source include/master-slave.inc; +# We disable this for now as PS doesn't handle redirection +--disable_ps_protocol #first, make sure the slave has had enough time to register save_master_pos; diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test index 35fbec72ac8..73b3ace473e 100644 --- a/mysql-test/t/rpl_user_variables.test +++ b/mysql-test/t/rpl_user_variables.test @@ -2,6 +2,9 @@ # Test of replicating user variables # source include/master-slave.inc; +# Disable PS as the log positions differs +--disable_ps_protocol + # Clean up old slave's binlogs. # The slave is started with --log-slave-updates diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index c260c7777e2..5bae44796dc 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1706,12 +1706,18 @@ select t2.companynr,companyname,count(*) from t2,t4 where t2.companynr=t4.compan select count(*) from t2; select count(*) from t2 where fld1 < 098024; +# PS does correct pre-zero here. MySQL can't do it as it returns a number. +--disable_ps_protocol select min(fld1) from t2 where fld1>= 098024; +--enable_ps_protocol select max(fld1) from t2 where fld1>= 098024; select count(*) from t3 where price2=76234234; select count(*) from t3 where companynr=512 and price2=76234234; explain select min(fld1),max(fld1),count(*) from t2; +# PS does correct pre-zero here. MySQL can't do it as it returns a number. +--disable_ps_protocol select min(fld1),max(fld1),count(*) from t2; +--enable_ps_protocol select min(t2nr),max(t2nr) from t3 where t2nr=2115 and price2=823742; select count(*),min(t2nr),max(t2nr) from t3 where name='spates' and companynr=78; select t2nr,count(*) from t3 where name='gems' group by t2nr limit 20; diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 7be494bd0e7..31d9c8154d5 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -5,6 +5,8 @@ # connection in a separate thread. # --source include/not_embedded.inc +# PS causes different statistics +--disable_ps_protocol connect (con1,localhost,root,,); connect (con2,localhost,root,,); diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index bd571deff49..b67fa7a552d 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -16,7 +16,10 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7; CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000)); show columns from t1; +# PS doesn't give errors on prepare yet +--disable_ps_protocol CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000)); +--enable_ps_protocol show columns from t2; create table t3 (a long, b long byte); show create TABLE t3; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 4b627ea9b99..216d5bbd286 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -39,7 +39,10 @@ create table t1 (c1 double, c2 varchar(20)); insert t1 values (121,"16"); select c1 + c1 * (c2 / 100) as col from t1; create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1; +# Floats are a bit different in PS +--disable_ps_protocol select * from t2; +--enable_ps_protocol show create table t2; drop table t1,t2; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 6e16a2b02aa..36027e8c4cb 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -5,6 +5,9 @@ --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6; --enable_warnings +# PS doesn't work correctly with found_rows: to be fixed +--disable_ps_protocol + CREATE TABLE t1 (a int not null, b char (10) not null); insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); @@ -73,6 +76,7 @@ select * from t1 union select SQL_BUFFER_RESULT * from t2; # Test CREATE, INSERT and REPLACE create table t3 select a,b from t1 union all select a,b from t2; insert into t3 select a,b from t1 union all select a,b from t2; +# PS can't handle REPLACE ... SELECT replace into t3 select a,b as c from t1 union all select a,b from t2; drop table t1,t2,t3; diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index b6042df51f1..4bd659606f6 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -26,8 +26,11 @@ show warnings limit 1; drop database if exists not_exists_db; show count(*) warnings; create table t1(id int); +# PS doesn't give warnings on prepare +--disable_ps_protocol create table if not exists t1(id int); select @@warning_count; +--enable_ps_protocol drop table t1; # @@ -36,7 +39,10 @@ drop table t1; create table t1(a tinyint, b int not null, c date, d char(5)); load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; +# PS doesn't work good with @@warning_count +--disable_ps_protocol select @@warning_count; +--enable_ps_protocol drop table t1; # @@ -74,7 +80,9 @@ enable_query_log; alter table t1 add b char; set max_error_count=10; update t1 set b=a; +--disable_ps_protocol select @@warning_count; +--enable_ps_protocol # # Test for handler type @@ -87,12 +95,15 @@ drop table t1; # # Test for deprecated TYPE= syntax # + +# PS doesn't give warnings on prepare +--disable_ps_protocol create table t1 (id int) type=heap; alter table t1 type=myisam; drop table t1; +--enable_ps_protocol # # Test for deprecated table_type variable # set table_type=MYISAM; - |