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
5be6861f
Commit
5be6861f
authored
Jul 22, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed SP variables detecting (BUG#4604)
fixed error handling
parent
ed32dbba
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
mysql-test/r/view.result
mysql-test/r/view.result
+6
-0
mysql-test/t/view.test
mysql-test/t/view.test
+10
-0
sql/sql_base.cc
sql/sql_base.cc
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-1
No files found.
mysql-test/r/view.result
View file @
5be6861f
...
@@ -977,3 +977,9 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
...
@@ -977,3 +977,9 @@ ERROR HY000: View 'test.v1' references invalid table(s) or column(s)
drop view v1;
drop view v1;
create view v1 (a,a) as select 'a','a';
create view v1 (a,a) as select 'a','a';
ERROR 42S21: Duplicate column name 'a'
ERROR 42S21: Duplicate column name 'a'
create procedure p11 () begin declare v int; create view v1 as select v; end;//
Warnings:
Warning 1310 Referring to uninitialized variable v
call p11();
ERROR HY000: View's SELECT contains a variable or parameter
drop procedure p11;
mysql-test/t/view.test
View file @
5be6861f
...
@@ -900,3 +900,13 @@ drop view v1;
...
@@ -900,3 +900,13 @@ drop view v1;
#
#
--
error
1060
--
error
1060
create
view
v1
(
a
,
a
)
as
select
'a'
,
'a'
;
create
view
v1
(
a
,
a
)
as
select
'a'
,
'a'
;
#
# SP variables inside view test
#
delimiter
//;
create
procedure
p11
()
begin
declare
v
int
;
create
view
v1
as
select
v
;
end
;
//
delimiter
;
//
--
error
1350
call
p11
();
drop
procedure
p11
;
sql/sql_base.cc
View file @
5be6861f
...
@@ -1760,7 +1760,7 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
...
@@ -1760,7 +1760,7 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
DBUG_ENTER
(
"open_and_lock_tables"
);
DBUG_ENTER
(
"open_and_lock_tables"
);
uint
counter
;
uint
counter
;
if
(
open_tables
(
thd
,
tables
,
&
counter
)
||
lock_tables
(
thd
,
tables
,
counter
))
if
(
open_tables
(
thd
,
tables
,
&
counter
)
||
lock_tables
(
thd
,
tables
,
counter
))
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
DBUG_RETURN
(
thd
->
net
.
report_error
?
-
1
:
1
);
/* purecov: inspected */
DBUG_RETURN
(
mysql_handle_derived
(
thd
->
lex
));
DBUG_RETURN
(
mysql_handle_derived
(
thd
->
lex
));
}
}
...
...
sql/sql_yacc.yy
View file @
5be6861f
...
@@ -1987,7 +1987,8 @@ sp_elseifs:
...
@@ -1987,7 +1987,8 @@ sp_elseifs:
sp_case:
sp_case:
expr THEN_SYM
expr THEN_SYM
{
{
sp_head *sp= Lex->sphead;
LEX *lex= Lex;
sp_head *sp= lex->sphead;
sp_pcontext *ctx= Lex->spcont;
sp_pcontext *ctx= Lex->spcont;
uint ip= sp->instructions();
uint ip= sp->instructions();
sp_instr_jump_if_not *i;
sp_instr_jump_if_not *i;
...
@@ -2005,6 +2006,7 @@ sp_case:
...
@@ -2005,6 +2006,7 @@ sp_case:
Item *expr= new Item_func_eq(var, $1);
Item *expr= new Item_func_eq(var, $1);
i= new sp_instr_jump_if_not(ip, expr);
i= new sp_instr_jump_if_not(ip, expr);
lex->variables_used= 1;
}
}
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
sp->push_backpatch(i, ctx->push_label((char *)"", 0));
sp->add_instr(i);
sp->add_instr(i);
...
@@ -6170,6 +6172,7 @@ simple_ident:
...
@@ -6170,6 +6172,7 @@ simple_ident:
$1.str);
$1.str);
}
}
$$ = (Item*) new Item_splocal($1, spv->offset);
$$ = (Item*) new Item_splocal($1, spv->offset);
lex->variables_used= 1;
}
}
else
else
{
{
...
...
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