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
831de41c
Commit
831de41c
authored
Oct 25, 2005
by
anozdrin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for BUG#13037: undefined variable in IF cause erroneous error-message.
parent
d24027fa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
4 deletions
+103
-4
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+35
-2
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+54
-0
sql/sql_base.cc
sql/sql_base.cc
+1
-1
sql/sql_class.cc
sql/sql_class.cc
+5
-1
sql/sql_class.h
sql/sql_class.h
+8
-0
No files found.
mysql-test/r/sp-error.result
View file @
831de41c
...
...
@@ -444,9 +444,9 @@ set b = a;
end if;
end|
call bug2653_1(1, @b)|
ERROR 42S22: Unknown column 'aa' in '
order clause
'
ERROR 42S22: Unknown column 'aa' in '
field list
'
call bug2653_2(2, @b)|
ERROR 42S22: Unknown column 'aa' in '
order clause
'
ERROR 42S22: Unknown column 'aa' in '
field list
'
drop procedure bug2653_1|
drop procedure bug2653_2|
create procedure bug4344() drop procedure bug4344|
...
...
@@ -883,3 +883,36 @@ select count(*) into param1 from t3;
end|
ERROR 3D000: No database selected
use test;
DROP PROCEDURE IF EXISTS bug13037_p1;
DROP PROCEDURE IF EXISTS bug13037_p2;
DROP PROCEDURE IF EXISTS bug13037_p3;
CREATE PROCEDURE bug13037_p1()
BEGIN
IF bug13037_foo THEN
SELECT 1;
END IF;
END|
CREATE PROCEDURE bug13037_p2()
BEGIN
SET @bug13037_foo = bug13037_bar;
END|
CREATE PROCEDURE bug13037_p3()
BEGIN
SELECT bug13037_foo;
END|
CALL bug13037_p1();
ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
CALL bug13037_p2();
ERROR 42S22: Unknown column 'bug13037_bar' in 'field list'
CALL bug13037_p3();
ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
CALL bug13037_p1();
ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
CALL bug13037_p2();
ERROR 42S22: Unknown column 'bug13037_bar' in 'field list'
CALL bug13037_p3();
ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
DROP PROCEDURE bug13037_p1;
DROP PROCEDURE bug13037_p2;
DROP PROCEDURE bug13037_p3;
mysql-test/t/sp-error.test
View file @
831de41c
...
...
@@ -1284,6 +1284,60 @@ begin
end
|
delimiter
;
|
use
test
;
#
# BUG#13037: undefined variable in IF cause erroneous error-message
#
--
disable_warnings
DROP
PROCEDURE
IF
EXISTS
bug13037_p1
;
DROP
PROCEDURE
IF
EXISTS
bug13037_p2
;
DROP
PROCEDURE
IF
EXISTS
bug13037_p3
;
--
enable_warnings
delimiter
|
;
CREATE
PROCEDURE
bug13037_p1
()
BEGIN
IF
bug13037_foo
THEN
SELECT
1
;
END
IF
;
END
|
CREATE
PROCEDURE
bug13037_p2
()
BEGIN
SET
@
bug13037_foo
=
bug13037_bar
;
END
|
CREATE
PROCEDURE
bug13037_p3
()
BEGIN
SELECT
bug13037_foo
;
END
|
delimiter
;
|
--
echo
--
error
1054
CALL
bug13037_p1
();
--
error
1054
CALL
bug13037_p2
();
--
error
1054
CALL
bug13037_p3
();
--
error
1054
CALL
bug13037_p1
();
--
error
1054
CALL
bug13037_p2
();
--
error
1054
CALL
bug13037_p3
();
DROP
PROCEDURE
bug13037_p1
;
DROP
PROCEDURE
bug13037_p2
;
DROP
PROCEDURE
bug13037_p3
;
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
...
...
sql/sql_base.cc
View file @
831de41c
...
...
@@ -4272,7 +4272,7 @@ bool setup_fields(THD *thd, Item **ref_pointer_array,
thd
->
set_query_id
=
set_query_id
;
thd
->
allow_sum_func
=
allow_sum_func
;
thd
->
where
=
"field list"
;
thd
->
where
=
THD
::
DEFAULT_WHERE
;
/*
To prevent fail on forward lookup we fill it with zerows,
...
...
sql/sql_class.cc
View file @
831de41c
...
...
@@ -44,6 +44,8 @@
*/
char
internal_table_name
[
2
]
=
"*"
;
const
char
*
const
THD
::
DEFAULT_WHERE
=
"field list"
;
/*****************************************************************************
** Instansiate templates
...
...
@@ -234,7 +236,7 @@ THD::THD()
/* Variables with default values */
proc_info
=
"login"
;
where
=
"field list"
;
where
=
THD
::
DEFAULT_WHERE
;
server_id
=
::
server_id
;
slave_net
=
0
;
command
=
COM_CONNECT
;
...
...
@@ -545,6 +547,8 @@ void THD::cleanup_after_query()
}
/* Free Items that were created during this execution */
free_items
();
/* Reset where. */
where
=
THD
::
DEFAULT_WHERE
;
}
/*
...
...
sql/sql_class.h
View file @
831de41c
...
...
@@ -1109,6 +1109,14 @@ class THD :public Statement,
public
Open_tables_state
{
public:
/*
Constant for THD::where initialization in the beginning of every query.
It's needed because we do not save/restore THD::where normally during
primary (non subselect) query execution.
*/
static
const
char
*
const
DEFAULT_WHERE
;
#ifdef EMBEDDED_LIBRARY
struct
st_mysql
*
mysql
;
struct
st_mysql_data
*
data
;
...
...
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