Description:
Both delete and update do not work on this varchar(32) column. You have to use like instead of = to match records. Evidence below ( for the update comand) . However, on a different table, same database, it works. Now, I've deleted the tables and re-created them many times already and the problem persists.
mysql> show variables like '%char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
7 rows in set (0.00 sec)
version 4.1.3-beta-log
version_comment yes
version_compile_machine i686
version_compile_os pc-linux
mysql> select * from drupal_sessions where uid = 1;
+-----+----------------------------------+-----------------+------------+-----------------+
| uid | sid | hostname | timestamp | session |
+-----+----------------------------------+-----------------+------------+-----------------+
| 1 | 08cb660b2140bf4cedcd2fd032bdbbf8 | xxx.xxx.xxx.xxx | 1095034879 | messages|a:0:{} |
+-----+----------------------------------+-----------------+------------+-----------------+
1 row in set (0.00 sec)
mysql> update drupal_sessions SET uid=0 WHERE sid='08cb660b2140bf4cedcd2fd032bdbbf8';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql> update drupal_sessions SET uid=0 WHERE sid like '08cb660b2140bf4cedcd2fd032bdbbf8';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from drupal_sessions where sid='08cb660b2140bf4cedcd2fd032bdbbf8';
+-----+----------------------------------+-----------------+------------+-----------------+
| uid | sid | hostname | timestamp | session |
+-----+----------------------------------+-----------------+------------+-----------------+
| 1 | 08cb660b2140bf4cedcd2fd032bdbbf8 | xxx.xxx.xxx.xxx | 1095035122 | messages|a:0:{} |
+-----+----------------------------------+-----------------+------------+-----------------+
1 row in set (0.00 sec)
mysql> show table status like 'drupal_sessions';
+-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
| drupal_sessions | MyISAM | 9 | Dynamic | 1 | 92 | 216 | 4294967295 | 4096 | 124 | NULL | 2004-09-12 15:58:59 | 2004-09-12 19:25:22 | NULL | utf8_general_ci | NULL | | |
+-----------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)
mysql> show table status like 'drupal_users';
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
| drupal_users | MyISAM | 9 | Dynamic | 2 | 84 | 168 | 4294967295 | 4096 | 0 | NULL | 2004-09-12 15:58:59 | 2004-09-12 19:49:51 | NULL | utf8_general_ci | NULL | | |
+--------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+-----------------+----------+----------------+---------+
1 row in set (0.01 sec)
mysql> update drupal_users set changed=UNIX_TIMESTAMP() where name='admin';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> update drupal_users set changed=UNIX_TIMESTAMP() where name like 'admin';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
I tried this with the password field as well (since it uses similar jargon) and it worked in the user table. (didn't want to paste the pw hash in here).
This problem does not exists on slackware-current (post slackware-10 | pre slackware 11)
If you need additional information I will be more than happy to accomidate you.
How to repeat:
Compeletly removed mysql-* from the rpms.
Download 4.1.3 and compile it
create a user and import the tables into the server.
Populate the database and do selects.
Suggested fix:
none