Opened 13 years ago

Closed 13 years ago

#739 closed defect (fixed)

Applying a schema containing an int64 identity property converts the property to autogenerated int32

Reported by: jng Owned by: romicadascalescu
Priority: major Milestone: 3.6.0
Component: SQLite Provider Version: 3.5.0
Severity: 3 Keywords:
Cc: External ID:

Description

Apply a schema with one or more classes containing an int64 identity property.

The properties are converted to int32, with IsAutoGenerated = true

Attachments (3)

Pk_Int64_test.sqlite (192.0 KB ) - added by romicadascalescu 13 years ago.
Test File
Program.cs (3.3 KB ) - added by jng 13 years ago.
C# source demonstrating the issue.
Program_WithFix.cs (3.4 KB ) - added by romicadascalescu 13 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by jng, 13 years ago

Capabilities state that int64 is a supported identity property type, so this conversion should not occur.

comment:2 by traianstanev, 13 years ago

There is no conversion happening -- the property is still int64 internally and you can use GetInt64 to get the value, but I assume the returned FDO schema is lying to you -- probably to make Map3D happy for some reason.

comment:3 by traianstanev, 13 years ago

Owner: changed from traianstanev to romicadascalescu

by romicadascalescu, 13 years ago

Attachment: Pk_Int64_test.sqlite added

Test File

comment:4 by romicadascalescu, 13 years ago

Hi,

I've attached a test file where I have a SQLite file having two classes:

  • first has PK Int64 auto-generated
  • second has PK Int64 not auto-generated

Describe schema returns the right PK for classes. Could you provide some test code?

Thanks, Romy.

comment:5 by romicadascalescu, 13 years ago

You are talking about version FDO 3.5, yeah it's a known issue and there is not much I can do about it, however you could move (if possible) to FDO 3.6 where this issue and many others were fixed.

Romy.

by jng, 13 years ago

Attachment: Program.cs added

C# source demonstrating the issue.

comment:6 by jng, 13 years ago

The test app I just uploaded was built against a fairly recent build of FDO 3.6 (F040)

by romicadascalescu, 13 years ago

Attachment: Program_WithFix.cs added

comment:7 by romicadascalescu, 13 years ago

You have to use "UseFdoMetadata=TRUE;" connect parameter when you create database and connect to database.

By default UseFdoMetadata=false; and sqlite will not be able to keep details about columns. I attached your test file with the issue fixed.

Romy.

comment:8 by traianstanev, 13 years ago

This is definitely a bug. In the case where the provider is not using metadata, we should not downcast the property from Int64 -- we should be exposing the true type of the property. In the past, I had the downcast in there to make Map3D happy, but this downcast is no longer necessary as Map can handle Int64 IDs now.

comment:9 by romicadascalescu, 13 years ago

Resolution: fixed
Status: newclosed

I've fixed this issue, see below. You have two options to use or not FDO metadata.

Author: romicadascalescu Date: 2011-01-17 11:00:39 -0800 (Mon, 17 Jan 2011) New Revision: 5863

Modified:

trunk/Providers/SQLite/Src/Provider/SltMetadata.cpp

Log: #504 SQLite provider. Improvements:

  • Remove a hack forcing a PK to FdoDataType_Int32. This code is not executed in case FDO metadata = true;
Note: See TracTickets for help on using tickets.