Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 queries executed, 1 success, 0 errors, 1 warnings
- Query: call User_Signup('lee3@gmail.com', 'password', 'Lee', 'Brooks', null, null, null, null)
- 1 row(s) affected, 1 warning(s)
- Execution Time : 0.042 sec
- Transfer Time : 0.093 sec
- Total Time : 0.136 sec
- Note Code : 1592
- Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.
- CALL User_Signup('lee3@gmail.com', 'password', 'Lee', 'Brooks', NULL, NULL, NULL, NULL);
- DELIMITER $$
- USE `MobiFit_Dev` $$
- DROP PROCEDURE IF EXISTS `User_Signup` $$
- CREATE DEFINER = `root` @`localhost` PROCEDURE `User_Signup` (
- email VARCHAR (250),
- hashedPassword BINARY(60),
- firstName VARCHAR (100),
- lastName VARCHAR (100),
- gender ENUM ('Male', 'Female'),
- dateOfBirth DATE,
- height DECIMAL (3, 2),
- currentWeight DECIMAL (4, 1)
- )
- BEGIN
- INSERT INTO USER (
- Email,
- HashedPassword,
- RoleId,
- FirstName,
- LastName,
- Gender,
- DateOfBirth,
- Height,
- CurrentWeight,
- CreatedAt
- )
- VALUES
- (
- email,
- hashedPassword,
- (SELECT
- id
- FROM
- Role
- WHERE `Code` = 'CUSTOMER'),
- firstName,
- lastName,
- gender,
- dateOfBirth,
- height,
- currentWeight,
- UTC_TIMESTAMP()
- ) ;
- END $$
- DELIMITER ;
- (SELECT id FROM Role
- WHERE `Code` = 'CUSTOMER')
- DELIMITER $$
- USE `MobiFit_Dev` $$
- DROP PROCEDURE IF EXISTS `User_Signup` $$
- CREATE DEFINER = `root` @`localhost` PROCEDURE `User_Signup` (
- email VARCHAR (250),
- hashedPassword BINARY(60),
- User_Role INT,
- firstName VARCHAR (100),
- lastName VARCHAR (100),
- gender ENUM ('Male', 'Female'),
- dateOfBirth DATE,
- height DECIMAL (3, 2),
- currentWeight DECIMAL (4, 1)
- )
- BEGIN
- INSERT INTO USER (
- Email,
- HashedPassword,
- RoleId,
- FirstName,
- LastName,
- Gender,
- DateOfBirth,
- Height,
- CurrentWeight,
- CreatedAt
- )
- VALUES
- (
- email,
- hashedPassword,
- User_Role,
- firstName,
- lastName,
- gender,
- dateOfBirth,
- height,
- currentWeight,
- UTC_TIMESTAMP()
- ) ;
- END $$
- SELECT id INTO @GivenRoleID FROM Role WHERE `Code` = 'CUSTOMER';
- User_Signup('lee3@gmail.com', 'password', @GivenRoleID, 'Lee', 'Brooks',
- null, null, null, null);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement