Bug 162111 - Trying to create a primary key while importing a table to Firebird database generates an error
Summary: Trying to create a primary key while importing a table to Firebird database g...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
24.2.3.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.0.2
Keywords:
Depends on:
Blocks: Database-Firebird-Default
  Show dependency treegraph
 
Reported: 2024-07-19 23:24 UTC by Mike Kaganski
Modified: 2024-08-05 07:23 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2024-07-19 23:24:54 UTC
Basically, the same initial steps as in bug 130345:

1. Open a Firebird database.
2. Copy a table, for example from Calc.
3. Insert the table to Firebird.
4. Check "Create New Field as Primary Key" > ID
5. Create

Alternatively, omit #4, and then, after #5, a dialog appears suggesting to create a primary key. Agree (click Yes).

In both cases, a message box pops up:

> Warning at .../dbaccess/source/ui/dlg/sqlmessage.cxx:571
> 
> Incorrect type for setValue at .../connectivity/source/commontools/dbexception.cxx:446
> Continue anyway?

The created table is empty in any case.

Likely related to commit c07548447a564b2d142cc439a124b76e6a71dfbd (Related: tdf#108057 Use autoincrement for automatically added primary key, 2024-03-20), which made sure to use the largest type that supports autoincrement.
Comment 1 Mike Kaganski 2024-07-19 23:40:19 UTC
https://gerrit.libreoffice.org/c/core/+/170787
Comment 2 Commit Notification 2024-07-20 05:55:09 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1b796287df8b3dc40ddd905c6f4822c53b36f9b1

tdf#162111: promote integer types automatically

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2024-07-23 06:58:45 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/91d9b66ed66f07abba754800482cc40964d85cc4

tdf#162111: promote integer types automatically

It will be available in 24.8.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.