Re: Doubt with stored procedures

2013-04-17 Thread Antonio Fernández Pérez
Hi everybody,

Firstly thanks for your reply.

I'm using MySQL only in one server (I have only one), without replication
and without cluster configuration. I have defined the stored procedure as a
normal user, not as a root. And the call is make as a normal user also.
Occurs with MySQL 5.1.49 on Debian 6.

This normal user has CREATE PROCEDURE privilege and EXECUTE privilege.

Thanks.

Best regards,

Antonio.


Re: Doubt with stored procedures

2013-04-17 Thread hsv
>>>> 2013/04/17 14:16 +0200, Antonio Fernández Pérez >>>>
I have a doubt with stored procedures functionality. Is possible that a
stored procedure works with all databases form the server? I have created a
stored procedure on dataBaseA and also works with dataBaseB. Is that
correct? Independently of the user privileges defined. 
<<<<<<<<
It is the default assumption that a procedure within a database is meant for 
use within that database, but one can call a procedure from any of the set of 
databases by qualifying the name--and the MySQL command "show procedure status" 
shows all procedures. The only question is the procedure s use of variables: if 
they refer only to the arguments, it is of no importance whence it is called. 
This is documented:

USE
 statements within stored routines are not permitted. When a routine is 
invoked, an implicit USE db_name is performed (and undone when the routine 
terminates). The causes the routine to have the given default database while it 
executes. References to objects in databases other than the routine default 
database should be qualified with the appropriate database name. 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Re: Doubt with stored procedures

2013-04-17 Thread Johan De Meersman
- Original Message -
> From: "Antonio Fernández Pérez" 
> Subject: Doubt with stored procedures
> 
> I have a doubt with stored procedures functionality. Is possible that
> a stored procedure works with all databases form the server? I have
> created a stored procedure on dataBaseA and also works with dataBaseB. Is that
> correct? Independently of the user privileges defined.

Yes, that's all part of the mysql magic, any stored procedure ever defined will 
work on any server ever to exist.

Well, either that, or you might want to provide us with a little more detail, 
including but not limited to:
 * Is this MySQL or NDB Cluster?
 * Software version?
 * What is the relation between the servers (master, slave, master/master, ...) 
?
 * how exactly did you define the SP, using what user etc. ?
 * how are you calling the SP, using what user, ... ?
 * ...


That being said, using a set of default assumptions, I can tell you that both 
GRANT and CREATE PROCEDURE are replicated, so both all procedures and all users 
should logically exist on both sides of a replication setup.

-- 
Linux Kriek Wanderung
April 19-21, 2013
http://www.tuxera.be/lkw

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql



Doubt with stored procedures

2013-04-17 Thread Antonio Fernández Pérez
Hi everybody,

I have a doubt with stored procedures functionality. Is possible that a
stored procedure works with all databases form the server? I have created a
stored procedure on dataBaseA and also works with dataBaseB. Is that
correct? Independently of the user privileges defined.

Thanks everybody.

Best regards,

Antonio.