Page 1 of 2

[patch_done] String fields in Zeos

Posted: 19.07.2013, 18:01
by patyit
Hi all !

I must clarify some things about string fields in Zeos.
I use Lazarus 1.1, FPC 2.7.1, Zeos 7.10, Firebird 2.5.2 and
have database with varchar fields 1024 of length, UTF8.

What is the Zeos limitation (if any) of handling string fields length > 255 chars ? Howe can I handle this fields correctly ? (Query.FieldByName('name').AsString)

Posted: 19.07.2013, 20:00
by EgonHugeist
patyit,

i don't understand your question. Do you have got some problems with fields > 255 chars?

since 7.1 we've unlimitted (max 4GB or EOutOfMemory) field-sizes. Do we have some limitiations for firebird i don't know about?

Posted: 19.07.2013, 20:11
by patyit
EgonHugeist,

Yes I have problem, I got an SIGSEGV on posting data.
In meanwhile installed back Zeos 7.0.3 and everything is working fine !
Something is wrong in Zeos 7.1.0 !

Posted: 19.07.2013, 21:10
by EgonHugeist
patyit,

can you attach a little example which clearly points me to this issue? I'm sure i can fix it quickly. But i need something to work...

Posted: 20.07.2013, 13:03
by patyit
EgonHugeist,

I'm prepare a small test project to reproduce the problem.
This error occurs only on Linux (XUbuntu 32bit) !! On Win7 Starter it seams to bee OK !
The Zeos 7.0.3 stable is working correctly on both OS-es.
My environment is : Lazarus 1.1 svn, FPC 2.7.1 svn, Zeos 7.10 beta XUbuntu 12.04 LTS 32bit, Firebird 2.5.2.

In attachment is test project, test database with user: zaos, passwd: zeos
Modify connection parameters according to Your server ...

Run the test project and try to fill empty field (Descript (varchar(1024)) and
post updates (with clicking tick on DBNavigator or simply move up or down from current record), SIGSEGV error will upper ...

Posted: 20.07.2013, 23:15
by EgonHugeist
patyit,

uff ubuntu. That will take a while have to setup a new virtual box. Hope i can fiddle me into this OS too..

Posted: 21.07.2013, 19:24
by EgonHugeist
patyit,

gmble, the whole day long i'm trying to get a FPC2.7 running. No idea. XUbuntu 13 i've installed but why i can't run the CodeTyphon installation? Hints/Advices are welcome!

Posted: 21.07.2013, 19:56
by miab3
@EgonHugeist,

Extract CodeTyphonIns.zip from the root and then start from the root install.sh .

Michal

Posted: 21.07.2013, 20:48
by EgonHugeist
miab3,

thanks, Michal. Exacly this i'm trying to do. On OpenSuse it works. On XUbuntu happens nothing on clicking install.sh Wondering why...

Installing FPC 2.7.1 and Lazarus 1.1 SVN

Posted: 22.07.2013, 07:22
by patyit
Hi all !

In attachment is a script for installing standard versions of FPC 2.7.1 and Lazarus 1.1 from SVN.
You need to install SVN client first (if already not have it), then download fpcup utility from:
http://forum.lazarus.freepascal.org/ind ... ic=15919.0.

I usually place it into home root directory, run the script ./fpcup.txt ...
After finishing installation go to dir ../fpcdev/lazarus and run startlazarus

Now You can install Zeos packages.

CondeTyphon is grate project, but it is not a standard Lazarus. The package installation and packages are slightly modified (including Zeos), I afraid You will run in to another problem with installing right version of Zeos packages...

Posted: 22.07.2013, 21:39
by EgonHugeist
patyit,

well this eats my time (; Need to study a bit more about such OS's. Ok i got CodeTyphon 4.4 running on linux. (i know it isn't equal to latest FPC but i've an idea what's going wrong: I was writing with FPC core and asket for stability of the UnicodeString, which wouldn't be the issue. But i also switched some string convertion function from WideString to UnicodeString to avoid silly WideString/UnicodeString convertions (PWideChar = ^UnicodeString) so i !think! we're tracking a FPC issue here )

Hint: I allways fail to open your attached zeos_test.fdb file. Tryed to open it with flamerobin too and i fail again. Can you check that file please?

Posted: 23.07.2013, 06:41
by patyit
EgonHugeist,

Thank you and sorry for your time !
On Linux (ubuntu) must check file privileges after copy database, owner must bee firebird and group also firebird, only read/write access is allowed... but I think the best will bee to create database (DDL from FlameRobin):

Create new database with page size: 4096, default cahrset: UTF8, user: SYSDBA password: masterkey
(modify test program connection properties user name and password to SYSDBA and masterkey)

/********************* ROLES **********************/
/********************* UDFS ***********************/
/****************** GENERATORS ********************/
/******************** DOMAINS *********************/
CREATE DOMAIN VCHAR1024
AS varchar(1024)
DEFAULT ''
NOT NULL
COLLATE UTF8;

CREATE DOMAIN VCHAR30
AS varchar(30)
DEFAULT ''
NOT NULL
COLLATE UTF8;
/******************* PROCEDURES ******************/
/******************** TABLES **********************/
CREATE TABLE TEST
(
NAME VCHAR30 DEFAULT '',
DESCRIPT VCHAR1024 DEFAULT '',
CONSTRAINT PK_TEST PRIMARY KEY (NAME)
);
/********************* VIEWS **********************/
/******************* EXCEPTIONS *******************/
/******************** TRIGGERS ********************/

GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
ON TEST TO SYSDBA WITH GRANT OPTION;

You can fill data with my test program, the result will bee the same ...

Regards, Patyi

Posted: 23.07.2013, 16:11
by EgonHugeist
patyit,

that was a long jurney. Don't know how to execute the fpcup_linux_x?? files! Found how to install CodeTyphon: simply use "bash install.sh". Hmpf, i'm a *nix dummy, trust me. I'm not able to start the FireBird service on openSuse while it was simple and good documented for XUbuntu.

But i got the bug: AnsiStrComp can't handle nil values on *nix systems. I don't know if it's a FPC-Bug? This function is a inline func on Windows but i didn't track it on FPC-linux yet. It crash on WideStringManager.StrCompAnsiStringProc(S1,S2) in Unit Sysstr.inc. Raise a bugreport if you want. This is a behavior difference but i don't know if they also access a system function.

Patch done: R2536 \testing7.1 (SVN)

Can you test it please?

Posted: 23.07.2013, 20:19
by patyit
EgonHugeist,

You don't need to run fpcup_linux_x directly, it is called from script fpcup.txt (.txt because forum doesn?t accept .sh extension) in terminal like: ./fpcup.txt [enter] where fpcup_linux_x and fpcup.txt script is in ../home dir.

Anyway thanks for your time, with a five minutes will try patch and will inform you about the result ...

Posted: 23.07.2013, 20:20
by patyit
EgonHugeist,

Firstly tested it with the test program, it is now OK !
Tested it with my production program witch is the origin of this discussion and it works perfectly !
I do not noticed any other problems by now ...

Again meany thanks for so quick help and for your time !

Regards. Patyi.