Bug #69706 Cannot pass "long" typed parameter to a stored procedure from mysql workbench
Submitted: 10 Jul 2013 0:49 Modified: 10 Jul 2013 16:41
Reporter: Birzhan Amirov Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.35 OS:Windows (7)
Assigned to: CPU Architecture:Any

[10 Jul 2013 0:49] Birzhan Amirov
Description:
Parameter value is incorrect when calling a stored procedure with parameter of type "long"

How to repeat:
1) Create DB, table and stored procedure.
Create Database tstDb;
Use tstDb;

Create table test (id long);

Insert into test (id) values (33);

DELIMITER $$

CREATE PROCEDURE `get`(hbTime long)
BEGIN
    SELECT * FROM test
    WHERE id < hbTime;
END;

2) Run two queries in the query window.

SELECT * FROM test
WHERE id < 100;

call get(100);

They have the same code, but will return different results.
Change long to int in the procedure signature, and the bug will disappear.

Suggested fix:
Make long parameters work.
[10 Jul 2013 16:41] Alfredo Kojima
There is no numeric type called "long" in MySQL, you must be confusing it with something else. Try BIGINT. See http://dev.mysql.com/doc/refman/5.6/en/blob.html for what long actually is (long = long varchar = mediumtext).