Issue 37076 - table data view: "Invalid cursor state" when omitting the PKEY value
Summary: table data view: "Invalid cursor state" when omitting the PKEY value
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: 680m61
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2004-11-12 12:09 UTC by Frank Schönheit
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Frank Schönheit 2004-11-12 12:09:36 UTC
- for an arbitrary MySQL database, create a table with the following SQL
statement(s):
  DROP TABLE IF EXISTS `bugdoc`;
  CREATE TABLE `bugdoc` (
    `ID` int(11) NOT NULL default '0',
    `name` varchar(50) default NULL,
    PRIMARY KEY  (`ID`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

(Note that you can also create the table via the table designer, there's nothing
specail
about the above script)

- create a database document for this database, using the MyODBC driver (I'm
  using version 3.51, not sure whether this matters)
- open the database document
- open the table by double-clicking onto it
- in the first row, enter some arbitrary value into the "Name" column, and leave the
  row (e.g. by pressing Cursor-Down).
=> assertion: "No rows"
=> error message "Error inserting the new record. Invalid cursor state."
- reload the data by pressing the respective toolbox button
=> several more assertions
=> it shows that the record in fact has been inserted, with an auto-generated ID
value
   0
Comment 1 Frank Schönheit 2004-11-12 12:23:36 UTC
This used to work with the very same DB/Table/Driver in OOo 1.1.x => regression.
Comment 2 ocke.janssen 2004-11-18 07:43:38 UTC
For the records :-)
ID is not an autoincrement field. If so someone could insert a second row, but
that isn't possible -> error duplicate key '0'
Comment 3 ocke.janssen 2004-11-18 07:55:31 UTC
Set this to later.
Comment 4 justinclift 2005-02-27 03:45:28 UTC
This problem is also affecting insertion of data into PostgreSQL databases
through the PostgreSQL ODBC driver (latest version with PostgreSQL 8).

It might be related to the old problem of inserting into a field that has a
default value defined.  Apparently other databases (i.e. SQL Server 2003) have
this occur too.

Regards and best wishes,

Justin Clift
Comment 5 ocke.janssen 2005-03-07 08:03:11 UTC
Fixed in cws dba25.

Now the default value for a primary key column will be set after the a new row
has been inserted. What ever sense it makes to set a default value for a primary
key :-)

Best regards,

Ocke

Comment 6 ocke.janssen 2005-03-09 07:27:59 UTC
Please verify. Thanks.

re-open issue and reassign to msc@openoffice.org
Comment 7 ocke.janssen 2005-03-09 07:28:12 UTC
reassign to msc@openoffice.org
Comment 8 ocke.janssen 2005-03-09 07:28:16 UTC
reset resolution to FIXED
Comment 9 marc.neumann 2005-03-16 12:08:11 UTC
hi,

verified in cws dba25

Bye Marc
Comment 10 thorsten.ziehm 2005-03-21 16:15:38 UTC
This task is fixed in OOo 2.0, therefore I align the 'target milestone' field.
=> set to 'OOo 2.0'
Comment 11 marc.neumann 2005-04-07 09:57:46 UTC
Hi,

fixed in current developer build -> close.
The current developer build can be found at
http://download.openoffice.org/680/index.html
Feel free to reopen if this issue is not fixed in the developer build.

Bye Marc