
From trevor@cyberspc.mb.ca Fri May 31 15:10:35 1996
Date: Thu, 30 May 1996 16:00:45 -0400
From: Trevor Cordes <trevor@cyberspc.mb.ca>
Subject: [mSQL] corruption bug

I have recently installed msql on my system and am having problems with a
simple database I am testing the software with.  If someone can shed any
light, that would be wonderful.  Besides this intermittent problem, I am very
pleased with msql and wish to use it further.  PLEASE HELP!

Here is the output of "msqladmin version":

Version Details :-
        msqladmin version       1.0.13
        mSQL connection         Localhost via UNIX socket
        mSQL server version     1.0.13
        mSQL protocol version   6
        mSQL TCP socket         1112
        mSQL UNIX socket        /dev/msql
        mSQL root user          root

My system is an IBM PowerSeries 850 with the PowerPC 604 133Mhz CPU running
AIX 4.1.3.  Msql compiled with gcc v2.7.2 with no problems whatsoever.

The problem I am experiencing is what seems like random corruption of tables.
It will probably be easiest to show an example using dumps.

Here is the whole database dump, before any problems show up.  (FYI, the
database is to catalog my Star Trek TNG videotapes, it is just a single table,
these lines may run off the screen or wrap a bit)

#
# mSQL Dump  (requires mSQL-1.0.6 or better)
#
# Host: localhost    Database: sttng
#--------------------------------------------------------


#
# Table structure for table 'episode'
#
CREATE TABLE episode (
  code CHAR(4) NOT NULL PRIMARY KEY,
  time CHAR(4),
  date CHAR(7),
  title CHAR(30) NOT NULL,
  notes CHAR(80)
) \g


#
# Dumping data for table 'episode'
#

