I`m facing a weird problem in MySQL, I try to update a value in a table that exists, but get an error that the table doesn't exists even though it does. The SELECT statement works fine:
mysql> SELECT * FROM CurrentState;
+----+------------+--------+--------+
| ID | last_price | buyer | seller |
+----+------------+--------+--------+
| 1 | 5.10 | 5.09 | 5.12 |
| 2 | 132.00 | 130.30 | 132.40 |
+----+------------+--------+--------+
2 rows in set (0.00 sec)
mysql> UPDATE CurrentState SET buyer = buyer;
ERROR 1109 (42S02): Unknown table 'CurrentState' in field list
I have tried doing the query as a regular user and as root and I get the same results. What can the problem be? The only thing I have done is that I have created a trigger for the table in case an update statement is executed. But now that isn't even possible.
Thanks for any help!
EDIT: Added trigger
CREATE TRIGGER push_changes AFTER UPDATE ON CurrentState FOR EACH ROW CALL winners_change(CurrentState.buyer,CurrentState.seller,CurrentState.last_price);
As I write this I guess the problem is the (CurrentState.buyer,CurrentState.seller,CurrentState.last_price);
part, should CurrentState
be removed?
You should use NEW
instead of CurrentState
to reference the current row.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments