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

Fix error in TJSONSerializer.WriteObject #3

wants to merge 1 commit into from


Copy link

jorditudela commented Sep 9, 2014

CollectionItem with references to TSQLRecord objects where not properly

CollectionItem with references to TSQLRecord objects where not properly

This comment has been minimized.

Copy link

synopse commented on 3f35c66 Sep 10, 2014

This implementation is not correct either.
I've just committed a cleaner fix.
Thanks for the feedback.

@synopse synopse closed this Sep 10, 2014
synopse pushed a commit that referenced this pull request May 28, 2019
merge from synopse/mORMot
synopse pushed a commit that referenced this pull request Dec 20, 2019
Pull the latest revision from upstream synopse/mORMot
synopse pushed a commit that referenced this pull request Jan 9, 2020
* inherit TSQLMonitorUsage from TSQLRecordNoCaseExtended
to optimize stored content

* new TSynMonitorUsageRest.ProcessIDShift and optional Batch support

* several fixes to TSynMonitorUsage/TSynMonitorUsageRest

* WIP: slow any base64 buffer decoder

* fast version of fail tolerant base64toBin

* remove unused parameter in anyBase64toBin

* optimized VariantToBoolean(null)

* fixed THttpRequest.Create when aIgnoreSSLCertificateErrors is true

* fix unmapping memory mapped files for Unix

* small optimization of TPdfEncryptionRC4MD5.EncodeBuffer

* tuning of TServiceCustomAnswer content SOA logging

* fixed regression after last commit

* several fixes for Delphi 10.3 Rio compatibility

* SyNode: Embadding JavaScript files into executable as a resources

* TCurlHTTP: remove 1 second delay on non-GET requests by disabling sending of 'Expect: 100-continue' HTTP header

* avoid potential AV in curl.slist_append

* fixed potential GPF in latest pull request

* new SynDaemonIntercept function and SynDaemonTerminated flag

* New functions GetProcessInfo to collect more detailed info about Windows processes

* published TDynArrayHashed.ElemPtr/ElemCopyAt methods for Unicode Delphi

* documentation update

* enhanced items per second display during performance tests

* new TSynDaemon.ConsoleMode property

* mast TSynLog constructor as virtual

* TextColor - prevent unnecessary syscalls and made 'thread safe'

* Fixed a bug in TPropInfo.GetVariant handling of tkDynArray. Result from GetOrdProp was being erroneously dereferenced before being passed to TDocVariantData.InitArrayFromObjArray.

* StrLenSSE42 & StcCompSSE42 available only if HASAESIN is defined

* fix access to memory we do not write to in UnCamelCase(D,P)

* add tip about disabling HASAESNI in case testing with valgrind

* add +x permission to SQLite3/ and remove #13 in Shebang

* return back call to ioresult to reset a global InOutRes to 0

* add idents (git diff -w can be used to see only valuable changes)

* updated SQLite3 engine to latest version 3.26.0

* fixed TJSONSerializer.RegisterCustomSerializerFieldNames
- thanks mohsenti for the patch!

* fixed potential GPF in TSQLRestStorage classes when no server is supplied
(fallback to an owned model instance instead of an hypothetical/ephemeral external server)

* avoid wrongly deleted content with FillZero(RawUTF8/RawByteString)

* fixed TSynAnsiConvert.AnsiBufferToUnicode for FPC/POSIX

* new functions to handle unquoting CSV strings

* Bug fix for broken quoted string (return empty string for such case) and tests.

* Fix Delphi compilation

* WIP: get a low level connection ID from reverse proxy server header

* Use GetNextItemUInt64 instead of SynCommons.GetInt64 + compare RemoteConnectionID <> 0 instead of >0

* WIP: initial support for Unix Domain Socket

* fix Windows build (AF_UNIX is not defined under Win)

* Lazarus project for 36-RestBenchmark

* enhance Sample36 by UnixDomainSocket

* UnixDomainSocket support for TCurlHTTP

* prevent redefining of prototype props in descendants

* SyNode: new function TSMEngine.CallObjectFunctionVal + use this function for call timerLoop. A small optimization as a result

* fix Windows build

* some minor (mostly documentation) enhancements

* after latest merges, fixes for compilation on all targets
(especially old Delphi compilers)

