summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-01-04 13:46:53 +0200
committerunknown <monty@mysql.com>2005-01-04 13:46:53 +0200
commitbd365f76222e6263095e079ab9e634e88f06b7e1 (patch)
treed360ddc93c589f0b29af048f743def5cd7593d6c /mysql-test
parent6d0443331ac989415b71adc795c8850a7b19dd98 (diff)
downloadmariadb-git-bd365f76222e6263095e079ab9e634e88f06b7e1.tar.gz
After merge fixes
Add support for warnings for prepare of prepared statements Fixed test to work with --ps-protocol Fixed some test results libmysql/libmysql.c: Add support for warnings for prepare of prepared statements mysql-test/r/func_concat.result: After merge fixes mysql-test/r/select.result: Delete conflicting tables form previous tests mysql-test/r/view.result: New code from 4.1 fixed old error mysql-test/t/create.test: Ensure that --ps-protocol return same results as normal test mysql-test/t/func_group.test: Remove not needed --disable_ps_protocol mysql-test/t/func_time.test: Ensure that --ps-protocol return same results as normal test mysql-test/t/having.test: Ensure that --ps-protocol return same results as normal test mysql-test/t/insert_select.test: Remove not needed --disable_ps_protocol mysql-test/t/select.test: Ensure that --ps-protocol return same results as normal test mysql-test/t/sp.test: Fixed comment mysql-test/t/system_mysql_db_fix.test: Fix that results is same as from system_mysql_db.test mysql-test/t/trigger.test: Added comment mysql-test/t/type_blob.test: Remove not needed --disable_ps_protocol mysql-test/t/union.test: Run most of the test with --ps-protocol mysql-test/t/user_limits.test: Ensure that --ps-protocol return same results as normal test mysql-test/t/view.test: Removed --error as bug is now fixed mysql-test/t/warnings.test: Ensure that --ps-protocol return same results as normal test ndb/include/Makefile.am: Don't automaticly use SCCS files sql/ha_ndbcluster.cc: Removed compiler warning sql/log_event.cc: After merge fix sql/sql_class.h: After merge fix sql/sql_insert.cc: After merge fix sql/sql_load.cc: After merge fix sql/sql_prepare.cc: Add support for warnings for prepare of prepared statements sql/sql_update.cc: After merge fixes
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_concat.result6
-rw-r--r--mysql-test/r/select.result2
-rw-r--r--mysql-test/r/view.result3
-rw-r--r--mysql-test/t/create.test2
-rw-r--r--mysql-test/t/func_group.test2
-rw-r--r--mysql-test/t/func_time.test3
-rw-r--r--mysql-test/t/having.test4
-rw-r--r--mysql-test/t/insert_select.test2
-rw-r--r--mysql-test/t/select.test3
-rw-r--r--mysql-test/t/sp.test2
-rw-r--r--mysql-test/t/system_mysql_db_fix.test8
-rw-r--r--mysql-test/t/trigger.test1
-rw-r--r--mysql-test/t/type_blob.test2
-rw-r--r--mysql-test/t/union.test24
-rw-r--r--mysql-test/t/user_limits.test4
-rw-r--r--mysql-test/t/view.test1
-rw-r--r--mysql-test/t/warnings.test6
17 files changed, 55 insertions, 20 deletions
diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result
index cf6fbf2da4f..0bd53b32dd7 100644
--- a/mysql-test/r/func_concat.result
+++ b/mysql-test/r/func_concat.result
@@ -63,4 +63,8 @@ a0
select 'a' union select concat('a', -0.0);
a
a
-good
+a0.0
+select 'a' union select concat('a', -0.0000);
+a
+a
+a0.0000
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index ac0157fcfd1..7d5b2ed18cb 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -1,5 +1,5 @@
drop table if exists t1,t2,t3,t4;
-drop table if exists t1_1,t1_2,t9_1,t9_2;
+drop table if exists t1_1,t1_2,t9_1,t9_2,t1aa,t2aa;
drop view if exists v1;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 8013521e2f4..d31575eb38e 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1433,7 +1433,8 @@ insert into v1 values (1) on duplicate key update a=2;
insert into v1 values (1) on duplicate key update a=2;
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (1) on duplicate key update a=2;
-ERROR HY000: CHECK OPTION failed 'test.v1'
+Warnings:
+Error 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 6f222eedec1..686bf5a97ad 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -273,8 +273,8 @@ 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;
+--disable_ps_protocol
select @@warning_count;
--enable_ps_protocol
create temporary table t3 like t2;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 9a06d07149e..65ef9f2535c 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -32,9 +32,7 @@ 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_time.test b/mysql-test/t/func_time.test
index a3da2f5d21d..80ddb205110 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -271,7 +271,10 @@ select date_add(date,INTERVAL "1" QUARTER) from t1;
select timestampadd(MINUTE, 1, date) from t1;
select timestampadd(WEEK, 1, date) from t1;
select timestampadd(SQL_TSI_SECOND, 1, date) from t1;
+# Prepared statements doesn't support FRAC_SECOND yet
+--disable_ps_protocol
select timestampadd(SQL_TSI_FRAC_SECOND, 1, date) from t1;
+--enable_ps_protocol
select timestampdiff(MONTH, '2001-02-01', '2001-05-01') as a;
select timestampdiff(YEAR, '2002-05-01', '2001-01-01') as a;
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index b0fc600030b..3221b0d4624 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -280,7 +280,11 @@ insert into t1 values (1),(2),(3);
select count(*) from t1 group by s1 having s1 is null;
+# prepared statements prints warnings too early
+--disable_ps_protocol
select s1*0 as s1 from t1 group by s1 having s1 <> 0;
+--enable_ps_protocol
+
# ANSI requires: 3 rows
# MySQL returns: 0 rows - because of GROUP BY name resolution
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index e1459310bb9..15509b06679 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -136,9 +136,7 @@ insert into t2 values (2,"t2:2"), (3,"t2:3");
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/select.test b/mysql-test/t/select.test
index 85a5f6d0ee1..47b115cf030 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1789,7 +1789,10 @@ CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned defa
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,3,10,'2002-06-01 08:00:00',35),(1,3,1010,'2002-06-01 12:00:01',35);
+# Disable PS becasue we get more warnings from PS than from normal execution
+--disable_ps_protocol
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= 'wrong-date-value' AND b.sampletime < 'wrong-date-value' AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
+--enable_ps_protocol
# Testing the same select with NULL's instead of invalid datetime values
SELECT a.gvid, (SUM(CASE b.sampletid WHEN 140 THEN b.samplevalue ELSE 0 END)) as the_success,(SUM(CASE b.sampletid WHEN 141 THEN b.samplevalue ELSE 0 END)) as the_fail,(SUM(CASE b.sampletid WHEN 142 THEN b.samplevalue ELSE 0 END)) as the_size,(SUM(CASE b.sampletid WHEN 143 THEN b.samplevalue ELSE 0 END)) as the_time FROM t1 a, t2 b WHERE a.hmid = b.hmid AND a.volid = b.volid AND b.sampletime >= NULL AND b.sampletime < NULL AND b.sampletid IN (140, 141, 142, 143) GROUP BY a.gvid;
DROP TABLE t1,t2;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 5f912622101..4f556e34d51 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -944,7 +944,7 @@ select fun(2.3, 3, 5)|
insert into t2 values (append("xxx", "yyy"), mul(4,3), e())|
insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))|
-# These don't work yet.
+# Disable PS because double's give a bit different values
--disable_ps_protocol
select * from t2 where s = append("a", "b")|
select * from t2 where i = mul(4,3) or i = mul(mul(3,4),2)|
diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test
index 56f291ae69d..2cefa167466 100644
--- a/mysql-test/t/system_mysql_db_fix.test
+++ b/mysql-test/t/system_mysql_db_fix.test
@@ -1,6 +1,14 @@
#
# This is the test for mysql_fix_privilege_tables
#
+# Note: If this test fails, don't be confused about the errors reported
+# by mysql-test-run; This shows warnings from generated by
+# mysql_fix_system_tables which should be ignored.
+# Instead, concentrate on the errors in r/system_mysql_db.reject
+
+--disable_warnings
+drop table if exists t1,t1aa,t2aa;
+--enable_warnings
-- disable_result_log
-- disable_query_log
diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test
index 3900e59c2ee..bf75f09d553 100644
--- a/mysql-test/t/trigger.test
+++ b/mysql-test/t/trigger.test
@@ -53,6 +53,7 @@ select @a;
drop trigger t1.trg;
drop table t1;
+# PS doesn't work with multi-row statements
--disable_ps_protocol
# Before update trigger
# (In future we will achieve this via proper error handling in triggers)
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 085cad8cffa..20a501bb5ed 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -17,10 +17,8 @@ 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(255), b varbinary(70000), c varchar(70000000));
CREATE TABLE t4 (c varchar(65530) character set utf8 not null);
---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/union.test b/mysql-test/t/union.test
index 468a88b83db..58e4c22e168 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -5,9 +5,6 @@
--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');
@@ -30,9 +27,12 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
explain extended (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
select sql_calc_found_rows a,b from t1 union all select a,b from t2 limit 2;
select found_rows();
+--enable_ps_protocol
#
# Test some error conditions with UNION
@@ -210,15 +210,27 @@ insert into t2 values (3),(4),(5);
# Test global limits
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2) LIMIT 1;
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
+--enable_ps_protocol
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2) LIMIT 2;
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
+--enable_ps_protocol
# Test cases where found_rows() should return number of returned rows
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION all (SELECT * FROM t2);
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
+--enable_ps_protocol
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
+--enable_ps_protocol
# This used to work in 4.0 but not anymore in 4.1
--error 1064
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
@@ -226,9 +238,15 @@ select found_rows();
# In these case found_rows() should work
SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1 UNION all SELECT * FROM t2 LIMIT 2;
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
+--disable_ps_protocol
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION all SELECT * FROM t2 LIMIT 2;
+# PS doesn't work correctly with found_rows: to be fixed
+--disable_ps_protocol
select found_rows();
+--disable_ps_protocol
# The following examples will not be exact
SELECT SQL_CALC_FOUND_ROWS * FROM t1 UNION SELECT * FROM t2 LIMIT 2;
diff --git a/mysql-test/t/user_limits.test b/mysql-test/t/user_limits.test
index 8c6d5453789..50c16e5e114 100644
--- a/mysql-test/t/user_limits.test
+++ b/mysql-test/t/user_limits.test
@@ -14,6 +14,9 @@ delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
+# Limits doesn't work with prepared statements (yet)
+--disable_ps_protocol
+
# Test of MAX_QUERIES_PER_HOUR limit
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
connect (mqph, localhost, mysqltest_1,,);
@@ -149,6 +152,7 @@ disconnect muca2;
disconnect muca3;
set global max_user_connections= 0;
drop user mysqltest_1@localhost;
+--enable_ps_protocol
# Final cleanup
drop table t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 6dc49b28426..2aabbe20657 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1394,7 +1394,6 @@ create view v1 as select * from t1 where a < 2 with check option;
insert into v1 values (1) on duplicate key update a=2;
-- error 1369
insert into v1 values (1) on duplicate key update a=2;
--- error 1369
insert ignore into v1 values (1) on duplicate key update a=2;
select * from t1;
drop view v1;
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index 4bd659606f6..67162e7f84b 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -26,9 +26,8 @@ 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);
+--disable_ps_protocol
select @@warning_count;
--enable_ps_protocol
drop table t1;
@@ -96,12 +95,9 @@ 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