Hello,

    I have been successfully using the MYSQL database for the past
    3+ months - however I have just encountered a bug with MYSQL that
    prevents my query from working.

    Basically I have a field in a table that describes an item, and I have
    written a program that allows a user to search for a word within this
    field.  Here is a sample table structure:

    create TABLE my_table
    (
        my_index     int unsigned not null auto_increment,
        my_field      varchar(256)
    )

    The command I am issuing is as follows:

        select * from my_table where my_field like '%string%';

    * where "string" is the value I am searching for.

    As previously mentioned my application has been working perfectly
    for the past 3 months - but to my suprise it stopped working recently.

    For example:

        select * from my_table where my_field like '%hello%';

    The above query will fail, even though row 12000 contains the string
    "hello" within it.

    I did some experimentation and identified the corrupt record - I then
    executed a select statement searching for a record (in the same way as
    above) but for a record before the corruption:

    For example:

        select * from my_table where my_index < 12000 AND my_field
like'%hello%';

    The above query will work!  Also if the corrupt record is for example
    record 12001 (with my_index=12001) and I invoke the following select
    statement:

        select * from my_table where my_index=12000;

    The select statement will work.  I simply cant understand why this is
the case.

    I did try running some of the mysql repair tools but they failed.  I
Also
    tried doing a mysqldump and reading the table back in - however I
noticed
    taht I lost about 100 records!  Finally I wrote my own MYSQL repair
command,
    basically it looped through each record in the table (obtaining each
record doing
    a select on the primary key) then I dumped the data to an output file.
I then
    read the table back into the database.  This works - however one record
would
    always be lost.

    Its really urgent that I get this bug fixed, and I would be
exceptionally
    greatful if there is anyone who can advise me on how to resolve this
    problem.

    I am using MYSQL version:

 mysql  Ver 11.15 Distrib 3.23.39, for pc-linux-gnu (i686)

    Best regards,

Spencer
([EMAIL PROTECTED])



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to