summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <mikael/pappa@dator5.(none)>2006-09-28 06:10:28 -0400
committerunknown <mikael/pappa@dator5.(none)>2006-09-28 06:10:28 -0400
commitf6230caa32cd3e9e5bb52f5da7fa4b0657aff01d (patch)
tree687aeac5d2442fe1d000bd375095e834f5c778c2 /mysql-test/t
parent51b1ec1f44924d8ac6385d306ee9090575fe2386 (diff)
parent2d48a1f2a3c3539a977839b94a9d3fe703666753 (diff)
downloadmariadb-git-f6230caa32cd3e9e5bb52f5da7fa4b0657aff01d.tar.gz
Merge dator5.(none):/home/pappa/clean-mysql-5.1
into dator5.(none):/home/pappa/bug18198 sql/sql_table.cc: Auto merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/events.test31
-rw-r--r--mysql-test/t/events_bugs.test19
-rw-r--r--mysql-test/t/events_restart_phase0.log22
-rw-r--r--mysql-test/t/events_restart_phase0.result22
-rw-r--r--mysql-test/t/log_tables.test18
-rw-r--r--mysql-test/t/sp.test27
6 files changed, 105 insertions, 34 deletions
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index add5dbcaa24..32863308687 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -49,35 +49,26 @@ drop event event2;
create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end;
drop event event2;
+#
# BUG #16537 (Events: mysql.event.starts is null)
+#
CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1;
---replace_column 8 # 9 #
-SHOW EVENTS;
-SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT interval_field, interval_value, body FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02';
---replace_column 8 # 9 #
-SHOW EVENTS;
-SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
ALTER EVENT event_starts_test COMMENT "non-empty comment";
---replace_column 8 # 9 #
-SHOW EVENTS;
-SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
ALTER EVENT event_starts_test COMMENT "";
---replace_column 8 # 9 #
-SHOW EVENTS;
-SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
DROP EVENT event_starts_test;
+
CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2;
---replace_column 8 # 9 #
-SHOW EVENTS;
-SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
ALTER EVENT event_starts_test COMMENT "non-empty comment";
---replace_column 8 # 9 #
-SHOW EVENTS;
-SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
ALTER EVENT event_starts_test COMMENT "";
---replace_column 8 # 9 #
-SHOW EVENTS;
+SELECT execute_at IS NULL, starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
DROP EVENT event_starts_test;
#
#
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index c9a8842f8f0..60e8c78d8bb 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -234,4 +234,23 @@ create event e_53 on schedule every 5 second ends (select s1 from ttx) do drop t
# END - BUG#16394: Events: Crash if schedule contains SELECT
#
+#
+# START - BUG#22397: Events: crash with procedure which alters events
+#
+--disable_warnings
+drop event if exists e_16;
+drop procedure if exists p_16;
+--enable_warnings
+create event e_16 on schedule every 1 second do set @a=5;
+create procedure p_16 () alter event e_16 on schedule every @a second;
+set @a = null;
+--error ER_WRONG_VALUE
+call p_16();
+--error ER_WRONG_VALUE
+call p_16();
+set @a= 6;
+call p_16();
+
+drop procedure p_16;
+drop event e_16;
drop database events_test;
diff --git a/mysql-test/t/events_restart_phase0.log b/mysql-test/t/events_restart_phase0.log
new file mode 100644
index 00000000000..218b804a302
--- /dev/null
+++ b/mysql-test/t/events_restart_phase0.log
@@ -0,0 +1,22 @@
+SHOW VARIABLES LIKE 'event%';
+Variable_name Value
+event_scheduler DISABLED
+SELECT @@global.event_scheduler;
+@@global.event_scheduler
+DISABLED
+SET GLOBAL event_scheduler=on;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=off;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=0;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=1;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=2;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
+SET GLOBAL event_scheduler=SUSPEND;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPEND'
+SET GLOBAL event_scheduler=SUSPENDED;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPENDED'
+SET GLOBAL event_scheduler=disabled;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled'
diff --git a/mysql-test/t/events_restart_phase0.result b/mysql-test/t/events_restart_phase0.result
new file mode 100644
index 00000000000..218b804a302
--- /dev/null
+++ b/mysql-test/t/events_restart_phase0.result
@@ -0,0 +1,22 @@
+SHOW VARIABLES LIKE 'event%';
+Variable_name Value
+event_scheduler DISABLED
+SELECT @@global.event_scheduler;
+@@global.event_scheduler
+DISABLED
+SET GLOBAL event_scheduler=on;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=off;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=0;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=1;
+ERROR HY000: The MySQL server is running with the --event-scheduler=DISABLED option so it cannot execute this statement
+SET GLOBAL event_scheduler=2;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
+SET GLOBAL event_scheduler=SUSPEND;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPEND'
+SET GLOBAL event_scheduler=SUSPENDED;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'SUSPENDED'
+SET GLOBAL event_scheduler=disabled;
+ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled'
diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test
index 97c83310b4d..d9e17129799 100644
--- a/mysql-test/t/log_tables.test
+++ b/mysql-test/t/log_tables.test
@@ -178,21 +178,21 @@ select * from mysql.slow_log;
# check that appropriate error messages are given when one attempts to alter
# or drop a log tables, while corresponding logs are enabled
---error ER_CANT_ALTER_LOG_TABLE
+--error ER_BAD_LOG_STATEMENT
alter table mysql.general_log engine=myisam;
---error ER_CANT_ALTER_LOG_TABLE
+--error ER_BAD_LOG_STATEMENT
alter table mysql.slow_log engine=myisam;
---error ER_CANT_DROP_LOG_TABLE
+--error ER_BAD_LOG_STATEMENT
drop table mysql.general_log;
---error ER_CANT_DROP_LOG_TABLE
+--error ER_BAD_LOG_STATEMENT
drop table mysql.slow_log;
# check that one can alter log tables to MyISAM
set global general_log='OFF';
# cannot convert another log table
---error ER_CANT_ALTER_LOG_TABLE
+--error ER_BAD_LOG_STATEMENT
alter table mysql.slow_log engine=myisam;
# alter both tables
@@ -252,13 +252,13 @@ set global general_log='OFF';
set global slow_query_log='OFF';
# check that alter table doesn't work for other engines
---error ER_BAD_LOG_ENGINE
+--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=ndb;
---error ER_BAD_LOG_ENGINE
+--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=innodb;
---error ER_BAD_LOG_ENGINE
+--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=archive;
---error ER_BAD_LOG_ENGINE
+--error ER_UNSUPORTED_LOG_ENGINE
alter table mysql.slow_log engine=blackhole;
drop table mysql.slow_log;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 32f9bf24703..49d6186f389 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -1,13 +1,9 @@
#
# Basic stored PROCEDURE tests
#
-# Please keep this file free of --error cases and other
-# things that will not run in a single debugged mysqld
-# process (e.g. master-slave things).
-#
# Test cases for bugs are added at the end. See template there.
#
-# Tests that require --error go into sp-error.test
+# Some tests that require --error go into sp-error.test
# Tests that require inndb go into sp_trans.test
# Tests that check privilege and security issues go to sp-security.test.
# Tests that require multiple connections, except security/privilege tests,
@@ -6296,6 +6292,25 @@ call bug21416()|
drop procedure bug21416|
#
+# BUG#21414: SP: Procedure undroppable, to some extent
+#
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug21414|
+--enable_warnings
+
+CREATE PROCEDURE bug21414() SELECT 1|
+
+FLUSH TABLES WITH READ LOCK|
+
+--error ER_CANT_UPDATE_WITH_READLOCK
+DROP PROCEDURE bug21414|
+
+UNLOCK TABLES|
+
+--echo The following should succeed.
+DROP PROCEDURE bug21414|
+
+#
# BUG#21493: Crash on the second call of a procedure containing
# a select statement that uses an IN aggregating subquery
#
@@ -6363,6 +6378,8 @@ DROP FUNCTION bug21493|
DROP TABLE t3,t4|
--echo End of 5.0 tests
+
+
#
# BUG#NNNN: New bug synopsis
#