Bug #12760 User Variables within a View
Submitted: 23 Aug 2005 18:13 Modified: 2 Sep 2006 9:04
Reporter: J Jorgenson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.7 OS:Solaris (Solaris)
Assigned to: CPU Architecture:Any

[23 Aug 2005 18:13] J Jorgenson
Description:
Please allow a 'User Variable' to be allowed within a view.  

The variable could utilize the 'current session' variable space.

-- j --

How to repeat:
CREATE ALGORITM=TEMPTABLE  VIEW `my_test_view` AS
SELECT
  @sumA := t1.column_a + t2.column_a  AS sum_a,
  @sumB := t1.column_b + t2.column_b  AS sum_b,
  @fractA := @sumA / @sumB       AS fraction_a,
  @fractB := @sumA / t2.column_b AS fraction_b,
  @fractC := @fractA * fractC      AS fraction_c
FROM table_a t1, table_b t2

Suggested fix:
Along the lines of a temp table being specific to a users' session, 
why not allow user variables for the user's session?
[2 Sep 2006 9:04] Valeriy Kravchuk
Duplicate of Bug #18433, already verified.