[fpc-pascal] Re: RE : RE : RE : Assigning value to ftVariant datatype& varbytes-still stuck

2011-08-09 Thread Reinier Olislagers
On 9-8-2011 12:17, Ludo Brands wrote:
> I created a patch for ftVariant, ftBytes and ftVarBytes support as well as a
> check for supported types and attached it to the issue. Feel free to extend
> your tests with it ;) 
Thanks, I'll have a look.

> 
> Also a change in fpXMLXSDExport line 388:
> 
>   Fanode := Foutputdoc.Createtextnode(Utf8decode(EF.Field.AsString));
> 
> Instead of 
> 
>   Fanode :=
> Foutputdoc.Createtextnode(Encodestringbase64(EF.Field.AsString));
> 
> The format was defined as string before.
That doesn't match my current version.
Maybe I already made the change:
I've changed ftVariant to base64 encoding (i.e. treat is as binary) in
commit 19:
https://bitbucket.org/reiniero/fpc_laz_patch_playground/changeset/a78b5a5de22e

Can you tell me what field type it is? I'm guessing ftVariant...

You might also be interested in the newest version on Bitbucket. The
last couple of days I've added some fixes to block invalid date ranges
for Access/Excel, as well as the order of output in Delphi clientdataset...
The tests are crashing again now, so I might be back with some newbie
questions.

Thanks for the help & the patch,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: RE : RE : RE : Assigning value to ftVariant datatype& varbytes-still stuck

2011-08-09 Thread Reinier Olislagers
On 9-8-2011 12:17, Ludo Brands wrote:
> I created a patch for ftVariant, ftBytes and ftVarBytes support as well as a
> check for supported types and attached it to the issue. Feel free to extend
> your tests with it ;) 
Applied patch in fpc source, make clean, make all make install for FPC,
make for Lazarus, rescan fpc source directory, recompile test project.

Still get access violations.
(ftVariant, ftVarbytes set to size 10, then assigning all kinds of
strings to it using .AsString)

Could you have a look at the test code now - I might still be doing
something really stupid.
The commit where the files are readded, you can download the test code
there:
https://bitbucket.org/reiniero/fpc_laz_patch_playground/changeset/6be7ed0edb4b

(It seems getting the value from the ftVariant field gives an access
violation, but I'm not sure)

Thanks,
Reinier



Some output from the test:
*** Starting to fill row 1

Field: ftString_256 has value Douglas Adams less than: < greater than
> tab:  crlf:
åœ‹ç¼ºç•Œå¹¿æ¬ å»£ç•Œç•Œä¸œç¼º. Haddock drinks rosé (ros, e accent
aigu), водка (wodka cyrillic) and ο�ζο (ouzo Greek) but prefers
Loch Lomond whiskey.
Field: ftTime has value 23:59:59
Field: ftTypedBinary has value
Field: ftVariant: error retrieving value:
EAccessViolation; detailed error message: Access violation
Field: ftVarBytes has value Douglas Ad

EAccessViolation; detailed error message: Access violat Time:00.027 N:8
E:7 F:0 I:0
  Ttestxmlxsdexport1 Time:00.027 N:8 E:7 F:0 I:0
00.003  TestXSDExport_Access_NoXSD_Decimal  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.003  TestXSDExport_Access_NoXSD_NoDecimal  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.004  TestXSDExport_Access_XSD_Decimal  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.004  TestXSDExport_Access_XSD_NoDecimal  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.003  TestXSDExport_ADONET_NoXSD  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.003  TestXSDExport_ADONET_XSD  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.003  TestXSDExport_DelphiClientDataset  Error: EAccessViolation
  Exception:   Access violation
  Source unit:
  Method name:
  Line number: 574
00.004  TestXSDExport_Excel

Number of run tests: 8
Number of errors:7
Number of failures:  0

List of errors:
  Error:
Message:
Ttestxmlxsdexport1.TestXSDExport_Access_NoXSD_Decimal: Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:

  Error:
Message:
Ttestxmlxsdexport1.TestXSDExport_Access_NoXSD_NoDecimal: Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:

  Error:
Message:
Ttestxmlxsdexport1.TestXSDExport_Access_XSD_Decimal: Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:

  Error:
Message:
Ttestxmlxsdexport1.TestXSDExport_Access_XSD_NoDecimal: Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:

  Error:
Message:   Ttestxmlxsdexport1.TestXSDExport_ADONET_NoXSD:
Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:

  Error:
Message:   Ttestxmlxsdexport1.TestXSDExport_ADONET_XSD:
Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:

  Error:
Message:
Ttestxmlxsdexport1.TestXSDExport_DelphiClientDataset: Access violation
Exception class:   EAccessViolation
Exception message: Access violation
Source unitname:
Line number:   574
Failed methodname:
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE : [fpc-pascal] Re: RE : RE : RE : Assigning value to ftVariant datatype& varbytes-still stuck

2011-08-09 Thread Ludo Brands
> > The format was defined as string before.
> That doesn't match my current version.
> Maybe I already made the change:
> I've changed ftVariant to base64 encoding (i.e. treat is as 
> binary) in commit 19: 

