Update is wrong and 80% of records are updated

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
moppelstroppel
Posts: 19
Joined: Sat 25 Aug 2018 08:09

Update is wrong and 80% of records are updated

Post by moppelstroppel » Sat 25 Aug 2018 08:20

Hello all,

after installing the new version the update statements are sometimes wrong.
I'm using the version 9.2.6 with C++Builder 10.2

The statement is

Code: Select all

SELECT * FROM t_gesamtpreis_detail
WHERE n_auftrag_id = :auftragId
AND n_posten_id = :postenId
and the update was

Code: Select all

UPDATE t_gesamtpreis_detail
SET
  n_betrag = ?
WHERE
  n_id = ?
-- 282 row(s) affected.
The table is

Code: Select all

CREATE TABLE `t_gesamtpreis_detail` (
  `n_auftrag_id` int(11) NOT NULL,
  `n_posten_id` int(11) NOT NULL,
  `n_id` int(11) NOT NULL AUTO_INCREMENT,
  `n_typ_id` int(3) NOT NULL COMMENT 'kat_grp = 61',
  `c_bez` varchar(50) DEFAULT NULL,
  `n_betrag` decimal(19,2) NOT NULL,
  PRIMARY KEY (`n_auftrag_id`,`n_posten_id`,`n_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
So I have to go back to an old version 9.1.5.

Thomas

moppelstroppel
Posts: 19
Joined: Sat 25 Aug 2018 08:09

Re: Update is wrong and 80% of records are updated

Post by moppelstroppel » Sat 25 Aug 2018 10:34

Back to old version everything is working fine.
But the prices from 282 records are changed. Very bad!!
I have to rolback to an databse backup and will loose record.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Update is wrong and 80% of records are updated

Post by ViktorV » Mon 27 Aug 2018 13:18

Unfortunately, we could not reproduce the issue.
To investigate the specified MyDAC behavior, please compose a small sample demonstrating the described behavior and send it using the contact form https://devart.com/company/contactform.html, including your database dump. Also, please specify the used MySQL version.

moppelstroppel
Posts: 19
Joined: Sat 25 Aug 2018 08:09

Re: Update is wrong and 80% of records are updated

Post by moppelstroppel » Tue 28 Aug 2018 08:37

Hello,

I set using these lines

Code: Select all

	
	QrMultimedia->Active = false;
	QrMultimedia->SQL->Text = stmt;
	QrMultimedia->FilterSQL = where;
And the columns listed in FilterSQL are not used for updating the table.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Update is wrong and 80% of records are updated

Post by ViktorV » Tue 28 Aug 2018 11:24

Unfortunately, we cannot reproduce the issue using the information provided by you.
To understand the cause of the issue and find a solution to fix it, we need a test sample in which the issue is stably reproduced. As soon as we get such an sample and if the cause of the issue is in the code of our product, we will try to fix it as soon as possible.
Therefore, please, compose a full sample demonstrating the described behavior and send it to us using the contact form https://devart.com/company/contactform.html including the script for creating and filling in the database objects.

Post Reply