Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export for table with datetime2 in primary key #20

Closed
SamWalkerRxSense opened this issue Nov 1, 2019 · 4 comments
Closed

Export for table with datetime2 in primary key #20

SamWalkerRxSense opened this issue Nov 1, 2019 · 4 comments
Assignees

Comments

@SamWalkerRxSense
Copy link

Hi,

Having an issue exporting data when table uses a composite primary key of varchar(11) and datetime2. The datetime2 appears to be truncated to datetime, and subsequent queries don't match the datetime2, resulting in 0 rows exported.

When exporting I get a popup stating

Warning: The number of rows collected (8) differs from that of the exported ones (0).
This may have been caused by an invalid primary key definition.
Please note that each primary key must be unique and never null.
It is recommended to check the integrity of the primary keys.

The sql.log shows the PK datetime2 is converted to datetime, which is truncating the value.
this is the PK sql.
Select '49452127001' PK0, convert(datetime, '2019-03-01T04:08:38.153', 126) PK1
I did some experimenting and found that this sql works by using datetime2 and including all the decimal places.
(Select '49452127001' PK0, convert(datetime2, '2019-03-01T04:08:38.1533333', 126)

Jailer 9.1.4
Microsoft SQL Server (MS SQL Server) 13.00.4522
Thanks is advance... let me know if you need more info.

For the record, I'm not a fan of datetime in primary keys, but changing it now is not an option.

@Wisser Wisser self-assigned this Nov 2, 2019
Wisser added a commit that referenced this issue Nov 3, 2019
@Wisser
Copy link
Owner

Wisser commented Nov 3, 2019

Hi @SamWalkerRxSense

Thank you for the issue report.
The "datetime2" data type was not supported. I checked in a fix. If you want, you can test it by replacing the jailer.jar and jailer.xml files with the attached files.

Regards,
Ralf

JailerPatch9.1.4.3.zip

Wisser added a commit that referenced this issue Nov 4, 2019
@SamWalkerRxSense
Copy link
Author

Thanks, I'll try it out.

@SamWalkerRxSense
Copy link
Author

Those patch files are working for me. The export is working using the datetime2 datatype in primary key. thanks for quick fix.

@Wisser
Copy link
Owner

Wisser commented Nov 6, 2019

Fixed in release 9.1.5

@Wisser Wisser closed this as completed Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants