mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/alik/Documents/AllProgs/MySQL/devel/5.0-bug13095
This commit is contained in:
@ -3532,4 +3532,47 @@ select @a|
|
||||
Local
|
||||
drop function bug13941|
|
||||
drop procedure bug13941|
|
||||
DROP PROCEDURE IF EXISTS bug13095;
|
||||
DROP TABLE IF EXISTS bug13095_t1;
|
||||
DROP VIEW IF EXISTS bug13095_v1;
|
||||
CREATE PROCEDURE bug13095(tbl_name varchar(32))
|
||||
BEGIN
|
||||
SET @str =
|
||||
CONCAT("CREATE TABLE ", tbl_name, "(stuff char(15))");
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
SET @str =
|
||||
CONCAT("INSERT INTO ", tbl_name, " VALUES('row1'),('row2'),('row3')" );
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
SET @str =
|
||||
CONCAT("CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM ", tbl_name);
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
SELECT * FROM bug13095_v1;
|
||||
SET @str =
|
||||
"DROP VIEW bug13095_v1";
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
END|
|
||||
CALL bug13095('bug13095_t1');
|
||||
@str
|
||||
CREATE TABLE bug13095_t1(stuff char(15))
|
||||
@str
|
||||
INSERT INTO bug13095_t1 VALUES('row1'),('row2'),('row3')
|
||||
@str
|
||||
CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM bug13095_t1
|
||||
c1
|
||||
row1
|
||||
row2
|
||||
row3
|
||||
@str
|
||||
DROP VIEW bug13095_v1
|
||||
DROP PROCEDURE IF EXISTS bug13095;
|
||||
DROP VIEW IF EXISTS bug13095_v1;
|
||||
DROP TABLE IF EXISTS bug13095_t1;
|
||||
drop table t1,t2;
|
||||
|
@ -4433,6 +4433,62 @@ drop function bug13941|
|
||||
drop procedure bug13941|
|
||||
|
||||
|
||||
#
|
||||
# BUG#13095: Cannot create VIEWs in prepared statements
|
||||
#
|
||||
|
||||
delimiter ;|
|
||||
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS bug13095;
|
||||
DROP TABLE IF EXISTS bug13095_t1;
|
||||
DROP VIEW IF EXISTS bug13095_v1;
|
||||
--enable_warnings
|
||||
|
||||
delimiter |;
|
||||
|
||||
CREATE PROCEDURE bug13095(tbl_name varchar(32))
|
||||
BEGIN
|
||||
SET @str =
|
||||
CONCAT("CREATE TABLE ", tbl_name, "(stuff char(15))");
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @str =
|
||||
CONCAT("INSERT INTO ", tbl_name, " VALUES('row1'),('row2'),('row3')" );
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
|
||||
SET @str =
|
||||
CONCAT("CREATE VIEW bug13095_v1(c1) AS SELECT stuff FROM ", tbl_name);
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
|
||||
SELECT * FROM bug13095_v1;
|
||||
|
||||
SET @str =
|
||||
"DROP VIEW bug13095_v1";
|
||||
SELECT @str;
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
END|
|
||||
|
||||
delimiter ;|
|
||||
|
||||
CALL bug13095('bug13095_t1');
|
||||
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS bug13095;
|
||||
DROP VIEW IF EXISTS bug13095_v1;
|
||||
DROP TABLE IF EXISTS bug13095_t1;
|
||||
--enable_warnings
|
||||
|
||||
delimiter |;
|
||||
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
Reference in New Issue
Block a user