You are not logged in.
Pages: 1
JSONRetrieveIDField() calls function GetInteger(P: PUTF8Char): PtrInt which overflows badly on '{"RowID":10073450777,...}' at SynCommons.pas:19215.
Offline
Fixed by http://synopse.info/fossil/info/95068648b4
Thanks for the feedback!
Online
You're welcome! Ditto for:
Index: SQLite3/mORMotDB.pas
==================================================================
--- SQLite3/mORMotDB.pas
+++ SQLite3/mORMotDB.pas
@@ -175,1 +175,1 @@
- fEngineLockedLastID: integer;
+ fEngineLockedLastID: TID;
@@ -190,1 +190,2 @@
- fBatchCapacity, fBatchCount, fBatchFirstAddedID: integer;
+ fBatchCapacity, fBatchCount: integer;
+ fBatchFirstAddedID: TID;
@@ -220,1 +221,1 @@
- function EngineLockedNextID: Integer; virtual;
+ function EngineLockedNextID: TID; virtual;
@@ -242,1 +243,1 @@
- function InternalBatchAdd(const aValue: RawUTF8; aID: TID): integer;
+ function InternalBatchAdd(const aValue: RawUTF8; aID: TID): TID;
@@ -259,1 +260,1 @@
- UpdatedID: TID): integer;
+ UpdatedID: TID): TID;
@@ -907,1 +908,1 @@
-function TSQLRestStorageExternal.EngineLockedNextID: Integer;
+function TSQLRestStorageExternal.EngineLockedNextID: TID;
@@ -1090,1 +1091,1 @@
- const aValue: RawUTF8; aID: TID): integer;
+ const aValue: RawUTF8; aID: TID): TID;
@@ -1647,1 +1648,1 @@
- const SentData: RawUTF8; Occasion: TSQLOccasion; UpdatedID: TID): integer;
+ const SentData: RawUTF8; Occasion: TSQLOccasion; UpdatedID: TID): TID;
@@ -1652,1 +1653,1 @@
- InsertedID, F: integer;
+ InsertedID: TID; F: integer;
@@ -1956,1 +1957,1 @@
-end.
+end.
Offline
This was on purpose that the EngineLockedNextID / BatchInsert methods do use integer and not TID.
A generated ID, with linear increase, won't overflow the 32 bit.
We would certainly change that when I will implement some new Feature Requests (like big data sharding).
But in the meanwhile, current code seems correct.
Online
Edit:
I've introduced several fixes and enhancements related to TID = Int64 process.
I made another code review, and found some problems - which are now fixed.
It would help preparing the upcoming features, by the way, to have TID everywhere - and it makes code more obvious.
See http://synopse.info/fossil/info/93e54b45a6
Thanks for your feedback!
Online
Just see the type of the InsertedID local variable in the TSQLRestStorageExternal.ExecuteFromJSON() and how it gets assigned with the call of JSONRetrieveIDField() just a few lines after. Not much different, regardless the http://synopse.info/fossil/info/95068648b4.
Offline
JSONRetrieveIDField() returned a Int64 = TID now, so I do not think there is a problem, right?
Sorry, my fault! Playing with mORMotDB, SynDBODBC and I was stuck to the previous fossil revision.
Offline
Pages: 1