DROP PROCEDURE IF EXISTS checkExistingEmail;
delimiter $$
CREATE PROCEDURE checkExistingEmail(
IN parmEmail VARCHAR(100)
,IN parmFName VARCHAR(100)
,IN parmLName VARCHAR(100)
,IN parmPassword VARCHAR(60)
,OUT RetVal TINYINT
,OUT UID VARCHAR(36)
)
BEGIN
IF EXISTS (SELECT email FROM User_Registration WHERE email = parmEmail) THEN
SET RetVal = 0;
SET UID = null;
ELSE
SET UID = UUID();
SET RetVal = 1;
INSERT INTO User_Registration(Email,FirstName,LastName,Password,GUID)
VALUES(parmEmail,parmFName,parmLName,parmPassword,UID);
END IF;
END
我收到了SQL语法错误,但我无法弄清问题是什么。问题只发生在我将应用程序推送到OpenShift时。它在我的快速应用程序和MySQL Workbench中都可以在本地运行。
它没有任何意义,因为我可以在PHP管理控制台中执行此语句。
我正在使用MySQL 5.5。
==> app-root/logs/nodejs.log <==
POST /register - - ms - -
checking user: bob@me.com
call checkExistingEmail('bob@me.com','Bob','Dole','$2a$10$wlZ345NAAyLAU2PawLJN6eBTXg7T3qftX0L7gU/5DYjxpFw6RUnd2',@RetVal,@UID);SELECT @RetVal as retVal,@UID as uid;
Error: { [Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT @RetVal as retVal,@UID as uid' at line 1]
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlState: '42000',
index: 0 }
这表明它在本地工作。
checking user: bob@me.com
call checkExistingEmail('bob@me.com','Bob','Dole','$2a$10$CboZR8mlMacNlMzyUKHVVuEn5t.Yx9tphyqBNG8wO1GnKVd2K54E2',@RetVal,@UID); SELECT @RetVal as retVal,@UID as uid;
[ OkPacket {
fieldCount: 0,
affectedRows: 1,
insertId: 0,
serverStatus: 10,
warningCount: 0,
message: '',
protocol41: true,
changedRows: 0 },
[ RowDataPacket { retVal: 1, uid: '76f54340-82be-11e6-9304-182b925c144f' } ] ]
POST /register 302 267.012 ms - 92