mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint configure.in: Auto merged include/mysql.h: Auto merged include/mysql_com.h: Auto merged sql-common/client.c: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/sql_acl.cc: Auto merged
This commit is contained in:
commit
085446b8c8
65 changed files with 2626 additions and 820 deletions
|
|
@ -72,3 +72,16 @@ show tables;
|
|||
Tables_in_test
|
||||
t1
|
||||
drop table t1;
|
||||
drop database if exists mysqltest;
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
lock tables t1 read;
|
||||
create database mysqltest;
|
||||
drop table t1;
|
||||
show open tables;
|
||||
drop database mysqltest;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
unlock tables;
|
||||
End of 5.0 tests
|
||||
|
|
|
|||
|
|
@ -943,6 +943,31 @@ DROP TABLE mysqltest3.t_nn;
|
|||
DROP DATABASE mysqltest3;
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
|
||||
DROP USER 'mysqltest_1'@'localhost';
|
||||
use test;
|
||||
create user mysqltest1_thisisreallytoolong;
|
||||
ERROR HY000: Operation CREATE USER failed for 'mysqltest1_thisisreallytoolong'@'%'
|
||||
ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
|
||||
GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
GRANT CREATE ON mysqltest.* TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
REVOKE CREATE ON mysqltest.* FROM 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
REVOKE CREATE ON mysqltest.* FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
GRANT CREATE ON t1 TO 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
GRANT CREATE ON t1 TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
REVOKE CREATE ON t1 FROM 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
REVOKE CREATE ON t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
End of 5.0 tests
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
|||
|
|
@ -1297,3 +1297,18 @@ ERROR 3D000: No database selected
|
|||
create temporary table t1 (i int);
|
||||
ERROR 3D000: No database selected
|
||||
use test;
|
||||
DROP TABLE IF EXISTS t1, t2, t3;
|
||||
CREATE TABLE t1 (i BIGINT, j BIGINT);
|
||||
CREATE TABLE t2 (i BIGINT);
|
||||
CREATE TABLE t3 (i BIGINT, j BIGINT);
|
||||
PREPARE stmt FROM "SELECT * FROM t1 JOIN t2 ON (t2.i = t1.i)
|
||||
LEFT JOIN t3 ON ((t3.i, t3.j) = (t1.i, t1.j))
|
||||
WHERE t1.i = ?";
|
||||
SET @a= 1;
|
||||
EXECUTE stmt USING @a;
|
||||
i j i i j
|
||||
EXECUTE stmt USING @a;
|
||||
i j i i j
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE IF EXISTS t1, t2, t3;
|
||||
End of 5.0 tests.
|
||||
|
|
|
|||
|
|
@ -634,6 +634,45 @@ flush tables;
|
|||
return 5;
|
||||
end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin reset query cache;
|
||||
return 1; end|
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin reset master;
|
||||
return 1; end|
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin reset slave;
|
||||
return 1; end|
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush hosts;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush privileges;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush tables with read lock;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush tables;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush logs;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush status;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush slave;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush master;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush des_key_file;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create function bug8409() returns int begin flush user_resources;
|
||||
return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create procedure bug9529_901234567890123456789012345678901234567890123456789012345()
|
||||
begin
|
||||
end|
|
||||
|
|
|
|||
|
|
@ -4872,8 +4872,6 @@ declare continue handler for sqlexception begin end;
|
|||
select no_such_function();
|
||||
end|
|
||||
call bug18787()|
|
||||
no_such_function()
|
||||
NULL
|
||||
drop procedure bug18787|
|
||||
create database bug18344_012345678901|
|
||||
use bug18344_012345678901|
|
||||
|
|
@ -5222,6 +5220,126 @@ CHARSET(p3) COLLATION(p3)
|
|||
greek greek_general_ci
|
||||
use test|
|
||||
DROP DATABASE mysqltest1|
|
||||
drop table if exists t3|
|
||||
drop table if exists t4|
|
||||
drop procedure if exists bug8153_subselect|
|
||||
drop procedure if exists bug8153_subselect_a|
|
||||
drop procedure if exists bug8153_subselect_b|
|
||||
drop procedure if exists bug8153_proc_a|
|
||||
drop procedure if exists bug8153_proc_b|
|
||||
create table t3 (a int)|
|
||||
create table t4 (a int)|
|
||||
insert into t3 values (1), (1), (2), (3)|
|
||||
insert into t4 values (1), (1)|
|
||||
create procedure bug8153_subselect()
|
||||
begin
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
select 'statement failed';
|
||||
end;
|
||||
update t3 set a=a+1 where (select a from t4 where a=1) is null;
|
||||
select 'statement after update';
|
||||
end|
|
||||
call bug8153_subselect()|
|
||||
statement failed
|
||||
statement failed
|
||||
statement after update
|
||||
statement after update
|
||||
select * from t3|
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
call bug8153_subselect()|
|
||||
statement failed
|
||||
statement failed
|
||||
statement after update
|
||||
statement after update
|
||||
select * from t3|
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
drop procedure bug8153_subselect|
|
||||
create procedure bug8153_subselect_a()
|
||||
begin
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
select 'in continue handler';
|
||||
end;
|
||||
select 'reachable code a1';
|
||||
call bug8153_subselect_b();
|
||||
select 'reachable code a2';
|
||||
end|
|
||||
create procedure bug8153_subselect_b()
|
||||
begin
|
||||
select 'reachable code b1';
|
||||
update t3 set a=a+1 where (select a from t4 where a=1) is null;
|
||||
select 'unreachable code b2';
|
||||
end|
|
||||
call bug8153_subselect_a()|
|
||||
reachable code a1
|
||||
reachable code a1
|
||||
reachable code b1
|
||||
reachable code b1
|
||||
in continue handler
|
||||
in continue handler
|
||||
reachable code a2
|
||||
reachable code a2
|
||||
select * from t3|
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
call bug8153_subselect_a()|
|
||||
reachable code a1
|
||||
reachable code a1
|
||||
reachable code b1
|
||||
reachable code b1
|
||||
in continue handler
|
||||
in continue handler
|
||||
reachable code a2
|
||||
reachable code a2
|
||||
select * from t3|
|
||||
a
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
drop procedure bug8153_subselect_a|
|
||||
drop procedure bug8153_subselect_b|
|
||||
create procedure bug8153_proc_a()
|
||||
begin
|
||||
declare continue handler for sqlexception
|
||||
begin
|
||||
select 'in continue handler';
|
||||
end;
|
||||
select 'reachable code a1';
|
||||
call bug8153_proc_b();
|
||||
select 'reachable code a2';
|
||||
end|
|
||||
create procedure bug8153_proc_b()
|
||||
begin
|
||||
select 'reachable code b1';
|
||||
select no_such_function();
|
||||
select 'unreachable code b2';
|
||||
end|
|
||||
call bug8153_proc_a()|
|
||||
reachable code a1
|
||||
reachable code a1
|
||||
reachable code b1
|
||||
reachable code b1
|
||||
in continue handler
|
||||
in continue handler
|
||||
reachable code a2
|
||||
reachable code a2
|
||||
drop procedure bug8153_proc_a|
|
||||
drop procedure bug8153_proc_b|
|
||||
drop table t3|
|
||||
drop table t4|
|
||||
drop procedure if exists bug19862|
|
||||
CREATE TABLE t11 (a INT)|
|
||||
CREATE TABLE t12 (a INT)|
|
||||
|
|
@ -5256,4 +5374,24 @@ a
|
|||
1
|
||||
use test|
|
||||
drop table t3|
|
||||
DROP PROCEDURE IF EXISTS bug16899_p1|
|
||||
DROP FUNCTION IF EXISTS bug16899_f1|
|
||||
CREATE DEFINER=1234567890abcdefGHIKL@localhost PROCEDURE bug16899_p1()
|
||||
BEGIN
|
||||
SET @a = 1;
|
||||
END|
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
CREATE DEFINER=some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY
|
||||
FUNCTION bug16899_f1() RETURNS INT
|
||||
BEGIN
|
||||
RETURN 1;
|
||||
END|
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
drop procedure if exists bug21416|
|
||||
create procedure bug21416() show create procedure bug21416|
|
||||
call bug21416()|
|
||||
Procedure sql_mode Create Procedure
|
||||
bug21416 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug21416`()
|
||||
show create procedure bug21416
|
||||
drop procedure bug21416|
|
||||
drop table t1,t2;
|
||||
|
|
|
|||
|
|
@ -626,12 +626,51 @@ Trigger Event Table Statement Timing Created sql_mode Definer
|
|||
t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE # root@localhost
|
||||
drop table t1;
|
||||
create table t1 (id int);
|
||||
create trigger t1_ai after insert on t1 for each row reset query cache;
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row reset master;
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row reset slave;
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush hosts;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush tables with read lock;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush logs;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush status;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush slave;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush master;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush des_key_file;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush user_resources;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush tables;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush privileges;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create procedure p1() flush tables;
|
||||
drop procedure if exists p1;
|
||||
create trigger t1_ai after insert on t1 for each row call p1();
|
||||
create procedure p1() flush tables;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() reset query cache;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() reset master;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() reset slave;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: RESET is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush hosts;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
|
|
@ -639,6 +678,38 @@ create procedure p1() flush privileges;
|
|||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush tables with read lock;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush tables;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush logs;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush status;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush slave;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush master;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush des_key_file;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush user_resources;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
drop table t1;
|
||||
create table t1 (id int, data int, username varchar(16));
|
||||
insert into t1 (id, data) values (1, 0);
|
||||
|
|
@ -1089,4 +1160,17 @@ begin
|
|||
set @a:= 1;
|
||||
end|
|
||||
ERROR HY000: Triggers can not be created on system tables
|
||||
use test|
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1(c INT);
|
||||
CREATE TABLE t2(c INT);
|
||||
CREATE DEFINER=1234567890abcdefGHIKL@localhost
|
||||
TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a = 1;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
CREATE DEFINER=some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY
|
||||
TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW SET @a = 2;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
End of 5.0 tests
|
||||
|
|
|
|||
|
|
@ -422,3 +422,34 @@ DROP TABLE IF EXISTS t1;
|
|||
CREATE TABLE t1(f1 CHAR(100) DEFAULT 'test');
|
||||
INSERT INTO t1 VALUES(SUBSTR(f1, 1, 3));
|
||||
DROP TABLE IF EXISTS t1;
|
||||
drop table if exists t1, t2, t3;
|
||||
create table t3 (
|
||||
id int(11),
|
||||
en varchar(255) character set utf8,
|
||||
cz varchar(255) character set utf8
|
||||
);
|
||||
truncate table t3;
|
||||
insert into t3 (id, en, cz) values
|
||||
(1,'en string 1','cz string 1'),
|
||||
(2,'en string 2','cz string 2'),
|
||||
(3,'en string 3','cz string 3');
|
||||
create table t1 (
|
||||
id int(11),
|
||||
name_id int(11)
|
||||
);
|
||||
insert into t1 (id, name_id) values (1,1), (2,3), (3,3);
|
||||
create table t2 (id int(11));
|
||||
insert into t2 (id) values (1), (2), (3);
|
||||
select t1.*, t2.id, t3.en, t3.cz from t1 left join t2 on t1.id=t2.id
|
||||
left join t3 on t1.id=t3.id order by t3.id;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t1 t1 id id 3 11 1 Y 32768 0 63
|
||||
def test t1 t1 name_id name_id 3 11 1 Y 32768 0 63
|
||||
def test t2 t2 id id 3 11 1 Y 32768 0 63
|
||||
def test t3 t3 en en 253 255 11 Y 0 0 8
|
||||
def test t3 t3 cz cz 253 255 11 Y 0 0 8
|
||||
id name_id id en cz
|
||||
1 1 1 en string 1 cz string 1
|
||||
2 3 2 en string 2 cz string 2
|
||||
3 3 3 en string 3 cz string 3
|
||||
drop table t1, t2, t3;
|
||||
|
|
|
|||
|
|
@ -2879,3 +2879,41 @@ View Create View
|
|||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute))
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP VIEW IF EXISTS v1;
|
||||
DROP VIEW IF EXISTS v2;
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
CREATE DEFINER=1234567890abcdefGHIKL@localhost
|
||||
VIEW v1 AS SELECT a FROM t1;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
CREATE DEFINER=some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY
|
||||
VIEW v2 AS SELECT b FROM t1;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
DROP TABLE t1;
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP FUNCTION IF EXISTS f2;
|
||||
DROP VIEW IF EXISTS v1, v2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (i INT);
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
CREATE FUNCTION f1() RETURNS INT
|
||||
BEGIN
|
||||
INSERT INTO v1 VALUES (0);
|
||||
RETURN 0;
|
||||
END |
|
||||
SELECT f1();
|
||||
f1()
|
||||
0
|
||||
CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t1;
|
||||
CREATE FUNCTION f2() RETURNS INT
|
||||
BEGIN
|
||||
INSERT INTO v2 VALUES (0);
|
||||
RETURN 0;
|
||||
END |
|
||||
SELECT f2();
|
||||
ERROR HY000: The target table v2 of the INSERT is not updatable
|
||||
DROP FUNCTION f1;
|
||||
DROP FUNCTION f2;
|
||||
DROP VIEW v1, v2;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue