Bug #58144 := operator missing from function/operation listing
Submitted: 11 Nov 2010 16:19 Modified: 12 Nov 2010 19:37
Reporter: Lig Isler-Turmelle Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:all OS:Any
Assigned to: Jon Stephens CPU Architecture:Any

[11 Nov 2010 16:19] Lig Isler-Turmelle
The := operator is missing from http://dev.mysql.com/doc/refman/5.1/en/func-op-summary-ref.html  So there is no way to find out about it unless you know where to look in the manual.

As noted on http://dev.mysql.com/doc/refman/5.1/en/user-variables.html

"For SET, either = or := can be used as the assignment operator.

You can also assign a value to a user variable in statements other than SET. In this case, the assignment operator must be := and not = because = is treated as a comparison operator in non-SET statements:

mysql> SET @t1=1, @t2=2, @t3:=4;
mysql> SELECT @t1, @t2, @t3, @t4 := @t1+@t2+@t3;
| @t1  | @t2  | @t3  | @t4 := @t1+@t2+@t3 |
|    1 |    2 |    4 |                  7 | 

How to repeat:

Suggested fix:
Add to the documentation
[11 Nov 2010 22:20] Jon Stephens
Adopting this one following IRC discussion with Paul.
[12 Nov 2010 19:37] Jon Stephens
(Good catch, Lig!)

Issues in addition to those noted by the submitter:

1. The *assignment* form of = was not listed (it was listed as a *comparison* operator, but it can function as either one or the other, depending on the circumstances).

2. There were no descriptions of the = and := assignment operators in "Functions and Operators"


1. The assignment operators = and := are now listed in the summary table.

2. A new section has been added to the "Functions and Operators" chapter with detailed descriptions of these; it will appear soon at http://dev.mysql.com/doc/refman/5.1/en/assignment-operators.html.