[patch_done] Bug insert record russian symbols Linux Lazarus

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

[patch_done] Bug insert record russian symbols Linux Lazarus

Post by ism »

with ascii symbols all ok , with Cyrillic this
Linux Lazarus 0.9.30.2 fpc 2.4.4 MySql 5.5

Image
Image
Image
Image

in base the field is null, after insert
where inserted symbols ?
CREATE TABLE `new_table1` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`str` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8 PACK_KEYS=0;
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

This only in Linux in Windows Xp all ok
possible it is related to the peculiarities of Unicode in Lazarus Linux

In unix Lazarus all strings and functions results Only in utf8
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Changed GetString-default for FPC to:

GetString(ColumnIndex: Integer; const CharEncoding: TZCharEncoding = {$IFDEF FPC}ceUTF8{$ELSE}ceAnsi{$ENDIF}): Ansistring;

Eventually the FPC UTF8ToAnsi doesn't work for Linux..
That's something i wanted to do long times before.

Can you pleas verify? Changes?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

Rev 1064
No effect , the problem is not solved
maybe problem with update process and key fields ?
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Can you debug out:

TZDbcGenericResolver.pas

procedure TZGenericCachedResolver.FillStatement(Statement: IZPreparedStatement;
Params: TObjectList; OldRowAccessor, NewRowAccessor: TZRowAccessor);

and check the Values at line 600 (set a breakpoint just befure you'll post the row):
Statement.SetString(I + 1, ZAnsiString(RowAccessor.GetString(ColumnIndex, WasNull)));

Check the RowAccessor.GetString/the Result of ZAnsiString and the Statement.SetString.

Are the values valid?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

RowAccessor.GetString(ColumnIndex, WasNull); returns empty value
stString:
{$IFDEF CHECK_CLIENT_CODE_PAGE}
begin
test_s:=RowAccessor.GetString(ColumnIndex, WasNull);
Statement.SetString(I + 1, ZAnsiString(RowAccessor.GetString(ColumnIndex, WasNull)));
end;
{$ELSE}
Statement.SetString(I + 1, AnsiString(RowAccessor.GetString(ColumnIndex, WasNull)));
{$ENDIF}
result

test_s:='' , but i write russian symbols value

wireshark sniffer show

Code: Select all

INSERT INTO test.new_table1 (id,str) VALUES (NULL,NULL)
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Uppps whats that? That means we've a problem on setting the data between DB.TField and the AbstactRODataSet. There i did no work. Start to study me in what and why it happens...

ism,

can you please open the ZDateSetUtils.pas

go to line 516 of
procedure PostToResultSet(ResultSet: IZResultSet;
const FieldsLookupTable: TIntegerDynArray; Fields: TFields;
RowAccessor: TZRowAccessor);

and check the value assignment between ftString too? If we've the same results like before we've a problem higher up...
Last edited by EgonHugeist on 09.03.2012, 22:43, edited 1 time in total.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

ZDatasetUtils.pas
ftString:
// gto: do we need PChar here?
//ResultSet.UpdatePChar(ColumnIndex, RowAccessor.GetPChar(FieldIndex, WasNull));
begin
tests:=RowAccessor.GetString(FieldIndex, WasNull);
ResultSet.UpdateString(ColumnIndex, AnsiString(RowAccessor.GetString(FieldIndex, WasNull)));
end;
write "ыыы"

result

test:='';
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

the bug not stable ,
Sometimes a record with a russian symbols is inserted properly
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

random bugs are difficult.
Do you see source-differences between MSWINDOWS vs. UNIX?
Do you've findings?
How did you inserted the other displayed values of your example on topic?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

Hm, this bug also in trunk rev 926 ,

maybe problem in Lazarus ?

I test it
Lazarus 1.0.8 fpc 2.6.0
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

ism,
you're a man of spoken words. You said you want help and you do. I like it.

If the trunk has the same problems than it seems really like a Lazarus problem...

It would be wonderfull to get the reason why it happens and/or a solution...
It makes me a little bit wondering why we've no report about this issues before. On the other hand maybe nobody tested it before. Or am i wrong here?

I See you check this issues with FPC2.4.4 is it complicated for you to upgrade Lazarus 0.9.30 and FPC 2.6? Can you use differnt IDE's eventually? Is the Problem the same?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

in last lazarus bug is present ,
maybe cause in mysql
Lazarus 1.0.8 fpc 2.6.0
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

I don't belive it's a MySQL problem... Actually i'm going deeper in the Dbc-Layers to see if it's possible there...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

Hint

If insert russian symbols without DBNavigator (arrow down in keyboard), all inserted normally

mysteriously

maybe problem in post method in DBNavigator Lazarus or Zeos
Locked