Try something like this:
mysql> set @total := 0;
Query OK, 0 rows affected (0.00 sec)
mysql> select id, salary, @total:=salary+@total from info;
+----+--------+-----------------------+
| id | salary | @total:=salary+@total |
+----+--------+-----------------------+
| 1 | 1 | 1 |
| 2 | 3 | 4 |
| 3 | 3 | 7 |
| 4 | 8 | 15 |
+----+--------+-----------------------+
4 rows in set (0.00 sec)
mysql> select id, salary, total from (select id, salary, @total:=salary+@total as total from info) a where a.total < 10;
+----+--------+-------+
| id | salary | total |
+----+--------+-------+
| 1 | 1 | 1 |
| 2 | 3 | 4 |
| 3 | 3 | 7 |
+----+--------+-------+
3 rows in set (0.01 sec)