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
c57cebfe
Commit
c57cebfe
authored
Dec 04, 2003
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0
parents
b1406b3b
a5780a48
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
81 additions
and
10 deletions
+81
-10
include/mysqld_error.h
include/mysqld_error.h
+2
-1
include/sql_state.h
include/sql_state.h
+1
-0
mysql-test/r/sp-error.result
mysql-test/r/sp-error.result
+10
-0
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+17
-0
sql/item.cc
sql/item.cc
+11
-0
sql/item.h
sql/item.h
+1
-4
sql/share/czech/errmsg.txt
sql/share/czech/errmsg.txt
+1
-0
sql/share/danish/errmsg.txt
sql/share/danish/errmsg.txt
+1
-0
sql/share/dutch/errmsg.txt
sql/share/dutch/errmsg.txt
+1
-0
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+1
-0
sql/share/estonian/errmsg.txt
sql/share/estonian/errmsg.txt
+1
-0
sql/share/french/errmsg.txt
sql/share/french/errmsg.txt
+1
-0
sql/share/german/errmsg.txt
sql/share/german/errmsg.txt
+1
-0
sql/share/greek/errmsg.txt
sql/share/greek/errmsg.txt
+1
-0
sql/share/hungarian/errmsg.txt
sql/share/hungarian/errmsg.txt
+1
-0
sql/share/italian/errmsg.txt
sql/share/italian/errmsg.txt
+1
-0
sql/share/japanese/errmsg.txt
sql/share/japanese/errmsg.txt
+1
-0
sql/share/korean/errmsg.txt
sql/share/korean/errmsg.txt
+1
-0
sql/share/norwegian-ny/errmsg.txt
sql/share/norwegian-ny/errmsg.txt
+1
-0
sql/share/norwegian/errmsg.txt
sql/share/norwegian/errmsg.txt
+1
-0
sql/share/polish/errmsg.txt
sql/share/polish/errmsg.txt
+1
-0
sql/share/portuguese/errmsg.txt
sql/share/portuguese/errmsg.txt
+1
-0
sql/share/romanian/errmsg.txt
sql/share/romanian/errmsg.txt
+1
-0
sql/share/russian/errmsg.txt
sql/share/russian/errmsg.txt
+1
-0
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+1
-0
sql/share/slovak/errmsg.txt
sql/share/slovak/errmsg.txt
+1
-0
sql/share/spanish/errmsg.txt
sql/share/spanish/errmsg.txt
+1
-0
sql/share/swedish/errmsg.txt
sql/share/swedish/errmsg.txt
+1
-0
sql/share/ukrainian/errmsg.txt
sql/share/ukrainian/errmsg.txt
+1
-0
sql/sp_head.cc
sql/sp_head.cc
+3
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+13
-3
No files found.
include/mysqld_error.h
View file @
c57cebfe
...
...
@@ -333,4 +333,5 @@
#define ER_SP_DUP_COND 1314
#define ER_SP_DUP_CURS 1315
#define ER_SP_CANT_ALTER 1316
#define ER_ERROR_MESSAGES 317
#define ER_SP_SUBSELECT_NYI 1317
#define ER_ERROR_MESSAGES 318
include/sql_state.h
View file @
c57cebfe
...
...
@@ -194,3 +194,4 @@ ER_SP_DUP_VAR, "42000", "",
ER_SP_DUP_COND
,
"42000"
,
""
,
ER_SP_DUP_CURS
,
"42000"
,
""
,
/*ER_SP_CANT_ALTER*/
ER_SP_SUBSELECT_NYI
,
"0A000"
,
""
,
mysql-test/r/sp-error.result
View file @
c57cebfe
...
...
@@ -270,4 +270,14 @@ ERROR 42S22: Unknown column 'valname' in 'order clause'
drop procedure bug1965;
select 1 into a;
ERROR 42000: Undeclared variable: a
create procedure bug336(id char(16))
begin
declare x int;
set x = (select sum(t.data) from test.t2 t);
end;
ERROR 0A000: Subselect value not supported
create function bug1654()
returns int
return (select sum(t.data) from test.t2 t);
ERROR 0A000: Statements like SELECT, INSERT, UPDATE (and others) are not allowed in a FUNCTION
drop table t1;
mysql-test/t/sp-error.test
View file @
c57cebfe
...
...
@@ -361,6 +361,23 @@ drop procedure bug1965|
--
error
1309
select
1
into
a
|
#
# BUG#336
#
--
error
1317
create
procedure
bug336
(
id
char
(
16
))
begin
declare
x
int
;
set
x
=
(
select
sum
(
t
.
data
)
from
test
.
t2
t
);
end
|
#
# BUG#1654
#
--
error
1296
create
function
bug1654
()
returns
int
return
(
select
sum
(
t
.
data
)
from
test
.
t2
t
)
|
drop
table
t1
|
...
...
sql/item.cc
View file @
c57cebfe
...
...
@@ -240,6 +240,17 @@ Item_splocal::this_const_item() const
return
thd
->
spcont
->
get_item
(
m_offset
);
}
Item
::
Type
Item_splocal
::
type
()
const
{
THD
*
thd
=
current_thd
;
if
(
thd
->
spcont
)
return
thd
->
spcont
->
get_item
(
m_offset
)
->
type
();
return
NULL_ITEM
;
// Anything but SUBSELECT_ITEM
}
bool
DTCollation
::
aggregate
(
DTCollation
&
dt
)
{
if
(
!
my_charset_same
(
collation
,
dt
.
collation
))
...
...
sql/item.h
View file @
c57cebfe
...
...
@@ -260,10 +260,7 @@ public:
// Abstract methods inherited from Item. Just defer the call to
// the item in the frame
inline
enum
Type
type
()
const
{
return
this_const_item
()
->
type
();
}
enum
Type
type
()
const
;
inline
double
val
()
{
...
...
sql/share/czech/errmsg.txt
View file @
c57cebfe
...
...
@@ -329,3 +329,4 @@ character-set=latin2
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/danish/errmsg.txt
View file @
c57cebfe
...
...
@@ -323,3 +323,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/dutch/errmsg.txt
View file @
c57cebfe
...
...
@@ -331,3 +331,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/english/errmsg.txt
View file @
c57cebfe
...
...
@@ -320,3 +320,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/estonian/errmsg.txt
View file @
c57cebfe
...
...
@@ -325,3 +325,4 @@ character-set=latin7
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/french/errmsg.txt
View file @
c57cebfe
...
...
@@ -320,3 +320,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/german/errmsg.txt
View file @
c57cebfe
...
...
@@ -332,3 +332,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/greek/errmsg.txt
View file @
c57cebfe
...
...
@@ -320,3 +320,4 @@ character-set=greek
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/hungarian/errmsg.txt
View file @
c57cebfe
...
...
@@ -322,3 +322,4 @@ character-set=latin2
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/italian/errmsg.txt
View file @
c57cebfe
...
...
@@ -320,3 +320,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/japanese/errmsg.txt
View file @
c57cebfe
...
...
@@ -322,3 +322,4 @@ character-set=ujis
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/korean/errmsg.txt
View file @
c57cebfe
...
...
@@ -320,3 +320,4 @@ character-set=euckr
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/norwegian-ny/errmsg.txt
View file @
c57cebfe
...
...
@@ -322,3 +322,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/norwegian/errmsg.txt
View file @
c57cebfe
...
...
@@ -322,3 +322,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/polish/errmsg.txt
View file @
c57cebfe
...
...
@@ -324,3 +324,4 @@ character-set=latin2
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/portuguese/errmsg.txt
View file @
c57cebfe
...
...
@@ -321,3 +321,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/romanian/errmsg.txt
View file @
c57cebfe
...
...
@@ -324,3 +324,4 @@ character-set=latin2
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/russian/errmsg.txt
View file @
c57cebfe
...
...
@@ -322,3 +322,4 @@ character-set=koi8r
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/serbian/errmsg.txt
View file @
c57cebfe
...
...
@@ -315,3 +315,4 @@ character-set=cp1250
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/slovak/errmsg.txt
View file @
c57cebfe
...
...
@@ -328,3 +328,4 @@ character-set=latin2
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/spanish/errmsg.txt
View file @
c57cebfe
...
...
@@ -322,3 +322,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/swedish/errmsg.txt
View file @
c57cebfe
...
...
@@ -320,3 +320,4 @@ character-set=latin1
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/share/ukrainian/errmsg.txt
View file @
c57cebfe
...
...
@@ -325,3 +325,4 @@ character-set=koi8u
"Duplicate condition: %s"
"Duplicate cursor: %s"
"Failed to ALTER %s %s"
"Subselect value not supported"
sql/sp_head.cc
View file @
c57cebfe
...
...
@@ -714,6 +714,7 @@ sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
{
LEX
*
olex
;
// The other lex
Item
*
freelist
;
SELECT_LEX
*
sl
;
int
res
;
olex
=
thd
->
lex
;
// Save the other lex
...
...
@@ -726,7 +727,7 @@ sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
// Copy WHERE clause pointers to avoid damaging by optimisation
// Also clear ref_pointer_arrays.
for
(
SELECT_LEX
*
sl
=
lex
->
all_selects_list
;
for
(
sl
=
lex
->
all_selects_list
;
sl
;
sl
=
sl
->
next_select_in_list
())
{
...
...
@@ -772,7 +773,7 @@ sp_instr_stmt::exec_stmt(THD *thd, LEX *lex)
close_thread_tables
(
thd
);
/* Free tables */
}
for
(
SELECT_LEX
*
sl
=
lex
->
all_selects_list
;
for
(
sl
=
lex
->
all_selects_list
;
sl
;
sl
=
sl
->
next_select_in_list
())
{
...
...
sql/sql_yacc.yy
View file @
c57cebfe
...
...
@@ -1548,10 +1548,15 @@ sp_proc_stmt:
}
else
{
sp_instr_freturn *i=
new sp_instr_freturn(lex->sphead->instructions(),
$2, lex->sphead->m_returns);
sp_instr_freturn *i;
if ($2->type() == Item::SUBSELECT_ITEM)
{ /* QQ For now, just disallow subselects as values */
send_error(lex->thd, ER_SP_BADSTATEMENT);
YYABORT;
}
i= new sp_instr_freturn(lex->sphead->instructions(),
$2, lex->sphead->m_returns);
lex->sphead->add_instr(i);
lex->sphead->m_has_return= TRUE;
}
...
...
@@ -5933,6 +5938,11 @@ option_value:
}
else
{ /* An SP local variable */
if ($3 && $3->type() == Item::SUBSELECT_ITEM)
{ /* QQ For now, just disallow subselects as values */
send_error(lex->thd, ER_SP_SUBSELECT_NYI);
YYABORT;
}
sp_pvar_t *spv= lex->spcont->find_pvar(&$1.base_name);
sp_instr_set *i= new sp_instr_set(lex->sphead->instructions(),
spv->offset, $3, spv->type);
...
...
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