Mmm... That's taking risks and requires quite some testing with the
different host applications. When transferring data as strings, we know that
apps do the string to integer/date/whatever transformation. But when you
transfer them as binary, I'm afraid that they will be imported as is ie. no
transformation. 

> Can you tell me what field type it is? I'm guessing ftVariant...

Yes, it came up when testing new the ftVariant.

Ludo

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE : [fpc-pascal] Re: RE : RE : RE : Assigning value to ftVariant datatype& varbytes-still stuck

2011-08-09 Thread Ludo Brands
> Applied patch in fpc source, make clean, make all make 
> install for FPC, make for Lazarus, rescan fpc source 
> directory, recompile test project.
> 
> Still get access violations.
> (ftVariant, ftVarbytes set to size 10, then assigning all 
> kinds of strings to it using .AsString)
> 
> Could you have a look at the test code now - I might still be 
> doing something really stupid. The commit where the files are 
> readded, you can download the test code
> there: 
> https://bitbucket.org/reiniero/fpc_laz_patch_playground/change
> set/6be7ed0edb4b
> 

Downloaded the code and it raises an SUnsupportedFieldType when creating the 
ftAutoInc field. That is OK since I didn't include ftAutoinc in the supported 
list for TBufDataset. If you are not getting this error, then the patch and/or 
install didn't work.

> (It seems getting the value from the ftVariant field gives an 
> access violation, but I'm not sure)
> 
> Thanks,
> Reinier
> 
> 
> 
> Some output from the test:
> *** Starting to fill row 1
> 
> Field: ftString_256 has value Douglas Adams less than: < greater than
> > tab:crlf:
> åœ‹ç¼ºç•Œå¹¿æ¬ å»£ç•Œç•Œä¸œç¼º. Haddock drinks rosé (ros, e 
> accent aigu), водка (wodka cyrillic) and ούζο (ouzo 
> Greek) but prefers Loch Lomond whiskey.
> Field: ftTime has value 23:59:59
> Field: ftTypedBinary has value
> Field: ftVariant: error retrieving value:
> EAccessViolation; detailed error message: Access violation
> Field: ftVarBytes has value Douglas Ad
> 
> EAccessViolation; detailed error message: Access violat 
> Time:00.027 N:8 E:7 F:0 I:0
>   Ttestxmlxsdexport1 Time:00.027 N:8 E:7 F:0 I:0
> 00.003  TestXSDExport_Access_NoXSD_Decimal  Error: 
> EAccessViolation
>   Exception:   Access violation
>   Source unit:
>   Method name:
>   Line number: 574
> 00.003  TestXSDExport_Access_NoXSD_NoDecimal  Error: 

Line 547 is where FillTestData is called. Not very usefull. 

I do get a segfault in the last test when assigning to ftWideString256. When 
tracing the code it crashes when moving the size+1 chracters to the database. 
This fixed length moving is fundamentally wrong. The string is only 20 or so 
chars long and TCustomBufDataset.SetFieldData tries to do a move of the full 
514 bytes (256+1)*2. This asking for trouble. The source of the data is here a 
temporary WideString created by casting a string, so probably on the heap. 
Reading 514 bytes when only 40 odd where allocated is not always working  

I'll try to fix that one also.

Ludo

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: RE : [fpc-pascal] Re: RE : RE : RE : Assigning value to ftVariant datatype& varbytes-still stuck

2011-08-09 Thread Reinier Olislagers
On 9-8-2011 16:42, Ludo Brands wrote:
> 
> Downloaded the code and it raises an SUnsupportedFieldType when
> creating the ftAutoInc field. That is OK since I didn't include
> ftAutoinc in the supported list for TBufDataset. If you are not
> getting this error, then the patch and/or install didn't work.
I feared as much. Totally strange, as I tried my patch for SQLExport as
well and that did work fine.
I'll clean up everything & try again...

> Line 547 is where FillTestData is called. Not very usefull.
I agree. Seems like the test setup & teardown should be a test of their
own for TBufDataset :(
> 
> I do get a segfault in the last test when assigning to
> ftWideString256. When tracing the code it crashes when moving the
> size+1 chracters to the database. This fixed length moving is
> fundamentally wrong. The string is only 20 or so chars long and
> TCustomBufDataset.SetFieldData tries to do a move of the full 514
> bytes (256+1)*2. This asking for trouble. The source of the data is
> here a temporary WideString created by casting a string, so probably
> on the heap. Reading 514 bytes when only 40 odd where allocated is
> not always working
> 
> I'll try to fix that one also.
I'd appreciate that a lot!


Thanks a lot for the help,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: RE : [fpc-pascal] Re: RE : RE : RE : Assigning value to ftVariant datatype& varbytes-still stuck

2011-08-09 Thread waldo kitty

On 8/9/2011 10:42, Ludo Brands wrote:

   Exception:   Access violation
   Source unit:
   Method name:
   Line number: 574
 00.003  TestXSDExport_Access_NoXSD_NoDecimal  Error:


Line 547 is where FillTestData is called. Not very usefull.


line 547 or 574? the error report is 574 ;)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal