Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. 1 queries executed, 1 success, 0 errors, 1 warnings
  2.  
  3. Query: call User_Signup('lee3@gmail.com', 'password', 'Lee', 'Brooks', null, null, null, null)
  4.  
  5. 1 row(s) affected, 1 warning(s)
  6.  
  7. Execution Time : 0.042 sec
  8. Transfer Time : 0.093 sec
  9. Total Time : 0.136 sec
  10.  
  11. Note Code : 1592
  12. 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.
  13.  
  14. CALL User_Signup('lee3@gmail.com', 'password', 'Lee', 'Brooks', NULL, NULL, NULL, NULL);
  15.  
  16. DELIMITER $$
  17.  
  18. USE `MobiFit_Dev` $$
  19.  
  20. DROP PROCEDURE IF EXISTS `User_Signup` $$
  21.  
  22. CREATE DEFINER = `root` @`localhost` PROCEDURE `User_Signup` (
  23. email VARCHAR (250),
  24. hashedPassword BINARY(60),
  25. firstName VARCHAR (100),
  26. lastName VARCHAR (100),
  27. gender ENUM ('Male', 'Female'),
  28. dateOfBirth DATE,
  29. height DECIMAL (3, 2),
  30. currentWeight DECIMAL (4, 1)
  31. )
  32. BEGIN
  33. INSERT INTO USER (
  34. Email,
  35. HashedPassword,
  36. RoleId,
  37. FirstName,
  38. LastName,
  39. Gender,
  40. DateOfBirth,
  41. Height,
  42. CurrentWeight,
  43. CreatedAt
  44. )
  45. VALUES
  46. (
  47. email,
  48. hashedPassword,
  49. (SELECT
  50. id
  51. FROM
  52. Role
  53. WHERE `Code` = 'CUSTOMER'),
  54. firstName,
  55. lastName,
  56. gender,
  57. dateOfBirth,
  58. height,
  59. currentWeight,
  60. UTC_TIMESTAMP()
  61. ) ;
  62. END $$
  63.  
  64. DELIMITER ;
  65.  
  66. (SELECT id FROM Role
  67. WHERE `Code` = 'CUSTOMER')
  68.  
  69. DELIMITER $$
  70.  
  71. USE `MobiFit_Dev` $$
  72.  
  73. DROP PROCEDURE IF EXISTS `User_Signup` $$
  74.  
  75. CREATE DEFINER = `root` @`localhost` PROCEDURE `User_Signup` (
  76. email VARCHAR (250),
  77. hashedPassword BINARY(60),
  78. User_Role INT,
  79. firstName VARCHAR (100),
  80. lastName VARCHAR (100),
  81. gender ENUM ('Male', 'Female'),
  82. dateOfBirth DATE,
  83. height DECIMAL (3, 2),
  84. currentWeight DECIMAL (4, 1)
  85. )
  86. BEGIN
  87. INSERT INTO USER (
  88. Email,
  89. HashedPassword,
  90. RoleId,
  91. FirstName,
  92. LastName,
  93. Gender,
  94. DateOfBirth,
  95. Height,
  96. CurrentWeight,
  97. CreatedAt
  98. )
  99. VALUES
  100. (
  101. email,
  102. hashedPassword,
  103. User_Role,
  104. firstName,
  105. lastName,
  106. gender,
  107. dateOfBirth,
  108. height,
  109. currentWeight,
  110. UTC_TIMESTAMP()
  111. ) ;
  112. END $$
  113.  
  114. SELECT id INTO @GivenRoleID FROM Role WHERE `Code` = 'CUSTOMER';
  115. User_Signup('lee3@gmail.com', 'password', @GivenRoleID, 'Lee', 'Brooks',
  116. null, null, null, null);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement