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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
fd465c2b
Commit
fd465c2b
authored
Oct 23, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert the fix for bug #47627 as it's causing the regression tests in pb2 to
fail.
parent
cf635940
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
137 deletions
+15
-137
mysql-test/r/sp.result
mysql-test/r/sp.result
+0
-45
mysql-test/t/sp.test
mysql-test/t/sp.test
+1
-45
sql/sql_yacc.yy
sql/sql_yacc.yy
+14
-47
No files found.
mysql-test/r/sp.result
View file @
fd465c2b
...
...
@@ -6979,51 +6979,6 @@ CALL p1;
ERROR 42S22: Unknown column 'A.b' in 'IN/ALL/ANY subquery'
DROP PROCEDURE p1;
DROP TABLE t1, t2;
#
# Bug47627 SET @@{global.session}.local_variable in stored routine causes crash
#
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP PROCEDURE IF EXISTS p3;
CREATE PROCEDURE p1()
BEGIN
DECLARE v INT DEFAULT 0;
SET @@session.v= 10;
END//
ERROR HY000: Unknown system variable 'v'
CREATE PROCEDURE p2()
BEGIN
DECLARE v INT DEFAULT 0;
SET v= 10;
END//
call p2()//
CREATE PROCEDURE p3()
BEGIN
DECLARE v INT DEFAULT 0;
SELECT @@session.v;
END//
ERROR HY000: Unknown system variable 'v'
CREATE PROCEDURE p4()
BEGIN
DECLARE v INT DEFAULT 0;
SET @@global.v= 10;
END//
ERROR HY000: Unknown system variable 'v'
CREATE PROCEDURE p5()
BEGIN
DECLARE v INT DEFAULT 0;
SET @@global.query_cache_size= 0;
SET @@session.identity= 1;
SELECT @@session.identity;
SELECT @@global.query_cache_size;
END//
CALL p5();
@@session.identity
1
@@global.query_cache_size
0
DROP PROCEDURE p2;
DROP PROCEDURE p5;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
mysql-test/t/sp.test
View file @
fd465c2b
...
...
@@ -8263,51 +8263,7 @@ CALL p1;
DROP
PROCEDURE
p1
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug47627 SET @@{global.session}.local_variable in stored routine causes crash
--
echo
#
--
disable_warnings
DROP
PROCEDURE
IF
EXISTS
p1
;
DROP
PROCEDURE
IF
EXISTS
p2
;
DROP
PROCEDURE
IF
EXISTS
p3
;
--
enable_warnings
delimiter
//;
--
error
ER_UNKNOWN_SYSTEM_VARIABLE
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
v
INT
DEFAULT
0
;
SET
@@
session
.
v
=
10
;
END
//
CREATE
PROCEDURE
p2
()
BEGIN
DECLARE
v
INT
DEFAULT
0
;
SET
v
=
10
;
END
//
call
p2
()
//
--
error
ER_UNKNOWN_SYSTEM_VARIABLE
CREATE
PROCEDURE
p3
()
BEGIN
DECLARE
v
INT
DEFAULT
0
;
SELECT
@@
session
.
v
;
END
//
--
error
ER_UNKNOWN_SYSTEM_VARIABLE
CREATE
PROCEDURE
p4
()
BEGIN
DECLARE
v
INT
DEFAULT
0
;
SET
@@
global
.
v
=
10
;
END
//
CREATE
PROCEDURE
p5
()
BEGIN
DECLARE
v
INT
DEFAULT
0
;
SET
@@
global
.
query_cache_size
=
0
;
SET
@@
session
.
identity
=
1
;
SELECT
@@
session
.
identity
;
SELECT
@@
global
.
query_cache_size
;
END
//
delimiter
;
//
CALL
p5
();
DROP
PROCEDURE
p2
;
DROP
PROCEDURE
p5
;
--
echo
# ------------------------------------------------------------------
--
echo
# -- End of 5.1 tests
--
echo
# ------------------------------------------------------------------
sql/sql_yacc.yy
View file @
fd465c2b
...
...
@@ -11783,17 +11783,8 @@ option_type:
;
option_type2:
/* empty */
{
$$= OPT_DEFAULT;
Lex->option_type= OPT_DEFAULT;
}
| ONE_SHOT_SYM
{
Lex->one_shot_set= 1;
$$= OPT_SESSION;
Lex->option_type= OPT_SESSION;
}
/* empty */ { $$= OPT_DEFAULT; }
| ONE_SHOT_SYM { Lex->one_shot_set= 1; $$= OPT_SESSION; }
;
opt_var_type:
...
...
@@ -11804,26 +11795,10 @@ opt_var_type:
;
opt_var_ident_type:
/* empty */
{
$$=OPT_DEFAULT;
Lex->option_type= OPT_DEFAULT;
}
| GLOBAL_SYM '.'
{
$$=OPT_GLOBAL;
Lex->option_type= OPT_GLOBAL;
}
| LOCAL_SYM '.'
{
$$=OPT_SESSION;
Lex->option_type= OPT_SESSION;
}
| SESSION_SYM '.'
{
$$=OPT_SESSION;
Lex->option_type= OPT_SESSION;
}
/* empty */ { $$=OPT_DEFAULT; }
| GLOBAL_SYM '.' { $$=OPT_GLOBAL; }
| LOCAL_SYM '.' { $$=OPT_SESSION; }
| SESSION_SYM '.' { $$=OPT_SESSION; }
;
ext_option_value:
...
...
@@ -12063,22 +12038,8 @@ internal_variable_name:
sp_pcontext *spc= lex->spcont;
sp_variable_t *spv;
/*
We have to lookup here since local vars can shadow sysvars.
We also have to inspect the option_type first since the variable
identifier might have been prefixed with @@session or @@global
prefixes. Without this check we would wrongly identify them
as SP local variables.
*/
if (lex->option_type == OPT_DEFAULT && spc &&
(spv= spc->find_variable(&$1)))
{
/* An SP local variable */
$$.var= NULL;
$$.base_name= $1;
}
else
/* We have to lookup here since local vars can shadow sysvars */
if (!spc || !(spv = spc->find_variable(&$1)))
{
/* Not an SP local variable */
sys_var *tmp=find_sys_var(thd, $1.str, $1.length);
...
...
@@ -12095,6 +12056,12 @@ internal_variable_name:
lex->sphead->m_flags|= sp_head::HAS_SET_AUTOCOMMIT_STMT;
}
}
else
{
/* An SP local variable */
$$.var= NULL;
$$.base_name= $1;
}
}
| ident '.' ident
{
...
...
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