[patch_done] Bug Incorrect work with : in ZSQLProcessor

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

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

[patch_done] Bug Incorrect work with : in ZSQLProcessor

Post by ism »

Hello
Found problem , with incorrect processing of the script
I found the commit in which the problem occurs
svn rev 1404 testing-egonhugeist

in rev 1391 all working ok

If the script is: if an exception occurs

Image

Example script

http://workism.narod2.ru/archives/test_error_script.7z

If delete : all working
("87621-4L010","876214L010 // ELEC:HTD","Hyundai","Дзеркало праве / скло / // Accent /11--*/",279.96*(100+(-20))/100,"4",246,-20,6),

all options ZSqlProcessor is default


Example Error script , problem in : and \"\"
insert into result_table (number_sapchasti,number_cross,brend,opisanie_sapchasti,cena_zakupki,nalichie,id_sklad_postavshika,skidki_procent,id_valuta) values
("87621-4L010","876214L010 // ELEC:HTD","Hyundai","Дзеркало праве / скло / // Accent /11--*/",279.96*(100+(-20))/100,"4",246,-20,6),
("51712-26100","5171226100 // DISC-FR WHEEL BRAKE","Hyundai","Диск гальмівний передній // Santa Fe MT5, 4WD R16\"\"",840.36*(100+(-20))/100,"10",246,-20,6),
("51712-2B700","517122B700 // DISC-FR WHEEL BRAKE","Hyundai","Диск гальмівний передній // Santa Fe /05--*/",940.92*(100+(-20))/100,"2",246,-20,6);
,
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,