INSERT INTO episode VALUES ('00.0','0.00','44932.3','In Theory','Jenna falls
for Data; nebula anomolies causing bits of the Enterprise to phase')\g
INSERT INTO episode VALUES ('00.1','0.45','44995.3','Redemption','Picard
arbitrating the Klingon succession; Worf regains family honor & resigns')\g
INSERT INTO episode VALUES ('00.2','1.30','45020.4','Redemption II','Setup
tachyon net to detect Romulan intervention; Taschas daughter; Worf return')\g
INSERT INTO episode VALUES ('00.3','2.15','45047.2','Darmok','Tamarians who
speak with imagery abduct Picard to attemp communication')\g
INSERT INTO episode VALUES ('00.4','3.00','45076.3','Ensign Ro','Ro Laren
joins to stop Bejoran terrorists; Kardassian/Fed conspiracy')\g
INSERT INTO episode VALUES ('00.5','3.46','45122.3','Silicon Avatar','Space
crystal destroys Fed colony; old woman scientist Dr.Marr destroys it')\g
INSERT INTO episode VALUES ('00.6','4.31','45156.1','Disaster','E hits quantum
filament all systems down; Science Fair kids; Worf delivers baby')\g
INSERT INTO episode VALUES ('00.7','5.16','45208.2','The Game','Riker picks up
Kitarians mind controlling sex game; Wesley & babe save the day')\g
INSERT INTO episode VALUES ('01.0','0.00','45233.1','Unification
I','Roddenberry died; Spock supposedly defects to Romulus; Picard goes after
him')\g
INSERT INTO episode VALUES ('01.1','0.45','45245.8','Unification II','Spock
aiming for reunification; Tashas daughter plans invasion of Vulcan')\g
INSERT INTO episode VALUES ('01.2','1.30','45376.3','New Ground','Alexander
comes aboard to stay with Worf; test new Soloton wave warp system')\g
INSERT INTO episode VALUES ('01.3','2.16','45397.3','Hero
Worship','Investigating ship wreck; find boy who immitates Data; bad graviton
wavefront')\g
INSERT INTO episode VALUES ('01.4','3.01','45429.3','Violations','Eulian
telepathic race member putting E staff in comas to rape Troi; end cutoff')\g
INSERT INTO episode VALUES ('01.5','3.46','45470.1','The Masterpiece
Society','Stellar core fragment threatens a genetically engineered society')\g
INSERT INTO episode VALUES ('01.6','4.31','45494.2','Conundrum','Mysterious
ship causes E crew to lose identities; using E to attack enemies')\g
INSERT INTO episode VALUES ('01.7','5.16','45571.2','Power Play','Entities on
a penal planet take over Troi, Data & OBrien trying to escape')\g
INSERT INTO episode VALUES ('02.0','0.00','45587.3','Ethics','Worf gets back
injury and is paralyzed; undergoes genetronic procedure')\g
INSERT INTO episode VALUES ('02.1','0.45','45614.6','The Outcast','Genai
androgynous race member is persecuted; find a null space pocket')\g
INSERT INTO episode VALUES ('02.2','1.30','45652.1','Cause And Effect','Caught
in a time loop in the Typhon Expanse; must avoid collision via dejavu')\g
INSERT INTO episode VALUES ('02.3','2.16','45703.9','The First Duty','Wesleys
flight training group crashes doing a banned trick and then lies')\g
INSERT INTO episode VALUES ('02.4','3.01','45733.6','Cost Of Living','Trois
mother comes on board to get married; energy creature eating nitrium')\g
INSERT INTO episode VALUES ('02.5','3.46','45761.3','The Perfect Mate','Creos
& Volt Minor negotiating peace with a female metamorph wreaking havoc')\g
INSERT INTO episode VALUES ('02.6','4.31','45852.1','Imaginary Friend','Nebula
creature poses as little girls imaginary friend tyring to destroy the E')\g
INSERT INTO episode VALUES ('02.7','5.17','45854.2','I Borg','Capture injured
Borg; heal him; give him an identity, Hugh; release him')\g
INSERT INTO episode VALUES ('03.0','0.00','45882.4','The Next Phase','Romulan
ship accident causes Geordi & Ro to dephase-cloak; stop Romulan plot')\g
INSERT INTO episode VALUES ('03.1','0.46','45944.1','The Inner Light','Picard
is probed; caused to live a life on the doomed Katan; gets a flute')\g
INSERT INTO episode VALUES ('03.2','1.31','45959.1','Times Arrow','Datas head
found on earth in old cave; strange aliens out of phase')\g
INSERT INTO episode VALUES ('03.3','2.16','46001.3','Times Arrow, Part
II','Aliens ingesting neural energy from 1800 era humans; Mark Twain helps
out')\g
INSERT INTO episode VALUES ('03.4','3.01','46041.1','Realm Of Fear','Reg
Barclay with fear of transports rescues people caught in a transporter')\g
INSERT INTO episode VALUES ('03.5','3.46','46071.6','Man Of The
People','Diplomat takes over Troi making her old in order to negotiate
peace')\g
INSERT INTO episode VALUES ('03.6','4.31','46125.3','Relics','Dysonsphere
trapping E and a missing ship; Scotty in transporter for 70 years')\g



--- THEN, I insert another record:
insert into episode values (
'03.7',
'5.16',
'46154.2',
'Schisms',
'Datas poetry; E crew being abducted by aliens doing experiments'
)\g


--- THEN, if I do a select to view the whole table, it shows up corrupted!
The dump is identical to the above except for this last line (which *should*
be what I inserted above, not garbage):

INSERT INTO episode VALUES ('oing','expe','iments',NULL,NULL)\g


--- If I *drop* the whole database and recreate it with msqladmin, and then
try the above insert, the record will be inserted as it should and no
corruption is apparent!  BUT, if I then insert ANOTHER record after that, the
same corruption will occur with that last record!  I even tried shutting down
and restarting msqld, and still it occurs.

Strange thing is, I did not experience ANY corruption of this database until
now.  I have experienced the same thing with other databases of mine, though
when this happens and for how long it lasts (it seems to fix itself
eventually) seems completely random.

I should mention that it *seems* to happen when I make a typo in an insert and
then attempt to fix it either with a delete or update.  I will issue a fix
query, msql monitor (which is what I'm using for these simple db's) will say
"query ok" then I will do a select to see what I just added and it will show
up corrupted!

Please help!  I am going bonkers with this flakey reliability!


--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to msql-list-request@bunyip.com.  Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!
