List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:December 20 1999 2:30am
Subject:Weird MySQL behavior
View as plain text  
>>>>> "Boaz" == Boaz Yahav <berber@stripped> writes:

Boaz> Hi
Boaz> I'm having some weird MySQL behavior and I was wondering if anyone can
Boaz> explain it.
Boaz> I woke up today to find a bunch of emails about http://www.WeberDev.com
Boaz> having 
Boaz> a mysql problem. the error was in the banner system and showed : Duplicate
Boaz> entry '44' for key 1.

Boaz> The table is : 

Boaz> +----------+---------------+------+-----+---------+-------+
Boaz> | Field    | Type          | Null | Key | Default | Extra |
Boaz> +----------+---------------+------+-----+---------+-------+
Boaz> | bannerID | mediumint(9)  |      | MUL | 0       |       |
Boaz> | t_stamp  | timestamp(14) | YES  |     | NULL|       |
Boaz> | host     | varchar(255)  |      |     |         |       |
Boaz> +----------+---------------+------+-----+---------+-------+

Boaz> The query was : INSERT INTO phpAds_adviews VALUES ( '44', null,
Boaz> 'ras3-p81.hfa.netvision.net.il' )

Boaz> When I ran it manually I also got : 

mysql> INSERT INTO phpAds_adviews VALUES ( '44', null,
Boaz> 'ras3-p81.hfa.netvision.net.il' );
Boaz> ERROR 1062: Duplicate entry '44' for key 1

Boaz> I tried to remove the key (in a wrong way) :

mysql> alter table phpAds_adviews change bannerID bannerID mediumint(9)
Boaz> Default 0;
Boaz> ERROR 1121: Column 'bannerID' is used with UNIQUE or INDEX but is not
Boaz> defined as NOT NULL

Boaz> Than I tried to check another value (45 instead or 44):

mysql> INSERT INTO phpAds_adviews VALUES ( '45', null,
Boaz> 'ras3-p81.hfa.netvision.net.il' );
Boaz> Query OK, 1 row affected (0.02 sec)

Boaz> and then I tried the same query again :

mysql> INSERT INTO phpAds_adviews VALUES ( '44', null,
Boaz> 'ras3-p81.hfa.netvision.net.il' );
Boaz> Query OK, 1 row affected (0.00 sec)


Boaz> Now all is working again. This query that failed thousands of times all
Boaz> night suddenly succeeded
Boaz> after doing the above steps.

Boaz> Anyone has any idea?

Hi!

My guess is that at some point mysqld has been killed (died?) and the
table has been corrupted.

Try taking down mysqld and run 'isamchk' and 'isamchk -r' on the
table.

Regards,
Monty
Thread
Weird MySQL behaviorBoaz Yahav17 Dec
  • Re: Weird MySQL behaviorsinisa17 Dec
  • Weird MySQL behaviorMichael Widenius20 Dec
RE: Weird MySQL behaviorBoaz Yahav17 Dec
  • RE: Weird MySQL behaviorsinisa17 Dec