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
b1f0e781
Commit
b1f0e781
authored
Dec 02, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-merge1-5.0
parents
54b7e6e3
45e59f3d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
11 deletions
+53
-11
mysql-test/r/view.result
mysql-test/r/view.result
+12
-0
mysql-test/t/view.test
mysql-test/t/view.test
+19
-0
sql/sp_head.cc
sql/sp_head.cc
+6
-2
sql/sql_lex.h
sql/sql_lex.h
+2
-2
sql/sql_view.cc
sql/sql_view.cc
+2
-3
sql/sql_yacc.yy
sql/sql_yacc.yy
+12
-4
No files found.
mysql-test/r/view.result
View file @
b1f0e781
...
@@ -2424,6 +2424,18 @@ f1 sum(f2)
...
@@ -2424,6 +2424,18 @@ f1 sum(f2)
NULL 12
NULL 12
drop view v1;
drop view v1;
drop table t1;
drop table t1;
drop procedure if exists p1;
create procedure p1 () deterministic
begin
create view v1 as select 1;
end;
//
call p1();
show create view v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1`
drop view v1;
drop procedure p1;
CREATE VIEW v1 AS SELECT 42 AS Meaning;
CREATE VIEW v1 AS SELECT 42 AS Meaning;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS INTEGER
CREATE FUNCTION f1() RETURNS INTEGER
...
...
mysql-test/t/view.test
View file @
b1f0e781
...
@@ -2281,6 +2281,25 @@ select f1, sum(f2) from v1 group by f1;
...
@@ -2281,6 +2281,25 @@ select f1, sum(f2) from v1 group by f1;
drop
view
v1
;
drop
view
v1
;
drop
table
t1
;
drop
table
t1
;
#
# BUG#14885: incorrect SOURCE in view created in a procedure
# TODO: here SOURCE string must be shown when it will be possible
#
--
disable_warnings
drop
procedure
if
exists
p1
;
--
enable_warnings
delimiter
//;
create
procedure
p1
()
deterministic
begin
create
view
v1
as
select
1
;
end
;
//
delimiter
;
//
call
p1
();
show
create
view
v1
;
drop
view
v1
;
drop
procedure
p1
;
#
#
# BUG#15096: using function with view for view creation
# BUG#15096: using function with view for view creation
#
#
...
...
sql/sp_head.cc
View file @
b1f0e781
...
@@ -954,8 +954,12 @@ int sp_head::execute(THD *thd)
...
@@ -954,8 +954,12 @@ int sp_head::execute(THD *thd)
m_first_instance
->
m_first_free_instance
=
m_next_cached_sp
;
m_first_instance
->
m_first_free_instance
=
m_next_cached_sp
;
DBUG_PRINT
(
"info"
,
(
"first free for 0x%lx ++: 0x%lx->0x%lx, level: %lu, flags %x"
,
DBUG_PRINT
(
"info"
,
(
"first free for 0x%lx ++: 0x%lx->0x%lx, level: %lu, flags %x"
,
(
ulong
)
m_first_instance
,
this
,
m_next_cached_sp
,
(
ulong
)
m_first_instance
,
this
,
m_next_cached_sp
,
m_next_cached_sp
->
m_recursion_level
,
(
m_next_cached_sp
?
m_next_cached_sp
->
m_flags
));
m_next_cached_sp
->
m_recursion_level
:
0
),
(
m_next_cached_sp
?
m_next_cached_sp
->
m_flags
:
0
)));
/*
/*
Check that if there are not any instances after this one then
Check that if there are not any instances after this one then
pointer to the last instance points on this instance or if there are
pointer to the last instance points on this instance or if there are
...
...
sql/sql_lex.h
View file @
b1f0e781
...
@@ -738,8 +738,8 @@ typedef struct st_lex
...
@@ -738,8 +738,8 @@ typedef struct st_lex
TABLE_LIST
**
query_tables_last
;
TABLE_LIST
**
query_tables_last
;
/* 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
;
char
*
create_view_start
;
/* Position (first character index) of SELECT of CREATE VIEW statement */
char
*
create_view_select_start
;
uint
create_view_select_start
;
/*
/*
The definer of the object being created (view, trigger, stored routine).
The definer of the object being created (view, trigger, stored routine).
...
...
sql/sql_view.cc
View file @
b1f0e781
...
@@ -650,10 +650,9 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
...
@@ -650,10 +650,9 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
/* fill structure */
/* fill structure */
view
->
query
.
str
=
(
char
*
)
str
.
ptr
();
view
->
query
.
str
=
(
char
*
)
str
.
ptr
();
view
->
query
.
length
=
str
.
length
()
-
1
;
// we do not need last \0
view
->
query
.
length
=
str
.
length
()
-
1
;
// we do not need last \0
view
->
source
.
str
=
thd
->
lex
->
create_view_select_start
;
view
->
source
.
str
=
thd
->
query
+
thd
->
lex
->
create_view_select_start
;
view
->
source
.
length
=
(
thd
->
query_length
-
view
->
source
.
length
=
(
thd
->
query_length
-
(
thd
->
lex
->
create_view_select_start
-
thd
->
lex
->
create_view_select_start
);
thd
->
lex
->
create_view_start
));
view
->
file_version
=
1
;
view
->
file_version
=
1
;
view
->
calc_md5
(
md5
);
view
->
calc_md5
(
md5
);
view
->
md5
.
str
=
md5
;
view
->
md5
.
str
=
md5
;
...
...
sql/sql_yacc.yy
View file @
b1f0e781
...
@@ -3380,7 +3380,6 @@ alter:
...
@@ -3380,7 +3380,6 @@ alter:
THD *thd= YYTHD;
THD *thd= YYTHD;
LEX *lex= thd->lex;
LEX *lex= thd->lex;
lex->sql_command= SQLCOM_CREATE_VIEW;
lex->sql_command= SQLCOM_CREATE_VIEW;
lex->create_view_start= thd->query;
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 */
lex->select_lex.add_table_to_list(thd, $6, NULL, 0);
lex->select_lex.add_table_to_list(thd, $6, NULL, 0);
...
@@ -8984,7 +8983,6 @@ view_tail:
...
@@ -8984,7 +8983,6 @@ view_tail:
THD *thd= YYTHD;
THD *thd= YYTHD;
LEX *lex= thd->lex;
LEX *lex= thd->lex;
lex->sql_command= SQLCOM_CREATE_VIEW;
lex->sql_command= SQLCOM_CREATE_VIEW;
lex->create_view_start= thd->query;
/* first table in list is target VIEW name */
/* first table in list is target VIEW name */
if (!lex->select_lex.add_table_to_list(thd, $3, NULL, 0))
if (!lex->select_lex.add_table_to_list(thd, $3, NULL, 0))
YYABORT;
YYABORT;
...
@@ -9015,11 +9013,21 @@ view_list:
...
@@ -9015,11 +9013,21 @@ view_list:
view_select:
view_select:
SELECT_SYM remember_name select_init2
SELECT_SYM remember_name select_init2
{
{
Lex->create_view_select_start= $2;
THD *thd=YYTHD;
LEX *lex= thd->lex;
char *stmt_beg= (lex->sphead ?
(char *)lex->sphead->m_tmp_query :
thd->query);
lex->create_view_select_start= $2 - stmt_beg;
}
}
| '(' remember_name select_paren ')' union_opt
| '(' remember_name select_paren ')' union_opt
{
{
Lex->create_view_select_start= $2;
THD *thd=YYTHD;
LEX *lex= thd->lex;
char *stmt_beg= (lex->sphead ?
(char *)lex->sphead->m_tmp_query :
thd->query);
lex->create_view_select_start= $2 - stmt_beg;
}
}
;
;
...
...
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