Ok, building off of the last question I asked, How does Mysql handle the where statment in the following code:
DELIMITER ;//
DROP PROCEDURE IF EXISTS `test`;//
CREATE PROCEDURE `test`
(
id INT
)
BEGIN
SELECT *
FROM some_table
WHERE id = id;
END;//
What does MySQL do in this case? Does it treat the where clause as
some_table.id = id
or does it treat it like
some_table.id = some_table.id
Right now I am doing something like
WHERE id = @id
because I didn't know that there were session variables in MySQL and it didn't complain and I thought that it was an explicit way of saying "where this column equals this variable".
Some might say "duh.. of course it treats it as column = variable" but I could easily have said where "variable = column." So how does it handle this?