dbexport lurvely behaviour
Posted in 2000
A lot of our financial tables have triggers on them which call
procedures which copy a record to a 'audit' table when a record
is changed etc.
Now, from a legacy problem, the field storing the user was called,
get this... 'user'
Imagine the fun when dbexport sees this.
We did some maintenance work this past weekend which involved
amongst other things, exporting the databases, altering extent
sizes, dropping them and reimporting them...
Now, a contractor notices that user 'informix' (which did the
exports) has been doing quite a lot of work.... Well, first thing,
check to see if informix was actually logged in on those times,
in many cases not.
Next thing, check for a user-id with the same number as informix,
nothing there.
Ok, now what, setuid app? mmm nothing there
Suddenly it dawns on us that these records are everything up
to the point of export...
Ok, check the export files, oh look, in all cases in the one
table we looked at, the column had 'informix' in the data.
joy, i/o while grep -v spins thru a 150MB file :) gotta love
being the admin, no-one complains...
So, chalk this up to experience, select * from tablename
returns the correct data, select user from tablename returns
the current user, this we knew.
Seems like dbexport, instead of just unloading with a select *,
does a select field1, field2, fieldn.... etc, which just screws
with the data since the field name is user.
Fort' these tables are used only by the dev staff. Not by the
production users.
Let it be a warning, because it's legacy and never screwed up
before, doesn't mean it wont.... oh well, now I can go off
fishing for the weekend.
brett
--
-----------------------------------------------------------------
Brett's third law of UNIX administration...
Your cow-orkers will find the spray can of lubricant you've
been looking for as you hit the checkout with a new can.
-----------------------------------------------------------------
Brett Geer - UNIX Admin/Analyst/Programmer - Intratex Holdings.
Tel. +27 31 717 4000 Direct. +27 31 717 4146
Fax. +27 31 717 4001
-----------------------------------------------------------------
"I've got 'yer mission critical server right here..."
-----------------------------------------------------------------