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
b863798a
Commit
b863798a
authored
Jan 15, 2003
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some basic error handling for SP functions in mysql_execute_command().
parent
d0bcc9dc
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
175 additions
and
63 deletions
+175
-63
include/mysqld_error.h
include/mysqld_error.h
+5
-1
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
sql/share/czech/errmsg.txt
sql/share/czech/errmsg.txt
+5
-1
sql/share/danish/errmsg.txt
sql/share/danish/errmsg.txt
+5
-1
sql/share/dutch/errmsg.txt
sql/share/dutch/errmsg.txt
+5
-1
sql/share/english/errmsg.txt
sql/share/english/errmsg.txt
+6
-1
sql/share/estonian/errmsg.txt
sql/share/estonian/errmsg.txt
+5
-1
sql/share/french/errmsg.txt
sql/share/french/errmsg.txt
+5
-1
sql/share/german/errmsg.txt
sql/share/german/errmsg.txt
+5
-1
sql/share/greek/errmsg.txt
sql/share/greek/errmsg.txt
+5
-1
sql/share/hungarian/errmsg.txt
sql/share/hungarian/errmsg.txt
+5
-1
sql/share/italian/errmsg.txt
sql/share/italian/errmsg.txt
+5
-1
sql/share/japanese/errmsg.txt
sql/share/japanese/errmsg.txt
+5
-1
sql/share/korean/errmsg.txt
sql/share/korean/errmsg.txt
+5
-1
sql/share/norwegian-ny/errmsg.txt
sql/share/norwegian-ny/errmsg.txt
+5
-1
sql/share/norwegian/errmsg.txt
sql/share/norwegian/errmsg.txt
+5
-1
sql/share/polish/errmsg.txt
sql/share/polish/errmsg.txt
+5
-1
sql/share/portuguese/errmsg.txt
sql/share/portuguese/errmsg.txt
+5
-1
sql/share/romanian/errmsg.txt
sql/share/romanian/errmsg.txt
+5
-1
sql/share/russian/errmsg.txt
sql/share/russian/errmsg.txt
+5
-1
sql/share/serbian/errmsg.txt
sql/share/serbian/errmsg.txt
+5
-1
sql/share/slovak/errmsg.txt
sql/share/slovak/errmsg.txt
+5
-1
sql/share/spanish/errmsg.txt
sql/share/spanish/errmsg.txt
+5
-1
sql/share/swedish/errmsg.txt
sql/share/swedish/errmsg.txt
+5
-1
sql/share/ukrainian/errmsg.txt
sql/share/ukrainian/errmsg.txt
+5
-1
sql/sp_head.cc
sql/sp_head.cc
+3
-7
sql/sql_parse.cc
sql/sql_parse.cc
+50
-31
No files found.
include/mysqld_error.h
View file @
b863798a
...
...
@@ -266,4 +266,8 @@
#define ER_SELECT_REDUCED 1247
#define ER_TABLENAME_NOT_ALLOWED_HERE 1248
#define ER_NOT_SUPPORTED_AUTH_MODE 1249
#define ER_ERROR_MESSAGES 250
#define ER_SP_NO_RECURSIVE_CREATE 1250
#define ER_SP_ALREADY_EXISTS 1251
#define ER_SP_DOES_NOT_EXIST 1252
#define ER_SP_DROP_FAILED 1253
#define ER_ERROR_MESSAGES 254
sql/mysql_priv.h
View file @
b863798a
...
...
@@ -349,7 +349,7 @@ extern "C" pthread_handler_decl(handle_one_connection,arg);
extern
"C"
pthread_handler_decl
(
handle_bootstrap
,
arg
);
void
end_thread
(
THD
*
thd
,
bool
put_in_cache
);
void
flush_thread_cache
();
void
mysql_execute_command
(
THD
*
thd
);
int
mysql_execute_command
(
THD
*
thd
);
bool
do_command
(
THD
*
thd
);
bool
dispatch_command
(
enum
enum_server_command
command
,
THD
*
thd
,
char
*
packet
,
uint
packet_length
);
...
...
sql/share/czech/errmsg.txt
View file @
b863798a
...
...
@@ -260,3 +260,7 @@ v/*
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/danish/errmsg.txt
View file @
b863798a
...
...
@@ -254,3 +254,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/dutch/errmsg.txt
View file @
b863798a
...
...
@@ -262,3 +262,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/english/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,8 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
"Failed to store PROCEDURE"
sql/share/estonian/errmsg.txt
View file @
b863798a
...
...
@@ -256,3 +256,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/french/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/german/errmsg.txt
View file @
b863798a
...
...
@@ -261,3 +261,7 @@
"Select %u wurde während der Optimierung reduziert.",
"Tabelle '%-.64s', die in einem der SELECT-Befehle verwendet wurde kann nicht in %-.32s verwendet werden."
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/greek/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/hungarian/errmsg.txt
View file @
b863798a
...
...
@@ -253,3 +253,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/italian/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/japanese/errmsg.txt
View file @
b863798a
...
...
@@ -253,3 +253,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/korean/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/norwegian-ny/errmsg.txt
View file @
b863798a
...
...
@@ -253,3 +253,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/norwegian/errmsg.txt
View file @
b863798a
...
...
@@ -253,3 +253,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/polish/errmsg.txt
View file @
b863798a
...
...
@@ -255,3 +255,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/portuguese/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/romanian/errmsg.txt
View file @
b863798a
...
...
@@ -255,3 +255,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/russian/errmsg.txt
View file @
b863798a
...
...
@@ -254,3 +254,7 @@
"Select %u ",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/serbian/errmsg.txt
View file @
b863798a
...
...
@@ -247,3 +247,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/slovak/errmsg.txt
View file @
b863798a
...
...
@@ -259,3 +259,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/spanish/errmsg.txt
View file @
b863798a
...
...
@@ -252,3 +252,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/swedish/errmsg.txt
View file @
b863798a
...
...
@@ -251,3 +251,7 @@
"Select %u was reduced during optimisation",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/share/ukrainian/errmsg.txt
View file @
b863798a
...
...
@@ -256,3 +256,7 @@
"Select %u was iii",
"Table '%-.64s' from one of SELECT's can not be used in %-.32s"
"Client does not support authentication protocol requested by server. Consider upgrading MySQL client"
"Can't create a PROCEDURE from within a PROCEDURE"
"PROCEDURE already exists"
"PROCEDURE does not exist"
"Failed to DROP PROCEDURE"
sql/sp_head.cc
View file @
b863798a
...
...
@@ -157,9 +157,6 @@ sp_head::execute(THD *thd)
{
// Execute instructions...
uint
ip
=
0
;
my_bool
nsok
=
thd
->
net
.
no_send_ok
;
thd
->
net
.
no_send_ok
=
TRUE
;
// Don't send_ok() during execution
while
(
ret
==
0
)
{
...
...
@@ -170,8 +167,6 @@ sp_head::execute(THD *thd)
break
;
ret
=
i
->
execute
(
thd
,
&
ip
);
}
thd
->
net
.
no_send_ok
=
nsok
;
}
// Don't copy back OUT values if we got an error
...
...
@@ -323,18 +318,19 @@ int
sp_instr_stmt
::
execute
(
THD
*
thd
,
uint
*
nextp
)
{
LEX
olex
;
// The other lex
int
res
;
memcpy
(
&
olex
,
&
thd
->
lex
,
sizeof
(
LEX
));
// Save the other lex
memcpy
(
&
thd
->
lex
,
&
m_lex
,
sizeof
(
LEX
));
// Use my own lex
thd
->
lex
.
thd
=
thd
;
mysql_execute_command
(
thd
);
res
=
mysql_execute_command
(
thd
);
memcpy
(
&
thd
->
lex
,
&
olex
,
sizeof
(
LEX
));
// Restore the other lex
*
nextp
=
m_ip
+
1
;
return
0
;
return
res
;
}
//
...
...
sql/sql_parse.cc
View file @
b863798a
...
...
@@ -1482,7 +1482,7 @@ bool alloc_query(THD *thd, char *packet, ulong packet_length)
** Execute command saved in thd and current_lex->sql_command
****************************************************************************/
void
int
mysql_execute_command
(
THD
*
thd
)
{
int
res
=
0
;
...
...
@@ -1513,7 +1513,7 @@ mysql_execute_command(THD *thd)
given and the table list says the query should not be replicated
*/
if
(
table_rules_on
&&
tables
&&
!
tables_ok
(
thd
,
tables
))
DBUG_VOID_RETURN
;
return
0
;
#ifndef TO_BE_DELETED
/*
This is a workaround to deal with the shortcoming in 3.23.44-3.23.46
...
...
@@ -1549,7 +1549,7 @@ mysql_execute_command(THD *thd)
{
if
(
res
<
0
||
thd
->
net
.
report_error
)
send_error
(
thd
,
thd
->
killed
?
ER_SERVER_SHUTDOWN
:
0
);
DBUG_VOID_RETURN
;
return
res
;
}
}
}
...
...
@@ -1558,7 +1558,7 @@ mysql_execute_command(THD *thd)
lex
->
unit
.
create_total_list
(
thd
,
lex
,
&
tables
))
||
(
table_rules_on
&&
tables
&&
thd
->
slave_thread
&&
!
tables_ok
(
thd
,
tables
)))
DBUG_VOID_RETURN
;
return
0
;
statistic_increment
(
com_stat
[
lex
->
sql_command
],
&
LOCK_status
);
switch
(
lex
->
sql_command
)
{
...
...
@@ -1597,7 +1597,7 @@ mysql_execute_command(THD *thd)
if
(
!
(
result
=
new
select_send
()))
{
send_error
(
thd
,
ER_OUT_OF_RESOURCES
);
DBUG_VOID_RETURN
;
goto
error
;
}
else
thd
->
send_explain_fields
(
result
);
...
...
@@ -1838,7 +1838,7 @@ mysql_execute_command(THD *thd)
find_real_table_in_list
(
tables
->
next
,
tables
->
db
,
tables
->
real_name
))
{
net_printf
(
thd
,
ER_UPDATE_TABLE_USED
,
tables
->
real_name
);
DBUG_VOID_RETURN
;
return
-
1
;
}
if
(
tables
->
next
)
{
...
...
@@ -1918,7 +1918,7 @@ mysql_execute_command(THD *thd)
if
(
thd
->
locked_tables
||
thd
->
active_transaction
())
{
send_error
(
thd
,
ER_LOCK_OR_ACTIVE_TRANSACTION
);
break
;
goto
error
;
}
{
LOCK_ACTIVE_MI
;
...
...
@@ -1929,7 +1929,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_ALTER_TABLE
:
#if defined(DONT_ALLOW_SHOW_COMMANDS)
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
break
;
goto
error
;
#else
{
ulong
priv
=
0
;
...
...
@@ -2019,7 +2019,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_BINLOGS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
{
if
(
check_global_access
(
thd
,
SUPER_ACL
))
...
...
@@ -2031,7 +2031,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_CREATE
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
{
if
(
check_db_used
(
thd
,
tables
)
||
...
...
@@ -2103,7 +2103,7 @@ mysql_execute_command(THD *thd)
if
(
select_lex
->
item_list
.
elements
!=
lex
->
value_list
.
elements
)
{
send_error
(
thd
,
ER_WRONG_VALUE_COUNT
);
DBUG_VOID_RETURN
;
goto
error
;
}
res
=
mysql_update
(
thd
,
tables
,
select_lex
->
item_list
,
...
...
@@ -2123,7 +2123,7 @@ mysql_execute_command(THD *thd)
if
(
select_lex
->
item_list
.
elements
!=
lex
->
value_list
.
elements
)
{
send_error
(
thd
,
ER_WRONG_VALUE_COUNT
);
DBUG_VOID_RETURN
;
goto
error
;
}
{
const
char
*
msg
=
0
;
...
...
@@ -2159,7 +2159,7 @@ mysql_execute_command(THD *thd)
if
(
select_lex
->
item_list
.
elements
!=
lex
->
value_list
.
elements
)
{
send_error
(
thd
,
ER_WRONG_VALUE_COUNT
);
DBUG_VOID_RETURN
;
goto
error
;
}
res
=
mysql_insert
(
thd
,
tables
,
lex
->
field_list
,
lex
->
many_values
,
select_lex
->
item_list
,
lex
->
value_list
,
...
...
@@ -2199,7 +2199,7 @@ mysql_execute_command(THD *thd)
if
(
find_real_table_in_list
(
tables
->
next
,
tables
->
db
,
tables
->
real_name
))
{
net_printf
(
thd
,
ER_UPDATE_TABLE_USED
,
tables
->
real_name
);
DBUG_VOID_RETURN
;
return
-
1
;
}
/* Skip first table, which is the table we are inserting in */
...
...
@@ -2357,7 +2357,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_DATABASES
:
#if defined(DONT_ALLOW_SHOW_COMMANDS)
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
if
((
specialflag
&
SPECIAL_SKIP_SHOW_DB
)
&&
check_global_access
(
thd
,
SHOW_DB_ACL
))
...
...
@@ -2391,7 +2391,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_LOGS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
{
if
(
grant_option
&&
check_access
(
thd
,
FILE_ACL
,
any_db
))
...
...
@@ -2404,7 +2404,7 @@ mysql_execute_command(THD *thd)
/* FALL THROUGH */
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
{
char
*
db
=
select_lex
->
db
?
select_lex
->
db
:
thd
->
db
;
...
...
@@ -2440,7 +2440,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_FIELDS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
{
char
*
db
=
tables
->
db
;
...
...
@@ -2465,7 +2465,7 @@ mysql_execute_command(THD *thd)
case
SQLCOM_SHOW_KEYS
:
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
thd
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
goto
error
;
#else
{
char
*
db
=
tables
->
db
;
...
...
@@ -2813,13 +2813,17 @@ mysql_execute_command(THD *thd)
break
;
case
SQLCOM_CREATE_PROCEDURE
:
if
(
!
lex
->
sphead
)
res
=
-
1
;
{
send_error
(
thd
,
ER_SP_NO_RECURSIVE_CREATE
);
goto
error
;
}
else
{
res
=
lex
->
sphead
->
create
(
thd
);
if
(
res
<
0
)
if
(
res
!=
0
)
{
// QQ Error!
send_error
(
thd
,
ER_SP_ALREADY_EXISTS
);
goto
error
;
}
send_ok
(
thd
);
}
...
...
@@ -2833,14 +2837,23 @@ mysql_execute_command(THD *thd)
sp
=
sp_find
(
thd
,
s
);
if
(
!
sp
)
{
// QQ Error!
res
=
-
1
;
send_error
(
thd
,
ER_SP_DOES_NOT_EXIST
);
goto
error
;
}
else
{
// When executing substatements, they're assumed to send_error when
// it happens, but not to send_ok.
my_bool
nsok
=
thd
->
net
.
no_send_ok
;
thd
->
net
.
no_send_ok
=
TRUE
;
res
=
sp
->
execute
(
thd
);
thd
->
net
.
no_send_ok
=
nsok
;
if
(
res
==
0
)
send_ok
(
thd
);
else
goto
error
;
// Substatement should already have sent error
}
}
break
;
...
...
@@ -2853,8 +2866,8 @@ mysql_execute_command(THD *thd)
sp
=
sp_find
(
thd
,
s
);
if
(
!
sp
)
{
// QQ Error!
res
=
-
1
;
send_error
(
thd
,
ER_SP_DOES_NOT_EXIST
);
goto
error
;
}
else
{
...
...
@@ -2873,17 +2886,18 @@ mysql_execute_command(THD *thd)
sp
=
sp_find
(
thd
,
s
);
if
(
!
sp
)
{
// QQ Error!
res
=
-
1
;
send_error
(
thd
,
ER_SP_DOES_NOT_EXIST
);
goto
error
;
}
else
{
String
*
name
=
s
->
const_string
();
res
=
sp_drop
(
thd
,
name
->
c_ptr
(),
name
->
length
());
if
(
res
<
0
)
if
(
res
!=
0
)
{
// QQ Error!
send_error
(
thd
,
ER_SP_DROP_FAILED
);
goto
error
;
}
send_ok
(
thd
);
}
...
...
@@ -2894,11 +2908,16 @@ mysql_execute_command(THD *thd)
break
;
}
thd
->
proc_info
=
"query end"
;
// QQ
// We end up here if res == 0 and send_ok() has been done,
// or res != 0 and no send_error() has yet been done.
if
(
res
<
0
)
send_error
(
thd
,
thd
->
killed
?
ER_SERVER_SHUTDOWN
:
0
);
return
res
;
error:
DBUG_VOID_RETURN
;
// We end up here if send_error() has already been done.
return
-
1
;
}
...
...
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