Hi,

I might not have worded things the best. I did not grep the sql db,
but the output from mysqldump. I only grep'ed on plain text files:

1) mysqldump output
2) grep the input sql file that has 'replace into...' (see below)
3) the log file for mysql, which is plain text (see my follow-up email)

I just did a 'mysql virus' and got (cut of what I got):

mysql> select * from virus where name='VBS/LoveLet-G';
+--------+---------------+
| n      | name          |
+--------+---------------+
| 111009 | VBS/LoveLet-G |
+--------+---------------+
1 row in set (0.00 sec)

I was not grep'ing the sql data files in the var directory of mysql.
My problem, from everything I can see is that the value of 'n' is
wrong in almost every line of the data. Only the first entry in the
input sql file has the 'n' value right at '3'. All the others appear
to be wrong (at least the quick scans I have done). This leads me to
suspect there is a bug in mysql and/or something is wrong with the
'unique' option in the create command below.

Hope this helps,
Thanks,
Cheers,
Douglas

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:58 AM
To: [EMAIL PROTECTED]
Cc: Douglas B Jones; [EMAIL PROTECTED]; 'Paul DuBois'
Subject: RE: automatically incrementing an int value



If I understand correctly, you are trying to grep the SQL data file.
This
is emphatically not a valid thing to do. The data file is *not* a
representation of the table displayed when you SELECT * from it. For a
start, if you have deleted records and not overwritten them, the blank
space will still contain, inaccessably, the data which was there.
Non-text
fields are stored in binary formats. Records do not have line breaks at
the
end, so grep will dump a splurge of data, not a clean record.What you
are
doing is akin to dumping a program and expecting to see the source code;
it
ain't like that.

The *only* valid way of inspecing MySQL tables is via MySQL itself. The
MySQL team will understand what is inside them, byt we lesser mortals
should stay well outside.

      Alec

------------------------------------------------------
You said:



I just tried the below:

create table virus (
        n int auto_increment not null,
        name char(128) not null,
        primary key(n),
        unique(name(100))
);

with a data file that has 122,111 sql commands like:

replace into virus values(NULL,"VBS/LoveLet-E");
replace into virus values(NULL,"VBS/LoveLet-E");
replace into virus values(NULL,"VBS/LoveLet-E");
replace into virus values(NULL,"VBS/LoveLet-G");
replace into virus values(NULL,"WM97/Myna-C");
replace into virus values(NULL,"VBS/LoveLet-G");
replace into virus values(NULL,"WM97/Myna-C");
replace into virus values(NULL,"VBS/LoveLet-G");
replace into virus values(NULL,"VBS/LoveLet-G");
replace into virus values(NULL,"W32/Sircam-A");

Now when I do a:

grep VBS/LoveLet-G sqlfile | wc

I get:

       123       492      6027





---------------------------------------------------------------------
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