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
2aed47c9
Commit
2aed47c9
authored
Feb 20, 2008
by
davi@endora.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into mysql.com:/Users/davi/mysql/mysql-5.1-runtime
parents
57679421
529ed223
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
12 deletions
+40
-12
mysql-test/r/view.result
mysql-test/r/view.result
+10
-0
mysql-test/t/view.test
mysql-test/t/view.test
+20
-0
sql/sql_lex.h
sql/sql_lex.h
+2
-4
sql/sql_view.cc
sql/sql_view.cc
+2
-6
sql/sql_yacc.yy
sql/sql_yacc.yy
+6
-2
No files found.
mysql-test/r/view.result
View file @
2aed47c9
...
@@ -3720,6 +3720,16 @@ DROP VIEW v1;
...
@@ -3720,6 +3720,16 @@ DROP VIEW v1;
# -- End of test case for Bug#32538.
# -- End of test case for Bug#32538.
drop view if exists a;
drop procedure if exists p;
create procedure p()
begin
declare continue handler for sqlexception begin end;
create view a as select 1;
end|
call p();
call p();
drop procedure p;
# -----------------------------------------------------------------
# -----------------------------------------------------------------
# -- Bug#34337: Server crash when Altering a view using a table name.
# -- Bug#34337: Server crash when Altering a view using a table name.
# -----------------------------------------------------------------
# -----------------------------------------------------------------
...
...
mysql-test/t/view.test
View file @
2aed47c9
...
@@ -3601,6 +3601,26 @@ DROP VIEW v1;
...
@@ -3601,6 +3601,26 @@ DROP VIEW v1;
--
echo
# -- End of test case for Bug#32538.
--
echo
# -- End of test case for Bug#32538.
--
echo
--
echo
#
# Bug#34587 Creating a view inside a stored procedure leads to a server crash
#
--
disable_warnings
drop
view
if
exists
a
;
drop
procedure
if
exists
p
;
--
enable_warnings
delimiter
|
;
create
procedure
p
()
begin
declare
continue
handler
for
sqlexception
begin
end
;
create
view
a
as
select
1
;
end
|
delimiter
;
|
call
p
();
call
p
();
drop
procedure
p
;
###########################################################################
###########################################################################
--
echo
# -----------------------------------------------------------------
--
echo
# -----------------------------------------------------------------
...
...
sql/sql_lex.h
View file @
2aed47c9
...
@@ -1513,10 +1513,8 @@ typedef struct st_lex : public Query_tables_list
...
@@ -1513,10 +1513,8 @@ typedef struct st_lex : public Query_tables_list
/* store original leaf_tables for INSERT SELECT and PS/SP */
/* store original leaf_tables for INSERT SELECT and PS/SP */
TABLE_LIST
*
leaf_tables_insert
;
TABLE_LIST
*
leaf_tables_insert
;
/** Start of SELECT of CREATE VIEW statement */
/** SELECT of CREATE VIEW statement */
const
char
*
create_view_select_start
;
LEX_STRING
create_view_select
;
/** End of SELECT of CREATE VIEW statement */
const
char
*
create_view_select_end
;
/** Start of 'ON table', in trigger statements. */
/** Start of 'ON table', in trigger statements. */
const
char
*
raw_trg_on_table_name_begin
;
const
char
*
raw_trg_on_table_name_begin
;
...
...
sql/sql_view.cc
View file @
2aed47c9
...
@@ -260,7 +260,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
...
@@ -260,7 +260,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
/* This is ensured in the parser. */
/* This is ensured in the parser. */
DBUG_ASSERT
(
!
lex
->
proc_list
.
first
&&
!
lex
->
result
&&
DBUG_ASSERT
(
!
lex
->
proc_list
.
first
&&
!
lex
->
result
&&
!
lex
->
param_list
.
elements
&&
!
lex
->
derived_tables
);
!
lex
->
param_list
.
elements
);
if
(
mode
!=
VIEW_CREATE_NEW
)
if
(
mode
!=
VIEW_CREATE_NEW
)
{
{
...
@@ -741,11 +741,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
...
@@ -741,11 +741,7 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
/* fill structure */
/* fill structure */
view
->
select_stmt
.
str
=
view_query
.
c_ptr_safe
();
view
->
select_stmt
.
str
=
view_query
.
c_ptr_safe
();
view
->
select_stmt
.
length
=
view_query
.
length
();
view
->
select_stmt
.
length
=
view_query
.
length
();
view
->
source
=
thd
->
lex
->
create_view_select
;
view
->
source
.
str
=
(
char
*
)
thd
->
lex
->
create_view_select_start
;
view
->
source
.
length
=
(
thd
->
lex
->
create_view_select_end
-
thd
->
lex
->
create_view_select_start
);
trim_whitespace
(
thd
->
charset
(),
&
view
->
source
);
view
->
file_version
=
1
;
view
->
file_version
=
1
;
view
->
calc_md5
(
md5
);
view
->
calc_md5
(
md5
);
...
...
sql/sql_yacc.yy
View file @
2aed47c9
...
@@ -12056,18 +12056,22 @@ view_select:
...
@@ -12056,18 +12056,22 @@ view_select:
lex->parsing_options.allows_select_into= FALSE;
lex->parsing_options.allows_select_into= FALSE;
lex->parsing_options.allows_select_procedure= FALSE;
lex->parsing_options.allows_select_procedure= FALSE;
lex->parsing_options.allows_derived= FALSE;
lex->parsing_options.allows_derived= FALSE;
lex->create_view_select
_start=
lip->get_cpp_ptr();
lex->create_view_select
.str= (char *)
lip->get_cpp_ptr();
}
}
view_select_aux view_check_option
view_select_aux view_check_option
{
{
THD *thd= YYTHD;
THD *thd= YYTHD;
LEX *lex= Lex;
LEX *lex= Lex;
Lex_input_stream *lip= thd->m_lip;
Lex_input_stream *lip= thd->m_lip;
uint len= lip->get_cpp_ptr() - lex->create_view_select.str;
void *create_view_select= thd->memdup(lex->create_view_select.str, len);
lex->create_view_select.length= len;
lex->create_view_select.str= (char *) create_view_select;
trim_whitespace(thd->charset(), &lex->create_view_select);
lex->parsing_options.allows_variable= TRUE;
lex->parsing_options.allows_variable= TRUE;
lex->parsing_options.allows_select_into= TRUE;
lex->parsing_options.allows_select_into= TRUE;
lex->parsing_options.allows_select_procedure= TRUE;
lex->parsing_options.allows_select_procedure= TRUE;
lex->parsing_options.allows_derived= TRUE;
lex->parsing_options.allows_derived= TRUE;
lex->create_view_select_end= lip->get_cpp_ptr();
}
}
;
;
...
...
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