Page 1 of 1

BUG: SHOW CREATE TABLE "invalid field size" on v5.90.0.57

Posted: Tue 11 May 2010 02:15
by lancelot59
Hi,

SHOW CREATE TABLE TEST.DEPT reports message "invalid field size"
meaning that the TStringfield size exceeds dsMaxStringsize (8192) characters.

I've noticed this error and similar SHOW ... output problems have been solved on multiple previous versions ?
My version is only a trial version at this point, maybe that's why ?

Hope you fix it (even for the trial version)

Thanks.

Posted: Tue 11 May 2010 09:26
by Dimon
I can not reproduce the problem.
Please supply me the following information:
- the exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor;
- the exact version of your IDE;
- the exact version of MySQL server and client. You can see it in the Info sheet of TMyConnection Editor.

RE: SHOW CREATE TABLE "invalid field size"

Posted: Tue 11 May 2010 11:01
by lancelot59
=============================
MyDAC v5.90.0.57 for Delphi 5 (Trial Edition)
Delphi v5.0 (build 6.18) update pack 1
MySQL server version: 5.1.46-community
MySQL client version: Direct
=============================

As mentioned this occurs in the Trial Edition,
when tried on the compiled demo it does not fail.

Ok, I think I located the problem...
The default value of TMyQuery.Options.LongStrings is TRUE, when running the program with LongStrings is FALSE it works.
So obviously your LongStrings solution is doing something wrong here.

Why are you using default options that do not agree with standard MySQL behaviour ???
Options.LongStrings default TRUE (should be FALSE)
Options.EnableBoolean default TRUE (should be FALSE)
Options.CreateConnection default TRUE (should be FALSE)
and these are only the ones I've located up until now...

And why is OptimizedBigInt defined on the connection, where EnableBoolean (a similar option) is defined on the dataset ?
(that seems to be inconsistent)

Anyway...

Replicate:
1. drop a TMyConnection on a form
2. drop a TMyQuery on a form
3. drop a TButton on a form
4. code TButton.onClick to be MyQuery1.active := true
5. run and click on the button

1. TMemDataset.CreateFieldDefs is trying to create a TFieldDef of type DB.TStringField
2. DB.TStringField.CheckTypeSize checks the desired size to be <= dsMaxStringSize, which is defined as 8192
3. DatabaseError(SInvalidFieldSize) is triggered ("invalid field size")

Relevant debug output:

Code: Select all

exception class   : EDatabaseError
exception message : Invalid field size.

main thread ($d64):
004a5e04 +080 Project26.exe Db        2170  +3 DatabaseError
004aa0f4 +040 Project26.exe Db        4202  +2 TStringField.CheckTypeSize
004a693c +048 Project26.exe Db        2655  +4 TFieldDef.Create
004cc785 +15d Project26.exe MemDS              TMemDataSet.CreateFieldDefs
005373ea +026 Project26.exe MyAccess           TCustomMyDataSet.CreateFieldDefs
004cba32 +042 Project26.exe MemDS              TMemDataSet.InternalOpen
004eea82 +0c6 Project26.exe DBAccess           TCustomDADataSet.InternalOpen
0053787b +01f Project26.exe MyAccess           TCustomMyDataSet.InternalOpen
004b2572 +022 Project26.exe Db        8260  +2 TDataSet.DoInternalOpen
004b2642 +02e Project26.exe Db        8289  +4 TDataSet.OpenCursor
004cbd32 +00a Project26.exe MemDS              TMemDataSet.OpenCursor
004e9cc2 +1a2 Project26.exe DBAccess           TCustomDADataSet.OpenCursor
004b24dd +05d Project26.exe Db        8242 +12 TDataSet.SetActive
004e9b0d +03d Project26.exe DBAccess           TCustomDADataSet.SetActive
00538d95 +019 Project26.exe Unit26      88  +1 TForm1.Button1Click
[/code]

Posted: Tue 11 May 2010 13:39
by Dimon
Thank you for information. This problem is reproduced only for Delphi 5. We have fixed it. This fix will be included in the next MyDAC build.