[MCOL-4029] Update with a join is not showing correct number of rows affected but the actual rows are updated. Created: 2020-06-01  Updated: 2021-01-14

Status: Open
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.4.3
Fix Version/s: Icebox

Type: Bug Priority: Major
Reporter: Gagan Goel (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Below are steps to reproduce. As can be seen, the update with join query indeed updates the record but does not return rows affected/rows matched stat is incorrect:

MariaDB [test]> drop table if exists bug4925;
Query OK, 0 rows affected (0.231 sec)
 
MariaDB [test]> drop table if exists bug4925_1;
Query OK, 0 rows affected (0.184 sec)
 
MariaDB [test]> create table bug4925 (id int, c1 int)engine=columnstore;
Query OK, 0 rows affected (0.169 sec)
 
MariaDB [test]> insert into bug4925 values(1,1),(2,2),(3,3),(4,4);
Query OK, 4 rows affected (0.267 sec)
Records: 4  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select * from bug4925;
+------+------+
| id   | c1   |
+------+------+
|    1 |    1 |
|    2 |    2 |
|    3 |    3 |
|    4 |    4 |
+------+------+
4 rows in set (0.062 sec)
 
MariaDB [test]> create table bug4925_1 (c1 int)engine=columnstore;
Query OK, 0 rows affected (0.207 sec)
 
MariaDB [test]> insert into bug4925_1 values(10),(100),(1),(2);
Query OK, 4 rows affected (0.411 sec)
Records: 4  Duplicates: 0  Warnings: 0
 
MariaDB [test]> update bug4925 join bug4925_1 using (c1) set bug4925.id=1000 where 1=1 and bug4925_1.c1>1;
Query OK, 0 rows affected (0.310 sec)
Rows matched: 0  Changed: 0  Warnings: 0
 
MariaDB [test]> select * from bug4925;
+------+------+
| id   | c1   |
+------+------+
|    1 |    1 |
| 1000 |    2 |
|    3 |    3 |
|    4 |    4 |
+------+------+
4 rows in set (0.021 sec)


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