hi, long times not seen here (:.

ism, can you tell me which driver do you use here? Also did we change the download location on sf.net after an software update. New URL: http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing

So checkout Rev 1646.

Michael
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 »

I changed the script
But a new problem

Image

If the script is first \' and later ; it pops up an error
If delete ; in 'AUDI 100 A 9 /79-; PASS.T' all ok

Example problem script
insert into result_table (number_sapchasti,number_cross,brend,opisanie_sapchasti,cena_zakupki,nalichie,id_sklad_postavshika,skidki_procent,id_valuta) values
('409169','','HP','Пыльник гранаты R Master 11/00> 16\'',4.69,'10',380,0,3),
('443 498 201B','','HP','МАHЖЕТА ВHУТРЕH. (K-Т) AUDI 100 A 9 /79-; PASS.T4 (c чашкой)',3.93,'10',380,0,3);
Fields number_sapchasti,number_cross,brend,opisanie_sapchasti in table is varchar

database mysql-5

http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing
rev 1648
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,

this seems for me like a bad SQL Token detection. So i removed the ttEscapeQuoted detection from the MySQL-Tokenizer. On PostgreSQL we had a similar trouble before. So i reintroduced the old ttQuoted detaction.

So can you please test Rev.1649 with your first script again? I had no time to test this script today. If it does make trouble again then please add the Table-create script too.

Michael
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 »

Error script
insert into result_table (number_sapchasti,number_cross,brend,opisanie_sapchasti,cena_zakupki,nalichie,id_sklad_postavshika,skidki_procent,id_valuta) values
('42X811','','MS Group','Насос Г/У с эл.приводом Opel Astra H/Zafira, 1.6.1.8 \'05 тип',446.15,'5',380,0,3),
('10.774 R=10.413 R','','GP','Колодки тормозные пер. VW PASSAT 88-; A80/100 16mm 20669',6.65,'3',380,0,3);
http://workism.narod2.ru/archives/token_error.7z

Image
Last edited by ism on 17.08.2012, 11:19, edited 1 time in total.
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,

ok i'll test it. Seems the error still apears. But i wonder about, because the whole Token detection is now the old one..

Can you add the Create-Table script too?

Michael
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 »

CREATE TABLE result_table (
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
number_sapchasti VARCHAR(150) NOT NULL DEFAULT '?',
number_sapchasti_compressed VARCHAR(150) NOT NULL DEFAULT '?',
number_cross VARCHAR(150) DEFAULT '...',
number_cross_compressed VARCHAR(150) DEFAULT '...',
brend VARCHAR(50) DEFAULT '?',
opisanie_sapchasti VARCHAR(170) DEFAULT '?',
cena_zakupki DOUBLE UNSIGNED NOT NULL DEFAULT 0,
nalichie VARCHAR(20) DEFAULT '?',
id_sklad_postavshika INT(10) UNSIGNED NOT NULL,
skidki_procent DOUBLE DEFAULT 0,
id_valuta TINYINT(4) UNSIGNED NOT NULL,
stoimost_dostavki_procent DOUBLE NOT NULL DEFAULT 0,
id_random MEDIUMINT(9) UNSIGNED NOT NULL DEFAULT 0,
old_brand VARCHAR(50) DEFAULT NULL,
PRIMARY KEY (id),
INDEX brend (brend),
INDEX FK_result_table_valuta_table_id (id_valuta),
INDEX IX_result_table_id_sklad_postavshika (id_sklad_postavshika),
INDEX IX_result_table_nalichie (nalichie),
CONSTRAINT FK_result_table_skladi_postavshikov_id FOREIGN KEY (id_sklad_postavshika)
REFERENCES skladi_postavshikov(id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT FK_result_table_valuta_table_id FOREIGN KEY (id_valuta)
REFERENCES valuta_table(id) ON DELETE RESTRICT ON UPDATE RESTRICT
)
ENGINE = INNODB
Lazarus 1.0.8 fpc 2.6.0
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

Packet from sniffer Wireshark
insert into result_table (number_sapchasti,number_cross,brend,opisanie_sapchasti,cena_zakupki,nalichie,id_sklad_postavshika,skidki_procent,id_valuta) values
('42X811','','MS Group','Насос Г/У с эл.приводом Opel Astra H/Zafira, 1.6.1.8 \'05 тип',446.15,'5',380,0,3),
('10.774 R=10.413 R','','GP','Колодки тормозные пер. VW PASSAT 88-
SQL query breaks , but script above is correct
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,

did run you first script with R1650 and it works fine... Can you test it please?

Now i'll check the second script..

Michael
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 »

insert into result_table (number_sapchasti,number_cross,brend,opisanie_sapchasti,cena_zakupki,nalichie,id_sklad_postavshika,skidki_procent,id_valuta) values
("87621-4L010","876214L010 // ELEC:HTD","Hyundai","Дзеркало праве / скло / // Accent /11--*/",279.96*(100+(-20))/100,"4",246,-20,6),
("51712-26100","5171226100 // DISC-FR WHEEL BRAKE","Hyundai","Диск гальмівний передній // Santa Fe MT5, 4WD R16\"\"",840.36*(100+(-20))/100,"10",246,-20,6),
("51712-2B700","517122B700 // DISC-FR WHEEL BRAKE","Hyundai","Диск гальмівний передній // Santa Fe /05--*/",940.92*(100+(-20))/100,"2",246,-20,6);
rev 1652 all working good
insert into result_table (number_sapchasti,number_cross,brend,opisanie_sapchasti,cena_zakupki,nalichie,id_sklad_postavshika,skidki_procent,id_valuta) values
('42X811','','MS Group','Насос Г/У с эл.приводом Opel Astra H/Zafira, 1.6.1.8 \'05 тип',446.15,'5',380,0,3),
('10.774 R=10.413 R','','GP','Колодки тормозные пер. VW PASSAT 88-; A80/100 16mm 20669',6.65,'3',380,0,3);
rev 1652
Same error

Image
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,

got now both scripts running. I'm not very happy about because (actually) no more Ansi-/QuotedStr Detection is possible for MySQL (which seems for me they have a algorythm to know how.) Anyway i hope you bug is fixed. And i'll check how to surround my issue in a more stable way.

Ism, can i add your testscripts to our test-suites? This would be great to keep control about what's going wrong..

Patch done Rev 1653

Michael
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 »

EgonHugeist wrote:ism,
Ism, can i add your testscripts to our test-suites? This would be great to keep control about what's going wrong
Michael
Yes, of course
This is part of the large text price lists

I'll try to check tomorrow
Lazarus 1.0.8 fpc 2.6.0
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

So far all working normally
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,

thank you for that confirmation. I'll add your scripts to our testsuites later.

Michael
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
Locked