Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
6f059005
Commit
6f059005
authored
Jun 27, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge
parents
637d9f1c
c5ebbb65
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
78 additions
and
27 deletions
+78
-27
mysql-test/r/ps_1general.result
mysql-test/r/ps_1general.result
+2
-0
mysql-test/r/sp-dynamic.result
mysql-test/r/sp-dynamic.result
+17
-1
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+2
-2
mysql-test/t/ps_1general.test
mysql-test/t/ps_1general.test
+4
-0
mysql-test/t/sp-dynamic.test
mysql-test/t/sp-dynamic.test
+10
-2
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+5
-5
sql/handler.cc
sql/handler.cc
+1
-1
sql/sp.cc
sql/sp.cc
+1
-1
sql/sp_head.cc
sql/sp_head.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+7
-0
sql/sql_error.cc
sql/sql_error.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+4
-0
sql/sql_prepare.cc
sql/sql_prepare.cc
+7
-1
sql/sql_trigger.cc
sql/sql_trigger.cc
+1
-1
sql/sql_view.cc
sql/sql_view.cc
+9
-10
sql/sql_yacc.yy
sql/sql_yacc.yy
+5
-0
No files found.
mysql-test/r/ps_1general.result
View file @
6f059005
...
@@ -396,6 +396,8 @@ prepare stmt1 from ' execute stmt2 ' ;
...
@@ -396,6 +396,8 @@ prepare stmt1 from ' execute stmt2 ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' deallocate prepare never_prepared ' ;
prepare stmt1 from ' deallocate prepare never_prepared ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from 'alter view v1 as select 2';
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt4 from ' use test ' ;
prepare stmt4 from ' use test ' ;
ERROR HY000: This command is not supported in the prepared statement protocol yet
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' create database mysqltest ';
prepare stmt3 from ' create database mysqltest ';
...
...
mysql-test/r/sp-dynamic.result
View file @
6f059005
...
@@ -87,6 +87,10 @@ prepare stmt from "create table t1 (a int)";
...
@@ -87,6 +87,10 @@ prepare stmt from "create table t1 (a int)";
execute stmt;
execute stmt;
insert into t1 (a) values (1);
insert into t1 (a) values (1);
select * from t1;
select * from t1;
prepare stmt_alter from "alter table t1 add (b int)";
execute stmt_alter;
insert into t1 (a,b) values (2,1);
deallocate prepare stmt_alter;
deallocate prepare stmt;
deallocate prepare stmt;
deallocate prepare stmt_drop;
deallocate prepare stmt_drop;
end|
end|
...
@@ -245,6 +249,9 @@ a
...
@@ -245,6 +249,9 @@ a
1
1
drop procedure p1|
drop procedure p1|
drop table if exists t1|
drop table if exists t1|
drop table if exists t2|
Warnings:
Note 1051 Unknown table 't2'
create table t1 (id integer primary key auto_increment,
create table t1 (id integer primary key auto_increment,
stmt_text char(35), status varchar(20))|
stmt_text char(35), status varchar(20))|
insert into t1 (stmt_text) values
insert into t1 (stmt_text) values
...
@@ -255,7 +262,10 @@ insert into t1 (stmt_text) values
...
@@ -255,7 +262,10 @@ insert into t1 (stmt_text) values
("help help"), ("show databases"), ("show tables"),
("help help"), ("show databases"), ("show tables"),
("show table status"), ("show open tables"), ("show storage engines"),
("show table status"), ("show open tables"), ("show storage engines"),
("insert into t1 (id) values (1)"), ("update t1 set status=''"),
("insert into t1 (id) values (1)"), ("update t1 set status=''"),
("delete from t1"), ("truncate t1"), ("call p1()"), ("foo bar")|
("delete from t1"), ("truncate t1"), ("call p1()"), ("foo bar"),
("create view v1 as select 1"), ("alter view v1 as select 2"),
("drop view v1"),("create table t2 (a int)"),("alter table t2 add (b int)"),
("drop table t2")|
create procedure p1()
create procedure p1()
begin
begin
declare v_stmt_text varchar(255);
declare v_stmt_text varchar(255);
...
@@ -305,6 +315,12 @@ id stmt_text status
...
@@ -305,6 +315,12 @@ id stmt_text status
20 truncate t1 supported
20 truncate t1 supported
21 call p1() supported
21 call p1() supported
22 foo bar syntax error
22 foo bar syntax error
23 create view v1 as select 1 supported
24 alter view v1 as select 2 not supported
25 drop view v1 supported
26 create table t2 (a int) supported
27 alter table t2 add (b int) supported
28 drop table t2 supported
drop procedure p1|
drop procedure p1|
drop table t1|
drop table t1|
prepare stmt from 'select 1'|
prepare stmt from 'select 1'|
...
...
mysql-test/r/sp-error.result
View file @
6f059005
...
@@ -982,9 +982,9 @@ ERROR HY000: Explicit or implicit commit is not allowed in stored function or tr
...
@@ -982,9 +982,9 @@ ERROR HY000: Explicit or implicit commit is not allowed in stored function or tr
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
ERROR
HY000: Explicit or implicit commit is not allowed in stored function or trigger.
ERROR
0A000: ALTER VIEW is not allowed in stored procedures
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
ERROR
HY000: Explicit or implicit commit is not allowed in stored function or trigger.
ERROR
0A000: ALTER VIEW is not allowed in stored procedures
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop view v1; END |
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN drop view v1; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE FUNCTION bug_13627_f() returns int BEGIN drop view v1; return 1; END |
CREATE FUNCTION bug_13627_f() returns int BEGIN drop view v1; return 1; END |
...
...
mysql-test/t/ps_1general.test
View file @
6f059005
...
@@ -423,6 +423,10 @@ prepare stmt1 from ' execute stmt2 ' ;
...
@@ -423,6 +423,10 @@ prepare stmt1 from ' execute stmt2 ' ;
--
error
ER_UNSUPPORTED_PS
--
error
ER_UNSUPPORTED_PS
prepare
stmt1
from
' deallocate prepare never_prepared '
;
prepare
stmt1
from
' deallocate prepare never_prepared '
;
## We don't support alter view as prepared statements
--
error
ER_UNSUPPORTED_PS
prepare
stmt1
from
'alter view v1 as select 2'
;
## switch the database connection
## switch the database connection
--
error
1295
--
error
1295
prepare
stmt4
from
' use test '
;
prepare
stmt4
from
' use test '
;
...
...
mysql-test/t/sp-dynamic.test
View file @
6f059005
...
@@ -85,7 +85,7 @@ call p1()|
...
@@ -85,7 +85,7 @@ call p1()|
call
p1
()
|
call
p1
()
|
drop
procedure
p1
|
drop
procedure
p1
|
#
#
# D. Create/Drop a table (a DDL that issues a commit) in Dynamic SQL.
# D. Create/Drop
/Alter
a table (a DDL that issues a commit) in Dynamic SQL.
# (should work ok).
# (should work ok).
#
#
create
procedure
p1
()
create
procedure
p1
()
...
@@ -96,6 +96,10 @@ begin
...
@@ -96,6 +96,10 @@ begin
execute
stmt
;
execute
stmt
;
insert
into
t1
(
a
)
values
(
1
);
insert
into
t1
(
a
)
values
(
1
);
select
*
from
t1
;
select
*
from
t1
;
prepare
stmt_alter
from
"alter table t1 add (b int)"
;
execute
stmt_alter
;
insert
into
t1
(
a
,
b
)
values
(
2
,
1
);
deallocate
prepare
stmt_alter
;
deallocate
prepare
stmt
;
deallocate
prepare
stmt
;
deallocate
prepare
stmt_drop
;
deallocate
prepare
stmt_drop
;
end
|
end
|
...
@@ -239,6 +243,7 @@ drop procedure p1|
...
@@ -239,6 +243,7 @@ drop procedure p1|
# K. Use of continue handlers with Dynamic SQL.
# K. Use of continue handlers with Dynamic SQL.
#
#
drop
table
if
exists
t1
|
drop
table
if
exists
t1
|
drop
table
if
exists
t2
|
create
table
t1
(
id
integer
primary
key
auto_increment
,
create
table
t1
(
id
integer
primary
key
auto_increment
,
stmt_text
char
(
35
),
status
varchar
(
20
))
|
stmt_text
char
(
35
),
status
varchar
(
20
))
|
insert
into
t1
(
stmt_text
)
values
insert
into
t1
(
stmt_text
)
values
...
@@ -249,7 +254,10 @@ insert into t1 (stmt_text) values
...
@@ -249,7 +254,10 @@ insert into t1 (stmt_text) values
(
"help help"
),
(
"show databases"
),
(
"show tables"
),
(
"help help"
),
(
"show databases"
),
(
"show tables"
),
(
"show table status"
),
(
"show open tables"
),
(
"show storage engines"
),
(
"show table status"
),
(
"show open tables"
),
(
"show storage engines"
),
(
"insert into t1 (id) values (1)"
),
(
"update t1 set status=''"
),
(
"insert into t1 (id) values (1)"
),
(
"update t1 set status=''"
),
(
"delete from t1"
),
(
"truncate t1"
),
(
"call p1()"
),
(
"foo bar"
)
|
(
"delete from t1"
),
(
"truncate t1"
),
(
"call p1()"
),
(
"foo bar"
),
(
"create view v1 as select 1"
),
(
"alter view v1 as select 2"
),
(
"drop view v1"
),(
"create table t2 (a int)"
),(
"alter table t2 add (b int)"
),
(
"drop table t2"
)
|
create
procedure
p1
()
create
procedure
p1
()
begin
begin
declare
v_stmt_text
varchar
(
255
);
declare
v_stmt_text
varchar
(
255
);
...
...
mysql-test/t/sp-error.test
View file @
6f059005
...
@@ -1087,12 +1087,12 @@ delimiter ;|
...
@@ -1087,12 +1087,12 @@ delimiter ;|
#
#
# BUG 12490 (Packets out of order if calling HELP CONTENTS from Stored Procedure)
# BUG 12490 (Packets out of order if calling HELP CONTENTS from Stored Procedure)
#
#
--
error
1314
--
error
ER_SP_BADSTATEMENT
CREATE
PROCEDURE
BUG_12490
()
HELP
CONTENTS
;
CREATE
PROCEDURE
BUG_12490
()
HELP
CONTENTS
;
--
error
1314
--
error
ER_SP_BADSTATEMENT
CREATE
FUNCTION
BUG_12490
()
RETURNS
INT
HELP
CONTENTS
;
CREATE
FUNCTION
BUG_12490
()
RETURNS
INT
HELP
CONTENTS
;
CREATE
TABLE
t_bug_12490
(
a
int
);
CREATE
TABLE
t_bug_12490
(
a
int
);
--
error
1314
--
error
ER_SP_BADSTATEMENT
CREATE
TRIGGER
BUG_12490
BEFORE
UPDATE
ON
t_bug_12490
FOR
EACH
ROW
HELP
CONTENTS
;
CREATE
TRIGGER
BUG_12490
BEFORE
UPDATE
ON
t_bug_12490
FOR
EACH
ROW
HELP
CONTENTS
;
DROP
TABLE
t_bug_12490
;
DROP
TABLE
t_bug_12490
;
...
@@ -1397,9 +1397,9 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create view v1 as sele
...
@@ -1397,9 +1397,9 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create view v1 as sele
--
error
ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
--
error
ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE
FUNCTION
bug_13627_f
()
returns
int
BEGIN
create
view
v1
as
select
1
;
return
1
;
END
|
CREATE
FUNCTION
bug_13627_f
()
returns
int
BEGIN
create
view
v1
as
select
1
;
return
1
;
END
|
--
error
ER_
COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
--
error
ER_
SP_BADSTATEMENT
CREATE
TRIGGER
tr1
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
BEGIN
alter
view
v1
as
select
1
;
END
|
CREATE
TRIGGER
tr1
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
BEGIN
alter
view
v1
as
select
1
;
END
|
--
error
ER_
COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
--
error
ER_
SP_BADSTATEMENT
CREATE
FUNCTION
bug_13627_f
()
returns
int
BEGIN
alter
view
v1
as
select
1
;
return
1
;
END
|
CREATE
FUNCTION
bug_13627_f
()
returns
int
BEGIN
alter
view
v1
as
select
1
;
return
1
;
END
|
--
error
ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
--
error
ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
...
...
sql/handler.cc
View file @
6f059005
...
@@ -1343,7 +1343,7 @@ int ha_delete_table(THD *thd, enum db_type table_type, const char *path,
...
@@ -1343,7 +1343,7 @@ int ha_delete_table(THD *thd, enum db_type table_type, const char *path,
strmake
(
buff
,
thd
->
net
.
last_error
,
sizeof
(
buff
)
-
1
);
strmake
(
buff
,
thd
->
net
.
last_error
,
sizeof
(
buff
)
-
1
);
thd
->
query_error
=
0
;
thd
->
query_error
=
0
;
thd
->
spcont
=
0
;
thd
->
spcont
=
NULL
;
thd
->
lex
->
current_select
=
0
;
thd
->
lex
->
current_select
=
0
;
thd
->
net
.
last_error
[
0
]
=
0
;
thd
->
net
.
last_error
[
0
]
=
0
;
...
...
sql/sp.cc
View file @
6f059005
...
@@ -438,10 +438,10 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
...
@@ -438,10 +438,10 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp,
Lex_input_stream
lip
(
thd
,
defstr
.
c_ptr
(),
defstr
.
length
());
Lex_input_stream
lip
(
thd
,
defstr
.
c_ptr
(),
defstr
.
length
());
thd
->
m_lip
=
&
lip
;
thd
->
m_lip
=
&
lip
;
lex_start
(
thd
);
lex_start
(
thd
);
thd
->
spcont
=
NULL
;
ret
=
MYSQLparse
(
thd
);
ret
=
MYSQLparse
(
thd
);
}
}
thd
->
spcont
=
0
;
if
(
ret
||
thd
->
is_fatal_error
||
newlex
.
sphead
==
NULL
)
if
(
ret
||
thd
->
is_fatal_error
||
newlex
.
sphead
==
NULL
)
{
{
sp_head
*
sp
=
newlex
.
sphead
;
sp_head
*
sp
=
newlex
.
sphead
;
...
...
sql/sp_head.cc
View file @
6f059005
...
@@ -2581,7 +2581,7 @@ sp_instr_set::exec_core(THD *thd, uint *nextp)
...
@@ -2581,7 +2581,7 @@ sp_instr_set::exec_core(THD *thd, uint *nextp)
sp_rcontext
*
spcont
=
thd
->
spcont
;
sp_rcontext
*
spcont
=
thd
->
spcont
;
thd
->
spcont
=
0
;
/* Avoid handlers */
thd
->
spcont
=
NULL
;
/* Avoid handlers */
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
spcont
->
clear_handler
();
spcont
->
clear_handler
();
thd
->
spcont
=
spcont
;
thd
->
spcont
=
spcont
;
...
@@ -3316,7 +3316,7 @@ sp_instr_set_case_expr::exec_core(THD *thd, uint *nextp)
...
@@ -3316,7 +3316,7 @@ sp_instr_set_case_expr::exec_core(THD *thd, uint *nextp)
sp_rcontext
*
spcont
=
thd
->
spcont
;
sp_rcontext
*
spcont
=
thd
->
spcont
;
thd
->
spcont
=
0
;
/* Avoid handlers */
thd
->
spcont
=
NULL
;
/* Avoid handlers */
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
));
spcont
->
clear_handler
();
spcont
->
clear_handler
();
thd
->
spcont
=
spcont
;
thd
->
spcont
=
spcont
;
...
...
sql/sql_class.h
View file @
6f059005
...
@@ -697,6 +697,13 @@ class Query_arena
...
@@ -697,6 +697,13 @@ class Query_arena
#ifndef DBUG_OFF
#ifndef DBUG_OFF
bool
is_backup_arena
;
/* True if this arena is used for backup. */
bool
is_backup_arena
;
/* True if this arena is used for backup. */
#endif
#endif
/*
The states relfects three diffrent life cycles for three
different types of statements:
Prepared statement: INITIALIZED -> PREPARED -> EXECUTED.
Stored procedure: INITIALIZED_FOR_SP -> EXECUTED.
Other statements: CONVENTIONAL_EXECUTION never changes.
*/
enum
enum_state
enum
enum_state
{
{
INITIALIZED
=
0
,
INITIALIZED_FOR_SP
=
1
,
PREPARED
=
2
,
INITIALIZED
=
0
,
INITIALIZED_FOR_SP
=
1
,
PREPARED
=
2
,
...
...
sql/sql_error.cc
View file @
6f059005
...
@@ -126,7 +126,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
...
@@ -126,7 +126,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
sp_rcontext
*
spcont
=
thd
->
spcont
;
sp_rcontext
*
spcont
=
thd
->
spcont
;
thd
->
no_warnings_for_error
=
1
;
thd
->
no_warnings_for_error
=
1
;
thd
->
spcont
=
0
;
thd
->
spcont
=
NULL
;
thd
->
killed
=
THD
::
KILL_BAD_DATA
;
thd
->
killed
=
THD
::
KILL_BAD_DATA
;
my_message
(
code
,
msg
,
MYF
(
0
));
my_message
(
code
,
msg
,
MYF
(
0
));
...
...
sql/sql_parse.cc
View file @
6f059005
...
@@ -4882,6 +4882,10 @@ mysql_execute_command(THD *thd)
...
@@ -4882,6 +4882,10 @@ mysql_execute_command(THD *thd)
#endif // ifndef DBUG_OFF
#endif // ifndef DBUG_OFF
case
SQLCOM_CREATE_VIEW
:
case
SQLCOM_CREATE_VIEW
:
{
{
/*
Note: SQLCOM_CREATE_VIEW also handles 'ALTER VIEW' commands
as specified through the thd->lex->create_view_mode flag.
*/
if
(
end_active_trans
(
thd
))
if
(
end_active_trans
(
thd
))
goto
error
;
goto
error
;
...
...
sql/sql_prepare.cc
View file @
6f059005
...
@@ -1724,6 +1724,13 @@ static bool check_prepared_statement(Prepared_statement *stmt,
...
@@ -1724,6 +1724,13 @@ static bool check_prepared_statement(Prepared_statement *stmt,
res
=
mysql_test_create_table
(
stmt
);
res
=
mysql_test_create_table
(
stmt
);
break
;
break
;
case
SQLCOM_CREATE_VIEW
:
if
(
lex
->
create_view_mode
==
VIEW_ALTER
)
{
my_message
(
ER_UNSUPPORTED_PS
,
ER
(
ER_UNSUPPORTED_PS
),
MYF
(
0
));
goto
error
;
}
break
;
case
SQLCOM_DO
:
case
SQLCOM_DO
:
res
=
mysql_test_do_fields
(
stmt
,
tables
,
lex
->
insert_list
);
res
=
mysql_test_do_fields
(
stmt
,
tables
,
lex
->
insert_list
);
break
;
break
;
...
@@ -1766,7 +1773,6 @@ static bool check_prepared_statement(Prepared_statement *stmt,
...
@@ -1766,7 +1773,6 @@ static bool check_prepared_statement(Prepared_statement *stmt,
case
SQLCOM_ROLLBACK
:
case
SQLCOM_ROLLBACK
:
case
SQLCOM_TRUNCATE
:
case
SQLCOM_TRUNCATE
:
case
SQLCOM_CALL
:
case
SQLCOM_CALL
:
case
SQLCOM_CREATE_VIEW
:
case
SQLCOM_DROP_VIEW
:
case
SQLCOM_DROP_VIEW
:
case
SQLCOM_REPAIR
:
case
SQLCOM_REPAIR
:
case
SQLCOM_ANALYZE
:
case
SQLCOM_ANALYZE
:
...
...
sql/sql_trigger.cc
View file @
6f059005
...
@@ -982,7 +982,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
...
@@ -982,7 +982,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db,
Lex_input_stream
lip
(
thd
,
trg_create_str
->
str
,
trg_create_str
->
length
);
Lex_input_stream
lip
(
thd
,
trg_create_str
->
str
,
trg_create_str
->
length
);
thd
->
m_lip
=
&
lip
;
thd
->
m_lip
=
&
lip
;
lex_start
(
thd
);
lex_start
(
thd
);
thd
->
spcont
=
0
;
thd
->
spcont
=
NULL
;
int
err
=
MYSQLparse
((
void
*
)
thd
);
int
err
=
MYSQLparse
((
void
*
)
thd
);
if
(
err
||
thd
->
is_fatal_error
)
if
(
err
||
thd
->
is_fatal_error
)
...
...
sql/sql_view.cc
View file @
6f059005
...
@@ -205,18 +205,17 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
...
@@ -205,18 +205,17 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
}
}
/*
/*
*
Creating/altering VIEW procedure
@brief
Creating/altering VIEW procedure
SYNOPSIS
@param thd thread handler
mysql_create_view()
@param views views to create
thd - thread handler
@param mode VIEW_CREATE_NEW, VIEW_ALTER, VIEW_CREATE_OR_REPLACE
views - views to create
mode - VIEW_CREATE_NEW, VIEW_ALTER, VIEW_CREATE_OR_REPLACE
RETURN VALUE
@note This function handles both create and alter view commands.
FALSE OK
TRUE Error
@retval FALSE Operation was a success.
@retval TRUE An error occured.
*/
*/
bool
mysql_create_view
(
THD
*
thd
,
TABLE_LIST
*
views
,
bool
mysql_create_view
(
THD
*
thd
,
TABLE_LIST
*
views
,
...
...
sql/sql_yacc.yy
View file @
6f059005
...
@@ -3671,6 +3671,11 @@ alter:
...
@@ -3671,6 +3671,11 @@ alter:
{
{
THD *thd= YYTHD;
THD *thd= YYTHD;
LEX *lex= thd->lex;
LEX *lex= thd->lex;
if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "ALTER VIEW");
MYSQL_YYABORT;
}
lex->sql_command= SQLCOM_CREATE_VIEW;
lex->sql_command= SQLCOM_CREATE_VIEW;
lex->create_view_mode= VIEW_ALTER;
lex->create_view_mode= VIEW_ALTER;
/* first table in list is target VIEW name */
/* first table in list is target VIEW name */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment