[MCOL-1082] row_count() function always returns 0 for any engine Created: 2017-12-06  Updated: 2018-01-11  Resolved: 2017-12-06

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.1.2
Fix Version/s: 1.0.12, 1.1.3

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

Epic Link: ColumnStore Compatibility Improvements
Sprint: 2017-24

 Description   

from kb questions: https://mariadb.com/kb/en/library/does-row_count-work-on-column-store-tables/

MariaDB [test]> create table inno1(id int);
Query OK, 0 rows affected (0.02 sec)
 
MariaDB [test]> insert into inno1 values (1), (2);
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select row_count();
+-------------+
| row_count() |
+-------------+
|           0 |
+-------------+
1 row in set (0.01 sec)

The same logic on a regular mariadb server will return 2 for row_count.



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2017-12-06 ]

I swear we had a ticket for this already but I can't find it

Comment by Andrew Hutchings (Inactive) [ 2017-12-06 ]

ok, this is due to a bad bug fix from InfiniDB. Search for "Bug 5315" in sql_parse.cc to find it.

The problem was that the rows affected (row_count()) persisted between DML queries. The 'fix' clears it on a non-ColumnStore select query, which basically covers "select row_count()".

I've tested and the original InfiniDB bug appears to have gone. We can just remove this line.

Comment by Andrew Hutchings (Inactive) [ 2017-12-06 ]

Pull request for 1.1 and 1.0 (since we can't merge up server code)

For QA: See description, it should show '2' in the row_count()

Comment by Daniel Lee (Inactive) [ 2017-12-06 ]

Builds verified: github source

1.0.12-1

/root/columnstore/mariadb-columnstore-server
commit 7ec285d104a8e68320cbf14b44ee8509693fbda2
Merge: 25e9d05 f546eaf
Author: David.Hall <david.hall@mariadb.com>
Date: Wed Dec 6 10:04:56 2017 -0600

Merge pull request #81 from mariadb-corporation/MCOL-1082-1.0

MCOL-1082 Preserve row_count through vtable

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit b295c8fc0f827546e81b4e50135eb8dceb2a3fb9
Merge: 22cb352 26f7344
Author: david hill <david.hill@mariadb.com>
Date: Wed Dec 6 11:02:56 2017 -0600

Merge pull request #340 from mariadb-corporation/MCOL-445

MCOL-445: Modify getConfig and setConfig to be case insensitive on va…

1.1.3-1

/root/columnstore/mariadb-columnstore-server
commit 0b3b26032aa60d2937cd06535946d7d8575cd4fd
Merge: 632e265 101ea14
Author: David.Hall <david.hall@mariadb.com>
Date: Wed Dec 6 10:05:32 2017 -0600

Merge pull request #80 from mariadb-corporation/MCOL-1082

MCOL-1082 Preserve row_count through vtable

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 71a901e8b38bca584ece8d7b070ad263c4b65c3f
Merge: 4d80266 addd719
Author: David.Hall <david.hall@mariadb.com>
Date: Wed Dec 6 11:17:49 2017 -0600

Merge pull request #341 from mariadb-corporation/MCOL-1083

MCOL-1083 Fix NULL row init for TEXT/BLOB

Verified mentioned test case.

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