mirror of
https://github.com/MariaDB/server.git
synced 2025-08-30 11:22:14 +03:00
Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge
This commit is contained in:
@@ -610,7 +610,6 @@ id ev_nm ev_cnt
|
||||
6 ev_sched_1823 6
|
||||
DROP TABLE event_log;
|
||||
SET GLOBAL event_scheduler = OFF;
|
||||
DROP DATABASE events_test;
|
||||
SET GLOBAL event_scheduler= ON;
|
||||
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
|
||||
DO BEGIN
|
||||
@@ -618,3 +617,105 @@ SELECT 1;
|
||||
END;|
|
||||
SET GLOBAL event_scheduler= OFF;
|
||||
DROP EVENT bug28641;
|
||||
|
||||
#####################################################################
|
||||
#
|
||||
# BUG#31111: --read-only crashes MySQL (events fail to load).
|
||||
#
|
||||
#####################################################################
|
||||
|
||||
DROP USER mysqltest_u1@localhost;
|
||||
DROP EVENT IF EXISTS e1;
|
||||
DROP EVENT IF EXISTS e2;
|
||||
|
||||
GRANT EVENT ON *.* TO mysqltest_u1@localhost;
|
||||
|
||||
SET GLOBAL READ_ONLY = 1;
|
||||
|
||||
#
|
||||
# Connection: u1_con (mysqltest_u1@localhost/events_test).
|
||||
#
|
||||
|
||||
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
|
||||
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||
|
||||
ALTER EVENT e1 COMMENT 'comment';
|
||||
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||
|
||||
DROP EVENT e1;
|
||||
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||
|
||||
#
|
||||
# Connection: root_con (root@localhost/events_test).
|
||||
#
|
||||
|
||||
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
|
||||
|
||||
ALTER EVENT e1 COMMENT 'comment';
|
||||
|
||||
DROP EVENT e1;
|
||||
|
||||
SET GLOBAL READ_ONLY = 0;
|
||||
|
||||
#
|
||||
# Connection: u1_con (mysqltest_u1@localhost/test).
|
||||
#
|
||||
|
||||
CREATE EVENT e1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND DO SET @a = 1;
|
||||
CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO SET @a = 1;
|
||||
|
||||
SELECT
|
||||
event_name,
|
||||
last_executed IS NULL,
|
||||
definer
|
||||
FROM INFORMATION_SCHEMA.EVENTS
|
||||
WHERE event_schema = 'events_test';
|
||||
event_name last_executed IS NULL definer
|
||||
e1 1 mysqltest_u1@localhost
|
||||
e2 1 mysqltest_u1@localhost
|
||||
|
||||
#
|
||||
# Connection: root_con (root@localhost/events_test).
|
||||
#
|
||||
|
||||
SET GLOBAL READ_ONLY = 1;
|
||||
|
||||
SET GLOBAL EVENT_SCHEDULER = ON;
|
||||
|
||||
# Waiting for the event scheduler to execute and drop event e1...
|
||||
|
||||
# Waiting for the event scheduler to execute and update event e2...
|
||||
|
||||
SET GLOBAL EVENT_SCHEDULER = OFF;
|
||||
|
||||
SELECT
|
||||
event_name,
|
||||
last_executed IS NULL,
|
||||
definer
|
||||
FROM INFORMATION_SCHEMA.EVENTS
|
||||
WHERE event_schema = 'events_test';
|
||||
event_name last_executed IS NULL definer
|
||||
e2 0 mysqltest_u1@localhost
|
||||
|
||||
DROP EVENT e1;
|
||||
ERROR HY000: Unknown event 'e1'
|
||||
|
||||
# Cleanup.
|
||||
|
||||
DROP EVENT e2;
|
||||
|
||||
SET GLOBAL READ_ONLY = 0;
|
||||
|
||||
#
|
||||
# Connection: default
|
||||
#
|
||||
|
||||
DROP USER mysqltest_u1@localhost;
|
||||
|
||||
#####################################################################
|
||||
#
|
||||
# End of BUG#31111.
|
||||
#
|
||||
#####################################################################
|
||||
|
||||
DROP DATABASE events_test;
|
||||
|
@@ -2251,7 +2251,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
|
||||
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
|
||||
2 SUBQUERY t1 range NULL a 5 NULL 8
|
||||
EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
|
||||
a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
@@ -2268,7 +2268,7 @@ AND t1_outer1.b = t1_outer2.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
|
||||
1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer
|
||||
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
|
||||
2 SUBQUERY t1 range NULL a 5 NULL 8
|
||||
EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
|
||||
FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
|
@@ -286,7 +286,7 @@ NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
|
||||
explain select * from (select * from t1 where key1 = 3 or key2 =3) as Z where key8 >5;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
|
||||
2 DERIVED t1 index_merge i1,i2 i1,i2 4,4 NULL 2 Using union(i1,i2); Using where; Using index
|
||||
2 DERIVED t1 index_merge i1,i2 i1,i2 4,4 NULL 2 Using union(i1,i2); Using where
|
||||
create table t3 like t0;
|
||||
insert into t3 select * from t0;
|
||||
alter table t3 add key9 int not null, add index i9(key9);
|
||||
|
@@ -1287,6 +1287,40 @@ a b
|
||||
2 2
|
||||
3 2
|
||||
1 1
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#27610: ALTER TABLE ROW_FORMAT=... does not rebuild the table.
|
||||
#
|
||||
|
||||
# - prepare;
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
||||
CREATE TABLE t1(c INT)
|
||||
ENGINE = InnoDB
|
||||
ROW_FORMAT = COMPACT;
|
||||
|
||||
# - initial check;
|
||||
|
||||
SELECT table_schema, table_name, row_format
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema = DATABASE() AND table_name = 't1';
|
||||
table_schema table_name row_format
|
||||
test t1 Compact
|
||||
|
||||
# - change ROW_FORMAT and check;
|
||||
|
||||
ALTER TABLE t1 ROW_FORMAT = REDUNDANT;
|
||||
|
||||
SELECT table_schema, table_name, row_format
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema = DATABASE() AND table_name = 't1';
|
||||
table_schema table_name row_format
|
||||
test t1 Redundant
|
||||
|
||||
# - that's it, cleanup.
|
||||
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
CREATE TABLE `t2` (
|
||||
|
@@ -530,3 +530,18 @@ ORDER BY c.b, c.d
|
||||
a b c d e f g h i j a b c d
|
||||
2 2 1 2004-11-30 12:00:00 1 0 0 0 0 0 2 3388000 -553000 NULL
|
||||
DROP TABLE t1, t2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT);
|
||||
INSERT INTO t1 VALUES (), (), ();
|
||||
SELECT 1 AS c1
|
||||
FROM t1
|
||||
ORDER BY (
|
||||
SELECT 1 AS c2
|
||||
FROM t1
|
||||
GROUP BY GREATEST(LAST_INSERT_ID(), t1.a) ASC
|
||||
LIMIT 1);
|
||||
c1
|
||||
1
|
||||
1
|
||||
1
|
||||
DROP TABLE t1;
|
||||
|
@@ -4081,6 +4081,41 @@ SELECT `x` FROM v3;
|
||||
x
|
||||
1
|
||||
DROP VIEW v1, v2, v3;
|
||||
|
||||
#
|
||||
# Bug#30736: Row Size Too Large Error Creating a Table and
|
||||
# Inserting Data.
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
|
||||
CREATE TABLE t1(
|
||||
c1 DECIMAL(10, 2),
|
||||
c2 FLOAT);
|
||||
|
||||
INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5);
|
||||
|
||||
CREATE TABLE t2(
|
||||
c3 DECIMAL(10, 2))
|
||||
SELECT
|
||||
c1 * c2 AS c3
|
||||
FROM t1;
|
||||
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
0.00 1
|
||||
2.00 3
|
||||
4.00 5
|
||||
|
||||
SELECT * FROM t2;
|
||||
c3
|
||||
0.00
|
||||
6.00
|
||||
20.00
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
End of 5.0 tests
|
||||
create table t1(a INT, KEY (a));
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
|
@@ -1523,3 +1523,13 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
SELECT ..inexistent();
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.inexistent()' at line 1
|
||||
USE test;
|
||||
create function f1() returns int
|
||||
begin
|
||||
set @test = 1, password = password('foo');
|
||||
return 1;
|
||||
end|
|
||||
ERROR HY000: Not allowed to set autocommit from a stored function or trigger
|
||||
create trigger t1
|
||||
before insert on t2 for each row set password = password('foo');
|
||||
delimiter ;|
|
||||
ERROR HY000: Not allowed to set autocommit from a stored function or trigger
|
||||
|
@@ -11,7 +11,7 @@ RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
|
||||
CREATE AGGREGATE FUNCTION avgcost
|
||||
RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
|
||||
select myfunc_double();
|
||||
ERROR HY000: myfunc_double must have at least one argument
|
||||
ERROR HY000: Can't initialize function 'myfunc_double'; myfunc_double must have at least one argument
|
||||
select myfunc_double(1);
|
||||
myfunc_double(1)
|
||||
49.00
|
||||
@@ -24,26 +24,26 @@ select myfunc_int();
|
||||
myfunc_int()
|
||||
0
|
||||
select lookup();
|
||||
ERROR HY000: Wrong arguments to lookup; Use the source
|
||||
ERROR HY000: Can't initialize function 'lookup'; Wrong arguments to lookup; Use the source
|
||||
select lookup("127.0.0.1");
|
||||
lookup("127.0.0.1")
|
||||
127.0.0.1
|
||||
select lookup(127,0,0,1);
|
||||
ERROR HY000: Wrong arguments to lookup; Use the source
|
||||
ERROR HY000: Can't initialize function 'lookup'; Wrong arguments to lookup; Use the source
|
||||
select lookup("localhost");
|
||||
lookup("localhost")
|
||||
127.0.0.1
|
||||
select reverse_lookup();
|
||||
ERROR HY000: Wrong number of arguments to reverse_lookup; Use the source
|
||||
ERROR HY000: Can't initialize function 'reverse_lookup'; Wrong number of arguments to reverse_lookup; Use the source
|
||||
select reverse_lookup("127.0.0.1");
|
||||
select reverse_lookup(127,0,0,1);
|
||||
select reverse_lookup("localhost");
|
||||
reverse_lookup("localhost")
|
||||
NULL
|
||||
select avgcost();
|
||||
ERROR HY000: wrong number of arguments: AVGCOST() requires two arguments
|
||||
ERROR HY000: Can't initialize function 'avgcost'; wrong number of arguments: AVGCOST() requires two arguments
|
||||
select avgcost(100,23.76);
|
||||
ERROR HY000: wrong argument type: AVGCOST() requires an INT and a REAL
|
||||
ERROR HY000: Can't initialize function 'avgcost'; wrong argument type: AVGCOST() requires an INT and a REAL
|
||||
create table t1(sum int, price float(24));
|
||||
insert into t1 values(100, 50.00), (100, 100.00);
|
||||
select avgcost(sum, price) from t1;
|
||||
|
Reference in New Issue
Block a user