summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2006-02-08 14:05:19 +0300
committerunknown <konstantin@mysql.com>2006-02-08 14:05:19 +0300
commitfa86430f2870c7609bb659598ce269aeefa288fa (patch)
tree30aac0d473473490e476729fb311b3b1d9c36e52 /mysql-test
parent28c8134cf35daa44f7a18688096642218e7bc692 (diff)
parent86f9bdf8b2e5ea624e3eff2962c531b8c3c6e3c0 (diff)
downloadmariadb-git-fa86430f2870c7609bb659598ce269aeefa288fa.tar.gz
Merge mysql.com:/home/kostja/mysql/tmp_merge
into mysql.com:/home/kostja/mysql/mysql-5.1-merge client/mysqltest.c: Auto merged mysql-test/r/date_formats.result: Auto merged mysql-test/r/sp-error.result: Auto merged mysql-test/r/sp-security.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/type_float.result: Auto merged mysql-test/t/date_formats.test: Auto merged mysql-test/t/sp-error.test: Auto merged mysql-test/t/sp-security.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/type_float.test: Auto merged mysql-test/t/variables.test: Auto merged sql/item_timefunc.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/date_formats.result9
-rw-r--r--mysql-test/r/sp-error.result29
-rw-r--r--mysql-test/r/sp-security.result23
-rw-r--r--mysql-test/r/sp.result19
-rw-r--r--mysql-test/t/date_formats.test7
-rw-r--r--mysql-test/t/sp-error.test60
-rw-r--r--mysql-test/t/sp-security.test38
-rw-r--r--mysql-test/t/sp.test31
8 files changed, 216 insertions, 0 deletions
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 434a5df1e17..214c9466c8c 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -506,3 +506,12 @@ d1 d2
02 February
01 January
drop table t1;
+select str_to_date( 1, NULL );
+str_to_date( 1, NULL )
+NULL
+select str_to_date( NULL, 1 );
+str_to_date( NULL, 1 )
+NULL
+select str_to_date( 1, IF(1=1,NULL,NULL) );
+str_to_date( 1, IF(1=1,NULL,NULL) )
+NULL
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index d26f0029001..885b7827370 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1134,3 +1134,32 @@ show procedure status;
Db Name Type Definer Modified Created Security_type Comment
test bug15658 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER
drop procedure ` bug15658`;
+drop function if exists bug14270;
+drop table if exists t1;
+create table t1 (s1 int primary key);
+create function bug14270() returns int
+begin
+load index into cache t1;
+return 1;
+end|
+ERROR 0A000: Not allowed to return a result set from a function
+create function bug14270() returns int
+begin
+cache index t1 key (`primary`) in keycache1;
+return 1;
+end|
+ERROR 0A000: Not allowed to return a result set from a function
+drop table t1;
+drop procedure if exists bug15091;
+create procedure bug15091()
+begin
+declare selectstr varchar(6000) default ' ';
+declare conditionstr varchar(5000) default '';
+set selectstr = concat(selectstr,
+' and ',
+c.operatorid,
+'in (',conditionstr, ')');
+end|
+call bug15091();
+ERROR 42S02: Unknown table 'c' in field list
+drop procedure bug15091;
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index b223c0cd487..ff729e87f97 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -291,3 +291,26 @@ drop user user1_bug14834@localhost;
drop user user2_bug14834@localhost;
drop user user3_bug14834@localhost;
drop database db_bug14834;
+create database db_bug14533;
+use db_bug14533;
+create table t1 (id int);
+create user user_bug14533@localhost identified by '';
+create procedure bug14533_1()
+sql security definer
+desc db_bug14533.t1;
+create procedure bug14533_2()
+sql security definer
+select * from db_bug14533.t1;
+grant execute on procedure db_bug14533.bug14533_1 to user_bug14533@localhost;
+grant execute on procedure db_bug14533.bug14533_2 to user_bug14533@localhost;
+call db_bug14533.bug14533_1();
+Field Type Null Key Default Extra
+id int(11) YES NULL
+call db_bug14533.bug14533_2();
+id
+desc db_bug14533.t1;
+ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
+select * from db_bug14533.t1;
+ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
+drop user user_bug14533@localhost;
+drop database db_bug14533;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index ea4420c8e70..761d4b83a39 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -4425,4 +4425,23 @@ drop procedure if exists bug15231_1|
drop procedure if exists bug15231_2|
drop procedure if exists bug15231_3|
drop procedure if exists bug15231_4|
+drop procedure if exists bug15011|
+create table t3 (c1 int primary key)|
+insert into t3 values (1)|
+create procedure bug15011()
+deterministic
+begin
+declare continue handler for 1062
+select 'Outer' as 'Handler';
+begin
+declare continue handler for 1062
+select 'Inner' as 'Handler';
+insert into t3 values (1);
+end;
+end|
+call bug15011()|
+Handler
+Inner
+drop procedure bug15011|
+drop table t3|
drop table t1,t2;
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index 88106ae6956..2e1af51efa7 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -272,4 +272,11 @@ insert into t1 (f1) values ("2005-01-01");
insert into t1 (f1) values ("2005-02-01");
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
drop table t1;
+
+#
+# Bug #15828
+#
+select str_to_date( 1, NULL );
+select str_to_date( NULL, 1 );
+select str_to_date( 1, IF(1=1,NULL,NULL) );
# End of 4.1 tests
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index d7044bee632..63185ea9a88 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1622,6 +1622,66 @@ drop procedure ` bug15658`;
#
+# BUG#14270: Stored procedures: crash if load index
+#
+--disable_warnings
+drop function if exists bug14270;
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (s1 int primary key);
+
+delimiter |;
+--error ER_SP_NO_RETSET
+create function bug14270() returns int
+begin
+ load index into cache t1;
+ return 1;
+end|
+
+--error ER_SP_NO_RETSET
+create function bug14270() returns int
+begin
+ cache index t1 key (`primary`) in keycache1;
+ return 1;
+end|
+delimiter ;|
+
+drop table t1;
+
+
+#
+# BUG#15091: Sp Returns Unknown error in order clause....and
+# there is no order by clause
+#
+--disable_warnings
+drop procedure if exists bug15091;
+--enable_warnings
+
+delimiter |;
+create procedure bug15091()
+begin
+ declare selectstr varchar(6000) default ' ';
+ declare conditionstr varchar(5000) default '';
+
+ set selectstr = concat(selectstr,
+ ' and ',
+ c.operatorid,
+ 'in (',conditionstr, ')');
+end|
+delimiter ;|
+
+# The error message used to be:
+# ERROR 1109 (42S02): Unknown table 'c' in order clause
+# but is now rephrased to something less misleading:
+# ERROR 1109 (42S02): Unknown table 'c' in field list
+--error ER_UNKNOWN_TABLE
+call bug15091();
+
+drop procedure bug15091;
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index 223bc09b9fc..90160780618 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -487,4 +487,42 @@ drop user user2_bug14834@localhost;
drop user user3_bug14834@localhost;
drop database db_bug14834;
+
+#
+# BUG#14533: 'desc tbl' in stored procedure causes error 1142
+#
+create database db_bug14533;
+use db_bug14533;
+create table t1 (id int);
+create user user_bug14533@localhost identified by '';
+
+create procedure bug14533_1()
+ sql security definer
+ desc db_bug14533.t1;
+
+create procedure bug14533_2()
+ sql security definer
+ select * from db_bug14533.t1;
+
+grant execute on procedure db_bug14533.bug14533_1 to user_bug14533@localhost;
+grant execute on procedure db_bug14533.bug14533_2 to user_bug14533@localhost;
+
+connect (user_bug14533,localhost,user_bug14533,,test);
+
+# These should work
+call db_bug14533.bug14533_1();
+call db_bug14533.bug14533_2();
+
+# For reference, these should not work
+--error ER_TABLEACCESS_DENIED_ERROR
+desc db_bug14533.t1;
+--error ER_TABLEACCESS_DENIED_ERROR
+select * from db_bug14533.t1;
+
+# Cleanup
+connection default;
+disconnect user_bug14533;
+drop user user_bug14533@localhost;
+drop database db_bug14533;
+
# End of 5.0 bugs.
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 02772313d01..74585a0d3b7 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -5199,6 +5199,37 @@ drop procedure if exists bug15231_4|
#
+# BUG#15011: error handler in nested block not activated
+#
+--disable_warnings
+drop procedure if exists bug15011|
+--enable_warnings
+
+create table t3 (c1 int primary key)|
+
+insert into t3 values (1)|
+
+create procedure bug15011()
+ deterministic
+begin
+ declare continue handler for 1062
+ select 'Outer' as 'Handler';
+
+ begin
+ declare continue handler for 1062
+ select 'Inner' as 'Handler';
+
+ insert into t3 values (1);
+ end;
+end|
+
+call bug15011()|
+
+drop procedure bug15011|
+drop table t3|
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings