Issue 14870 - ALTERING field names via the UI deletes all the dataHi,
Summary: ALTERING field names via the UI deletes all the dataHi,
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 1.1 RC
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-25 20:04 UTC by alex.thurgood
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
sql command for creating the table (103 bytes, text/plain)
2003-05-27 08:34 UTC, alex.thurgood
no flags Details
sql command for populating the table (51 bytes, text/plain)
2003-05-27 08:35 UTC, alex.thurgood
no flags Details
sql ALTER statement to rename field and place it after another one (57 bytes, text/plain)
2003-05-27 08:36 UTC, alex.thurgood
no flags Details
diff file for fix (3.97 KB, patch)
2003-05-27 09:52 UTC, ocke.janssen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description alex.thurgood 2003-05-25 20:04:29 UTC
Hi,
I've just had a very un pleasant experience with beta2.

With mysql via the console you can issue ALTER statements to change, for
example, the sequence of the fields in a table, the type definition, etc. When
you do this, data is not corrupted if you maintain the same field definition,
and even if you change it, mysql will try and adapt the values in the fields to
the new definition without losing data.

I thought I'd try this via the UI in the DSB. When you click on Edit Table from
the menu, the table definition window shows up. You can then alter the table
definitions and save your changes. I just tried changing the name of a
pre-existing field, OOo duly complied, and I saved, but then when I went to look
in the grid view of the data in the DSB all of my data in that column had been
wiped, and nary so much as warning from OOo. I consider this to be a bad bug,
and follows the behaviour that used to occur with dbase databases when you
changed the field type or definition via OOo. This shouldn't really happen as
mysql supports these changes. Unless of course, it is an extension to SQL92, and
therefore not implemented in the ODBC driver. 

In the latter case, OOo should at least issue a warning. Anyone care to comment ?


Alex
Comment 1 ocke.janssen 2003-05-26 08:01:46 UTC
Hi Alex,

could you please attach a sql script to create the table you wanted to
alter. And then describe which column you want to change. Thx.

Best regards,

Ocke
Comment 2 Frank Schönheit 2003-05-26 08:43:21 UTC
correcting sub component (see
http://www.openoffice.org/issues/describecomponents.cgi?component=database%20access,
please), and default owner
Comment 3 alex.thurgood 2003-05-27 08:32:32 UTC
Fine tuning of the bug.

The problem only seems to occur when you change the name of the field
via the UI. I've noticed that even if the new name is alphabetically
before the following field OOo will place it after what was the
following field in the list. It seems like the UI uses the command
MODIFY and not CHANGE, thereby creating a new field.

If you use the SQL command console within OOo, everything works OK, so
the problem is one of the command passed via the UI.

I've attached some sql scripts so that you can reproduce this.
Comment 4 alex.thurgood 2003-05-27 08:34:06 UTC
Created attachment 6461 [details]
sql command for creating the table
Comment 5 alex.thurgood 2003-05-27 08:35:08 UTC
Created attachment 6462 [details]
sql command for populating the table
Comment 6 alex.thurgood 2003-05-27 08:36:15 UTC
Created attachment 6463 [details]
sql ALTER statement to rename field and place it after another one
Comment 7 ocke.janssen 2003-05-27 09:52:57 UTC
Created attachment 6465 [details]
diff file for fix
Comment 8 ocke.janssen 2003-05-27 09:56:11 UTC
Fixed. Patch file attached.
Comment 9 ocke.janssen 2003-05-27 10:01:06 UTC
Wrong issue. Sorry :-)
Comment 10 ocke.janssen 2003-05-27 10:05:45 UTC
Reopen it.
Comment 11 ocke.janssen 2003-05-28 11:41:02 UTC
Hi Alex,

if fixed the bug in our SQL alter statement, that will be fixed in the
next version. I alter the table the same as your alter statement but
without the after part. And the data is not wiped out anymore. May
this could also be a problem with the MySQL version you use.
MyODDBC 3.51.0.6
MySQL 4.x

Best regards,

Ocke

PS: Thx, for the testing us :-)
Comment 12 alex.thurgood 2003-05-28 13:45:39 UTC
Hi Ocke,

Great news. Sorry, I forgot to give my MySql and MyODBC versions :

MySQL : 4.0.1-max
MyODBC : 3.51.06-1

so apart from having InnoDB support, I have essentially the same
versions as you.

Alex.
Comment 13 Frank Schönheit 2003-06-02 12:27:08 UTC
fs->clu: please verify in dba07
Comment 14 Frank Schönheit 2003-06-02 12:27:48 UTC
moving from UNFONFIRMED to FIXED (should have been done earlier)
Comment 15 christoph.lukasiak 2003-06-03 13:20:21 UTC
CLU->MSC: rather your area
Comment 16 marc.neumann 2003-06-05 12:21:09 UTC
set to fixed
Comment 17 marc.neumann 2003-06-05 12:21:38 UTC
verified in dba07
Comment 18 marc.neumann 2003-06-10 09:20:13 UTC
I close this bug, because it's fixed in the OOo 1.1 RC, which will be
available soon.

Bye Marc
Comment 19 hans_werner67 2004-02-02 12:33:30 UTC
change subcomponent to 'none'