我正在将开发数据库复制到 Web 生产服务器,它可以正常工作,直到以下情况:
CREATE PROCEDURE sprc_list_user_accounts
(
int_page_number INT,
int_recs_per_page INT
)
BEGIN
DECLARE int_record_first INT;
IF int_page_number = 0
THEN SELECT record_identifier,
name_account,
name_last,
name_first,
flag_disabled
FROM acs_accounts
ORDER BY name_last,
name_first;
ELSE SET int_record_first = ((int_page_number - 1) * int_recs_per_page);
SELECT record_identifier,
name_account,
name_last,
name_first,
flag_disabled
FROM acs_accounts
ORDER BY name_last,
name_first
LIMIT int_record_first, int_recs_per_page;
END IF;
END $$
这在我自己的机器上完美运行 - Win7/64 MySQL 5.5.24,但在 Web 机器上阻塞 - Linux/64 MySQL 5.1.55。令人讨厌的是,所有前面的表格和过程都显示得很好。结果是一个没有任何解释的不是很有帮助的 1064。
确切的反应是
Error
SQL query: Documentation
-- =====
-- LISTS
-- =====
CREATE PROCEDURE sprc_list_user_accounts(
int_page_number INT,
int_recs_per_page INT
) BEGIN DECLARE int_record_first INT;
SELECT COUNT( * )
FROM acs_accounts;
IF int_page_number =0 THEN SELECT record_identifier, name_account, name_last, name_first
FROM acs_accounts
WHERE flag_disabled =0
ORDER BY name_last, name_first;
ELSE SET int_record_first = ( (
int_page_number -1
) * int_recs_per_page ) ;
SELECT name_account, name_last, name_first, flag_disabled
FROM acs_accounts
ORDER BY name_last, name_first
LIMIT int_record_first, int_recs_per_page;
END IF ;
END $$
MySQL said: Documentation
#1064 -
--- 信息结束!