[MCOL-1782] UPDATE and DELETE reported incorrect affected row count Created: 2018-10-08  Updated: 2021-10-01  Resolved: 2018-11-10

Status: Closed
Project: MariaDB ColumnStore
Component/s: DMLProc
Affects Version/s: 1.2
Fix Version/s: 1.2.1

Type: Bug Priority: Major
Reporter: Daniel Lee (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-2239 Rows matched: and Changed: are 0 even... Closed
relates to MCOL-4536 update returns wrong number of rows u... Closed
Sprint: 2018-20

 Description   

Build tested:

/root/columnstore/mariadb-columnstore-server
commit 6b44f0d9c453ede53024f525b7ddf32b5323171b
Merge: 7db44a7 853a0f7
Author: Andrew Hutchings <andrew@linuxjedi.co.uk>
Date: Thu Sep 27 20:37:03 2018 +0100

Merge pull request #134 from mariadb-corporation/versionCmakeFix

port changes for mysql_version cmake to fix columnstore RPM packaging

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 6ee12248b8764569ca7e965b5cc35746b25d816c
Merge: 068b168 47fbf62
Author: Roman Nozdrin <drrtuy@gmail.com>
Date: Mon Oct 8 11:22:42 2018 +0300

Merge pull request #586 from mariadb-corporation/MCOL-1775

MCOL-1775 Fix addtime/subtime for WHERE

Both UPDATE and DELETE reports one less than actual affected rows.
The row count is correct when row count is 0.

MariaDB [mytest]> create table t2 (c1 int,c2 varchar(20)) engine=columnstore;
Query OK, 0 rows affected (0.087 sec)

MariaDB [mytest]> insert t2 values (1,'a');
Query OK, 1 row affected (0.107 sec)

MariaDB [mytest]> insert t2 values (2,'b'), (3,'c'), (4, 'd');
Query OK, 3 rows affected (0.169 sec)
Records: 3 Duplicates: 0 Warnings: 0

MariaDB [mytest]> select * from t2;
----------+

c1 c2

----------+

1 a
2 b
3 c
4 d

----------+
4 rows in set (0.086 sec)

MariaDB [mytest]> update t2 set c1 = -10 where c1 < 3;
Query OK, 1 row affected (0.106 sec)
Rows matched: 0 Changed: 0 Warnings: 0

MariaDB [mytest]> select * from t2;
----------+

c1 c2

----------+

-10 a
-10 b
3 c
4 d

----------+
4 rows in set (0.022 sec)

MariaDB [mytest]> delete from t2 where c1 < 0;
Query OK, 1 row affected (0.074 sec)

MariaDB [mytest]> select * from t2;
----------+

c1 c2

----------+

3 c
4 d

----------+
2 rows in set (0.027 sec)

MariaDB [mytest]> delete from t2 where c1 < 0;
Query OK (0.194 sec)

MariaDB [mytest]> update t2 set c1 = -10 where c1 < 3;
Query OK (0.116 sec)
Rows matched: 0 Changed: 0 Warnings: 0

MariaDB [mytest]> update t2 set c1 = -10 where c1 = 3;
Query OK, 0 rows affected (0.131 sec)
Rows matched: 0 Changed: 0 Warnings: 0

MariaDB [mytest]> select * from t2;
----------+

c1 c2

----------+

-10 c
4 d

----------+
2 rows in set (0.025 sec)

MariaDB [mytest]> delete from t2 where c1 =4;
Query OK, 0 rows affected (0.114 sec)

MariaDB [mytest]> select * from t2;
----------+

c1 c2

----------+

-10 c

----------+
1 row in set (0.011 sec)



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2018-10-12 ]

This is causing test297 to fail

Comment by David Thompson (Inactive) [ 2018-11-10 ]

verified manually and that the regression test is passing in buildbot.

Generated at Thu Feb 08 02:31:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.