* fixed TTestExternalDatabase.AutoAdaptSQL regression tests
(low-level hooks were not working any more due to some code sanitation)

* propagate RemoteIPHeader & RemoteConnIDHeader to HttpApi server clones

* propagate RemoteIPHeader & RemoteConnIDHeader to HttpApi server clones
- from #165

* enhanced TIntelCpuFeatures with latest CPUID flags

* new GetDiskPartitions/GetDiskPartitionsText functions

* added aThreadName parameter to TSynLogFamily.OnBeforeException callback

* published PDynArrayRec to allow TDynArray.GetCount inlining

* new TSynLogFamily.WithInstancePointer property
to optionally reduce log verbosity

* exceptions will log the current thread name

* optionally include the free disk space to GetDiskPartitionsText()
- used for remote REST status of the serve too

* json serializer adds a T00:00Z to dates without in UTC0 timezone to allow FireFox propertyly decode a Date object

* introducing low-level GetMemoryInfo() API function

* GetMemoryInfo/TSynMonitorMemory won't return FastMM4 values
but OS returned values by default

* introducing TMatch.PrepareRaw method and published some TMatch properties

* new IsCaseSensitive() function

* initialize a DayOfWeek by 0 in GetNowUTCSystem

* minor refactoring of SynCrtSock (no functional change)
- mainly about performance and Kylix compatibility

* fixed Delphi 10.3 MainDemo compilation

* TSynTempBuffer.Init and TSQLTableJSON will always allocate 16 more bytes than required
- for a trailing #0 and to ensure our (e.g. TDocVariant) fast JSON parsing won't trigger any GPF (since it may read up to 4 bytes ahead via its PInteger() trick) or any SSE4.2 function applied on the buffer
- fix for #168
- also fixed other potential buffer overflows (especially in TTextWriter)

* please some paranoid valgrid expectations
for #168

* include method and uri to ECurlHTTP message

* new %L format specifier for ScanUTF8()

* fixed Delphi compilation
- sounds like if we really spend all our time in FPC/Lazarus now :)

* for FPC result of TPrecisionTimer.ProfileCurrentMethod should be assigned to local var

* happy new year 2019 ! :)

* fix typo in doc

* prevent raising of Overflow exception in case project is compiled with -Co flag

* some missing files for 2019

* too low coffee level - messed up last commit ;)

* new TSynSystemTime.ToDateTime method

* slight optimizations in the HTTP socket server
- no functional change

* ensure SynFPCLinux uses the regular conditionals

