Opened 14 years ago
Closed 14 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)
Change History (12)
comment:1 by , 14 years ago
comment:2 by , 14 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 , 14 years ago
Owner: | changed from | to
---|
comment:4 by , 14 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 , 14 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.
comment:6 by , 14 years ago
The test app I just uploaded was built against a fairly recent build of FDO 3.6 (F040)
by , 14 years ago
Attachment: | Program_WithFix.cs added |
---|
comment:7 by , 14 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 , 14 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 , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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;
Capabilities state that int64 is a supported identity property type, so this conversion should not occur.