I am creating a stored procedure below code
CREATE DEFINER=`john`@`%` PROCEDURE `new_type`(IN typ_id int(11), `typ_name` varchar(100))
BEGIN
INSERT INTO user_type (`typ_id`,`typ_name`,`usr_id`) VALUES (typ_id,usr_typ_name,usr_id)
ON DUPLICATE KEY UPDATE `typ_name` = VALUES(typ_name),
`usr_id` = VALUES(usr_id);
END
Insert and update work well. Problem of choice, I have two user accounts in MYSQL. The procedure created by John, and he has only access rights only to this database. Another username is called "Administrator" and has all the permissions to access the entire database. The result of selecting a query is different. see an example.
For admin result
1 'Admin', '4'
2 'Manger', '5'
3 'Secretary', '6'
For John's result
1 'Admin', '4'
2 'Manger', '5'
3 'Secretary', '6'
4 'User', '7'
5 'Assist Mager', '8'
Why admin didn’t get "User", "Mage Helper"