MySQL Forums
Forum List  »  Newbie

Problems with the QueryCache
Posted by: Jan Lüdtke
Date: January 20, 2009 08:44AM

Hiho,

I have a problem with the Query-Caching of 5.0.37 MySQL Community Server
I'll try to explain my Problem with a few samples:

I've got a simple table:

mysql> show full columns from werte;
+-------------+--------------+-----------------+------+-----+---------+-------+----------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------------+--------------+-----------------+------+-----+---------+-------+----------------------+---------+
| eigenschaft | varchar(255) | utf8_unicode_ci | NO | PRI | | | select,insert,update | |
| wert | varchar(255) | utf8_unicode_ci | NO | | | | select,insert,update | |
+-------------+--------------+-----------------+------+-----+---------+-------+----------------------+---------+
2 rows in set (0.02 sec)

it has some tupels:

mysql> select * from werte;
+-------------+------+
| eigenschaft | wert |
+-------------+------+
| a | 1 |
| b | 2 |
| suppenhuhn | blub |
+-------------+------+
3 rows in set (0.02 sec)

I now wanna insert/update a tuple:

mysql> insert into werte set eigenschaft = 'suppenhuhn' , wert = "hugo" on duplicate key update eigenschaft = "suppenhuhn" , wert ="hugo";
Query OK, 0 rows affected (0.38 sec)

Ok, let look at the table again:

mysql> select * from werte;
+-------------+------+
| eigenschaft | wert |
+-------------+------+
| a | 1 |
| b | 2 |
| suppenhuhn | blub |
+-------------+------+
3 rows in set (0.02 sec)

Huh?? No update??
Lets try:

mysql> select * from werte where wert ='blub';
Empty set (0.02 sec)

Whats that?? Lets check for the new value:

mysql> select * from werte where wert ="hugo";
+-------------+------+
| eigenschaft | wert |
+-------------+------+
| suppenhuhn | hugo |
+-------------+------+
1 row in set (0.02 sec)

And again:
mysql> select * from werte;
+-------------+------+
| eigenschaft | wert |
+-------------+------+
| a | 1 |
| b | 2 |
| suppenhuhn | blub |
+-------------+------+
3 rows in set (0.02 sec)


I guess you see my Problem :)
I allready found out that the Query-cache is responsible for this.
If I modify the select query, without changing the statement, by adding some whitespaces, it will give me the right values.. at the first time, of cause

So whats wrong with the Server..??

Options: ReplyQuote


Subject
Written By
Posted
Problems with the QueryCache
January 20, 2009 08:44AM
January 20, 2009 09:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.