Description:
Information function row_count() always gives output 0 for any DML in workbench. However which is working as expected from mysql command-line.
-- MySQL Server version: 5.7.18 MySQL Community Server (GPL)
-- MySQL Workbench version : 8.0.12 on OS (Centos 7.5.1804)
How to repeat:
-- Once executed from Workbench : (row_count() NOT working)
create table rcount(id int(4) primary key auto_increment, name varchar(4) not null);
insert into rcount(name) values ('test'),('t2'),('t3');
select row_count();
-- OUTPUT :
# row_count()
0
delete from rcount where name = 't2';
-- OUTPUT :
# row_count()
0
-- Once executed from mysql command-line client : (row_count() Working as expected)
mysql> create table rcount2(id int(4) primary key auto_increment, name varchar(4) not null);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into rcount2(name) values ('test'),('t2'),('t3');
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select row_count();
+-------------+
| row_count() |
+-------------+
| 3 |
+-------------+
1 row in set (0.00 sec)
mysql> delete from rcount2 where name = 't2';
Query OK, 1 rows affected (0.06 sec)
mysql> select row_count();
+-------------+
| row_count() |
+-------------+
| 1 |
+-------------+
1 row in set (0.00 sec)