* fixed SortDynArrayString on Delphi 2009+ (circumvent RTL's SysUtils.StrComp bug)

* proper detection of Windows Server 2019 edition

* exclude UID from links comments

* minor refactoring and fixes to mORMotReport.pas - no functional change

* new TExprParserMatch class for efficient search expression parsing

* fixed TQueryValue.AsVariant problem under FPC on empty string

* disable double quotes for TExprParserMatch
(it was not working anway)

* fixed IsCaseSensitive() to work as expected
- it was working like a IsUpperCase() function

* new TMatch.PrepareContains method and several optimizations to TMatch search

* enhanced TExprParserAbstract and TExprParserMatch implementation

* some TMatch fix for Delphi Win64

* udpated documentation about JWT auth

* fixed Delphi 6 compilation

* PasZip FPC/Linux compatibility and x86-64 performance fix

* fixed reference-counting in TJSONCustomParserRTTI.FinalizeNestedArray
- thanks maciej for the feedback!

* huge performance boost with TMatch.PrepareContains
by using Holub and Durian (2005) SBNDM2 algorithm for 2..31 long patterns

* optimized case-insensitive TMatch '*pattern*' search

* introducing TParserAbstract to allow any kind of expression parsers
(e.g. SQL evaluator)

* overloaded ToUTF8(TExprParserResult) function

* marked TSQLRestServerURIContext.AuthenticationCheck as virtual

* introducing TExprNodeWordAbstract.ParseWord virtual method

* optimized GetExtended() for FPC/x86-64

* x3 speedup of TMatch.PrepareContains(aCaseInsensitive=true) process

* ensure proper x86_64 registers use on some functions

* TExprParserMatch refactoring

* introducing BufferLineLength() fast function

* introducing PosExChar() fast function

* fixed typo in latest commit

* several fixes to BufferLineLength()
- with associated regression tests

* circumvent some Delphi compilation bugs

* some comments changes - no function modification

* minor changes to DateTimeToUnixMSTime() and GetExtended()

* specificaly implement pattern='' for TMatch

* new OS_INITIAL[] constants

* added explicit regression test for RecordSave() with a void dynamic array field

* new RecordSaveBytes() function

* some RecordSaveBase64/RecordLoadBase64 and similar optimizations

* comments fixes - no functional change

* ensure TCurlHTTP handles connection timeout parameter
- was left to the default libcurl value i.e. 300 seconds = 5 minutes!

* fixed TSynMonitorMemory.PhysicalMemoryTotal

* refactored TSynMonitorSize / TSynMonitorMemory / GetDiskPartitionsText
to allow shorter text without spaces

* new overloaded IsValidUTF8() functions

* add aIgnoreAnyException param to TSQLRestClientURI.ServiceRegister/ServiceDefine
so that TSQLRestClientURI.ServiceDefineSharedAPI works as expected

* introducing NOHTTPCLIENTWEBSOCKETS conditional

* use libcurl API to retrieve the error message

* renamed THttpSocket.HeaderValue to THttpSocket.HeaderGetValue
due to the parameter now required to be uppercased
- also several fixes and optimizations to the HTTP layer (e.g. about RemoteIPHeader)

* another fix about aIgnoreAnyException support

* new LogEscapeFull() overloaded functions

* several fixes to SynCrtSock, especially for Windows
- after instrumenting the code to add low-level logs, and spent the whole day examining the results on real-world production code
- there is still an unexpected problem sometimes with the TWinHttp client in some very obscure condition

* TRawByteStringGroup will now have on demand compaction
- also refactored to fix some potential GPF issues

* fixes for GetDiskPartitions/GetDiskPartitionsText

* fixed TSQLRest.OneFieldValues(TInt64DynArray) about "where" clause parsing

* new DDDNOSYNDB and DDDNOMONGODB to reduce the units linked by dddInfraSettings

* fixed DDDNOSYNDB process

* new ToText(TOperatingSystemVersion) and TrimLeftLowercaseToShort() functions

* enhanced TTextWriter + new ToTextOS() function

* TDynArray documentation precision - no functional change

* alllow days time unit in MicroSecToString()

* fixed MicroSecToString() with days unit
- includes associated regression tests

* fixed Darwin (OSX) compilation

* properly fix auxiliary columns in TSQLRecordRTree/TSQLRecordRTreeInteger
- latest pull request was breaking existing non RTree fields standard with '_'

* new TSynDictionary.FindKeyFromValue method

* includes regression tests for new TSynDictionary.FindKeyFromValue method

* allow some missing fields in the TSQLTableJSON input expanded objects

* added fmShareDenyWrite to TTextWriter.CreateOwnedFileStream flags

* new MatchAny() function

* prevern send Content-Type: STATICFILE header

* add optional BufferSize parameter to TSQLTable.GetJSONValues and TSQLRestBatch.Create
- default TSQLRestBatch value of 4KB is clearly underestimated

* new TFileVersion.UserAgent method

* enhanced THttpRequest and TSQLHttpClientGeneric

* avoid some unexpected Delphi compiler hints

* new TSQLTable.FieldAsString() overloaded methods

* more aggressive auto-resize of TTextWriter internal buffer
to use 1MB when 40MB is reached (instead of 64KB)

* Update SynWinSock.pas

* overloaded AddInteger/AddInt64 functions to append two dynamic arrays

* new TAlgoCompress.UncompressedSize class method

* new overloaded TDynArray.Sort with TEventDynArraySortCompare comparer

* new IsDirectoryWritable() function

* TSynDaemonSettings will ensure that /var/log folder is writable

* ensure GetSystemPath(spUserData) will return ~/.cache/appname for POSIX
- also used for spLog as fallback if neither /var/log nor the executable folder is writable

* use recursion only for smaller range on all QuickSort functions
- thanks Maciej for the tip!

* ensure the TDynArray.Sorted flag is set by Sort() not by SortRange()

* made TSynPersistentLock and TSynPersistentLocked aliases
since allocated PSynLocker on heap is no overhead in comparison to maintaining a lock

* new TSynLogFamily.OnThreadEnded method

* new TSynQueue.WaitPop/WaitPopFinalize methods

* enhanced TSynQueue.WaitPopFinalize

* try to return a correct folder for logs under Windows

* do not override FPC $hints value (which is commonly disabled)

* introducing TSynQueue.WaitPeekLocked method

* refactoring to fix "Times" embedded font naming

* new overloaded IPToCardinal() function, and CompareFloat/CompareInt64 comparators

* optimized PosEx() pure pascal version - especially for FPC x86_64

* updated SQLite3 engine to latest version 3.27.1

* fixed FTS RANK execution for Delphi Win32

* updated documentation - mainly about TSynDictionary

* made TSynLog.FamilyCreate thread-safe in all cases

* made TSQLRecordProperties and T*AutoCreateFields initialization thread-safe in all cases

* ensure PatchCode() will work even if OS memory page size is not 4KB

* fixed SHA256/x64-SSE4.1 process using new GetMemAligned() function

* introducing SynFPCCMemAligned unit

* small refactoring after latest changes - no functional modification

* small refactoring of TSHA384/TSHA512 - no functional modification

* SynFPCCMemAligned will make no overhead any more - but will be for Linux only

* optimized TDynArray.InternalSetLength

* introducing SynTBB unit and FPC_SYNTBB conditional for FPC + Intel TBB malloc use
(tested on Linux x86_64 for server-side multi-threaded performance)

* small optimization of SynFPCCMemAligned via direct glibc malloc/free calls

* allows SynFPCCMemAligned to use either glibc, Intel TBB or jemalloc libraires

* tuned heap manager identifier in SYNOPSE_FRAMEWORK_FULLVERSION

* new TSynSystemTime.ToNCSAText method

* new TPrecisionTimer.SizePerSec method

* new OnMainThreadIdle optional parameter to TSynParallelProcess.ParallelRunAndWait
- to allow e.g. direct call from the UI thread

* fixed TWrapperContext.CreateFromModel
- thanks EMartin for the patch!

* preliminary (beta state) Swagger support

* Socket HTTP Server refactoring for better performance and stability
- mainly reducing and tuning system calls, locks and CLOCK_MONOTONIC_COARSE

* new CMDLINESWITCH cross-platform constant

* tuned documentation about crc32c() to avoid confusion with plain zlib's crc()

* fixed Windows compilation

* new TAlgoCompress.Algo overloaded method

* TPrecisionTimer optimizations (mainly for FPC on Linux/BSD/Darwin)

* ensure our faster GetTickCount64 using CLOCK_MONOTONIC_COARSE is called

* refactored TPrecisionTimer for consistency

* ensure TSynLog will call QueryPerformanceCounterMicroSeconds on Linux/POSIX

* renamed QueryPerformanceCounterMicroSeconds() as QueryPerformanceMicroSeconds()

* new "auth" optional parameter to HttpPost()

* updated sqlite3-64.dll binary stored in repo

* updated documentation, mainly about installation process

* updated SourceCodeRep internal tool with latest fossil build

* optimized sorting of pointer-sized array

* try to fix unexpected problems in TAESPRNG.RandomExt with FPC/Win64

* documentation updates

* added "description" field to Swagger SOA template

* minor refactoring - no functional change

* optional BufferOffset parameter to TAlgoCompress.Compress/Decompress

* new TFastReader.ReadCompressed method

* optional BufferOffset parameter to TSynPersistentStore.SaveTo and TFileBufferWriter.FlushAndCompress

* fixed TAESAbstractSyn.Clone, and included some refactoring

* updated SQLite3 engine to latest version 3.27.2

* added BufferOffset optional parameter to overloaded TAlgoCompress.Decompress method

* introduced TDDDLogSettings.CustomFileName property

* added '/' in TFileVersion.UserAgent

* new TSQLRestServer.Sessions public property

* fixed several bugs in TAlgoCompress.Compress
- if BufferOffset<>0 or Plain=nil or PlainLen=0

* refactored TSQLRestServer.SessionDelete - no functional change
synopse pushed a commit that referenced this pull request Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.